ablok-components 0.2.13 → 0.2.15

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.
@@ -1,4 +1,4 @@
1
- (function(je,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(je=typeof globalThis<"u"?globalThis:je||self,s(je.AblokComponents={},je.Vue))})(this,(function(je,s){"use strict";const g_={class:"icon",preserveAspectRatio:"xMaxYMin"},B_=["xlink:href"],y_=s.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(e,A)=>(s.openBlock(),s.createElementBlock("i",{class:s.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(s.openBlock(),s.createElementBlock("svg",g_,[s.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,B_)]))],2))}}),w_={class:"loading-spinner d-block"},C_=s.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(e,A)=>(s.openBlock(),s.createElementBlock("span",w_,[A[0]||(A[0]=s.createElementVNode("span",{class:"loading-spinner__animation"},[s.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[s.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"},[s.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1)),s.renderSlot(e.$slots,"default")]))}}),b_=["src","alt"],v_=s.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}},setup(t){const e=s.ref(!1);return(A,n)=>{const r=s.resolveComponent("loading-spinner");return t.src?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["base-image",{"base-image--zoom":t.zoom}])},[t.spinner&&!e.value?(s.openBlock(),s.createBlock(r,{key:0})):s.createCommentVNode("",!0),s.createElementVNode("img",{class:s.normalizeClass(["",{"opacity-0":!e.value,"opacity-1":e.value}]),src:t.src,alt:t.alt,onLoad:n[0]||(n[0]=(()=>e.value=!0))},null,42,b_)],2)):s.createCommentVNode("",!0)}}}),E_=["innerHTML"],k_=s.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(t){const e=t,A=s.computed(()=>e.tag||"p");return(n,r)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(A.value),{class:s.normalizeClass(["headline",`${n.size} headline--${n.size}${n.className||""}`])},{default:s.withCtx(()=>[s.renderSlot(n.$slots,"default",{},()=>[s.createElementVNode("span",{class:"headline__text",innerHTML:n.text},null,8,E_)])]),_:3},8,["class"]))}}),S_=["innerHTML"],Q_=s.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(t){return(e,A)=>(s.openBlock(),s.createElementBlock("p",{class:s.normalizeClass(["base-paragraph",`${e.size||""} ${e.className||""}`]),innerHTML:e.text},null,10,S_))}});function Bt(){return Math.random().toString(16).slice(2)}const F_={class:"accordion-item"},U_=["id"],I_=["data-bs-target","aria-controls"],x_={class:"flex-grow-1"},T_=["id","aria-labelledby","data-bs-parent"],__=["innerHTML"],D_=s.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e;function r(){n("update:modelValue",!A.modelValue)}return(o,i)=>(s.openBlock(),s.createElementBlock("div",F_,[s.createElementVNode("div",{class:"accordion-header",id:`heading-${t.id}`},[s.createElementVNode("button",{class:s.normalizeClass(["accordion-button",!t.modelValue&&"collapsed"]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#target${t.id}`,"aria-expanded":"true","aria-controls":`target${t.id}`,onClick:r},[s.renderSlot(o.$slots,"toggle",{},()=>[s.createElementVNode("span",x_,s.toDisplayString(t.title),1)])],10,I_)],8,U_),s.createElementVNode("div",{class:s.normalizeClass(["accordion-collapse collapse",t.modelValue&&"show"]),id:`target${t.id}`,"aria-labelledby":`heading${t.id}`,"data-bs-parent":t.parent},[s.createElementVNode("div",{class:s.normalizeClass(["accordion-body",t.noPadding?"p-0":""])},[s.renderSlot(o.$slots,"body",{},()=>[s.createElementVNode("article",{innerHTML:t.body},null,8,__)])],2)],10,T_)]))}}),L_=(t,e)=>{const A=t.__vccOpts||t;for(const[n,r]of e)A[n]=r;return A},O_={},M_={class:"accordion"};function N_(t,e){return s.openBlock(),s.createElementBlock("div",M_,[s.renderSlot(t.$slots,"default")])}const H_=L_(O_,[["render",N_]]),R_=["type","disabled"],P_=s.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 e=t,A=s.computed(()=>e.caption&&!e.circle);return(n,r)=>{const o=s.resolveComponent("loading-spinner"),i=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("button",{type:t.type,disabled:t.disabled,class:s.normalizeClass(["btn",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,"rounded-circle":t.circle,[`btn-${t.color}`]:!t.outlined,[`btn-outline-${t.color}`]:t.outlined,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[t.pending?s.renderSlot(n.$slots,"pending-icon",{key:0},()=>[s.createVNode(o)]):s.createCommentVNode("",!0),s.renderSlot(n.$slots,"default",{},()=>[t.icon?(s.openBlock(),s.createBlock(i,{key:0,symbol:t.icon,class:"base-button__caption"},null,8,["symbol"])):s.createCommentVNode("",!0),A.value?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},s.toDisplayString(t.caption),3)):s.createCommentVNode("",!0)])],10,R_)}}}),V_={class:"input-group input__input-group"},$_=["type","id","name","placeholder","pattern","disabled","readonly","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],K_=["for","innerHTML"],G_=s.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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"}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.computed({get(){return A.modelValue},set(a){a=A.type==="number"?A.max&&Number(a)>A.max?A.max:A.min!==void 0&&Number(a)<A.min?A.min:Number(a):a,n("update:modelValue",a)}}),i=s.computed(()=>{if(A.type==="number"){const{min:a,max:l}=A;return{...a!==void 0?{min:a}:{},...l!==void 0?{max:l}:{}}}return{}});return s.onMounted(()=>{let a=l=>{o.value=typeof l.detail=="string"||typeof l.detail=="number"?`${l.detail}`:""};r.value.addEventListener("focusin",l=>{window.addEventListener("update-focussed-input",a)}),r.value.addEventListener("focusout",l=>{window.removeEventListener("update-focussed-input",a)})}),(a,l)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input",`input--${t.type}`])},[s.createElementVNode("div",V_,[s.renderSlot(a.$slots,"input-prepend",{slotScope:"props"}),s.withDirectives(s.createElementVNode("input",s.mergeProps({ref_key:"input",ref:r,"onUpdate:modelValue":l[0]||(l[0]=u=>o.value=u),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},i.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}),null,16,$_),[[s.vModelDynamic,o.value]]),s.renderSlot(a.$slots,"input-append",{slotScope:"props"})]),s.renderSlot(a.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id,class:s.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,K_)):s.createCommentVNode("",!0)])],2))}}),W_={class:"input input--textarea"},z_=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],Y_=["for","innerHTML"],J_=s.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",W_,[s.renderSlot(o.$slots,"input-prepend"),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),type:t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:s.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,z_),[[s.vModelText,r.value]]),s.renderSlot(o.$slots,"input-append"),s.renderSlot(o.$slots,"label",{},()=>[s.createElementVNode("label",{for:t.id,class:s.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,Y_)])]))}}),X_={class:"form-check input input--checkbox"},j_=["value","id","name","required","disabled","true-value","false-value"],q_=["for","innerHTML"],Z_=s.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:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue||A.checked},set(o){n("update:checked",o),n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",X_,[s.withDirectives(s.createElementVNode("input",{ref:"input","onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),value:t.value,id:t.id,name:t.name,type:"checkbox",required:t.required,disabled:t.disabled,class:"form-check-input","true-value":t.trueValue,"false-value":t.falseValue},null,8,j_),[[s.vModelCheckbox,r.value]]),s.createElementVNode("label",{class:"input__label form-check-label",for:t.id,innerHTML:t.label},null,8,q_),i[1]||(i[1]=s.createElementVNode("span",{class:"input__error"},"error",-1))]))}}),eD={class:"input-group input__input-group"},tD=["id","name","placeholder","pattern","disabled","read-only","required","aria-label"],AD=["for","innerHTML"],nD=s.defineComponent({__name:"input-datetime",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e,r=s.computed({get(){const o=A.modelValue&&new Date(`${A.modelValue}Z`),i=o&&new Date(o.getTime()+new Date().getTimezoneOffset()*-60*1e3).toISOString();return i&&i.replace("Z","")},set(o){const i=o&&new Date(o);o=i&&i.toISOString(),n("update:modelValue",o&&o.replace("Z",""))}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input",`input--${t.type}`])},[s.createElementVNode("div",eD,[s.renderSlot(o.$slots,"input-prepend",{slotScope:"props"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),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,tD),[[s.vModelText,r.value]]),s.renderSlot(o.$slots,"input-append",{slotScope:"props"})]),s.renderSlot(o.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,AD)):s.createCommentVNode("",!0)])],2))}}),Mw=6048e5,rD=864e5,oD=6e4,Nw=36e5,iD=1e3,Hw=Symbol.for("constructDateFrom");function Qt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Hw in t?t[Hw](e):t instanceof Date?new t.constructor(e):new Date(e)}function $e(t,e){return Qt(e||t,t)}function Xn(t,e,A){const n=$e(t,A?.in);return isNaN(e)?Qt(A?.in||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function gr(t,e,A){const n=$e(t,A?.in);if(isNaN(e))return Qt(t,NaN);if(!e)return n;const r=n.getDate(),o=Qt(t,n.getTime());o.setMonth(n.getMonth()+e+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Rw(t,e,A){const{years:n=0,months:r=0,weeks:o=0,days:i=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=$e(t,A?.in),h=r||n?gr(f,r+n*12):f,p=i||o?Xn(h,i+o*7):h,g=l+a*60,y=(u+g*60)*1e3;return Qt(t,+p+y)}function sD(t,e,A){return Qt(t,+$e(t)+e)}function aD(t,e,A){return sD(t,e*Nw)}let lD={};function Yi(){return lD}function Br(t,e){const A=Yi(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,r=$e(t,e?.in),o=r.getDay(),i=(o<n?7:0)+o-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Ws(t,e){return Br(t,{...e,weekStartsOn:1})}function Pw(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=Qt(A,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Ws(r),i=Qt(A,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=Ws(i);return A.getTime()>=o.getTime()?n+1:A.getTime()>=a.getTime()?n:n-1}function Xc(t){const e=$e(t),A=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return A.setUTCFullYear(e.getFullYear()),+t-+A}function sl(t,...e){const A=Qt.bind(null,e.find(n=>typeof n=="object"));return e.map(A)}function Vw(t,e){const A=$e(t,e?.in);return A.setHours(0,0,0,0),A}function $w(t,e,A){const[n,r]=sl(A?.in,t,e),o=Vw(n),i=Vw(r),a=+o-Xc(o),l=+i-Xc(i);return Math.round((a-l)/rD)}function cD(t,e){const A=Pw(t,e),n=Qt(t,0);return n.setFullYear(A,0,4),n.setHours(0,0,0,0),Ws(n)}function uD(t,e,A){return gr(t,e*3,A)}function Gh(t,e,A){return gr(t,e*12,A)}function Kw(t,e){const A=+$e(t)-+$e(e);return A<0?-1:A>0?1:A}function Gw(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function al(t){return!(!Gw(t)&&typeof t!="number"||isNaN(+$e(t)))}function Ww(t,e){const A=$e(t,e?.in);return Math.trunc(A.getMonth()/3)+1}function dD(t,e,A){const[n,r]=sl(A?.in,t,e);return n.getFullYear()-r.getFullYear()}function fD(t,e,A){const[n,r]=sl(A?.in,t,e),o=Kw(n,r),i=Math.abs(dD(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Kw(n,r)===-o,l=o*(i-+a);return l===0?0:l}function zw(t,e){const[A,n]=sl(t,e.start,e.end);return{start:A,end:n}}function Yw(t,e){const{start:A,end:n}=zw(e?.in,t);let r=+A>+n;const o=r?+A:+n,i=r?n:A;i.setHours(0,0,0,0);let a=1;const l=[];for(;+i<=o;)l.push(Qt(A,i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return r?l.reverse():l}function Ji(t,e){const A=$e(t,e?.in),n=A.getMonth(),r=n-n%3;return A.setMonth(r,1),A.setHours(0,0,0,0),A}function hD(t,e){const{start:A,end:n}=zw(e?.in,t);let r=+A>+n;const o=r?+Ji(A):+Ji(n);let i=Ji(r?n:A),a=1;const l=[];for(;+i<=o;)l.push(Qt(A,i)),i=uD(i,a);return r?l.reverse():l}function pD(t,e){const A=$e(t,e?.in);return A.setDate(1),A.setHours(0,0,0,0),A}function Jw(t,e){const A=$e(t,e?.in),n=A.getFullYear();return A.setFullYear(n+1,0,0),A.setHours(23,59,59,999),A}function ll(t,e){const A=$e(t,e?.in);return A.setFullYear(A.getFullYear(),0,1),A.setHours(0,0,0,0),A}function Xw(t,e){const A=Yi(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,r=$e(t,e?.in),o=r.getDay(),i=(o<n?-7:0)+6-(o-n);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}function jw(t,e){const A=$e(t,e?.in),n=A.getMonth(),r=n-n%3+3;return A.setMonth(r,0),A.setHours(23,59,59,999),A}const 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"}},gD=(t,e,A)=>{let n;const r=mD[t];return typeof r=="string"?n=r:e===1?n=r.one:n=r.other.replace("{{count}}",e.toString()),A?.addSuffix?A.comparison&&A.comparison>0?"in "+n:n+" ago":n};function Wh(t){return(e={})=>{const A=e.width?String(e.width):t.defaultWidth;return t.formats[A]||t.formats[t.defaultWidth]}}const BD={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"},wD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CD={date:Wh({formats:BD,defaultWidth:"full"}),time:Wh({formats:yD,defaultWidth:"full"}),dateTime:Wh({formats:wD,defaultWidth:"full"})},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=(t,e,A,n)=>bD[t];function cl(t){return(e,A)=>{const n=A?.context?String(A.context):"standalone";let r;if(n==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,a=A?.width?String(A.width):i;r=t.formattingValues[a]||t.formattingValues[i]}else{const i=t.defaultWidth,a=A?.width?String(A.width):t.defaultWidth;r=t.values[a]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(e):e;return r[o]}}const ED={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kD={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SD={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"]},QD={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"]},FD={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"}},UD={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"}},ID={ordinalNumber:(t,e)=>{const A=Number(t),n=A%100;if(n>20||n<10)switch(n%10){case 1:return A+"st";case 2:return A+"nd";case 3:return A+"rd"}return A+"th"},era:cl({values:ED,defaultWidth:"wide"}),quarter:cl({values:kD,defaultWidth:"wide",argumentCallback:t=>t-1}),month:cl({values:SD,defaultWidth:"wide"}),day:cl({values:QD,defaultWidth:"wide"}),dayPeriod:cl({values:FD,defaultWidth:"wide",formattingValues:UD,defaultFormattingWidth:"wide"})};function ul(t){return(e,A={})=>{const n=A.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const i=o[0],a=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?TD(a,h=>h.test(i)):xD(a,h=>h.test(i));let u;u=t.valueCallback?t.valueCallback(l):l,u=A.valueCallback?A.valueCallback(u):u;const f=e.slice(i.length);return{value:u,rest:f}}}function xD(t,e){for(const A in t)if(Object.prototype.hasOwnProperty.call(t,A)&&e(t[A]))return A}function TD(t,e){for(let A=0;A<t.length;A++)if(e(t[A]))return A}function _D(t){return(e,A={})=>{const n=e.match(t.matchPattern);if(!n)return null;const r=n[0],o=e.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=A.valueCallback?A.valueCallback(i):i;const a=e.slice(r.length);return{value:i,rest:a}}}const DD=/^(\d+)(th|st|nd|rd)?/i,LD=/\d+/i,OD={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},MD={any:[/^b/i,/^(a|c)/i]},ND={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},HD={any:[/1/i,/2/i,/3/i,/4/i]},RD={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},PD={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]},VD={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]},KD={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},GD={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}},WD={ordinalNumber:_D({matchPattern:DD,parsePattern:LD,valueCallback:t=>parseInt(t,10)}),era:ul({matchPatterns:OD,defaultMatchWidth:"wide",parsePatterns:MD,defaultParseWidth:"any"}),quarter:ul({matchPatterns:ND,defaultMatchWidth:"wide",parsePatterns:HD,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ul({matchPatterns:RD,defaultMatchWidth:"wide",parsePatterns:PD,defaultParseWidth:"any"}),day:ul({matchPatterns:VD,defaultMatchWidth:"wide",parsePatterns:$D,defaultParseWidth:"any"}),dayPeriod:ul({matchPatterns:KD,defaultMatchWidth:"any",parsePatterns:GD,defaultParseWidth:"any"})},qw={code:"en-US",formatDistance:gD,formatLong:CD,formatRelative:vD,localize:ID,match:WD,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zD(t,e){const A=$e(t,e?.in);return $w(A,ll(A))+1}function zh(t,e){const A=$e(t,e?.in),n=+Ws(A)-+cD(A);return Math.round(n/Mw)+1}function Yh(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=Yi(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Qt(e?.in||t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=Br(i,e),l=Qt(e?.in||t,0);l.setFullYear(n,0,o),l.setHours(0,0,0,0);const u=Br(l,e);return+A>=+a?n+1:+A>=+u?n:n-1}function YD(t,e){const A=Yi(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,r=Yh(t,e),o=Qt(e?.in||t,0);return o.setFullYear(r,0,n),o.setHours(0,0,0,0),Br(o,e)}function Jh(t,e){const A=$e(t,e?.in),n=+Br(A,e)-+YD(A,e);return Math.round(n/Mw)+1}function Ft(t,e){const A=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return A+n}const zo={y(t,e){const A=t.getFullYear(),n=A>0?A:1-A;return Ft(e==="yy"?n%100:n,e.length)},M(t,e){const A=t.getMonth();return e==="M"?String(A+1):Ft(A+1,2)},d(t,e){return Ft(t.getDate(),e.length)},a(t,e){const A=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return A.toUpperCase();case"aaa":return A;case"aaaaa":return A[0];case"aaaa":default:return A==="am"?"a.m.":"p.m."}},h(t,e){return Ft(t.getHours()%12||12,e.length)},H(t,e){return Ft(t.getHours(),e.length)},m(t,e){return Ft(t.getMinutes(),e.length)},s(t,e){return Ft(t.getSeconds(),e.length)},S(t,e){const A=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,A-3));return Ft(r,e.length)}},zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zw={G:function(t,e,A){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return A.era(n,{width:"abbreviated"});case"GGGGG":return A.era(n,{width:"narrow"});case"GGGG":default:return A.era(n,{width:"wide"})}},y:function(t,e,A){if(e==="yo"){const n=t.getFullYear(),r=n>0?n:1-n;return A.ordinalNumber(r,{unit:"year"})}return zo.y(t,e)},Y:function(t,e,A,n){const r=Yh(t,n),o=r>0?r:1-r;if(e==="YY"){const i=o%100;return Ft(i,2)}return e==="Yo"?A.ordinalNumber(o,{unit:"year"}):Ft(o,e.length)},R:function(t,e){const A=Pw(t);return Ft(A,e.length)},u:function(t,e){const A=t.getFullYear();return Ft(A,e.length)},Q:function(t,e,A){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ft(n,2);case"Qo":return A.ordinalNumber(n,{unit:"quarter"});case"QQQ":return A.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return A.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return A.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,A){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ft(n,2);case"qo":return A.ordinalNumber(n,{unit:"quarter"});case"qqq":return A.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return A.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return A.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,A){const n=t.getMonth();switch(e){case"M":case"MM":return zo.M(t,e);case"Mo":return A.ordinalNumber(n+1,{unit:"month"});case"MMM":return A.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return A.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return A.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,A){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ft(n+1,2);case"Lo":return A.ordinalNumber(n+1,{unit:"month"});case"LLL":return A.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return A.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return A.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,A,n){const r=Jh(t,n);return e==="wo"?A.ordinalNumber(r,{unit:"week"}):Ft(r,e.length)},I:function(t,e,A){const n=zh(t);return e==="Io"?A.ordinalNumber(n,{unit:"week"}):Ft(n,e.length)},d:function(t,e,A){return e==="do"?A.ordinalNumber(t.getDate(),{unit:"date"}):zo.d(t,e)},D:function(t,e,A){const n=zD(t);return e==="Do"?A.ordinalNumber(n,{unit:"dayOfYear"}):Ft(n,e.length)},E:function(t,e,A){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return A.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return A.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return A.day(n,{width:"short",context:"formatting"});case"EEEE":default:return A.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,A,n){const r=t.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Ft(o,2);case"eo":return A.ordinalNumber(o,{unit:"day"});case"eee":return A.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return A.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return A.day(r,{width:"short",context:"formatting"});case"eeee":default:return A.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,A,n){const r=t.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Ft(o,e.length);case"co":return A.ordinalNumber(o,{unit:"day"});case"ccc":return A.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return A.day(r,{width:"narrow",context:"standalone"});case"cccccc":return A.day(r,{width:"short",context:"standalone"});case"cccc":default:return A.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,A){const n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return Ft(r,e.length);case"io":return A.ordinalNumber(r,{unit:"day"});case"iii":return A.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return A.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return A.day(n,{width:"short",context:"formatting"});case"iiii":default:return A.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,A){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,A){const n=t.getHours();let r;switch(n===12?r=zs.noon:n===0?r=zs.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,A){const n=t.getHours();let r;switch(n>=17?r=zs.evening:n>=12?r=zs.afternoon:n>=4?r=zs.morning:r=zs.night,e){case"B":case"BB":case"BBB":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,A){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),A.ordinalNumber(n,{unit:"hour"})}return zo.h(t,e)},H:function(t,e,A){return e==="Ho"?A.ordinalNumber(t.getHours(),{unit:"hour"}):zo.H(t,e)},K:function(t,e,A){const n=t.getHours()%12;return e==="Ko"?A.ordinalNumber(n,{unit:"hour"}):Ft(n,e.length)},k:function(t,e,A){let n=t.getHours();return n===0&&(n=24),e==="ko"?A.ordinalNumber(n,{unit:"hour"}):Ft(n,e.length)},m:function(t,e,A){return e==="mo"?A.ordinalNumber(t.getMinutes(),{unit:"minute"}):zo.m(t,e)},s:function(t,e,A){return e==="so"?A.ordinalNumber(t.getSeconds(),{unit:"second"}):zo.s(t,e)},S:function(t,e){return zo.S(t,e)},X:function(t,e,A){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return t0(n);case"XXXX":case"XX":return Xi(n);case"XXXXX":case"XXX":default:return Xi(n,":")}},x:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"x":return t0(n);case"xxxx":case"xx":return Xi(n);case"xxxxx":case"xxx":default:return Xi(n,":")}},O:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+e0(n,":");case"OOOO":default:return"GMT"+Xi(n,":")}},z:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+e0(n,":");case"zzzz":default:return"GMT"+Xi(n,":")}},t:function(t,e,A){const n=Math.trunc(+t/1e3);return Ft(n,e.length)},T:function(t,e,A){return Ft(+t,e.length)}};function e0(t,e=""){const A=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),o=n%60;return o===0?A+String(r):A+String(r)+e+Ft(o,2)}function t0(t,e){return t%60===0?(t>0?"-":"+")+Ft(Math.abs(t)/60,2):Xi(t,e)}function Xi(t,e=""){const A=t>0?"-":"+",n=Math.abs(t),r=Ft(Math.trunc(n/60),2),o=Ft(n%60,2);return A+r+e+o}const A0=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},n0=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Xh={p:n0,P:(t,e)=>{const A=t.match(/(P+)(p+)?/)||[],n=A[1],r=A[2];if(!r)return A0(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",A0(n,e)).replace("{{time}}",n0(r,e))}},JD=/^D+$/,XD=/^Y+$/,jD=["D","DD","YY","YYYY"];function r0(t){return JD.test(t)}function o0(t){return XD.test(t)}function jh(t,e,A){const n=qD(t,e,A);if(console.warn(n),jD.includes(t))throw new RangeError(n)}function qD(t,e,A){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${A}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ZD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tL=/^'([^]*?)'?$/,AL=/''/g,nL=/[a-zA-Z]/;function Pr(t,e,A){const n=Yi(),r=A?.locale??n.locale??qw,o=A?.firstWeekContainsDate??A?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=$e(t,A?.in);if(!al(a))throw new RangeError("Invalid time value");let l=e.match(eL).map(f=>{const h=f[0];if(h==="p"||h==="P"){const p=Xh[h];return p(f,r.formatLong)}return f}).join("").match(ZD).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const h=f[0];if(h==="'")return{isToken:!1,value:rL(f)};if(Zw[h])return{isToken:!0,value:f};if(h.match(nL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const u={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return l.map(f=>{if(!f.isToken)return f.value;const h=f.value;(!A?.useAdditionalWeekYearTokens&&o0(h)||!A?.useAdditionalDayOfYearTokens&&r0(h))&&jh(h,e,String(t));const p=Zw[h[0]];return p(a,h,r.localize,u)}).join("")}function rL(t){const e=t.match(tL);return e?e[1].replace(AL,"'"):t}function oL(t,e){return $e(t,e?.in).getDay()}function iL(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=A.getMonth(),o=Qt(A,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function sL(){return Object.assign({},Yi())}function mo(t,e){return $e(t,e?.in).getHours()}function aL(t,e){const A=$e(t,e?.in).getDay();return A===0?7:A}function Yo(t,e){return $e(t,e?.in).getMinutes()}function ut(t,e){return $e(t,e?.in).getMonth()}function Ys(t){return $e(t).getSeconds()}function qe(t,e){return $e(t,e?.in).getFullYear()}function ji(t,e){return+$e(t)>+$e(e)}function Js(t,e){return+$e(t)<+$e(e)}function Xs(t,e){return+$e(t)==+$e(e)}function lL(t,e){const A=cL(e)?new e(0):Qt(e,0);return A.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),A.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),A}function cL(t){return typeof t=="function"&&t.prototype?.constructor===t}const uL=10;class i0{subPriority=0;validate(e,A){return!0}}class dL extends i0{constructor(e,A,n,r,o){super(),this.value=e,this.validateValue=A,this.setValue=n,this.priority=r,o&&(this.subPriority=o)}validate(e,A){return this.validateValue(e,this.value,A)}set(e,A,n){return this.setValue(e,A,this.value,n)}}class fL extends i0{priority=uL;subPriority=-1;constructor(e,A){super(),this.context=e||(n=>Qt(A,n))}set(e,A){return A.timestampIsSet?e:Qt(e,lL(e,this.context))}}let Ct=class{run(e,A,n,r){const o=this.parse(e,A,n,r);return o?{setter:new dL(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,A,n){return!0}};class hL extends Ct{priority=140;parse(e,A,n){switch(A){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,A,n){return A.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const iA={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Vr={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function sA(t,e){return t&&{value:e(t.value),rest:t.rest}}function Jt(t,e){const A=e.match(t);return A?{value:parseInt(A[0],10),rest:e.slice(A[0].length)}:null}function $r(t,e){const A=e.match(t);if(!A)return null;if(A[0]==="Z")return{value:0,rest:e.slice(1)};const n=A[1]==="+"?1:-1,r=A[2]?parseInt(A[2],10):0,o=A[3]?parseInt(A[3],10):0,i=A[5]?parseInt(A[5],10):0;return{value:n*(r*Nw+o*oD+i*iD),rest:e.slice(A[0].length)}}function s0(t){return Jt(iA.anyDigitsSigned,t)}function Zt(t,e){switch(t){case 1:return Jt(iA.singleDigit,e);case 2:return Jt(iA.twoDigits,e);case 3:return Jt(iA.threeDigits,e);case 4:return Jt(iA.fourDigits,e);default:return Jt(new RegExp("^\\d{1,"+t+"}"),e)}}function jc(t,e){switch(t){case 1:return Jt(iA.singleDigitSigned,e);case 2:return Jt(iA.twoDigitsSigned,e);case 3:return Jt(iA.threeDigitsSigned,e);case 4:return Jt(iA.fourDigitsSigned,e);default:return Jt(new RegExp("^-?\\d{1,"+t+"}"),e)}}function qh(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function a0(t,e){const A=e>0,n=A?e:1-e;let r;if(n<=50)r=t||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=t>=o%100;r=t+i-(a?100:0)}return A?r:1-r}function l0(t){return t%400===0||t%4===0&&t%100!==0}class pL extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,A,n){const r=o=>({year:o,isTwoDigitYear:A==="yy"});switch(A){case"y":return sA(Zt(4,e),r);case"yo":return sA(n.ordinalNumber(e,{unit:"year"}),r);default:return sA(Zt(A.length,e),r)}}validate(e,A){return A.isTwoDigitYear||A.year>0}set(e,A,n){const r=e.getFullYear();if(n.isTwoDigitYear){const i=a0(n.year,r);return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}const o=!("era"in A)||A.era===1?n.year:1-n.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class mL extends Ct{priority=130;parse(e,A,n){const r=o=>({year:o,isTwoDigitYear:A==="YY"});switch(A){case"Y":return sA(Zt(4,e),r);case"Yo":return sA(n.ordinalNumber(e,{unit:"year"}),r);default:return sA(Zt(A.length,e),r)}}validate(e,A){return A.isTwoDigitYear||A.year>0}set(e,A,n,r){const o=Yh(e,r);if(n.isTwoDigitYear){const a=a0(n.year,o);return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Br(e,r)}const i=!("era"in A)||A.era===1?n.year:1-n.year;return e.setFullYear(i,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Br(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class gL extends Ct{priority=130;parse(e,A){return jc(A==="R"?4:A.length,e)}set(e,A,n){const r=Qt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ws(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class BL extends Ct{priority=130;parse(e,A){return jc(A==="u"?4:A.length,e)}set(e,A,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class yL extends Ct{priority=120;parse(e,A,n){switch(A){case"Q":case"QQ":return Zt(A.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=1&&A<=4}set(e,A,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class wL extends Ct{priority=120;parse(e,A,n){switch(A){case"q":case"qq":return Zt(A.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=1&&A<=4}set(e,A,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class CL extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,A,n){const r=o=>o-1;switch(A){case"M":return sA(Jt(iA.month,e),r);case"MM":return sA(Zt(2,e),r);case"Mo":return sA(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class bL extends Ct{priority=110;parse(e,A,n){const r=o=>o-1;switch(A){case"L":return sA(Jt(iA.month,e),r);case"LL":return sA(Zt(2,e),r);case"Lo":return sA(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function vL(t,e,A){const n=$e(t,A?.in),r=Jh(n,A)-e;return n.setDate(n.getDate()-r*7),$e(n,A?.in)}class EL extends Ct{priority=100;parse(e,A,n){switch(A){case"w":return Jt(iA.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return Zt(A.length,e)}}validate(e,A){return A>=1&&A<=53}set(e,A,n,r){return Br(vL(e,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function kL(t,e,A){const n=$e(t,A?.in),r=zh(n,A)-e;return n.setDate(n.getDate()-r*7),n}class SL extends Ct{priority=100;parse(e,A,n){switch(A){case"I":return Jt(iA.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return Zt(A.length,e)}}validate(e,A){return A>=1&&A<=53}set(e,A,n){return Ws(kL(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const QL=[31,28,31,30,31,30,31,31,30,31,30,31],FL=[31,29,31,30,31,30,31,31,30,31,30,31];class UL extends Ct{priority=90;subPriority=1;parse(e,A,n){switch(A){case"d":return Jt(iA.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return Zt(A.length,e)}}validate(e,A){const n=e.getFullYear(),r=l0(n),o=e.getMonth();return r?A>=1&&A<=FL[o]:A>=1&&A<=QL[o]}set(e,A,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class IL extends Ct{priority=90;subpriority=1;parse(e,A,n){switch(A){case"D":case"DD":return Jt(iA.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return Zt(A.length,e)}}validate(e,A){const n=e.getFullYear();return l0(n)?A>=1&&A<=366:A>=1&&A<=365}set(e,A,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Zh(t,e,A){const n=Yi(),r=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=$e(t,A?.in),i=o.getDay(),l=(e%7+7)%7,u=7-r,f=e<0||e>6?e-(i+u)%7:(l+u)%7-(i+u)%7;return Xn(o,f,A)}class xL extends Ct{priority=90;parse(e,A,n){switch(A){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class TL extends Ct{priority=90;parse(e,A,n,r){const o=i=>{const a=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+a};switch(A){case"e":case"ee":return sA(Zt(A.length,e),o);case"eo":return sA(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _L extends Ct{priority=90;parse(e,A,n,r){const o=i=>{const a=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+a};switch(A){case"c":case"cc":return sA(Zt(A.length,e),o);case"co":return sA(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function DL(t,e,A){const n=$e(t,A?.in),r=aL(n,A),o=e-r;return Xn(n,o,A)}class LL extends Ct{priority=90;parse(e,A,n){const r=o=>o===0?7:o;switch(A){case"i":case"ii":return Zt(A.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return sA(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return sA(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return sA(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return sA(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,A){return A>=1&&A<=7}set(e,A,n){return e=DL(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class OL extends Ct{priority=80;parse(e,A,n){switch(A){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class ML extends Ct{priority=80;parse(e,A,n){switch(A){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class NL extends Ct{priority=80;parse(e,A,n){switch(A){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class HL extends Ct{priority=70;parse(e,A,n){switch(A){case"h":return Jt(iA.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return Zt(A.length,e)}}validate(e,A){return A>=1&&A<=12}set(e,A,n){const r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class RL extends Ct{priority=70;parse(e,A,n){switch(A){case"H":return Jt(iA.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return Zt(A.length,e)}}validate(e,A){return A>=0&&A<=23}set(e,A,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class PL extends Ct{priority=70;parse(e,A,n){switch(A){case"K":return Jt(iA.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return Zt(A.length,e)}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class VL extends Ct{priority=70;parse(e,A,n){switch(A){case"k":return Jt(iA.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return Zt(A.length,e)}}validate(e,A){return A>=1&&A<=24}set(e,A,n){const r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class $L extends Ct{priority=60;parse(e,A,n){switch(A){case"m":return Jt(iA.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return Zt(A.length,e)}}validate(e,A){return A>=0&&A<=59}set(e,A,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}class KL extends Ct{priority=50;parse(e,A,n){switch(A){case"s":return Jt(iA.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return Zt(A.length,e)}}validate(e,A){return A>=0&&A<=59}set(e,A,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class GL extends Ct{priority=30;parse(e,A){const n=r=>Math.trunc(r*Math.pow(10,-A.length+3));return sA(Zt(A.length,e),n)}set(e,A,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class WL extends Ct{priority=10;parse(e,A){switch(A){case"X":return $r(Vr.basicOptionalMinutes,e);case"XX":return $r(Vr.basic,e);case"XXXX":return $r(Vr.basicOptionalSeconds,e);case"XXXXX":return $r(Vr.extendedOptionalSeconds,e);case"XXX":default:return $r(Vr.extended,e)}}set(e,A,n){return A.timestampIsSet?e:Qt(e,e.getTime()-Xc(e)-n)}incompatibleTokens=["t","T","x"]}class zL extends Ct{priority=10;parse(e,A){switch(A){case"x":return $r(Vr.basicOptionalMinutes,e);case"xx":return $r(Vr.basic,e);case"xxxx":return $r(Vr.basicOptionalSeconds,e);case"xxxxx":return $r(Vr.extendedOptionalSeconds,e);case"xxx":default:return $r(Vr.extended,e)}}set(e,A,n){return A.timestampIsSet?e:Qt(e,e.getTime()-Xc(e)-n)}incompatibleTokens=["t","T","X"]}class YL extends Ct{priority=40;parse(e){return s0(e)}set(e,A,n){return[Qt(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class JL extends Ct{priority=20;parse(e){return s0(e)}set(e,A,n){return[Qt(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const XL={G:new hL,y:new pL,Y:new mL,R:new gL,u:new BL,Q:new yL,q:new wL,M:new CL,L:new bL,w:new EL,I:new SL,d:new UL,D:new IL,E:new xL,e:new TL,c:new _L,i:new LL,a:new OL,b:new ML,B:new NL,h:new HL,H:new RL,K:new PL,k:new VL,m:new $L,s:new KL,S:new GL,X:new WL,x:new zL,t:new YL,T:new JL},jL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZL=/^'([^]*?)'?$/,eO=/''/g,tO=/\S/,AO=/[a-zA-Z]/;function ep(t,e,A,n){const r=()=>Qt(n?.in||A,NaN),o=sL(),i=n?.locale??o.locale??qw,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!e)return t?r():$e(A,n?.in);const u={firstWeekContainsDate:a,weekStartsOn:l,locale:i},f=[new fL(n?.in,A)],h=e.match(qL).map(b=>{const w=b[0];if(w in Xh){const v=Xh[w];return v(b,i.formatLong)}return b}).join("").match(jL),p=[];for(let b of h){!n?.useAdditionalWeekYearTokens&&o0(b)&&jh(b,e,t),!n?.useAdditionalDayOfYearTokens&&r0(b)&&jh(b,e,t);const w=b[0],v=XL[w];if(v){const{incompatibleTokens:S}=v;if(Array.isArray(S)){const I=p.find(Q=>S.includes(Q.token)||Q.token===w);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${b}\` at the same time`)}else if(v.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);p.push({token:w,fullToken:b});const F=v.run(t,b,i.match,u);if(!F)return r();f.push(F.setter),t=F.rest}else{if(w.match(AO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(b==="''"?b="'":w==="'"&&(b=nO(b)),t.indexOf(b)===0)t=t.slice(b.length);else return r()}}if(t.length>0&&tO.test(t))return r();const g=f.map(b=>b.priority).sort((b,w)=>w-b).filter((b,w,v)=>v.indexOf(b)===w).map(b=>f.filter(w=>w.priority===b).sort((w,v)=>v.subPriority-w.subPriority)).map(b=>b[0]);let B=$e(A,n?.in);if(isNaN(+B))return r();const y={};for(const b of g){if(!b.validate(B,u))return r();const w=b.set(B,y,u);Array.isArray(w)?(B=w[0],Object.assign(y,w[1])):B=w}return B}function nO(t){return t.match(ZL)[1].replace(eO,"'")}function c0(t,e,A){const[n,r]=sl(A?.in,t,e);return+Ji(n)==+Ji(r)}function u0(t,e,A){return Xn(t,-e,A)}function d0(t,e,A){const n=$e(t,A?.in),r=n.getFullYear(),o=n.getDate(),i=Qt(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=iL(i);return n.setMonth(e,Math.min(o,a)),n}function Tt(t,e,A){let n=$e(t,A?.in);return isNaN(+n)?Qt(t,NaN):(e.year!=null&&n.setFullYear(e.year),e.month!=null&&(n=d0(n,e.month)),e.date!=null&&n.setDate(e.date),e.hours!=null&&n.setHours(e.hours),e.minutes!=null&&n.setMinutes(e.minutes),e.seconds!=null&&n.setSeconds(e.seconds),e.milliseconds!=null&&n.setMilliseconds(e.milliseconds),n)}function rO(t,e,A){const n=$e(t,A?.in);return n.setHours(e),n}function f0(t,e,A){const n=$e(t,A?.in);return n.setMilliseconds(e),n}function oO(t,e,A){const n=$e(t,A?.in);return n.setMinutes(e),n}function h0(t,e,A){const n=$e(t,A?.in);return n.setSeconds(e),n}function Kr(t,e,A){const n=$e(t,A?.in);return isNaN(+n)?Qt(t,NaN):(n.setFullYear(e),n)}function js(t,e,A){return gr(t,-e,A)}function iO(t,e,A){const{years:n=0,months:r=0,weeks:o=0,days:i=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=js(t,r+n*12,A),h=u0(f,i+o*7,A),p=l+a*60,B=(u+p*60)*1e3;return Qt(t,+h-B)}function p0(t,e,A){return Gh(t,-e,A)}function qs(){const t=s.useAttrs();return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...t},[s.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),s.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),s.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),s.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}qs.compatConfig={MODE:3};function m0(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),s.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}m0.compatConfig={MODE:3};function tp(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}tp.compatConfig={MODE:3};function Ap(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}Ap.compatConfig={MODE:3};function np(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),s.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}np.compatConfig={MODE:3};function rp(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}rp.compatConfig={MODE:3};function op(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}op.compatConfig={MODE:3};const wn=(t,e)=>e?new Date(t.toLocaleString("en-US",{timeZone:e})):new Date(t),ip=(t,e,A)=>sp(t,e,A)||ye(),sO=(t,e,A)=>{const n=e.dateInTz?wn(new Date(t),e.dateInTz):ye(t);return A?UA(n,!0):n},sp=(t,e,A)=>{if(!t)return null;const n=A?UA(ye(t),!0):ye(t);return e?e.exactMatch?sO(t,e,A):wn(n,e.timezone):n},aO=t=>{const e=new Date(t.getFullYear(),0,1).getTimezoneOffset();return t.getTimezoneOffset()<e},lO=(t,e)=>{if(!t)return 0;const A=new Date,n=new Date(A.toLocaleString("en-US",{timeZone:"UTC"})),r=new Date(A.toLocaleString("en-US",{timeZone:t})),o=(aO(e??r)?r:e??r).getTimezoneOffset()/60;return(+n-+r)/(1e3*60*60)-o};var yr=(t=>(t.month="month",t.year="year",t))(yr||{}),wr=(t=>(t.top="top",t.bottom="bottom",t))(wr||{}),qi=(t=>(t.header="header",t.calendar="calendar",t.timePicker="timePicker",t))(qi||{}),zA=(t=>(t.month="month",t.year="year",t.calendar="calendar",t.time="time",t.minutes="minutes",t.hours="hours",t.seconds="seconds",t))(zA||{});const cO=["timestamp","date","iso"];var rn=(t=>(t.up="up",t.down="down",t.left="left",t.right="right",t))(rn||{}),Ht=(t=>(t.arrowUp="ArrowUp",t.arrowDown="ArrowDown",t.arrowLeft="ArrowLeft",t.arrowRight="ArrowRight",t.enter="Enter",t.space=" ",t.esc="Escape",t.tab="Tab",t.home="Home",t.end="End",t.pageUp="PageUp",t.pageDown="PageDown",t))(Ht||{}),Zs=(t=>(t.MONTH_AND_YEAR="MM-yyyy",t.YEAR="yyyy",t.DATE="dd-MM-yyyy",t))(Zs||{});function g0(t){return e=>{const A=new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`));return t==="ar"?A.slice(2,5):A.slice(0,2)}}function uO(t){return e=>Pr(wn(new Date(`2017-01-0${e}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:t})}const dO=(t,e,A)=>{const n=[1,2,3,4,5,6,7];let r;if(t!==null)try{r=n.map(uO(t))}catch{r=n.map(g0(e))}else r=n.map(g0(e));const o=r.slice(0,A),i=r.slice(A+1,r.length);return[r[A]].concat(...i).concat(...o)},ap=(t,e,A)=>{const n=[];for(let r=+t[0];r<=+t[1];r++)n.push({value:+r,text:v0(r,e)});return A?n.reverse():n},B0=(t,e,A)=>{const n=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const i=o<10?`0${o}`:o;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(t!==null)try{const o=A==="long"?"LLLL":"LLL";return n.map((i,a)=>{const l=Pr(wn(i,"UTC"),o,{locale:t});return{text:l.charAt(0).toUpperCase()+l.substring(1),value:a}})}catch{}const r=new Intl.DateTimeFormat(e,{month:A,timeZone:"UTC"});return n.map((o,i)=>{const a=r.format(o);return{text:a.charAt(0).toUpperCase()+a.substring(1),value:i}})},fO=t=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][t],BA=t=>{const e=s.unref(t);return e!=null&&e.$el?e?.$el:e},hO=t=>({type:"dot",...t??{}}),y0=t=>Array.isArray(t)?!!t[0]&&!!t[1]:!1,lp={prop:t=>`"${t}" prop must be enabled!`,dateArr:t=>`You need to use array as "model-value" binding in order to support "${t}"`},FA=t=>t,w0=t=>t===0?t:!t||isNaN(+t)?null:+t,C0=t=>t===null,b0=t=>{if(t)return[...t.querySelectorAll("input, button, select, textarea, a[href]")][0]},pO=t=>{const e=[],A=n=>n.filter(r=>r);for(let n=0;n<t.length;n+=3){const r=[t[n],t[n+1],t[n+2]];e.push(A(r))}return e},dl=(t,e,A)=>{const n=A!=null,r=e!=null;if(!n&&!r)return!1;const o=+A,i=+e;return n&&r?+t>o||+t<i:n?+t>o:r?+t<i:!1},ea=(t,e)=>pO(t).map(A=>A.map(n=>{const{active:r,disabled:o,isBetween:i,highlighted:a}=e(n);return{...n,active:r,disabled:o,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&r,dp__cell_in_between:i,"dp--highlighted":a}}})),Jo=(t,e,A=!1)=>{t&&e.allowStopPropagation&&(A&&t.stopImmediatePropagation(),t.stopPropagation())},mO=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function gO(t,e){let A=[...document.querySelectorAll(mO())];A=A.filter(r=>!t.contains(r)||r.hasAttribute("data-datepicker-instance"));const n=A.indexOf(t);if(n>=0&&(e?n-1>=0:n+1<=A.length))return A[n+(e?-1:1)]}const cp=(t,e)=>t?.querySelector(`[data-dp-element="${e}"]`),v0=(t,e)=>new Intl.NumberFormat(e,{useGrouping:!1,style:"decimal"}).format(t),up=(t,e)=>Pr(t,e??Zs.DATE),dp=t=>Array.isArray(t),qc=(t,e,A)=>e.get(up(t,A)),BO=(t,e)=>t?e?e instanceof Map?!!qc(t,e):e(ye(t)):!1:!0,on=(t,e,A=!1,n)=>{if(t.key===Ht.enter||t.key===Ht.space)return A&&t.preventDefault(),e();if(n)return n(t)},yO=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,E0=(t,e)=>t?Zs.MONTH_AND_YEAR:e?Zs.YEAR:Zs.DATE,k0=t=>t<10?`0${t}`:t,S0=(t,e,A,n,r,o)=>{const i=ep(t,e.slice(0,t.length),new Date,{locale:o});return al(i)&&Gw(i)?n||r?i:Tt(i,{hours:+A.hours,minutes:+A?.minutes,seconds:+A?.seconds,milliseconds:0}):null},wO=(t,e,A,n,r,o)=>{const i=Array.isArray(A)?A[0]:A;if(typeof e=="string")return S0(t,e,i,n,r,o);if(Array.isArray(e)){let a=null;for(const l of e)if(a=S0(t,l,i,n,r,o),a)break;return a}return typeof e=="function"?e(t):null},ye=t=>t?new Date(t):new Date,CO=(t,e,A)=>{if(e){const r=(t.getMonth()+1).toString().padStart(2,"0"),o=t.getDate().toString().padStart(2,"0"),i=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),l=A?t.getSeconds().toString().padStart(2,"0"):"00";return`${t.getFullYear()}-${r}-${o}T${i}:${a}:${l}.000Z`}const n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());return new Date(n).toISOString()},UA=(t,e)=>{const A=ye(JSON.parse(JSON.stringify(t))),n=Tt(A,{hours:0,minutes:0,seconds:0,milliseconds:0});return e?pD(n):n},Xo=(t,e,A,n)=>{let r=t?ye(t):ye();return(e||e===0)&&(r=rO(r,+e)),(A||A===0)&&(r=oO(r,+A)),(n||n===0)&&(r=h0(r,+n)),f0(r,0)},eA=(t,e)=>!t||!e?!1:Js(UA(t),UA(e)),dt=(t,e)=>!t||!e?!1:Xs(UA(t),UA(e)),aA=(t,e)=>!t||!e?!1:ji(UA(t),UA(e)),fl=(t,e,A)=>t!=null&&t[0]&&t!=null&&t[1]?aA(A,t[0])&&eA(A,t[1]):t!=null&&t[0]&&e?aA(A,t[0])&&eA(A,e)||eA(A,t[0])&&aA(A,e):!1,Cr=t=>{const e=Tt(new Date(t),{date:1});return UA(e)},fp=(t,e,A)=>e&&(A||A===0)?Object.fromEntries(["hours","minutes","seconds"].map(n=>n===e?[n,A]:[n,isNaN(+t[n])?void 0:+t[n]])):{hours:isNaN(+t.hours)?void 0:+t.hours,minutes:isNaN(+t.minutes)?void 0:+t.minutes,seconds:isNaN(+t.seconds)?void 0:+t.seconds},Zi=t=>({hours:mo(t),minutes:Yo(t),seconds:Ys(t)}),Q0=(t,e)=>{if(e){const A=qe(ye(e));if(A>t)return 12;if(A===t)return ut(ye(e))}},F0=(t,e)=>{if(e){const A=qe(ye(e));return A<t?-1:A===t?ut(ye(e)):void 0}},ta=t=>{if(t)return qe(ye(t))},U0=(t,e)=>{const A=aA(t,e)?e:t,n=aA(e,t)?e:t;return Yw({start:A,end:n})},bO=t=>{const e=gr(t,1);return{month:ut(e),year:qe(e)}},go=(t,e)=>{const A=Br(t,{weekStartsOn:+e}),n=Xw(t,{weekStartsOn:+e});return[A,n]},I0=(t,e)=>{const A={hours:mo(ye()),minutes:Yo(ye()),seconds:e?Ys(ye()):0};return Object.assign(A,t)},jo=(t,e,A)=>[Tt(ye(t),{date:1}),Tt(ye(),{month:e,year:A,date:1})],Bo=(t,e,A)=>{let n=t?ye(t):ye();return(e||e===0)&&(n=d0(n,e)),A&&(n=Kr(n,A)),n},x0=(t,e,A,n,r)=>{if(!n||r&&!e||!r&&!A)return!1;const o=r?gr(t,1):js(t,1),i=[ut(o),qe(o)];return r?!EO(...i,e):!vO(...i,A)},vO=(t,e,A)=>eA(...jo(A,t,e))||dt(...jo(A,t,e)),EO=(t,e,A)=>aA(...jo(A,t,e))||dt(...jo(A,t,e)),T0=(t,e,A,n,r,o,i)=>{if(typeof e=="function"&&!i)return e(t);const a=A?{locale:A}:void 0;return Array.isArray(t)?`${Pr(t[0],o,a)}${r&&!t[1]?"":n}${t[1]?Pr(t[1],o,a):""}`:Pr(t,o,a)},Aa=t=>{if(t)return null;throw new Error(lp.prop("partial-range"))},Zc=(t,e)=>{if(e)return t();throw new Error(lp.prop("range"))},hp=t=>Array.isArray(t)?al(t[0])&&(t[1]?al(t[1]):!0):t?al(t):!1,kO=(t,e)=>Tt(e??ye(),{hours:+t.hours||0,minutes:+t.minutes||0,seconds:+t.seconds||0}),pp=(t,e,A,n)=>{if(!t)return!0;if(n){const r=A==="max"?Js(t,e):ji(t,e),o={seconds:0,milliseconds:0};return r||Xs(Tt(t,o),Tt(e,o))}return A==="max"?t.getTime()<=e.getTime():t.getTime()>=e.getTime()},mp=(t,e,A)=>t?kO(t,e):ye(A??e),_0=(t,e,A,n,r)=>{if(Array.isArray(n)){const i=mp(t,n[0],e),a=mp(t,n[1],e);return pp(n[0],i,A,!!e)&&pp(n[1],a,A,!!e)&&r}const o=mp(t,n,e);return pp(n,o,A,!!e)&&r},gp=t=>Tt(ye(),Zi(t)),SO=(t,e,A)=>{if(t instanceof Map){const n=`${k0(A+1)}-${e}`;return t.size?t.has(n):!1}return typeof t=="function"?t(UA(Tt(ye(),{month:A,year:e}),!0)):!1},QO=(t,e,A)=>{if(t instanceof Map){const n=`${k0(A+1)}-${e}`;return t.size?t.has(n):!0}return!0},D0=(t,e,A)=>typeof t=="function"?t({month:e,year:A}):!!t.months.find(n=>n.month===e&&n.year===A),Bp=(t,e)=>typeof t=="function"?t(e):t.years.includes(e),yp=t=>`dp-${Pr(t,"yyyy-MM-dd")}`,L0=(t,e)=>{const A=u0(UA(e),t),n=Xn(UA(e),t);return{before:A,after:n}},hl=s.reactive({menuFocused:!1,shiftKeyInMenu:!1}),O0=()=>{const t=A=>{hl.menuFocused=A},e=A=>{hl.shiftKeyInMenu!==A&&(hl.shiftKeyInMenu=A)};return{control:s.computed(()=>({shiftKeyInMenu:hl.shiftKeyInMenu,menuFocused:hl.menuFocused})),setMenuFocused:t,setShiftKey:e}},Rt=s.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),wp=s.ref(null),eu=s.ref(!1),Cp=s.ref(!1),bp=s.ref(!1),vp=s.ref(!1),YA=s.ref(0),lA=s.ref(0),qo=()=>{const t=s.computed(()=>eu.value?[...Rt.selectionGrid,Rt.actionRow].filter(h=>h.length):Cp.value?[...Rt.timePicker[0],...Rt.timePicker[1],vp.value?[]:[wp.value],Rt.actionRow].filter(h=>h.length):bp.value?[...Rt.monthPicker,Rt.actionRow]:[Rt.monthYear,...Rt.calendar,Rt.time,Rt.actionRow].filter(h=>h.length)),e=h=>{YA.value=h?YA.value+1:YA.value-1;let p=null;t.value[lA.value]&&(p=t.value[lA.value][YA.value]),!p&&t.value[lA.value+(h?1:-1)]?(lA.value=lA.value+(h?1:-1),YA.value=h?0:t.value[lA.value].length-1):p||(YA.value=h?YA.value-1:YA.value+1)},A=h=>{lA.value===0&&!h||lA.value===t.value.length&&h||(lA.value=h?lA.value+1:lA.value-1,t.value[lA.value]?t.value[lA.value]&&!t.value[lA.value][YA.value]&&YA.value!==0&&(YA.value=t.value[lA.value].length-1):lA.value=h?lA.value-1:lA.value+1)},n=h=>{let p=null;t.value[lA.value]&&(p=t.value[lA.value][YA.value]),p?p.focus({preventScroll:!eu.value}):YA.value=h?YA.value-1:YA.value+1},r=()=>{e(!0),n(!0)},o=()=>{e(!1),n(!1)},i=()=>{A(!1),n(!0)},a=()=>{A(!0),n(!0)},l=(h,p)=>{Rt[p]=h},u=(h,p)=>{Rt[p]=h},f=()=>{YA.value=0,lA.value=0};return{buildMatrix:l,buildMultiLevelMatrix:u,setTimePickerBackRef:h=>{wp.value=h},setSelectionGrid:h=>{eu.value=h,f(),h||(Rt.selectionGrid=[])},setTimePicker:(h,p=!1)=>{Cp.value=h,vp.value=p,f(),h||(Rt.timePicker[0]=[],Rt.timePicker[1]=[])},setTimePickerElements:(h,p=0)=>{Rt.timePicker[p]=h},arrowRight:r,arrowLeft:o,arrowUp:i,arrowDown:a,clearArrowNav:()=>{Rt.monthYear=[],Rt.calendar=[],Rt.time=[],Rt.actionRow=[],Rt.selectionGrid=[],Rt.timePicker[0]=[],Rt.timePicker[1]=[],eu.value=!1,Cp.value=!1,vp.value=!1,bp.value=!1,f(),wp.value=null},setMonthPicker:h=>{bp.value=h,f()},refSets:Rt}},M0=t=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...t??{}}),FO=t=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:e=>`Month picker${e?" overlay":""}`,yearPicker:e=>`Year picker${e?" overlay":""}`,timeOverlay:e=>`${e} overlay`,...t??{}}),N0=t=>t?typeof t=="boolean"?t?2:0:+t>=2?+t:2:0,UO=t=>{const e=typeof t=="object"&&t,A={static:!0,solo:!1};if(!t)return{...A,count:N0(!1)};const n=e?t:{},r=e?n.count??!0:t,o=N0(r);return Object.assign(A,n,{count:o})},IO=(t,e,A)=>t||(typeof A=="string"?A:e),xO=t=>typeof t=="boolean"?t?M0({}):!1:M0(t),TO=t=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - ",escClose:!0};return typeof t=="object"?{...e,...t??{},enabled:!0}:{...e,enabled:t}},_O=t=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...t??{}}),DO=t=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...t??{}}),LO=t=>{const e={input:!1};return typeof t=="object"?{...e,...t??{},enabled:!0}:{enabled:t,...e}},OO=t=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,mobileBreakpoint:600,setDateOnMenuClose:!1,...t??{}}),MO=t=>{const e={dates:Array.isArray(t)?t.map(A=>ye(A)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof t=="function"?t:{...e,...t??{}}},NO=t=>typeof t=="object"?{type:t?.type??"local",hideOnOffsetDates:t?.hideOnOffsetDates??!1}:{type:t,hideOnOffsetDates:!1},HO=t=>{const e={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof t=="object"?{enabled:!0,...e,...t}:{enabled:t,...e}},RO=t=>t?typeof t=="string"?{timezone:t,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:t.timezone,exactMatch:t.exactMatch??!1,dateInTz:t.dateInTz??void 0,emitTimezone:t.emitTimezone??void 0,convertModel:t.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},Ep=(t,e,A,n)=>new Map(t.map(r=>{const o=ip(r,e,n);return[up(o,A),o]})),PO=(t,e)=>t.length?new Map(t.map(A=>{const n=ip(A.date,e);return[up(n,Zs.DATE),A]})):null,VO=t=>{var e;const A=E0(t.isMonthPicker,t.isYearPicker);return{minDate:sp(t.minDate,t.timezone,t.isSpecific),maxDate:sp(t.maxDate,t.timezone,t.isSpecific),disabledDates:dp(t.disabledDates)?Ep(t.disabledDates,t.timezone,A,t.isSpecific):t.disabledDates,allowedDates:dp(t.allowedDates)?Ep(t.allowedDates,t.timezone,A,t.isSpecific):null,highlight:typeof t.highlight=="object"&&dp((e=t.highlight)==null?void 0:e.dates)?Ep(t.highlight.dates,t.timezone,A):t.highlight,markers:PO(t.markers,t.timezone)}},$O=t=>typeof t=="boolean"?{enabled:t,dragSelect:!0,limit:null}:{enabled:!!t,limit:t.limit?+t.limit:null,dragSelect:t.dragSelect??!0},KO=t=>({...Object.fromEntries(Object.keys(t).map(e=>{const A=e,n=t[A],r=typeof t[A]=="string"?{[n]:!0}:Object.fromEntries(n.map(o=>[o,!0]));return[e,r]}))}),Gt=t=>{const e=()=>{const Q=t.enableSeconds?":ss":"",x=t.enableMinutes?":mm":"";return t.is24?`HH${x}${Q}`:`hh${x}${Q} aa`},A=()=>{var Q;return t.format?t.format:t.monthPicker?"MM/yyyy":t.timePicker?e():t.weekPicker?`${((Q=b.value)==null?void 0:Q.type)==="iso"?"II":"ww"}-RR`:t.yearPicker?"yyyy":t.quarterPicker?"QQQ/yyyy":t.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy"},n=Q=>I0(Q,t.enableSeconds),r=()=>F.value.enabled?t.startTime&&Array.isArray(t.startTime)?[n(t.startTime[0]),n(t.startTime[1])]:null:t.startTime&&!Array.isArray(t.startTime)?n(t.startTime):null,o=s.computed(()=>UO(t.multiCalendars)),i=s.computed(()=>r()),a=s.computed(()=>FO(t.ariaLabels)),l=s.computed(()=>_O(t.filters)),u=s.computed(()=>xO(t.transitions)),f=s.computed(()=>DO(t.actionRow)),h=s.computed(()=>IO(t.previewFormat,t.format,A())),p=s.computed(()=>TO(t.textInput)),g=s.computed(()=>LO(t.inline)),B=s.computed(()=>OO(t.config)),y=s.computed(()=>MO(t.highlight)),b=s.computed(()=>NO(t.weekNumbers)),w=s.computed(()=>RO(t.timezone)),v=s.computed(()=>$O(t.multiDates)),S=s.computed(()=>VO({minDate:t.minDate,maxDate:t.maxDate,disabledDates:t.disabledDates,allowedDates:t.allowedDates,highlight:y.value,markers:t.markers,timezone:w.value,isSpecific:t.monthPicker||t.yearPicker||t.quarterPicker,isMonthPicker:t.monthPicker,isYearPicker:t.yearPicker})),F=s.computed(()=>HO(t.range)),I=s.computed(()=>KO(t.ui));return{defaultedTransitions:u,defaultedMultiCalendars:o,defaultedStartTime:i,defaultedAriaLabels:a,defaultedFilters:l,defaultedActionRow:f,defaultedPreviewFormat:h,defaultedTextInput:p,defaultedInline:g,defaultedConfig:B,defaultedHighlight:y,defaultedWeekNumbers:b,defaultedRange:F,propDates:S,defaultedTz:w,defaultedMultiDates:v,defaultedUI:I,getDefaultPattern:A,getDefaultStartTime:r,handleEventPropagation:Q=>{B.value.allowStopPropagation&&Q.stopPropagation(),B.value.allowPreventDefault&&Q.preventDefault()}}},GO=(t,e,A)=>{const n=s.ref(),{defaultedTextInput:r,defaultedRange:o,defaultedTz:i,defaultedMultiDates:a,getDefaultPattern:l}=Gt(e),u=s.ref(""),f=s.toRef(e,"format"),h=s.toRef(e,"formatLocale");s.watch(n,()=>{typeof e.onInternalModelChange=="function"&&t("internal-model-change",n.value,oe(!0))},{deep:!0}),s.watch(o,(k,X)=>{k.enabled!==X.enabled&&(n.value=null)}),s.watch(f,()=>{ee()});const p=k=>i.value.timezone&&i.value.convertModel?wn(k,i.value.timezone):k,g=k=>{if(i.value.timezone&&i.value.convertModel){const X=lO(i.value.timezone,k);return aD(k,X)}return k},B=(k,X,Se=!1)=>T0(k,e.format,e.formatLocale,r.value.rangeSeparator,e.modelAuto,X??l(),Se),y=k=>k?e.modelType?ce(k):{hours:mo(k),minutes:Yo(k),seconds:e.enableSeconds?Ys(k):0}:null,b=k=>e.modelType?ce(k):{month:ut(k),year:qe(k)},w=k=>Array.isArray(k)?a.value.enabled?k.map(X=>v(X,Kr(ye(),X))):Zc(()=>[Kr(ye(),k[0]),k[1]?Kr(ye(),k[1]):Aa(o.value.partialRange)],o.value.enabled):Kr(ye(),+k),v=(k,X)=>(typeof k=="string"||typeof k=="number")&&e.modelType?K(k):X,S=k=>Array.isArray(k)?[v(k[0],Xo(null,+k[0].hours,+k[0].minutes,k[0].seconds)),v(k[1],Xo(null,+k[1].hours,+k[1].minutes,k[1].seconds))]:v(k,Xo(null,k.hours,k.minutes,k.seconds)),F=k=>{const X=Tt(ye(),{date:1});return Array.isArray(k)?a.value.enabled?k.map(Se=>v(Se,Bo(X,+Se.month,+Se.year))):Zc(()=>[v(k[0],Bo(X,+k[0].month,+k[0].year)),v(k[1],k[1]?Bo(X,+k[1].month,+k[1].year):Aa(o.value.partialRange))],o.value.enabled):v(k,Bo(X,+k.month,+k.year))},I=k=>{if(Array.isArray(k))return k.map(X=>K(X));throw new Error(lp.dateArr("multi-dates"))},Q=k=>{if(Array.isArray(k)&&o.value.enabled){const X=k[0],Se=k[1];return[ye(Array.isArray(X)?X[0]:null),Array.isArray(Se)&&Se.length?ye(Se[0]):null]}return ye(k[0])},x=k=>e.modelAuto?Array.isArray(k)?[K(k[0]),K(k[1])]:e.autoApply?[K(k)]:[K(k),null]:Array.isArray(k)?Zc(()=>k[1]?[K(k[0]),k[1]?K(k[1]):Aa(o.value.partialRange)]:[K(k[0])],o.value.enabled):K(k),M=()=>{Array.isArray(n.value)&&o.value.enabled&&n.value.length===1&&n.value.push(Aa(o.value.partialRange))},O=()=>{const k=n.value;return[ce(k[0]),k[1]?ce(k[1]):Aa(o.value.partialRange)]},P=()=>Array.isArray(n.value)?n.value[1]?O():ce(FA(n.value[0])):[],ie=()=>(n.value||[]).map(k=>ce(k)),ae=(k=!1)=>(k||M(),e.modelAuto?P():a.value.enabled?ie():Array.isArray(n.value)?Zc(()=>O(),o.value.enabled):ce(FA(n.value))),ue=k=>!k||Array.isArray(k)&&!k.length?null:e.timePicker?S(FA(k)):e.monthPicker?F(FA(k)):e.yearPicker?w(FA(k)):a.value.enabled?I(FA(k)):e.weekPicker?Q(FA(k)):x(FA(k)),H=k=>{const X=ue(k);hp(FA(X))?(n.value=FA(X),ee()):(n.value=null,u.value="")},G=()=>{const k=X=>Pr(X,r.value.format);return`${k(n.value[0])} ${r.value.rangeSeparator} ${n.value[1]?k(n.value[1]):""}`},$=()=>A.value&&n.value?Array.isArray(n.value)?G():Pr(n.value,r.value.format):B(n.value),te=()=>n.value?a.value.enabled?n.value.map(k=>B(k)).join("; "):r.value.enabled&&typeof r.value.format=="string"?$():B(n.value):"",ee=()=>{!e.format||typeof e.format=="string"||r.value.enabled&&typeof r.value.format=="string"?u.value=te():u.value=e.format(n.value)},K=k=>{if(e.utc){const X=new Date(k);return e.utc==="preserve"?new Date(X.getTime()+X.getTimezoneOffset()*6e4):X}return e.modelType?cO.includes(e.modelType)?p(new Date(k)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?p(ep(k,l(),new Date,{locale:h.value})):p(ep(k,e.modelType,new Date,{locale:h.value})):p(new Date(k))},ce=k=>k?e.utc?CO(k,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+g(k):e.modelType==="iso"?g(k).toISOString():e.modelType==="format"&&(typeof e.format=="string"||!e.format)?B(g(k)):B(g(k),e.modelType,!0):g(k):"",j=(k,X=!1,Se=!1)=>{if(Se)return k;if(t("update:model-value",k),i.value.emitTimezone&&X){const ht=Array.isArray(k)?k.map(se=>wn(FA(se),i.value.emitTimezone)):wn(FA(k),i.value.emitTimezone);t("update:model-timezone-value",ht)}},Qe=k=>Array.isArray(n.value)?a.value.enabled?n.value.map(X=>k(X)):[k(n.value[0]),n.value[1]?k(n.value[1]):Aa(o.value.partialRange)]:k(FA(n.value)),R=()=>{if(Array.isArray(n.value)){const k=go(n.value[0],e.weekStart),X=n.value[1]?go(n.value[1],e.weekStart):[];return[k.map(Se=>ye(Se)),X.map(Se=>ye(Se))]}return go(n.value,e.weekStart).map(k=>ye(k))},J=(k,X)=>j(FA(Qe(k)),!1,X),Ae=k=>{const X=R();return k?X:t("update:model-value",R())},oe=(k=!1)=>(k||ee(),e.monthPicker?J(b,k):e.timePicker?J(y,k):e.yearPicker?J(qe,k):e.weekPicker?Ae(k):j(ae(k),!0,k));return{inputValue:u,internalModelValue:n,checkBeforeEmit:()=>n.value?o.value.enabled?o.value.partialRange?n.value.length>=1:n.value.length===2:!!n.value:!1,parseExternalModelValue:H,formatInputValue:ee,emitModelValue:oe}},WO=(t,e)=>{const{defaultedFilters:A,propDates:n}=Gt(t),{validateMonthYearInRange:r}=ei(t),o=(f,h)=>{let p=f;return A.value.months.includes(ut(p))?(p=h?gr(f,1):js(f,1),o(p,h)):p},i=(f,h)=>{let p=f;return A.value.years.includes(qe(p))?(p=h?Gh(f,1):p0(f,1),i(p,h)):p},a=(f,h=!1)=>{const p=Tt(ye(),{month:t.month,year:t.year});let g=f?gr(p,1):js(p,1);t.disableYearSelect&&(g=Kr(g,t.year));let B=ut(g),y=qe(g);A.value.months.includes(B)&&(g=o(g,f),B=ut(g),y=qe(g)),A.value.years.includes(y)&&(g=i(g,f),y=qe(g)),r(B,y,f,t.preventMinMaxNavigation)&&l(B,y,h)},l=(f,h,p)=>{e("update-month-year",{month:f,year:h,fromNav:p})},u=s.computed(()=>f=>x0(Tt(ye(),{month:t.month,year:t.year}),n.value.maxDate,n.value.minDate,t.preventMinMaxNavigation,f));return{handleMonthYearChange:a,isDisabled:u,updateMonthYear:l}},tu={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:[Boolean,String],default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},alwaysClearable:{type:Boolean,default:!1},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},br={...tu,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1},isMobile:{type:Boolean,default:void 0}},zO=["title"],YO=["disabled"],JO=s.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...br},emits:["close-picker","select-date","select-now","invalid-select"],setup(t,{emit:e}){const A=e,n=t,{defaultedActionRow:r,defaultedPreviewFormat:o,defaultedMultiCalendars:i,defaultedTextInput:a,defaultedInline:l,defaultedRange:u,defaultedMultiDates:f}=Gt(n),{isTimeValid:h,isMonthValid:p}=ei(n),{buildMatrix:g}=qo(),B=s.ref(null),y=s.ref(null),b=s.ref(!1),w=s.ref({}),v=s.ref(null),S=s.ref(null);s.onMounted(()=>{n.arrowNavigation&&g([BA(B),BA(y)],"actionRow"),F(),window.addEventListener("resize",F)}),s.onUnmounted(()=>{window.removeEventListener("resize",F)});const F=()=>{b.value=!1,setTimeout(()=>{var H,G;const $=(H=v.value)==null?void 0:H.getBoundingClientRect(),te=(G=S.value)==null?void 0:G.getBoundingClientRect();$&&te&&(w.value.maxWidth=`${te.width-$.width-20}px`),b.value=!0},0)},I=s.computed(()=>u.value.enabled&&!u.value.partialRange&&n.internalModelValue?n.internalModelValue.length===2:!0),Q=s.computed(()=>!h.value(n.internalModelValue)||!p.value(n.internalModelValue)||!I.value),x=()=>{const H=o.value;return n.timePicker||n.monthPicker,H(FA(n.internalModelValue))},M=()=>{const H=n.internalModelValue;return i.value.count>0?`${O(H[0])} - ${O(H[1])}`:[O(H[0]),O(H[1])]},O=H=>T0(H,o.value,n.formatLocale,a.value.rangeSeparator,n.modelAuto,o.value),P=s.computed(()=>!n.internalModelValue||!n.menuMount?"":typeof o.value=="string"?Array.isArray(n.internalModelValue)?n.internalModelValue.length===2&&n.internalModelValue[1]?M():f.value.enabled?n.internalModelValue.map(H=>`${O(H)}`):n.modelAuto?`${O(n.internalModelValue[0])}`:`${O(n.internalModelValue[0])} -`:O(n.internalModelValue):x()),ie=()=>f.value.enabled?"; ":" - ",ae=s.computed(()=>Array.isArray(P.value)?P.value.join(ie()):P.value),ue=()=>{h.value(n.internalModelValue)&&p.value(n.internalModelValue)&&I.value?A("select-date"):A("invalid-select")};return(H,G)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"actionRowRef",ref:S,class:"dp__action_row"},[H.$slots["action-row"]?s.renderSlot(H.$slots,"action-row",s.normalizeProps(s.mergeProps({key:0},{internalModelValue:H.internalModelValue,disabled:Q.value,selectDate:()=>H.$emit("select-date"),closePicker:()=>H.$emit("close-picker")}))):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.unref(r).showPreview?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__selection_preview",title:ae.value,style:s.normalizeStyle(w.value)},[H.$slots["action-preview"]&&b.value?s.renderSlot(H.$slots,"action-preview",{key:0,value:H.internalModelValue}):s.createCommentVNode("",!0),!H.$slots["action-preview"]&&b.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ae.value),1)],64)):s.createCommentVNode("",!0)],12,zO)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"actionBtnContainer",ref:v,class:"dp__action_buttons","data-dp-element":"action-row"},[H.$slots["action-buttons"]?s.renderSlot(H.$slots,"action-buttons",{key:0,value:H.internalModelValue}):s.createCommentVNode("",!0),H.$slots["action-buttons"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!s.unref(l).enabled&&s.unref(r).showCancel?(s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"cancelButtonRef",ref:B,type:"button",class:"dp__action_button dp__action_cancel",onClick:G[0]||(G[0]=$=>H.$emit("close-picker")),onKeydown:G[1]||(G[1]=$=>s.unref(on)($,()=>H.$emit("close-picker")))},s.toDisplayString(H.cancelText),545)):s.createCommentVNode("",!0),s.unref(r).showNow?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:G[2]||(G[2]=$=>H.$emit("select-now")),onKeydown:G[3]||(G[3]=$=>s.unref(on)($,()=>H.$emit("select-now")))},s.toDisplayString(H.nowButtonLabel),33)):s.createCommentVNode("",!0),s.unref(r).showSelect?(s.openBlock(),s.createElementBlock("button",{key:2,ref_key:"selectButtonRef",ref:y,type:"button",class:"dp__action_button dp__action_select",disabled:Q.value,"data-test-id":"select-button",onKeydown:G[4]||(G[4]=$=>s.unref(on)($,()=>ue())),onClick:ue},s.toDisplayString(H.selectText),41,YO)):s.createCommentVNode("",!0)],64))],512)],64))],512))}}),XO=["role","aria-label","tabindex"],jO={class:"dp__selection_grid_header"},qO=["aria-selected","aria-disabled","data-test-id","onClick","onKeydown","onMouseover"],ZO=["aria-label"],pl=s.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(t,{expose:e,emit:A}){const{setSelectionGrid:n,buildMultiLevelMatrix:r,setMonthPicker:o}=qo(),i=A,a=t,{defaultedAriaLabels:l,defaultedTextInput:u,defaultedConfig:f,handleEventPropagation:h}=Gt(a),{hideNavigationButtons:p}=ru(),g=s.ref(!1),B=s.ref(null),y=s.ref(null),b=s.ref([]),w=s.ref(),v=s.ref(null),S=s.ref(0),F=s.ref(null);s.onBeforeUpdate(()=>{B.value=null}),s.onMounted(()=>{s.nextTick().then(()=>ae()),a.noOverlayFocus||Q(),I(!0)}),s.onUnmounted(()=>I(!1));const I=R=>{var J;a.arrowNavigation&&((J=a.headerRefs)!=null&&J.length?o(R):n(R))},Q=()=>{var R;const J=BA(y);J&&(u.value.enabled||(B.value?(R=B.value)==null||R.focus({preventScroll:!0}):J.focus({preventScroll:!0})),g.value=J.clientHeight<J.scrollHeight)},x=s.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!a.useRelative,"dp--overlay-relative":a.useRelative})),M=s.computed(()=>a.useRelative?{height:`${a.height}px`,width:"var(--dp-menu-min-width)"}:void 0),O=s.computed(()=>({dp__overlay_col:!0})),P=s.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:g.value,dp__button_bottom:a.isLast})),ie=s.computed(()=>{var R,J;return{dp__overlay_container:!0,dp__container_flex:((R=a.items)==null?void 0:R.length)<=6,dp__container_block:((J=a.items)==null?void 0:J.length)>6}});s.watch(()=>a.items,()=>ae(!1),{deep:!0});const ae=(R=!0)=>{s.nextTick().then(()=>{const J=BA(B),Ae=BA(y),oe=BA(v),k=BA(F),X=oe?oe.getBoundingClientRect().height:0;Ae&&(Ae.getBoundingClientRect().height?S.value=Ae.getBoundingClientRect().height-X:S.value=f.value.modeHeight-X),J&&k&&R&&(k.scrollTop=J.offsetTop-k.offsetTop-(S.value/2-J.getBoundingClientRect().height)-X)})},ue=R=>{R.disabled||i("selected",R.value)},H=()=>{i("toggle"),i("reset-flow")},G=R=>{a.escClose&&(H(),h(R))},$=(R,J,Ae,oe)=>{R&&((J.active||J.value===a.focusValue)&&(B.value=R),a.arrowNavigation&&(Array.isArray(b.value[Ae])?b.value[Ae][oe]=R:b.value[Ae]=[R],te()))},te=()=>{var R,J;const Ae=(R=a.headerRefs)!=null&&R.length?[a.headerRefs].concat(b.value):b.value.concat([a.skipButtonRef?[]:[v.value]]);r(FA(Ae),(J=a.headerRefs)!=null&&J.length?"monthPicker":"selectionGrid")},ee=R=>{a.arrowNavigation||Jo(R,f.value,!0)},K=R=>{w.value=R,i("hover-value",R)},ce=()=>{if(H(),!a.isLast){const R=cp(a.menuWrapRef??null,"action-row");if(R){const J=b0(R);J?.focus()}}},j=R=>{switch(R.key){case Ht.esc:return G(R);case Ht.arrowLeft:return ee(R);case Ht.arrowRight:return ee(R);case Ht.arrowUp:return ee(R);case Ht.arrowDown:return ee(R);default:return}},Qe=R=>{if(R.key===Ht.enter)return H();if(R.key===Ht.tab)return ce()};return e({focusGrid:Q}),(R,J)=>{var Ae;return s.openBlock(),s.createElementBlock("div",{ref_key:"gridWrapRef",ref:y,class:s.normalizeClass(x.value),style:s.normalizeStyle(M.value),role:R.useRelative?void 0:"dialog","aria-label":R.overlayLabel,tabindex:R.useRelative?void 0:"0",onKeydown:j,onClick:J[0]||(J[0]=s.withModifiers(()=>{},["prevent"]))},[s.createElementVNode("div",{ref_key:"containerRef",ref:F,class:s.normalizeClass(ie.value),style:s.normalizeStyle({"--dp-overlay-height":`${S.value}px`}),role:"grid"},[s.createElementVNode("div",jO,[s.renderSlot(R.$slots,"header")]),R.$slots.overlay?s.renderSlot(R.$slots,"overlay",{key:0}):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(R.items,(oe,k)=>(s.openBlock(),s.createElementBlock("div",{key:k,class:s.normalizeClass(["dp__overlay_row",{dp__flex_row:R.items.length>=3}]),role:"row"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(oe,(X,Se)=>(s.openBlock(),s.createElementBlock("div",{key:X.value,ref_for:!0,ref:ht=>$(ht,X,k,Se),role:"gridcell",class:s.normalizeClass(O.value),"aria-selected":X.active||void 0,"aria-disabled":X.disabled||void 0,tabindex:"0","data-test-id":X.text,onClick:s.withModifiers(ht=>ue(X),["prevent"]),onKeydown:ht=>s.unref(on)(ht,()=>ue(X),!0),onMouseover:ht=>K(X.value)},[s.createElementVNode("div",{class:s.normalizeClass(X.className)},[R.$slots.item?s.renderSlot(R.$slots,"item",{key:0,item:X}):s.createCommentVNode("",!0),R.$slots.item?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(X.text),1)],64))],2)],42,qO))),128))],2))),128))],6),R.$slots["button-icon"]?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"toggleButton",ref:v,type:"button","aria-label":(Ae=s.unref(l))==null?void 0:Ae.toggleOverlay,class:s.normalizeClass(P.value),tabindex:"0",onClick:H,onKeydown:Qe},[s.renderSlot(R.$slots,"button-icon")],42,ZO)),[[s.vShow,!s.unref(p)(R.hideNavigation,R.type)]]):s.createCommentVNode("",!0)],46,XO)}}}),eM=["data-dp-mobile"],Au=s.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean},isMobile:{type:Boolean}},setup(t){const e=t,A=s.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),n=s.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(r,o)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse}),"data-dp-mobile":r.isMobile},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(i,a)=>(s.openBlock(),s.createElementBlock("div",{key:i,class:s.normalizeClass(n.value)},[s.renderSlot(r.$slots,"default",{instance:i,index:a})],2))),128))],10,eM))}}),tM=["data-dp-element","aria-label","aria-disabled"],ml=s.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(t,{emit:e}){const A=e,n=s.ref(null);return s.onMounted(()=>A("set-ref",n)),(r,o)=>(s.openBlock(),s.createElementBlock("button",{ref_key:"elRef",ref:n,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:o[0]||(o[0]=i=>r.$emit("activate")),onKeydown:o[1]||(o[1]=i=>s.unref(on)(i,()=>r.$emit("activate"),!0))},[s.createElementVNode("span",{class:s.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[s.renderSlot(r.$slots,"default")],2)],40,tM))}}),AM=["aria-label","data-test-id"],H0=s.defineComponent({__name:"YearModePicker",props:{...br,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(t,{emit:e}){const A=e,n=t,{showRightIcon:r,showLeftIcon:o}=ru(),{defaultedConfig:i,defaultedMultiCalendars:a,defaultedAriaLabels:l,defaultedTransitions:u,defaultedUI:f}=Gt(n),{showTransition:h,transitionName:p}=gl(u),g=s.ref(!1),B=(w=!1,v)=>{g.value=!g.value,A("toggle-year-picker",{flow:w,show:v})},y=w=>{g.value=!1,A("year-select",w)},b=(w=!1)=>{A("handle-year",w)};return(w,v)=>{var S,F,I,Q,x;return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{class:s.normalizeClass(["dp--year-mode-picker",{"dp--hidden-el":g.value}])},[s.unref(o)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:0,ref:"mpPrevIconRef","aria-label":(S=s.unref(l))==null?void 0:S.prevYear,disabled:t.isDisabled(!1),class:s.normalizeClass((F=s.unref(f))==null?void 0:F.navBtnPrev),onActivate:v[0]||(v[0]=M=>b(!1))},{default:s.withCtx(()=>[w.$slots["arrow-left"]?s.renderSlot(w.$slots,"arrow-left",{key:0}):s.createCommentVNode("",!0),w.$slots["arrow-left"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(tp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.createElementVNode("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${t.year}-${(I=s.unref(l))==null?void 0:I.openYearsOverlay}`,"data-test-id":`year-mode-btn-${t.instance}`,onClick:v[1]||(v[1]=()=>B(!1)),onKeydown:v[2]||(v[2]=s.withKeys(()=>B(!1),["enter"]))},[w.$slots.year?s.renderSlot(w.$slots,"year",{key:0,year:t.year}):s.createCommentVNode("",!0),w.$slots.year?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(t.year),1)],64))],40,AM),s.unref(r)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:1,ref:"mpNextIconRef","aria-label":(Q=s.unref(l))==null?void 0:Q.nextYear,disabled:t.isDisabled(!0),class:s.normalizeClass((x=s.unref(f))==null?void 0:x.navBtnNext),onActivate:v[3]||(v[3]=M=>b(!0))},{default:s.withCtx(()=>[w.$slots["arrow-right"]?s.renderSlot(w.$slots,"arrow-right",{key:0}):s.createCommentVNode("",!0),w.$slots["arrow-right"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(Ap),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0)],2),s.createVNode(s.Transition,{name:s.unref(p)(t.showYearPicker),css:s.unref(h)},{default:s.withCtx(()=>{var M,O;return[t.showYearPicker?(s.openBlock(),s.createBlock(pl,{key:0,items:t.items,"text-input":w.textInput,"esc-close":w.escClose,config:w.config,"is-last":w.autoApply&&!s.unref(i).keepActionRow,"hide-navigation":w.hideNavigation,"aria-labels":w.ariaLabels,"overlay-label":(O=(M=s.unref(l))==null?void 0:M.yearPicker)==null?void 0:O.call(M,!0),type:"year",onToggle:B,onSelected:v[4]||(v[4]=P=>y(P))},s.createSlots({"button-icon":s.withCtx(()=>[w.$slots["calendar-icon"]?s.renderSlot(w.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),w.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))]),_:2},[w.$slots["year-overlay-value"]?{name:"item",fn:s.withCtx(({item:P})=>[s.renderSlot(w.$slots,"year-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):s.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64)}}}),kp=(t,e,A)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(n=>dt(t,n))){const n=e.value.filter(r=>!dt(r,t));e.value=n.length?n:null}else(A&&+A>e.value.length||!A)&&e.value.push(t);else e.value=[t]},Sp=(t,e,A)=>{let n=t.value?t.value.slice():[];return n.length===2&&n[1]!==null&&(n=[]),n.length?(eA(e,n[0])?n.unshift(e):n[1]=e,A("range-end",e)):(n=[e],A("range-start",e)),n},nu=(t,e,A,n)=>{t&&(t[0]&&t[1]&&A&&e("auto-apply"),t[0]&&!t[1]&&n&&A&&e("auto-apply"))},R0=t=>{Array.isArray(t.value)&&t.value.length<=2&&t.range?t.modelValue.value=t.value.map(e=>wn(ye(e),t.timezone)):Array.isArray(t.value)||(t.modelValue.value=wn(ye(t.value),t.timezone))},P0=(t,e,A,n)=>Array.isArray(e.value)&&(e.value.length===2||e.value.length===1&&n.value.partialRange)?n.value.fixedStart&&(aA(t,e.value[0])||dt(t,e.value[0]))?[e.value[0],t]:n.value.fixedEnd&&(eA(t,e.value[1])||dt(t,e.value[1]))?[t,e.value[1]]:(A("invalid-fixed-range",t),e.value):[],V0=({multiCalendars:t,range:e,highlight:A,propDates:n,calendars:r,modelValue:o,props:i,filters:a,year:l,month:u,emit:f})=>{const h=s.computed(()=>ap(i.yearRange,i.locale,i.reverseYears)),p=s.ref([!1]),g=s.computed(()=>(P,ie)=>{const ae=Tt(Cr(new Date),{month:u.value(P),year:l.value(P)}),ue=ie?Jw(ae):ll(ae);return x0(ue,n.value.maxDate,n.value.minDate,i.preventMinMaxNavigation,ie)}),B=()=>Array.isArray(o.value)&&t.value.solo&&o.value[1],y=()=>{for(let P=0;P<t.value.count;P++)if(P===0)r.value[P]=r.value[0];else if(P===t.value.count-1&&B())r.value[P]={month:ut(o.value[1]),year:qe(o.value[1])};else{const ie=Tt(ye(),r.value[P-1]);r.value[P]={month:ut(ie),year:qe(Gh(ie,1))}}},b=P=>{if(!P)return y();const ie=Tt(ye(),r.value[P]);return r.value[0].year=qe(p0(ie,t.value.count-1)),y()},w=(P,ie)=>{const ae=fD(ie,P);return e.value.showLastInRange&&ae>1?ie:P},v=P=>i.focusStartDate||t.value.solo?P[0]:P[1]?w(P[0],P[1]):P[0],S=()=>{if(o.value){const P=Array.isArray(o.value)?v(o.value):o.value;r.value[0]={month:ut(P),year:qe(P)}}},F=()=>{S(),t.value.count&&y()};s.watch(o,(P,ie)=>{i.isTextInputDate&&JSON.stringify(P??{})!==JSON.stringify(ie??{})&&F()}),s.onMounted(()=>{F()});const I=(P,ie)=>{r.value[ie].year=P,f("update-month-year",{instance:ie,year:P,month:r.value[ie].month}),t.value.count&&!t.value.solo&&b(ie)},Q=s.computed(()=>P=>ea(h.value,ie=>{var ae;const ue=l.value(P)===ie.value,H=dl(ie.value,ta(n.value.minDate),ta(n.value.maxDate))||((ae=a.value.years)==null?void 0:ae.includes(l.value(P))),G=Bp(A.value,ie.value);return{active:ue,disabled:H,highlighted:G}})),x=(P,ie)=>{I(P,ie),O(ie)},M=(P,ie=!1)=>{if(!g.value(P,ie)){const ae=ie?l.value(P)+1:l.value(P)-1;I(ae,P)}},O=(P,ie=!1,ae)=>{ie||f("reset-flow"),ae!==void 0?p.value[P]=ae:p.value[P]=!p.value[P],p.value[P]?f("overlay-toggle",{open:!0,overlay:zA.year}):(f("overlay-closed"),f("overlay-toggle",{open:!1,overlay:zA.year}))};return{isDisabled:g,groupedYears:Q,showYearPicker:p,selectYear:I,toggleYearPicker:O,handleYearSelect:x,handleYear:M}},nM=(t,e)=>{const{defaultedMultiCalendars:A,defaultedAriaLabels:n,defaultedTransitions:r,defaultedConfig:o,defaultedRange:i,defaultedHighlight:a,propDates:l,defaultedTz:u,defaultedFilters:f,defaultedMultiDates:h}=Gt(t),p=()=>{t.isTextInputDate&&F(qe(ye(t.startDate)),0)},{modelValue:g,year:B,month:y,calendars:b}=Bl(t,e,p),w=s.computed(()=>B0(t.formatLocale,t.locale,t.monthNameFormat)),v=s.ref(null),{checkMinMaxRange:S}=ei(t),{selectYear:F,groupedYears:I,showYearPicker:Q,toggleYearPicker:x,handleYearSelect:M,handleYear:O,isDisabled:P}=V0({modelValue:g,multiCalendars:A,range:i,highlight:a,calendars:b,year:B,propDates:l,month:y,filters:f,props:t,emit:e});s.onMounted(()=>{t.startDate&&(g.value&&t.focusStartDate||!g.value)&&F(qe(ye(t.startDate)),0)});const ie=J=>J?{month:ut(J),year:qe(J)}:{month:null,year:null},ae=()=>g.value?Array.isArray(g.value)?g.value.map(J=>ie(J)):ie(g.value):ie(),ue=(J,Ae)=>{const oe=b.value[J],k=ae();return Array.isArray(k)?k.some(X=>X.year===oe?.year&&X.month===Ae):oe?.year===k.year&&Ae===k.month},H=(J,Ae,oe)=>{var k,X;const Se=ae();return Array.isArray(Se)?B.value(Ae)===((k=Se[oe])==null?void 0:k.year)&&J===((X=Se[oe])==null?void 0:X.month):!1},G=(J,Ae)=>{if(i.value.enabled){const oe=ae();if(Array.isArray(g.value)&&Array.isArray(oe)){const k=H(J,Ae,0)||H(J,Ae,1),X=Bo(Cr(ye()),J,B.value(Ae));return fl(g.value,v.value,X)&&!k}return!1}return!1},$=s.computed(()=>J=>ea(w.value,Ae=>{var oe;const k=ue(J,Ae.value),X=dl(Ae.value,Q0(B.value(J),l.value.minDate),F0(B.value(J),l.value.maxDate))||SO(l.value.disabledDates,B.value(J),Ae.value)||((oe=f.value.months)==null?void 0:oe.includes(Ae.value))||!QO(l.value.allowedDates,B.value(J),Ae.value),Se=G(Ae.value,J),ht=D0(a.value,Ae.value,B.value(J));return{active:k,disabled:X,isBetween:Se,highlighted:ht}})),te=(J,Ae)=>Bo(Cr(ye()),J,B.value(Ae)),ee=(J,Ae)=>{const oe=g.value?g.value:Cr(new Date);g.value=Bo(oe,J,B.value(Ae)),e("auto-apply"),e("update-flow-step")},K=(J,Ae)=>{const oe=te(J,Ae);i.value.fixedEnd||i.value.fixedStart?g.value=P0(oe,g,e,i):g.value?S(oe,g.value)&&(g.value=Sp(g,te(J,Ae),e)):g.value=[te(J,Ae)],s.nextTick().then(()=>{nu(g.value,e,t.autoApply,t.modelAuto)})},ce=(J,Ae)=>{kp(te(J,Ae),g,h.value.limit),e("auto-apply",!0)},j=(J,Ae)=>(b.value[Ae].month=J,R(Ae,b.value[Ae].year,J),h.value.enabled?ce(J,Ae):i.value.enabled?K(J,Ae):ee(J,Ae)),Qe=(J,Ae)=>{F(J,Ae),R(Ae,J,null)},R=(J,Ae,oe)=>{let k=oe;if(!k&&k!==0){const X=ae();k=Array.isArray(X)?X[J].month:X.month}e("update-month-year",{instance:J,year:Ae,month:k})};return{groupedMonths:$,groupedYears:I,year:B,isDisabled:P,defaultedMultiCalendars:A,defaultedAriaLabels:n,defaultedTransitions:r,defaultedConfig:o,showYearPicker:Q,modelValue:g,presetDate:(J,Ae)=>{R0({value:J,modelValue:g,range:i.value.enabled,timezone:Ae?void 0:u.value.timezone}),e("auto-apply")},setHoverDate:(J,Ae)=>{v.value=te(J,Ae)},selectMonth:j,selectYear:Qe,toggleYearPicker:x,handleYearSelect:M,handleYear:O,getModelMonthYear:ae}},rM=s.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...br},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=s.useSlots(),o=_n(r,"yearMode"),i=t;s.onMounted(()=>{i.shadow||n("mount",null)});const{groupedMonths:a,groupedYears:l,year:u,isDisabled:f,defaultedMultiCalendars:h,defaultedConfig:p,showYearPicker:g,modelValue:B,presetDate:y,setHoverDate:b,selectMonth:w,selectYear:v,toggleYearPicker:S,handleYearSelect:F,handleYear:I,getModelMonthYear:Q}=nM(i,n);return e({getSidebarProps:()=>({modelValue:B,year:u,getModelMonthYear:Q,selectMonth:w,selectYear:v,handleYear:I}),presetDate:y,toggleYearPicker:x=>S(0,x)}),(x,M)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":s.unref(h).count,collapse:x.collapse,stretch:"","is-mobile":x.isMobile},{default:s.withCtx(({instance:O})=>[x.$slots["top-extra"]?s.renderSlot(x.$slots,"top-extra",{key:0,value:x.internalModelValue}):s.createCommentVNode("",!0),x.$slots["month-year"]?s.renderSlot(x.$slots,"month-year",s.normalizeProps(s.mergeProps({key:1},{year:s.unref(u),months:s.unref(a)(O),years:s.unref(l)(O),selectMonth:s.unref(w),selectYear:s.unref(v),instance:O}))):(s.openBlock(),s.createBlock(pl,{key:2,items:s.unref(a)(O),"arrow-navigation":x.arrowNavigation,"is-last":x.autoApply&&!s.unref(p).keepActionRow,"esc-close":x.escClose,height:s.unref(p).modeHeight,config:x.config,"no-overlay-focus":!!(x.noOverlayFocus||x.textInput),"use-relative":"",type:"month",onSelected:P=>s.unref(w)(P,O),onHoverValue:P=>s.unref(b)(P,O)},s.createSlots({header:s.withCtx(()=>[s.createVNode(H0,s.mergeProps(x.$props,{items:s.unref(l)(O),instance:O,"show-year-picker":s.unref(g)[O],year:s.unref(u)(O),"is-disabled":P=>s.unref(f)(O,P),onHandleYear:P=>s.unref(I)(O,P),onYearSelect:P=>s.unref(F)(P,O),onToggleYearPicker:P=>s.unref(S)(O,P?.flow,P?.show)}),s.createSlots({_:2},[s.renderList(s.unref(o),(P,ie)=>({name:P,fn:s.withCtx(ae=>[s.renderSlot(x.$slots,P,s.normalizeProps(s.guardReactiveProps(ae)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[x.$slots["month-overlay-value"]?{name:"item",fn:s.withCtx(({item:P})=>[s.renderSlot(x.$slots,"month-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse","is-mobile"]))}}),oM=(t,e)=>{const A=()=>{t.isTextInputDate&&(f.value=qe(ye(t.startDate)))},{modelValue:n}=Bl(t,e,A),r=s.ref(null),{defaultedHighlight:o,defaultedMultiDates:i,defaultedFilters:a,defaultedRange:l,propDates:u}=Gt(t),f=s.ref();s.onMounted(()=>{t.startDate&&(n.value&&t.focusStartDate||!n.value)&&(f.value=qe(ye(t.startDate)))});const h=w=>Array.isArray(n.value)?n.value.some(v=>qe(v)===w):n.value?qe(n.value)===w:!1,p=w=>l.value.enabled&&Array.isArray(n.value)?fl(n.value,r.value,b(w)):!1,g=w=>u.value.allowedDates instanceof Map?u.value.allowedDates.size?u.value.allowedDates.has(`${w}`):!1:!0,B=w=>u.value.disabledDates instanceof Map?u.value.disabledDates.size?u.value.disabledDates.has(`${w}`):!1:!0,y=s.computed(()=>ea(ap(t.yearRange,t.locale,t.reverseYears),w=>{const v=h(w.value),S=dl(w.value,ta(u.value.minDate),ta(u.value.maxDate))||a.value.years.includes(w.value)||!g(w.value)||B(w.value),F=p(w.value)&&!v,I=Bp(o.value,w.value);return{active:v,disabled:S,isBetween:F,highlighted:I}})),b=w=>Kr(Cr(ll(new Date)),w);return{groupedYears:y,modelValue:n,focusYear:f,setHoverValue:w=>{r.value=Kr(Cr(new Date),w)},selectYear:w=>{var v;if(e("update-month-year",{instance:0,year:w}),i.value.enabled)return n.value?Array.isArray(n.value)&&(((v=n.value)==null?void 0:v.map(S=>qe(S))).includes(w)?n.value=n.value.filter(S=>qe(S)!==w):n.value.push(Kr(UA(ye()),w))):n.value=[Kr(UA(ll(ye())),w)],e("auto-apply",!0);l.value.enabled?(n.value=Sp(n,b(w),e),s.nextTick().then(()=>{nu(n.value,e,t.autoApply,t.modelAuto)})):(n.value=b(w),e("auto-apply"))}}},iM=s.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...br},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(t,{expose:e,emit:A}){const n=A,r=t,{groupedYears:o,modelValue:i,focusYear:a,selectYear:l,setHoverValue:u}=oM(r,n),{defaultedConfig:f}=Gt(r);return e({getSidebarProps:()=>({modelValue:i,selectYear:l})}),(h,p)=>(s.openBlock(),s.createElementBlock("div",null,[h.$slots["top-extra"]?s.renderSlot(h.$slots,"top-extra",{key:0,value:h.internalModelValue}):s.createCommentVNode("",!0),h.$slots["month-year"]?s.renderSlot(h.$slots,"month-year",s.normalizeProps(s.mergeProps({key:1},{years:s.unref(o),selectYear:s.unref(l)}))):(s.openBlock(),s.createBlock(pl,{key:2,items:s.unref(o),"is-last":h.autoApply&&!s.unref(f).keepActionRow,height:s.unref(f).modeHeight,config:h.config,"no-overlay-focus":!!(h.noOverlayFocus||h.textInput),"focus-value":s.unref(a),type:"year","use-relative":"",onSelected:s.unref(l),onHoverValue:s.unref(u)},s.createSlots({_:2},[h.$slots["year-overlay-value"]?{name:"item",fn:s.withCtx(({item:g})=>[s.renderSlot(h.$slots,"year-overlay-value",{text:g.text,value:g.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),sM={key:0,class:"dp__time_input"},aM=["data-compact","data-collapsed"],lM=["data-test-id","aria-label","onKeydown","onClick","onMousedown"],cM=["aria-label","disabled","data-test-id","onKeydown","onClick"],uM=["data-test-id","aria-label","onKeydown","onClick","onMousedown"],dM={key:0},fM=["aria-label","data-compact"],hM=s.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...br},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(t,{expose:e,emit:A}){const n=A,r=t,{setTimePickerElements:o,setTimePickerBackRef:i}=qo(),{defaultedAriaLabels:a,defaultedTransitions:l,defaultedFilters:u,defaultedConfig:f,defaultedRange:h,defaultedMultiCalendars:p}=Gt(r),{transitionName:g,showTransition:B}=gl(l),y=s.reactive({hours:!1,minutes:!1,seconds:!1}),b=s.ref("AM"),w=s.ref(null),v=s.ref([]),S=s.ref(),F=s.ref(!1);s.onMounted(()=>{n("mounted")});const I=D=>Tt(new Date,{hours:D.hours,minutes:D.minutes,seconds:r.enableSeconds?D.seconds:0,milliseconds:0}),Q=s.computed(()=>D=>K(D,r[D])||M(D,r[D])),x=s.computed(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),M=(D,ke)=>h.value.enabled&&!h.value.disableTimeRangeValidation?!r.validateTime(D,ke):!1,O=(D,ke)=>{if(h.value.enabled&&!h.value.disableTimeRangeValidation){const be=ke?+r[`${D}Increment`]:-+r[`${D}Increment`],_=r[D]+be;return!r.validateTime(D,_)}return!1},P=s.computed(()=>D=>!J(+r[D]+ +r[`${D}Increment`],D)||O(D,!0)),ie=s.computed(()=>D=>!J(+r[D]-+r[`${D}Increment`],D)||O(D,!1)),ae=(D,ke)=>Rw(Tt(ye(),D),ke),ue=(D,ke)=>iO(Tt(ye(),D),ke),H=s.computed(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),G=s.computed(()=>r.timePickerInline&&h.value.enabled&&!p.value.count),$=s.computed(()=>{const D=[{type:"hours"}];return r.enableMinutes&&D.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&D.push({type:"",separator:!0},{type:"seconds"}),D}),te=s.computed(()=>$.value.filter(D=>!D.separator)),ee=s.computed(()=>D=>{if(D==="hours"){const ke=ht(+r.hours);return{text:ke<10?`0${ke}`:`${ke}`,value:ke}}return{text:r[D]<10?`0${r[D]}`:`${r[D]}`,value:r[D]}}),K=(D,ke)=>{var be;if(!r.disabledTimesConfig)return!1;const _=r.disabledTimesConfig(r.order,D==="hours"?ke:void 0);return _[D]?!!((be=_[D])!=null&&be.includes(ke)):!0},ce=(D,ke)=>ke!=="hours"||b.value==="AM"?D:D+12,j=D=>{const ke=r.is24?24:12,be=D==="hours"?ke:60,_=+r[`${D}GridIncrement`],N=D==="hours"&&!r.is24?_:0,ne=[];for(let ve=N;ve<be;ve+=_)ne.push({value:r.is24?ve:ce(ve,D),text:ve<10?`0${ve}`:`${ve}`});return D==="hours"&&!r.is24&&ne.unshift({value:b.value==="PM"?12:0,text:"12"}),ea(ne,ve=>({active:!1,disabled:u.value.times[D].includes(ve.value)||!J(ve.value,D)||K(D,ve.value)||M(D,ve.value)}))},Qe=D=>D>=0?D:59,R=D=>D>=0?D:23,J=(D,ke)=>{const be=r.minTime?I(fp(r.minTime)):null,_=r.maxTime?I(fp(r.maxTime)):null,N=I(fp(x.value,ke,ke==="minutes"||ke==="seconds"?Qe(D):R(D)));return be&&_?(Js(N,_)||Xs(N,_))&&(ji(N,be)||Xs(N,be)):be?ji(N,be)||Xs(N,be):_?Js(N,_)||Xs(N,_):!0},Ae=D=>r[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],oe=D=>{Ae(D)||(y[D]=!y[D],y[D]?(F.value=!0,n("overlay-opened",D)):(F.value=!1,n("overlay-closed",D)))},k=D=>D==="hours"?mo:D==="minutes"?Yo:Ys,X=()=>{S.value&&clearTimeout(S.value)},Se=(D,ke=!0,be)=>{const _=ke?ae:ue,N=ke?+r[`${D}Increment`]:-+r[`${D}Increment`];J(+r[D]+N,D)&&n(`update:${D}`,k(D)(_({[D]:+r[D]},{[D]:+r[`${D}Increment`]}))),!(be!=null&&be.keyboard)&&f.value.timeArrowHoldThreshold&&(S.value=setTimeout(()=>{Se(D,ke)},f.value.timeArrowHoldThreshold))},ht=D=>r.is24?D:(D>=12?b.value="PM":b.value="AM",fO(D)),se=()=>{b.value==="PM"?(b.value="AM",n("update:hours",r.hours-12)):(b.value="PM",n("update:hours",r.hours+12)),n("am-pm-change",b.value)},Ye=D=>{y[D]=!0},ge=(D,ke,be)=>{if(D&&r.arrowNavigation){Array.isArray(v.value[ke])?v.value[ke][be]=D:v.value[ke]=[D];const _=v.value.reduce((N,ne)=>ne.map((ve,ze)=>[...N[ze]||[],ne[ze]]),[]);i(r.closeTimePickerBtn),w.value&&(_[1]=_[1].concat(w.value)),o(_,r.order)}},Ce=(D,ke)=>(oe(D),n(`update:${D}`,ke));return e({openChildCmp:Ye}),(D,ke)=>{var be;return D.disabled?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",sM,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList($.value,(_,N)=>{var ne,ve,ze;return s.openBlock(),s.createElementBlock("div",{key:N,class:s.normalizeClass(H.value),"data-compact":G.value&&!D.enableSeconds,"data-collapsed":G.value&&D.enableSeconds},[_.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[F.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(":")],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,0),type:"button",class:s.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:P.value(_.type),"dp--hidden-el":F.value}),"data-test-id":`${_.type}-time-inc-btn-${r.order}`,"aria-label":(ne=s.unref(a))==null?void 0:ne.incrementValue(_.type),tabindex:"0",onKeydown:W=>s.unref(on)(W,()=>Se(_.type,!0,{keyboard:!0}),!0),onClick:W=>s.unref(f).timeArrowHoldThreshold?void 0:Se(_.type,!0),onMousedown:W=>s.unref(f).timeArrowHoldThreshold?Se(_.type,!0):void 0,onMouseup:X},[r.timePickerInline?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[D.$slots["tp-inline-arrow-up"]?s.renderSlot(D.$slots,"tp-inline-arrow-up",{key:0}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[ke[2]||(ke[2]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),ke[3]||(ke[3]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D.$slots["arrow-up"]?s.renderSlot(D.$slots,"arrow-up",{key:0}):s.createCommentVNode("",!0),D.$slots["arrow-up"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(rp),{key:1}))],64))],42,lM),s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,1),type:"button","aria-label":`${ee.value(_.type).text}-${(ve=s.unref(a))==null?void 0:ve.openTpOverlay(_.type)}`,class:s.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":Q.value(_.type),"dp--time-overlay-btn":!Q.value(_.type),"dp--hidden-el":F.value}),disabled:Ae(_.type),tabindex:"0","data-test-id":`${_.type}-toggle-overlay-btn-${r.order}`,onKeydown:W=>s.unref(on)(W,()=>oe(_.type),!0),onClick:W=>oe(_.type)},[D.$slots[_.type]?s.renderSlot(D.$slots,_.type,{key:0,text:ee.value(_.type).text,value:ee.value(_.type).value}):s.createCommentVNode("",!0),D.$slots[_.type]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ee.value(_.type).text),1)],64))],42,cM),s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,2),type:"button",class:s.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:ie.value(_.type),"dp--hidden-el":F.value}),"data-test-id":`${_.type}-time-dec-btn-${r.order}`,"aria-label":(ze=s.unref(a))==null?void 0:ze.decrementValue(_.type),tabindex:"0",onKeydown:W=>s.unref(on)(W,()=>Se(_.type,!1,{keyboard:!0}),!0),onClick:W=>s.unref(f).timeArrowHoldThreshold?void 0:Se(_.type,!1),onMousedown:W=>s.unref(f).timeArrowHoldThreshold?Se(_.type,!1):void 0,onMouseup:X},[r.timePickerInline?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[D.$slots["tp-inline-arrow-down"]?s.renderSlot(D.$slots,"tp-inline-arrow-down",{key:0}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[ke[4]||(ke[4]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),ke[5]||(ke[5]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D.$slots["arrow-down"]?s.renderSlot(D.$slots,"arrow-down",{key:0}):s.createCommentVNode("",!0),D.$slots["arrow-down"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(op),{key:1}))],64))],42,uM)],64))],10,aM)}),128)),D.is24?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",dM,[D.$slots["am-pm-button"]?s.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:se,value:b.value}):s.createCommentVNode("",!0),D.$slots["am-pm-button"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:w,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(be=s.unref(a))==null?void 0:be.amPmButton,tabindex:"0","data-compact":G.value,onClick:se,onKeydown:ke[0]||(ke[0]=_=>s.unref(on)(_,()=>se(),!0))},s.toDisplayString(b.value),41,fM))])),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(te.value,(_,N)=>(s.openBlock(),s.createBlock(s.Transition,{key:N,name:s.unref(g)(y[_.type]),css:s.unref(B)},{default:s.withCtx(()=>{var ne,ve;return[y[_.type]?(s.openBlock(),s.createBlock(pl,{key:0,items:j(_.type),"is-last":D.autoApply&&!s.unref(f).keepActionRow,"esc-close":D.escClose,type:_.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,"aria-labels":D.ariaLabels,"overlay-label":(ve=(ne=s.unref(a)).timeOverlay)==null?void 0:ve.call(ne,_.type),onSelected:ze=>Ce(_.type,ze),onToggle:ze=>oe(_.type),onResetFlow:ke[1]||(ke[1]=ze=>D.$emit("reset-flow"))},s.createSlots({"button-icon":s.withCtx(()=>[D.$slots["clock-icon"]?s.renderSlot(D.$slots,"clock-icon",{key:0}):s.createCommentVNode("",!0),D.$slots["clock-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.timePickerInline?s.unref(qs):s.unref(np)),{key:1}))]),_:2},[D.$slots[`${_.type}-overlay-value`]?{name:"item",fn:s.withCtx(({item:ze})=>[s.renderSlot(D.$slots,`${_.type}-overlay-value`,{text:ze.text,value:ze.value})]),key:"0"}:void 0,D.$slots[`${_.type}-overlay-header`]?{name:"header",fn:s.withCtx(()=>[s.renderSlot(D.$slots,`${_.type}-overlay-header`,{toggle:()=>oe(_.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):s.createCommentVNode("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),pM=["data-dp-mobile"],mM=["aria-label","tabindex"],gM=["role","aria-label","tabindex"],BM=["aria-label"],$0=s.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...br},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(t,{expose:e,emit:A}){const n=A,r=t,{buildMatrix:o,setTimePicker:i}=qo(),a=s.useSlots(),{defaultedTransitions:l,defaultedAriaLabels:u,defaultedTextInput:f,defaultedConfig:h,defaultedRange:p}=Gt(r),{transitionName:g,showTransition:B}=gl(l),{hideNavigationButtons:y}=ru(),b=s.ref(null),w=s.ref(null),v=s.ref([]),S=s.ref(null),F=s.ref(!1);s.onMounted(()=>{n("mount"),!r.timePicker&&r.arrowNavigation?o([BA(b.value)],"time"):i(!0,r.timePicker)});const I=s.computed(()=>p.value.enabled&&r.modelAuto?y0(r.internalModelValue):!0),Q=s.ref(!1),x=K=>({hours:Array.isArray(r.hours)?r.hours[K]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[K]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[K]:r.seconds}),M=s.computed(()=>{const K=[];if(p.value.enabled)for(let ce=0;ce<2;ce++)K.push(x(ce));else K.push(x(0));return K}),O=(K,ce=!1,j="")=>{ce||n("reset-flow"),Q.value=K,n(K?"overlay-opened":"overlay-closed",zA.time),r.arrowNavigation&&i(K),s.nextTick(()=>{j!==""&&v.value[0]&&v.value[0].openChildCmp(j)})},P=s.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!h.value.keepActionRow})),ie=_n(a,"timePicker"),ae=(K,ce,j)=>p.value.enabled?ce===0?[K,M.value[1][j]]:[M.value[0][j],K]:K,ue=K=>{n("update:hours",K)},H=K=>{n("update:minutes",K)},G=K=>{n("update:seconds",K)},$=()=>{if(S.value&&!f.value.enabled&&!r.noOverlayFocus){const K=b0(S.value);K&&K.focus({preventScroll:!0})}},te=K=>{F.value=!1,n("overlay-closed",K)},ee=K=>{F.value=!0,n("overlay-opened",K)};return e({toggleTimePicker:O}),(K,ce)=>{var j;return s.openBlock(),s.createElementBlock("div",{class:"dp--tp-wrap","data-dp-mobile":K.isMobile},[!K.timePicker&&!K.timePickerInline?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"openTimePickerBtn",ref:b,type:"button",class:s.normalizeClass({...P.value,"dp--hidden-el":Q.value}),"aria-label":(j=s.unref(u))==null?void 0:j.openTimePicker,tabindex:K.noOverlayFocus?void 0:0,"data-test-id":"open-time-picker-btn",onKeydown:ce[0]||(ce[0]=Qe=>s.unref(on)(Qe,()=>O(!0))),onClick:ce[1]||(ce[1]=Qe=>O(!0))},[K.$slots["clock-icon"]?s.renderSlot(K.$slots,"clock-icon",{key:0}):s.createCommentVNode("",!0),K.$slots["clock-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(np),{key:1}))],42,mM)),[[s.vShow,!s.unref(y)(K.hideNavigation,"time")]]):s.createCommentVNode("",!0),s.createVNode(s.Transition,{name:s.unref(g)(Q.value),css:s.unref(B)&&!K.timePickerInline},{default:s.withCtx(()=>{var Qe,R;return[Q.value||K.timePicker||K.timePickerInline?(s.openBlock(),s.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:S,role:K.timePickerInline?void 0:"dialog",class:s.normalizeClass({dp__overlay:!K.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!K.timePickerInline,"dp--overlay-relative":r.timePicker}),style:s.normalizeStyle(K.timePicker?{height:`${s.unref(h).modeHeight}px`}:void 0),"aria-label":(Qe=s.unref(u))==null?void 0:Qe.timePicker,tabindex:K.timePickerInline?void 0:0},[s.createElementVNode("div",{class:s.normalizeClass(K.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[K.$slots["time-picker-overlay"]?s.renderSlot(K.$slots,"time-picker-overlay",{key:0,hours:t.hours,minutes:t.minutes,seconds:t.seconds,setHours:ue,setMinutes:H,setSeconds:G}):s.createCommentVNode("",!0),K.$slots["time-picker-overlay"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(K.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(M.value,(J,Ae)=>s.withDirectives((s.openBlock(),s.createBlock(hM,s.mergeProps({key:Ae,ref_for:!0},{...K.$props,order:Ae,hours:J.hours,minutes:J.minutes,seconds:J.seconds,closeTimePickerBtn:w.value,disabledTimesConfig:t.disabledTimesConfig,disabled:Ae===0?s.unref(p).fixedStart:s.unref(p).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:v,"validate-time":(oe,k)=>t.validateTime(oe,ae(k,Ae,oe)),"onUpdate:hours":oe=>ue(ae(oe,Ae,"hours")),"onUpdate:minutes":oe=>H(ae(oe,Ae,"minutes")),"onUpdate:seconds":oe=>G(ae(oe,Ae,"seconds")),onMounted:$,onOverlayClosed:te,onOverlayOpened:ee,onAmPmChange:ce[2]||(ce[2]=oe=>K.$emit("am-pm-change",oe))}),s.createSlots({_:2},[s.renderList(s.unref(ie),(oe,k)=>({name:oe,fn:s.withCtx(X=>[s.renderSlot(K.$slots,oe,s.mergeProps({ref_for:!0},X))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[s.vShow,Ae===0?!0:I.value]])),128))],2)),!K.timePicker&&!K.timePickerInline?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:2,ref_key:"closeTimePickerBtn",ref:w,type:"button",class:s.normalizeClass({...P.value,"dp--hidden-el":F.value}),"aria-label":(R=s.unref(u))==null?void 0:R.closeTimePicker,tabindex:"0",onKeydown:ce[3]||(ce[3]=J=>s.unref(on)(J,()=>O(!1))),onClick:ce[4]||(ce[4]=J=>O(!1))},[K.$slots["calendar-icon"]?s.renderSlot(K.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),K.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))],42,BM)),[[s.vShow,!s.unref(y)(K.hideNavigation,"time")]]):s.createCommentVNode("",!0)],2)],14,gM)):s.createCommentVNode("",!0)]}),_:3},8,["name","css"])],8,pM)}}}),K0=(t,e,A,n)=>{const{defaultedRange:r}=Gt(t),o=(S,F)=>Array.isArray(e[S])?e[S][F]:e[S],i=S=>t.enableSeconds?Array.isArray(e.seconds)?e.seconds[S]:e.seconds:0,a=(S,F)=>S?F!==void 0?Xo(S,o("hours",F),o("minutes",F),i(F)):Xo(S,e.hours,e.minutes,i()):h0(ye(),i(F)),l=(S,F)=>{e[S]=F},u=s.computed(()=>t.modelAuto&&r.value.enabled?Array.isArray(A.value)?A.value.length>1:!1:r.value.enabled),f=(S,F)=>{const I=Object.fromEntries(Object.keys(e).map(Q=>Q===S?[Q,F]:[Q,e[Q]].slice()));if(u.value&&!r.value.disableTimeRangeValidation){const Q=M=>A.value?Xo(A.value[M],I.hours[M],I.minutes[M],I.seconds[M]):null,x=M=>f0(A.value[M],0);return!(dt(Q(0),Q(1))&&(ji(Q(0),x(1))||Js(Q(1),x(0))))}return!0},h=(S,F)=>{f(S,F)&&(l(S,F),n&&n())},p=S=>{h("hours",S)},g=S=>{h("minutes",S)},B=S=>{h("seconds",S)},y=(S,F,I,Q)=>{F&&p(S),!F&&!I&&g(S),I&&B(S),A.value&&Q(A.value)},b=S=>{if(S){const F=Array.isArray(S),I=F?[+S[0].hours,+S[1].hours]:+S.hours,Q=F?[+S[0].minutes,+S[1].minutes]:+S.minutes,x=F?[+S[0].seconds,+S[1].seconds]:+S.seconds;l("hours",I),l("minutes",Q),t.enableSeconds&&l("seconds",x)}},w=(S,F)=>{const I={hours:Array.isArray(e.hours)?e.hours[S]:e.hours,disabledArr:[]};return(F||F===0)&&(I.hours=F),Array.isArray(t.disabledTimes)&&(I.disabledArr=r.value.enabled&&Array.isArray(t.disabledTimes[S])?t.disabledTimes[S]:t.disabledTimes),I},v=s.computed(()=>(S,F)=>{var I;if(Array.isArray(t.disabledTimes)){const{disabledArr:Q,hours:x}=w(S,F),M=Q.filter(O=>+O.hours===x);return((I=M[0])==null?void 0:I.minutes)==="*"?{hours:[x],minutes:void 0,seconds:void 0}:{hours:[],minutes:M?.map(O=>+O.minutes)??[],seconds:M?.map(O=>O.seconds?+O.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:l,updateHours:p,updateMinutes:g,updateSeconds:B,getSetDateTime:a,updateTimeValues:y,getSecondsValue:i,assignStartTime:b,validateTime:f,disabledTimesConfig:v}},yM=(t,e)=>{const A=()=>{t.isTextInputDate&&F()},{modelValue:n,time:r}=Bl(t,e,A),{defaultedStartTime:o,defaultedRange:i,defaultedTz:a}=Gt(t),{updateTimeValues:l,getSetDateTime:u,setTime:f,assignStartTime:h,disabledTimesConfig:p,validateTime:g}=K0(t,r,n,B);function B(){e("update-flow-step")}const y=Q=>{const{hours:x,minutes:M,seconds:O}=Q;return{hours:+x,minutes:+M,seconds:O?+O:0}},b=()=>{if(t.startTime){if(Array.isArray(t.startTime)){const x=y(t.startTime[0]),M=y(t.startTime[1]);return[Tt(ye(),x),Tt(ye(),M)]}const Q=y(t.startTime);return Tt(ye(),Q)}return i.value.enabled?[null,null]:null},w=()=>{if(i.value.enabled){const[Q,x]=b();n.value=[wn(u(Q,0),a.value.timezone),wn(u(x,1),a.value.timezone)]}else n.value=wn(u(b()),a.value.timezone)},v=Q=>Array.isArray(Q)?[Zi(ye(Q[0])),Zi(ye(Q[1]))]:[Zi(Q??ye())],S=(Q,x,M)=>{f("hours",Q),f("minutes",x),f("seconds",t.enableSeconds?M:0)},F=()=>{const[Q,x]=v(n.value);return i.value.enabled?S([Q.hours,x.hours],[Q.minutes,x.minutes],[Q.seconds,x.seconds]):S(Q.hours,Q.minutes,Q.seconds)};s.onMounted(()=>{if(!t.shadow)return h(o.value),n.value?F():w()});const I=()=>{Array.isArray(n.value)?n.value=n.value.map((Q,x)=>Q&&u(Q,x)):n.value=u(n.value),e("time-update")};return{modelValue:n,time:r,disabledTimesConfig:p,updateTime:(Q,x=!0,M=!1)=>{l(Q,x,M,I)},validateTime:g}},wM=s.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...br},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=_n(o,"timePicker"),a=s.ref(null),{time:l,modelValue:u,disabledTimesConfig:f,updateTime:h,validateTime:p}=yM(r,n);return s.onMounted(()=>{r.shadow||n("mount",null)}),e({getSidebarProps:()=>({modelValue:u,time:l,updateTime:h}),toggleTimePicker:(g,B=!1,y="")=>{var b;(b=a.value)==null||b.toggleTimePicker(g,B,y)}}),(g,B)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":0,stretch:"","is-mobile":g.isMobile},{default:s.withCtx(()=>[s.createVNode($0,s.mergeProps({ref_key:"tpRef",ref:a},g.$props,{hours:s.unref(l).hours,minutes:s.unref(l).minutes,seconds:s.unref(l).seconds,"internal-model-value":g.internalModelValue,"disabled-times-config":s.unref(f),"validate-time":s.unref(p),"onUpdate:hours":B[0]||(B[0]=y=>s.unref(h)(y)),"onUpdate:minutes":B[1]||(B[1]=y=>s.unref(h)(y,!1)),"onUpdate:seconds":B[2]||(B[2]=y=>s.unref(h)(y,!1,!0)),onAmPmChange:B[3]||(B[3]=y=>g.$emit("am-pm-change",y)),onResetFlow:B[4]||(B[4]=y=>g.$emit("reset-flow")),onOverlayClosed:B[5]||(B[5]=y=>g.$emit("overlay-toggle",{open:!1,overlay:y})),onOverlayOpened:B[6]||(B[6]=y=>g.$emit("overlay-toggle",{open:!0,overlay:y}))}),s.createSlots({_:2},[s.renderList(s.unref(i),(y,b)=>({name:y,fn:s.withCtx(w=>[s.renderSlot(g.$slots,y,s.normalizeProps(s.guardReactiveProps(w)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3},8,["is-mobile"]))}}),CM={class:"dp--header-wrap"},bM={key:0,class:"dp__month_year_wrap"},vM={key:0},EM={class:"dp__month_year_wrap"},kM=["data-dp-element","aria-label","data-test-id","onClick","onKeydown"],SM=s.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...br},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(t,{expose:e,emit:A}){const n=A,r=t,{defaultedTransitions:o,defaultedAriaLabels:i,defaultedMultiCalendars:a,defaultedFilters:l,defaultedConfig:u,defaultedHighlight:f,propDates:h,defaultedUI:p}=Gt(r),{transitionName:g,showTransition:B}=gl(o),{buildMatrix:y}=qo(),{handleMonthYearChange:b,isDisabled:w,updateMonthYear:v}=WO(r,n),{showLeftIcon:S,showRightIcon:F}=ru(),I=s.ref(!1),Q=s.ref(!1),x=s.ref(!1),M=s.ref([null,null,null,null]);s.onMounted(()=>{n("mount")});const O=R=>({get:()=>r[R],set:J=>{const Ae=R===yr.month?yr.year:yr.month;n("update-month-year",{[R]:J,[Ae]:r[Ae]}),R===yr.month?te(!0):ee(!0)}}),P=s.computed(O(yr.month)),ie=s.computed(O(yr.year)),ae=s.computed(()=>R=>({month:r.month,year:r.year,items:R===yr.month?r.months:r.years,instance:r.instance,updateMonthYear:v,toggle:R===yr.month?te:ee})),ue=s.computed(()=>r.months.find(J=>J.value===r.month)||{text:"",value:0}),H=s.computed(()=>ea(r.months,R=>{const J=r.month===R.value,Ae=dl(R.value,Q0(r.year,h.value.minDate),F0(r.year,h.value.maxDate))||l.value.months.includes(R.value),oe=D0(f.value,R.value,r.year);return{active:J,disabled:Ae,highlighted:oe}})),G=s.computed(()=>ea(r.years,R=>{const J=r.year===R.value,Ae=dl(R.value,ta(h.value.minDate),ta(h.value.maxDate))||l.value.years.includes(R.value),oe=Bp(f.value,R.value);return{active:J,disabled:Ae,highlighted:oe}})),$=(R,J,Ae)=>{Ae!==void 0?R.value=Ae:R.value=!R.value,R.value?(x.value=!0,n("overlay-opened",J)):(x.value=!1,n("overlay-closed",J))},te=(R=!1,J)=>{K(R),$(I,zA.month,J)},ee=(R=!1,J)=>{K(R),$(Q,zA.year,J)},K=R=>{R||n("reset-flow")},ce=(R,J)=>{r.arrowNavigation&&(M.value[J]=BA(R),y(M.value,"monthYear"))},j=s.computed(()=>{var R,J,Ae,oe,k,X;return[{type:yr.month,index:1,toggle:te,modelValue:P.value,updateModelValue:Se=>P.value=Se,text:ue.value.text,showSelectionGrid:I.value,items:H.value,ariaLabel:(R=i.value)==null?void 0:R.openMonthsOverlay,overlayLabel:((Ae=(J=i.value).monthPicker)==null?void 0:Ae.call(J,!0))??void 0},{type:yr.year,index:2,toggle:ee,modelValue:ie.value,updateModelValue:Se=>ie.value=Se,text:v0(r.year,r.locale),showSelectionGrid:Q.value,items:G.value,ariaLabel:(oe=i.value)==null?void 0:oe.openYearsOverlay,overlayLabel:((X=(k=i.value).yearPicker)==null?void 0:X.call(k,!0))??void 0}]}),Qe=s.computed(()=>r.disableYearSelect?[j.value[0]]:r.yearFirst?[...j.value].reverse():j.value);return e({toggleMonthPicker:te,toggleYearPicker:ee,handleMonthYearChange:b}),(R,J)=>{var Ae,oe,k,X,Se,ht;return s.openBlock(),s.createElementBlock("div",CM,[R.$slots["month-year"]?(s.openBlock(),s.createElementBlock("div",bM,[s.renderSlot(R.$slots,"month-year",s.normalizeProps(s.guardReactiveProps({month:t.month,year:t.year,months:t.months,years:t.years,updateMonthYear:s.unref(v),handleMonthYearChange:s.unref(b),instance:t.instance,isDisabled:s.unref(w)})))])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[R.$slots["top-extra"]?(s.openBlock(),s.createElementBlock("div",vM,[s.renderSlot(R.$slots,"top-extra",{value:R.internalModelValue})])):s.createCommentVNode("",!0),s.createElementVNode("div",EM,[s.unref(S)(s.unref(a),t.instance)&&!R.vertical?(s.openBlock(),s.createBlock(ml,{key:0,"aria-label":(Ae=s.unref(i))==null?void 0:Ae.prevMonth,disabled:s.unref(w)(!1),class:s.normalizeClass((oe=s.unref(p))==null?void 0:oe.navBtnPrev),"el-name":"action-prev",onActivate:J[0]||(J[0]=se=>s.unref(b)(!1,!0)),onSetRef:J[1]||(J[1]=se=>ce(se,0))},{default:s.withCtx(()=>[R.$slots["arrow-left"]?s.renderSlot(R.$slots,"arrow-left",{key:0}):s.createCommentVNode("",!0),R.$slots["arrow-left"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(tp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:R.disableYearSelect}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(Qe.value,(se,Ye)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:se.type},[s.createElementVNode("button",{ref_for:!0,ref:ge=>ce(ge,Ye+1),type:"button","data-dp-element":`overlay-${se.type}`,class:s.normalizeClass(["dp__btn dp__month_year_select",{"dp--hidden-el":x.value}]),"aria-label":`${se.text}-${se.ariaLabel}`,"data-test-id":`${se.type}-toggle-overlay-${t.instance}`,onClick:se.toggle,onKeydown:ge=>s.unref(on)(ge,()=>se.toggle(),!0)},[R.$slots[se.type]?s.renderSlot(R.$slots,se.type,{key:0,text:se.text,value:r[se.type]}):s.createCommentVNode("",!0),R.$slots[se.type]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(se.text),1)],64))],42,kM),s.createVNode(s.Transition,{name:s.unref(g)(se.showSelectionGrid),css:s.unref(B)},{default:s.withCtx(()=>[se.showSelectionGrid?(s.openBlock(),s.createBlock(pl,{key:0,items:se.items,"arrow-navigation":R.arrowNavigation,"hide-navigation":R.hideNavigation,"is-last":R.autoApply&&!s.unref(u).keepActionRow,"skip-button-ref":!1,config:R.config,type:se.type,"header-refs":[],"esc-close":R.escClose,"menu-wrap-ref":R.menuWrapRef,"text-input":R.textInput,"aria-labels":R.ariaLabels,"overlay-label":se.overlayLabel,onSelected:se.updateModelValue,onToggle:se.toggle},s.createSlots({"button-icon":s.withCtx(()=>[R.$slots["calendar-icon"]?s.renderSlot(R.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),R.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))]),_:2},[R.$slots[`${se.type}-overlay-value`]?{name:"item",fn:s.withCtx(({item:ge})=>[s.renderSlot(R.$slots,`${se.type}-overlay-value`,{text:ge.text,value:ge.value})]),key:"0"}:void 0,R.$slots[`${se.type}-overlay`]?{name:"overlay",fn:s.withCtx(()=>[s.renderSlot(R.$slots,`${se.type}-overlay`,s.mergeProps({ref_for:!0},ae.value(se.type)))]),key:"1"}:void 0,R.$slots[`${se.type}-overlay-header`]?{name:"header",fn:s.withCtx(()=>[s.renderSlot(R.$slots,`${se.type}-overlay-header`,{toggle:se.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):s.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),s.unref(S)(s.unref(a),t.instance)&&R.vertical?(s.openBlock(),s.createBlock(ml,{key:1,"aria-label":(k=s.unref(i))==null?void 0:k.prevMonth,"el-name":"action-prev",disabled:s.unref(w)(!1),class:s.normalizeClass((X=s.unref(p))==null?void 0:X.navBtnPrev),onActivate:J[2]||(J[2]=se=>s.unref(b)(!1,!0))},{default:s.withCtx(()=>[R.$slots["arrow-up"]?s.renderSlot(R.$slots,"arrow-up",{key:0}):s.createCommentVNode("",!0),R.$slots["arrow-up"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(rp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.unref(F)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:2,ref:"rightIcon","el-name":"action-next",disabled:s.unref(w)(!0),"aria-label":(Se=s.unref(i))==null?void 0:Se.nextMonth,class:s.normalizeClass((ht=s.unref(p))==null?void 0:ht.navBtnNext),onActivate:J[3]||(J[3]=se=>s.unref(b)(!0,!0)),onSetRef:J[4]||(J[4]=se=>ce(se,R.disableYearSelect?2:3))},{default:s.withCtx(()=>[R.$slots[R.vertical?"arrow-down":"arrow-right"]?s.renderSlot(R.$slots,R.vertical?"arrow-down":"arrow-right",{key:0}):s.createCommentVNode("",!0),R.$slots[R.vertical?"arrow-down":"arrow-right"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.vertical?s.unref(op):s.unref(Ap)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):s.createCommentVNode("",!0)])],64))])}}}),QM={class:"dp__calendar_header",role:"row"},FM={key:0,class:"dp__calendar_header_item",role:"gridcell"},UM=["aria-label"],IM={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},xM={class:"dp__cell_inner"},TM=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test-id","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],_M=s.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...br},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(t,{expose:e,emit:A}){const n=A,r=t,{buildMultiLevelMatrix:o}=qo(),{defaultedTransitions:i,defaultedConfig:a,defaultedAriaLabels:l,defaultedMultiCalendars:u,defaultedWeekNumbers:f,defaultedMultiDates:h,defaultedUI:p}=Gt(r),g=s.ref(null),B=s.ref({bottom:"",left:"",transform:""}),y=s.ref([]),b=s.ref(null),w=s.ref(!0),v=s.ref(""),S=s.ref({startX:0,endX:0,startY:0,endY:0}),F=s.ref([]),I=s.ref({left:"50%"}),Q=s.ref(!1),x=s.computed(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),M=s.computed(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):dO(r.formatLocale,r.locale,+r.weekStart));s.onMounted(()=>{n("mount",{cmp:"calendar",refs:y}),a.value.noSwipe||b.value&&(b.value.addEventListener("touchstart",ce,{passive:!1}),b.value.addEventListener("touchend",j,{passive:!1}),b.value.addEventListener("touchmove",Qe,{passive:!1})),r.monthChangeOnScroll&&b.value&&b.value.addEventListener("wheel",Ae,{passive:!1})}),s.onUnmounted(()=>{a.value.noSwipe||b.value&&(b.value.removeEventListener("touchstart",ce),b.value.removeEventListener("touchend",j),b.value.removeEventListener("touchmove",Qe)),r.monthChangeOnScroll&&b.value&&b.value.removeEventListener("wheel",Ae)});const O=se=>se?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",P=(se,Ye)=>{if(r.transitions){const ge=UA(Bo(ye(),r.month,r.year));v.value=aA(UA(Bo(ye(),se,Ye)),ge)?i.value[O(!0)]:i.value[O(!1)],w.value=!1,s.nextTick(()=>{w.value=!0})}},ie=s.computed(()=>({...p.value.calendar??{}})),ae=s.computed(()=>se=>{const Ye=hO(se);return{dp__marker_dot:Ye.type==="dot",dp__marker_line:Ye.type==="line"}}),ue=s.computed(()=>se=>dt(se,g.value)),H=s.computed(()=>({dp__calendar:!0,dp__calendar_next:u.value.count>0&&r.instance!==0})),G=s.computed(()=>se=>r.hideOffsetDates?se.current:!0),$=async(se,Ye)=>{const{width:ge,height:Ce}=se.getBoundingClientRect();g.value=Ye.value;let D={left:`${ge/2}px`},ke=-50;if(await s.nextTick(),F.value[0]){const{left:be,width:_}=F.value[0].getBoundingClientRect();be<0&&(D={left:"0"},ke=0,I.value.left=`${ge/2}px`),window.innerWidth<be+_&&(D={right:"0"},ke=0,I.value.left=`${_-ge/2}px`)}B.value={bottom:`${Ce}px`,...D,transform:`translateX(${ke}%)`}},te=async(se,Ye,ge)=>{var Ce,D,ke;const be=BA(y.value[Ye][ge]);be&&((Ce=se.marker)!=null&&Ce.customPosition&&(ke=(D=se.marker)==null?void 0:D.tooltip)!=null&&ke.length?B.value=se.marker.customPosition(be):await $(be,se),n("tooltip-open",se.marker))},ee=async(se,Ye,ge)=>{var Ce,D;if(Q.value&&h.value.enabled&&h.value.dragSelect)return n("select-date",se);if(n("set-hover-date",se),(D=(Ce=se.marker)==null?void 0:Ce.tooltip)!=null&&D.length){if(r.hideOffsetDates&&!se.current)return;await te(se,Ye,ge)}},K=se=>{g.value&&(g.value=null,B.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),n("tooltip-close",se.marker))},ce=se=>{S.value.startX=se.changedTouches[0].screenX,S.value.startY=se.changedTouches[0].screenY},j=se=>{S.value.endX=se.changedTouches[0].screenX,S.value.endY=se.changedTouches[0].screenY,R()},Qe=se=>{r.vertical&&!r.inline&&se.preventDefault()},R=()=>{const se=r.vertical?"Y":"X";Math.abs(S.value[`start${se}`]-S.value[`end${se}`])>10&&n("handle-swipe",S.value[`start${se}`]>S.value[`end${se}`]?"right":"left")},J=(se,Ye,ge)=>{se&&(Array.isArray(y.value[Ye])?y.value[Ye][ge]=se:y.value[Ye]=[se]),r.arrowNavigation&&o(y.value,"calendar")},Ae=se=>{r.monthChangeOnScroll&&(se.preventDefault(),n("handle-scroll",se))},oe=se=>f.value.type==="local"?Jh(se.value,{weekStartsOn:+r.weekStart}):f.value.type==="iso"?zh(se.value):typeof f.value.type=="function"?f.value.type(se.value):"",k=se=>{const Ye=se[0];return f.value.hideOnOffsetDates?se.some(ge=>ge.current)?oe(Ye):"":oe(Ye)},X=(se,Ye,ge=!0)=>{!ge&&yO()||(!h.value.enabled||a.value.allowPreventDefault)&&(Jo(se,a.value),n("select-date",Ye))},Se=se=>{Jo(se,a.value)},ht=se=>{h.value.enabled&&h.value.dragSelect?(Q.value=!0,n("select-date",se)):h.value.enabled&&n("select-date",se)};return e({triggerTransition:P}),(se,Ye)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(H.value)},[s.createElementVNode("div",{ref_key:"calendarWrapRef",ref:b,class:s.normalizeClass(ie.value),role:"grid"},[s.createElementVNode("div",QM,[se.weekNumbers?(s.openBlock(),s.createElementBlock("div",FM,s.toDisplayString(se.weekNumName),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(M.value,(ge,Ce)=>{var D,ke;return s.openBlock(),s.createElementBlock("div",{key:Ce,class:"dp__calendar_header_item",role:"gridcell","data-test-id":"calendar-header","aria-label":(ke=(D=s.unref(l))==null?void 0:D.weekDay)==null?void 0:ke.call(D,Ce)},[se.$slots["calendar-header"]?s.renderSlot(se.$slots,"calendar-header",{key:0,day:ge,index:Ce}):s.createCommentVNode("",!0),se.$slots["calendar-header"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ge),1)],64))],8,UM)}),128))]),Ye[2]||(Ye[2]=s.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1)),s.createVNode(s.Transition,{name:v.value,css:!!se.transitions},{default:s.withCtx(()=>[w.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:Ye[1]||(Ye[1]=ge=>Q.value=!1)},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(x.value,(ge,Ce)=>(s.openBlock(),s.createElementBlock("div",{key:Ce,class:"dp__calendar_row",role:"row"},[se.weekNumbers?(s.openBlock(),s.createElementBlock("div",IM,[s.createElementVNode("div",xM,s.toDisplayString(k(ge.days)),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(ge.days,(D,ke)=>{var be,_,N;return s.openBlock(),s.createElementBlock("div",{id:s.unref(yp)(D.value),ref_for:!0,ref:ne=>J(ne,Ce,ke),key:ke+Ce,role:"gridcell",class:"dp__calendar_item","aria-pressed":(D.classData.dp__active_date||D.classData.dp__range_start||D.classData.dp__range_start)??void 0,"aria-disabled":D.classData.dp__cell_disabled||void 0,"aria-label":(_=(be=s.unref(l))==null?void 0:be.day)==null?void 0:_.call(be,D),tabindex:!D.current&&se.hideOffsetDates?void 0:0,"data-test-id":s.unref(yp)(D.value),onClick:s.withModifiers(ne=>X(ne,D),["prevent"]),onTouchend:ne=>X(ne,D,!1),onKeydown:ne=>s.unref(on)(ne,()=>se.$emit("select-date",D)),onMouseenter:ne=>ee(D,Ce,ke),onMouseleave:ne=>K(D),onMousedown:ne=>ht(D),onMouseup:Ye[0]||(Ye[0]=ne=>Q.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["dp__cell_inner",D.classData])},[se.$slots.day&&G.value(D)?s.renderSlot(se.$slots,"day",{key:0,day:+D.text,date:D.value}):s.createCommentVNode("",!0),se.$slots.day?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(D.text),1)],64)),D.marker&&G.value(D)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[se.$slots.marker?s.renderSlot(se.$slots,"marker",{key:0,marker:D.marker,day:+D.text,date:D.value}):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(ae.value(D.marker)),style:s.normalizeStyle(D.marker.color?{backgroundColor:D.marker.color}:{})},null,6))],64)):s.createCommentVNode("",!0),ue.value(D.value)?(s.openBlock(),s.createElementBlock("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:F,class:"dp__marker_tooltip",style:s.normalizeStyle(B.value)},[(N=D.marker)!=null&&N.tooltip?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:Se},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.marker.tooltip,(ne,ve)=>(s.openBlock(),s.createElementBlock("div",{key:ve,class:"dp__tooltip_text"},[se.$slots["marker-tooltip"]?s.renderSlot(se.$slots,"marker-tooltip",{key:0,tooltip:ne,day:D.value}):s.createCommentVNode("",!0),se.$slots["marker-tooltip"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",{class:"dp__tooltip_mark",style:s.normalizeStyle(ne.color?{backgroundColor:ne.color}:{})},null,4),s.createElementVNode("div",null,s.toDisplayString(ne.text),1)],64))]))),128)),s.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:s.normalizeStyle(I.value)},null,4)])):s.createCommentVNode("",!0)],4)):s.createCommentVNode("",!0)],2)],40,TM)}),128))]))),128))],32)):s.createCommentVNode("",!0)]),_:3},8,["name","css"])],2)],2))}}),G0=t=>Array.isArray(t),DM=(t,e,A,n)=>{const r=s.ref([]),o=s.ref(new Date),i=s.ref(),a=()=>j(t.isTextInputDate),{modelValue:l,calendars:u,time:f,today:h}=Bl(t,e,a),{defaultedMultiCalendars:p,defaultedStartTime:g,defaultedRange:B,defaultedConfig:y,defaultedTz:b,propDates:w,defaultedMultiDates:v}=Gt(t),{validateMonthYearInRange:S,isDisabled:F,isDateRangeAllowed:I,checkMinMaxRange:Q}=ei(t),{updateTimeValues:x,getSetDateTime:M,setTime:O,assignStartTime:P,validateTime:ie,disabledTimesConfig:ae}=K0(t,f,l,n),ue=s.computed(()=>Z=>u.value[Z]?u.value[Z].month:0),H=s.computed(()=>Z=>u.value[Z]?u.value[Z].year:0),G=Z=>!y.value.keepViewOnOffsetClick||Z?!0:!i.value,$=(Z,Fe,Ve,At=!1)=>{var he,xe;G(At)&&(u.value[Z]||(u.value[Z]={month:0,year:0}),u.value[Z].month=C0(Fe)?(he=u.value[Z])==null?void 0:he.month:Fe,u.value[Z].year=C0(Ve)?(xe=u.value[Z])==null?void 0:xe.year:Ve)},te=()=>{t.autoApply&&e("select-date")},ee=()=>{g.value&&P(g.value)};s.onMounted(()=>{t.shadow||(l.value||(Ye(),ee()),j(!0),t.focusStartDate&&t.startDate&&Ye())});const K=s.computed(()=>{var Z;return(Z=t.flow)!=null&&Z.length&&!t.partialFlow?t.flowStep===t.flow.length:!0}),ce=()=>{t.autoApply&&K.value&&e("auto-apply",t.partialFlow?t.flowStep!==t.flow.length:!1)},j=(Z=!1)=>{if(l.value)return Array.isArray(l.value)?(r.value=l.value,X(Z)):J(l.value,Z);if(p.value.count&&Z&&!t.startDate)return R(ye(),Z)},Qe=()=>Array.isArray(l.value)&&B.value.enabled?ut(l.value[0])===ut(l.value[1]??l.value[0]):!1,R=(Z=new Date,Fe=!1)=>{if((!p.value.count||!p.value.static||Fe)&&$(0,ut(Z),qe(Z)),p.value.count&&(!l.value||Qe()||!p.value.solo)&&(!p.value.solo||Fe))for(let Ve=1;Ve<p.value.count;Ve++){const At=Tt(ye(),{month:ue.value(Ve-1),year:H.value(Ve-1)}),he=Rw(At,{months:1});u.value[Ve]={month:ut(he),year:qe(he)}}},J=(Z,Fe)=>{R(Z),O("hours",mo(Z)),O("minutes",Yo(Z)),O("seconds",Ys(Z)),p.value.count&&Fe&&se()},Ae=Z=>{if(p.value.count){if(p.value.solo)return 0;const Fe=ut(Z[0]),Ve=ut(Z[1]);return Math.abs(Ve-Fe)<p.value.count?0:1}return 1},oe=(Z,Fe)=>{Z[1]&&B.value.showLastInRange?R(Z[Ae(Z)],Fe):R(Z[0],Fe);const Ve=(At,he)=>[At(Z[0]),Z[1]?At(Z[1]):f[he][1]];O("hours",Ve(mo,"hours")),O("minutes",Ve(Yo,"minutes")),O("seconds",Ve(Ys,"seconds"))},k=(Z,Fe)=>{if((B.value.enabled||t.weekPicker)&&!v.value.enabled)return oe(Z,Fe);if(v.value.enabled&&Fe){const Ve=Z[Z.length-1];return J(Ve,Fe)}},X=Z=>{const Fe=l.value;k(Fe,Z),p.value.count&&p.value.solo&&se()},Se=(Z,Fe)=>{const Ve=Tt(ye(),{month:ue.value(Fe),year:H.value(Fe)}),At=Z<0?gr(Ve,1):js(Ve,1);S(ut(At),qe(At),Z<0,t.preventMinMaxNavigation)&&($(Fe,ut(At),qe(At)),e("update-month-year",{instance:Fe,month:ut(At),year:qe(At)}),p.value.count&&!p.value.solo&&ht(Fe),A())},ht=Z=>{for(let Fe=Z-1;Fe>=0;Fe--){const Ve=js(Tt(ye(),{month:ue.value(Fe+1),year:H.value(Fe+1)}),1);$(Fe,ut(Ve),qe(Ve))}for(let Fe=Z+1;Fe<=p.value.count-1;Fe++){const Ve=gr(Tt(ye(),{month:ue.value(Fe-1),year:H.value(Fe-1)}),1);$(Fe,ut(Ve),qe(Ve))}},se=()=>{if(Array.isArray(l.value)&&l.value.length===2){const Z=ye(ye(l.value[1]?l.value[1]:gr(l.value[0],1))),[Fe,Ve]=[ut(l.value[0]),qe(l.value[0])],[At,he]=[ut(l.value[1]),qe(l.value[1])];(Fe!==At||Fe===At&&Ve!==he)&&p.value.solo&&$(1,ut(Z),qe(Z))}else l.value&&!Array.isArray(l.value)&&($(0,ut(l.value),qe(l.value)),R(ye()))},Ye=()=>{t.startDate&&($(0,ut(ye(t.startDate)),qe(ye(t.startDate))),p.value.count&&ht(0))},ge=(Z,Fe)=>{if(t.monthChangeOnScroll){const Ve=new Date().getTime()-o.value.getTime(),At=Math.abs(Z.deltaY);let he=500;At>1&&(he=100),At>100&&(he=0),Ve>he&&(o.value=new Date,Se(t.monthChangeOnScroll!=="inverse"?-Z.deltaY:Z.deltaY,Fe))}},Ce=(Z,Fe,Ve=!1)=>{t.monthChangeOnArrows&&t.vertical===Ve&&D(Z,Fe)},D=(Z,Fe)=>{Se(Z==="right"?-1:1,Fe)},ke=Z=>{if(w.value.markers)return qc(Z.value,w.value.markers)},be=(Z,Fe)=>{switch(t.sixWeeks===!0?"append":t.sixWeeks){case"prepend":return[!0,!1];case"center":return[Z==0,!0];case"fair":return[Z==0||Fe>Z,!0];case"append":return[!1,!1];default:return[!1,!1]}},_=(Z,Fe,Ve,At)=>{if(t.sixWeeks&&Z.length<6){const he=6-Z.length,xe=(Fe.getDay()+7-At)%7,He=6-(Ve.getDay()+7-At)%7,[Or,ar]=be(xe,He);for(let co=1;co<=he;co++)if(ar?!!(co%2)==Or:Or){const uo=Z[0].days[0],Dc=N(Xn(uo.value,-7),ut(Fe));Z.unshift({days:Dc})}else{const uo=Z[Z.length-1],Dc=uo.days[uo.days.length-1],by=N(Xn(Dc.value,1),ut(Fe));Z.push({days:by})}}return Z},N=(Z,Fe)=>{const Ve=ye(Z),At=[];for(let he=0;he<7;he++){const xe=Xn(Ve,he),He=ut(xe)!==Fe;At.push({text:t.hideOffsetDates&&He?"":xe.getDate(),value:xe,current:!He,classData:{}})}return At},ne=(Z,Fe)=>{const Ve=[],At=new Date(Fe,Z),he=new Date(Fe,Z+1,0),xe=t.weekStart,He=Br(At,{weekStartsOn:xe}),Or=ar=>{const co=N(ar,Z);if(Ve.push({days:co}),!Ve[Ve.length-1].days.some(uo=>dt(UA(uo.value),UA(he)))){const uo=Xn(ar,7);Or(uo)}};return Or(He),_(Ve,At,he,xe)},ve=Z=>{const Fe=Xo(ye(Z.value),f.hours,f.minutes,Ue());e("date-update",Fe),v.value.enabled?kp(Fe,l,v.value.limit):l.value=Fe,n(),s.nextTick().then(()=>{ce()})},ze=Z=>B.value.noDisabledRange?U0(r.value[0],Z).some(Fe=>F(Fe)):!1,W=()=>{r.value=l.value?l.value.slice():[],r.value.length===2&&!(B.value.fixedStart||B.value.fixedEnd)&&(r.value=[])},fe=(Z,Fe)=>{const Ve=[ye(Z.value),Xn(ye(Z.value),+B.value.autoRange)];I(Ve)?(Fe&&q(Z.value),r.value=Ve):e("invalid-date",Z.value)},q=Z=>{const Fe=ut(ye(Z)),Ve=qe(ye(Z));if($(0,Fe,Ve),p.value.count>0)for(let At=1;At<p.value.count;At++){const he=bO(Tt(ye(Z),{year:H.value(At-1),month:ue.value(At-1)}));$(At,he.month,he.year)}},me=Z=>{if(ze(Z.value)||!Q(Z.value,l.value,B.value.fixedStart?0:1))return e("invalid-date",Z.value);r.value=P0(ye(Z.value),l,e,B)},Je=(Z,Fe)=>{if(W(),B.value.autoRange)return fe(Z,Fe);if(B.value.fixedStart||B.value.fixedEnd)return me(Z);r.value[0]?Q(ye(Z.value),l.value)&&!ze(Z.value)?eA(ye(Z.value),ye(r.value[0]))?(r.value.unshift(ye(Z.value)),e("range-end",r.value[0])):(r.value[1]=ye(Z.value),e("range-end",r.value[1])):(t.autoApply&&e("auto-apply-invalid",Z.value),e("invalid-date",Z.value)):(r.value[0]=ye(Z.value),e("range-start",r.value[0]))},Ue=(Z=!0)=>t.enableSeconds?Array.isArray(f.seconds)?Z?f.seconds[0]:f.seconds[1]:f.seconds:0,kt=Z=>{r.value[Z]=Xo(r.value[Z],f.hours[Z],f.minutes[Z],Ue(Z!==1))},kA=()=>{var Z,Fe;r.value[0]&&r.value[1]&&+((Z=r.value)==null?void 0:Z[0])>+((Fe=r.value)==null?void 0:Fe[1])&&(r.value.reverse(),e("range-start",r.value[0]),e("range-end",r.value[1]))},Fn=()=>{r.value.length&&(r.value[0]&&!r.value[1]?kt(0):(kt(0),kt(1),n()),kA(),l.value=r.value.slice(),nu(r.value,e,t.autoApply,t.modelAuto))},tn=(Z,Fe=!1)=>{if(F(Z.value)||!Z.current&&t.hideOffsetDates)return e("invalid-date",Z.value);if(i.value=JSON.parse(JSON.stringify(Z)),!B.value.enabled)return ve(Z);G0(f.hours)&&G0(f.minutes)&&!v.value.enabled&&(Je(Z,Fe),Fn())},Mo=(Z,Fe)=>{var Ve;$(Z,Fe.month,Fe.year,!0),p.value.count&&!p.value.solo&&ht(Z),e("update-month-year",{instance:Z,month:Fe.month,year:Fe.year}),A(p.value.solo?Z:void 0);const At=(Ve=t.flow)!=null&&Ve.length?t.flow[t.flowStep]:void 0;!Fe.fromNav&&(At===zA.month||At===zA.year)&&n()},lo=(Z,Fe)=>{R0({value:Z,modelValue:l,range:B.value.enabled,timezone:Fe?void 0:b.value.timezone}),te(),t.multiCalendars&&s.nextTick().then(()=>j(!0))},Ds=()=>{const Z=ip(ye(),b.value);!B.value.enabled&&!v.value.enabled?l.value=Z:l.value&&Array.isArray(l.value)&&l.value[0]?v.value.enabled?l.value=[...l.value,Z]:l.value=eA(Z,l.value[0])?[Z,l.value[0]]:[l.value[0],Z]:l.value=[Z],te()},Ls=()=>{if(Array.isArray(l.value))if(v.value.enabled){const Z=Os();l.value[l.value.length-1]=M(Z)}else l.value=l.value.map((Z,Fe)=>Z&&M(Z,Fe));else l.value=M(l.value);e("time-update")},Os=()=>Array.isArray(l.value)&&l.value.length?l.value[l.value.length-1]:null;return{calendars:u,modelValue:l,month:ue,year:H,time:f,disabledTimesConfig:ae,today:h,validateTime:ie,getCalendarDays:ne,getMarker:ke,handleScroll:ge,handleSwipe:D,handleArrow:Ce,selectDate:tn,updateMonthYear:Mo,presetDate:lo,selectCurrentDate:Ds,updateTime:(Z,Fe=!0,Ve=!1)=>{x(Z,Fe,Ve,Ls)},assignMonthAndYear:R,setStartTime:ee}},LM={key:0},OM=s.defineComponent({__name:"DatePicker",props:{...br},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=t,{calendars:o,month:i,year:a,modelValue:l,time:u,disabledTimesConfig:f,today:h,validateTime:p,getCalendarDays:g,getMarker:B,handleArrow:y,handleScroll:b,handleSwipe:w,selectDate:v,updateMonthYear:S,presetDate:F,selectCurrentDate:I,updateTime:Q,assignMonthAndYear:x,setStartTime:M}=DM(r,n,Qe,R),O=s.useSlots(),{setHoverDate:P,getDayClassData:ie,clearHoverDate:ae}=ZM(l,r),{defaultedMultiCalendars:ue}=Gt(r),H=s.ref([]),G=s.ref([]),$=s.ref(null),te=_n(O,"calendar"),ee=_n(O,"monthYear"),K=_n(O,"timePicker"),ce=ge=>{r.shadow||n("mount",ge)};s.watch(o,()=>{r.shadow||setTimeout(()=>{n("recalculate-position")},0)},{deep:!0}),s.watch(ue,(ge,Ce)=>{ge.count-Ce.count>0&&x()},{deep:!0});const j=s.computed(()=>ge=>g(i.value(ge),a.value(ge)).map(Ce=>({...Ce,days:Ce.days.map(D=>(D.marker=B(D),D.classData=ie(D),D))})));function Qe(ge){var Ce;ge||ge===0?(Ce=G.value[ge])==null||Ce.triggerTransition(i.value(ge),a.value(ge)):G.value.forEach((D,ke)=>D.triggerTransition(i.value(ke),a.value(ke)))}function R(){n("update-flow-step")}const J=(ge,Ce=!1)=>{v(ge,Ce),r.spaceConfirm&&n("select-date")},Ae=(ge,Ce,D=0)=>{var ke;(ke=H.value[D])==null||ke.toggleMonthPicker(ge,Ce)},oe=(ge,Ce,D=0)=>{var ke;(ke=H.value[D])==null||ke.toggleYearPicker(ge,Ce)},k=(ge,Ce,D)=>{var ke;(ke=$.value)==null||ke.toggleTimePicker(ge,Ce,D)},X=(ge,Ce)=>{var D;if(!r.range){const ke=l.value?l.value:h,be=Ce?new Date(Ce):ke,_=ge?Br(be,{weekStartsOn:1}):Xw(be,{weekStartsOn:1});v({value:_,current:ut(be)===i.value(0),text:"",classData:{}}),(D=document.getElementById(yp(_)))==null||D.focus()}},Se=ge=>{var Ce;(Ce=H.value[0])==null||Ce.handleMonthYearChange(ge,!0)},ht=ge=>{S(0,{month:i.value(0),year:a.value(0)+(ge?1:-1),fromNav:!0})},se=(ge,Ce)=>{ge===zA.time&&n(`time-picker-${Ce?"open":"close"}`),n("overlay-toggle",{open:Ce,overlay:ge})},Ye=ge=>{n("overlay-toggle",{open:!1,overlay:ge}),n("focus-menu")};return e({clearHoverDate:ae,presetDate:F,selectCurrentDate:I,toggleMonthPicker:Ae,toggleYearPicker:oe,toggleTimePicker:k,handleArrow:y,updateMonthYear:S,getSidebarProps:()=>({modelValue:l,month:i,year:a,time:u,updateTime:Q,updateMonthYear:S,selectDate:v,presetDate:F}),changeMonth:Se,changeYear:ht,selectWeekDate:X,setStartTime:M}),(ge,Ce)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(Au,{"multi-calendars":s.unref(ue).count,collapse:ge.collapse,"is-mobile":ge.isMobile},{default:s.withCtx(({instance:D,index:ke})=>[ge.disableMonthYearSelect?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(SM,s.mergeProps({key:0,ref:be=>{be&&(H.value[ke]=be)},months:s.unref(B0)(ge.formatLocale,ge.locale,ge.monthNameFormat),years:s.unref(ap)(ge.yearRange,ge.locale,ge.reverseYears),month:s.unref(i)(D),year:s.unref(a)(D),instance:D},ge.$props,{onMount:Ce[0]||(Ce[0]=be=>ce(s.unref(qi).header)),onResetFlow:Ce[1]||(Ce[1]=be=>ge.$emit("reset-flow")),onUpdateMonthYear:be=>s.unref(S)(D,be),onOverlayClosed:Ye,onOverlayOpened:Ce[2]||(Ce[2]=be=>ge.$emit("overlay-toggle",{open:!0,overlay:be}))}),s.createSlots({_:2},[s.renderList(s.unref(ee),(be,_)=>({name:be,fn:s.withCtx(N=>[s.renderSlot(ge.$slots,be,s.normalizeProps(s.guardReactiveProps(N)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),s.createVNode(_M,s.mergeProps({ref:be=>{be&&(G.value[ke]=be)},"mapped-dates":j.value(D),month:s.unref(i)(D),year:s.unref(a)(D),instance:D},ge.$props,{onSelectDate:be=>s.unref(v)(be,D!==1),onHandleSpace:be=>J(be,D!==1),onSetHoverDate:Ce[3]||(Ce[3]=be=>s.unref(P)(be)),onHandleScroll:be=>s.unref(b)(be,D),onHandleSwipe:be=>s.unref(w)(be,D),onMount:Ce[4]||(Ce[4]=be=>ce(s.unref(qi).calendar)),onResetFlow:Ce[5]||(Ce[5]=be=>ge.$emit("reset-flow")),onTooltipOpen:Ce[6]||(Ce[6]=be=>ge.$emit("tooltip-open",be)),onTooltipClose:Ce[7]||(Ce[7]=be=>ge.$emit("tooltip-close",be))}),s.createSlots({_:2},[s.renderList(s.unref(te),(be,_)=>({name:be,fn:s.withCtx(N=>[s.renderSlot(ge.$slots,be,s.normalizeProps(s.guardReactiveProps({...N})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse","is-mobile"]),ge.enableTimePicker?(s.openBlock(),s.createElementBlock("div",LM,[ge.$slots["time-picker"]?s.renderSlot(ge.$slots,"time-picker",s.normalizeProps(s.mergeProps({key:0},{time:s.unref(u),updateTime:s.unref(Q)}))):(s.openBlock(),s.createBlock($0,s.mergeProps({key:1,ref_key:"timePickerRef",ref:$},ge.$props,{hours:s.unref(u).hours,minutes:s.unref(u).minutes,seconds:s.unref(u).seconds,"internal-model-value":ge.internalModelValue,"disabled-times-config":s.unref(f),"validate-time":s.unref(p),onMount:Ce[8]||(Ce[8]=D=>ce(s.unref(qi).timePicker)),"onUpdate:hours":Ce[9]||(Ce[9]=D=>s.unref(Q)(D)),"onUpdate:minutes":Ce[10]||(Ce[10]=D=>s.unref(Q)(D,!1)),"onUpdate:seconds":Ce[11]||(Ce[11]=D=>s.unref(Q)(D,!1,!0)),onResetFlow:Ce[12]||(Ce[12]=D=>ge.$emit("reset-flow")),onOverlayClosed:Ce[13]||(Ce[13]=D=>se(D,!1)),onOverlayOpened:Ce[14]||(Ce[14]=D=>se(D,!0)),onAmPmChange:Ce[15]||(Ce[15]=D=>ge.$emit("am-pm-change",D))}),s.createSlots({_:2},[s.renderList(s.unref(K),(D,ke)=>({name:D,fn:s.withCtx(be=>[s.renderSlot(ge.$slots,D,s.normalizeProps(s.guardReactiveProps(be)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):s.createCommentVNode("",!0)],64))}}),MM=(t,e)=>{const A=s.ref(),{defaultedMultiCalendars:n,defaultedConfig:r,defaultedHighlight:o,defaultedRange:i,propDates:a,defaultedFilters:l,defaultedMultiDates:u}=Gt(t),{modelValue:f,year:h,month:p,calendars:g}=Bl(t,e),{isDisabled:B}=ei(t),{selectYear:y,groupedYears:b,showYearPicker:w,isDisabled:v,toggleYearPicker:S,handleYearSelect:F,handleYear:I}=V0({modelValue:f,multiCalendars:n,range:i,highlight:o,calendars:g,propDates:a,month:p,year:h,filters:l,props:t,emit:e}),Q=(G,$)=>[G,$].map(te=>Pr(te,"MMMM",{locale:t.formatLocale})).join("-"),x=s.computed(()=>G=>f.value?Array.isArray(f.value)?f.value.some($=>c0(G,$)):c0(f.value,G):!1),M=G=>{if(i.value.enabled){if(Array.isArray(f.value)){const $=dt(G,f.value[0])||dt(G,f.value[1]);return fl(f.value,A.value,G)&&!$}return!1}return!1},O=(G,$)=>G.quarter===Ww($)&&G.year===qe($),P=G=>typeof o.value=="function"?o.value({quarter:Ww(G),year:qe(G)}):!!o.value.quarters.find($=>O($,G)),ie=s.computed(()=>G=>{const $=Tt(new Date,{year:h.value(G)});return hD({start:ll($),end:Jw($)}).map(te=>{const ee=Ji(te),K=jw(te),ce=B(te),j=M(ee),Qe=P(ee);return{text:Q(ee,K),value:ee,active:x.value(ee),highlighted:Qe,disabled:ce,isBetween:j}})}),ae=G=>{kp(G,f,u.value.limit),e("auto-apply",!0)},ue=G=>{f.value=Sp(f,G,e),nu(f.value,e,t.autoApply,t.modelAuto)},H=G=>{f.value=G,e("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:n,groupedYears:b,year:h,isDisabled:v,quarters:ie,showYearPicker:w,modelValue:f,setHoverDate:G=>{A.value=G},selectYear:y,selectQuarter:(G,$,te)=>{if(!te)return g.value[$].month=ut(jw(G)),u.value.enabled?ae(G):i.value.enabled?ue(G):H(G)},toggleYearPicker:S,handleYearSelect:F,handleYear:I}},NM={class:"dp--quarter-items"},HM=["data-test-id","disabled","onClick","onMouseover"],RM=s.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...br},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=_n(o,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:l,groupedYears:u,year:f,isDisabled:h,quarters:p,modelValue:g,showYearPicker:B,setHoverDate:y,selectQuarter:b,toggleYearPicker:w,handleYearSelect:v,handleYear:S}=MM(r,n);return e({getSidebarProps:()=>({modelValue:g,year:f,selectQuarter:b,handleYearSelect:v,handleYear:S})}),(F,I)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":s.unref(a).count,collapse:F.collapse,stretch:"","is-mobile":F.isMobile},{default:s.withCtx(({instance:Q})=>[s.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:s.normalizeStyle({minHeight:`${s.unref(l).modeHeight}px`})},[F.$slots["top-extra"]?s.renderSlot(F.$slots,"top-extra",{key:0,value:F.internalModelValue}):s.createCommentVNode("",!0),s.createElementVNode("div",null,[s.createVNode(H0,s.mergeProps(F.$props,{items:s.unref(u)(Q),instance:Q,"show-year-picker":s.unref(B)[Q],year:s.unref(f)(Q),"is-disabled":x=>s.unref(h)(Q,x),onHandleYear:x=>s.unref(S)(Q,x),onYearSelect:x=>s.unref(v)(x,Q),onToggleYearPicker:x=>s.unref(w)(Q,x?.flow,x?.show)}),s.createSlots({_:2},[s.renderList(s.unref(i),(x,M)=>({name:x,fn:s.withCtx(O=>[s.renderSlot(F.$slots,x,s.normalizeProps(s.guardReactiveProps(O)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),s.createElementVNode("div",NM,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p)(Q),(x,M)=>(s.openBlock(),s.createElementBlock("div",{key:M},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":x.active,"dp--qr-btn-between":x.isBetween,"dp--qr-btn-disabled":x.disabled,"dp--highlighted":x.highlighted}]),"data-test-id":x.value,disabled:x.disabled,onClick:O=>s.unref(b)(x.value,Q,x.disabled),onMouseover:O=>s.unref(y)(x.value)},[F.$slots.quarter?s.renderSlot(F.$slots,"quarter",{key:0,value:x.value,text:x.text}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(x.text),1)],64))],42,HM)]))),128))])],4)]),_:3},8,["multi-calendars","collapse","is-mobile"]))}}),W0=(t,e)=>{const A=s.ref(0);s.onMounted(()=>{n(),window.addEventListener("resize",n,{passive:!0})}),s.onUnmounted(()=>{window.removeEventListener("resize",n)});const n=()=>{A.value=window.document.documentElement.clientWidth};return{isMobile:s.computed(()=>A.value<=t.value.mobileBreakpoint&&!e?!0:void 0)}},PM=["id","tabindex","role","aria-label"],VM={key:0,class:"dp--menu-load-container"},$M={key:1,class:"dp--menu-header"},KM=["data-dp-mobile"],GM={key:0,class:"dp__sidebar_left"},WM=["data-dp-mobile"],zM=["data-test-id","data-dp-mobile","onClick","onKeydown"],YM={key:2,class:"dp__sidebar_right"},JM={key:3,class:"dp__action_extra"},z0=s.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...tu,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle","menu-blur"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.ref(null),i=s.computed(()=>{const{openOnTop:W,...fe}=r;return{...fe,isMobile:b.value,flowStep:ue.value,menuWrapRef:o.value}}),{setMenuFocused:a,setShiftKey:l,control:u}=O0(),f=s.useSlots(),{defaultedTextInput:h,defaultedInline:p,defaultedConfig:g,defaultedUI:B,handleEventPropagation:y}=Gt(r),{isMobile:b}=W0(g,r.shadow),w=s.ref(null),v=s.ref(0),S=s.ref(null),F=s.ref(!1),I=s.ref(null),Q=s.ref(!1),x=W=>{Q.value=!0,g.value.allowPreventDefault&&W.preventDefault(),Jo(W,g.value,!0)};s.onMounted(()=>{if(!r.shadow){F.value=!0,M(),window.addEventListener("resize",M);const W=BA(o);W&&!h.value.enabled&&!p.value.enabled&&(a(!0),ce()),W&&(W.addEventListener("pointerdown",x),W.addEventListener("mousedown",x))}document.addEventListener("mousedown",ze)}),s.onUnmounted(()=>{window.removeEventListener("resize",M),document.removeEventListener("mousedown",ze);const W=BA(o);W&&(W.removeEventListener("pointerdown",x),W.removeEventListener("mousedown",x))});const M=()=>{const W=BA(S);W&&(v.value=W.getBoundingClientRect().width)},{arrowRight:O,arrowLeft:P,arrowDown:ie,arrowUp:ae}=qo(),{flowStep:ue,updateFlowStep:H,childMount:G,resetFlow:$,handleFlow:te}=eN(r,n,I),ee=s.computed(()=>r.monthPicker?rM:r.yearPicker?iM:r.timePicker?wM:r.quarterPicker?RM:OM),K=s.computed(()=>{var W;if(g.value.arrowLeft)return g.value.arrowLeft;const fe=(W=o.value)==null?void 0:W.getBoundingClientRect(),q=r.getInputRect();return q?.width<v?.value&&q?.left<=(fe?.left??0)?`${q?.width/2}px`:q?.right>=(fe?.right??0)&&q?.width<v?.value?`${v?.value-q?.width/2}px`:"50%"}),ce=()=>{const W=BA(o);W&&W.focus({preventScroll:!0})},j=s.computed(()=>{var W;return((W=I.value)==null?void 0:W.getSidebarProps())||{}}),Qe=()=>{r.openOnTop&&n("recalculate-position")},R=_n(f,"action"),J=s.computed(()=>r.monthPicker||r.yearPicker?_n(f,"monthYear"):r.timePicker?_n(f,"timePicker"):_n(f,"shared")),Ae=s.computed(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),oe=s.computed(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),k=s.computed(()=>({dp__menu:!0,dp__menu_index:!p.value.enabled,dp__relative:p.value.enabled,...B.value.menu??{}})),X=W=>{Jo(W,g.value,!0)},Se=W=>{r.escClose&&(n("close-picker"),y(W))},ht=W=>{if(r.arrowNavigation){if(W===rn.up)return ae();if(W===rn.down)return ie();if(W===rn.left)return P();if(W===rn.right)return O()}else W===rn.left||W===rn.up?D("handleArrow",rn.left,0,W===rn.up):D("handleArrow",rn.right,0,W===rn.down)},se=W=>{l(W.shiftKey),!r.disableMonthYearSelect&&W.code===Ht.tab&&W.target.classList.contains("dp__menu")&&u.value.shiftKeyInMenu&&(W.preventDefault(),Jo(W,g.value,!0),n("close-picker"))},Ye=()=>{ce(),n("time-picker-close")},ge=W=>{var fe,q,me;(fe=I.value)==null||fe.toggleTimePicker(!1,!1),(q=I.value)==null||q.toggleMonthPicker(!1,!1,W),(me=I.value)==null||me.toggleYearPicker(!1,!1,W)},Ce=(W,fe=0)=>{var q,me,Je;return W==="month"?(q=I.value)==null?void 0:q.toggleMonthPicker(!1,!0,fe):W==="year"?(me=I.value)==null?void 0:me.toggleYearPicker(!1,!0,fe):W==="time"?(Je=I.value)==null?void 0:Je.toggleTimePicker(!0,!1):ge(fe)},D=(W,...fe)=>{var q,me;(q=I.value)!=null&&q[W]&&((me=I.value)==null||me[W](...fe))},ke=()=>{D("selectCurrentDate")},be=(W,fe)=>{D("presetDate",s.toValue(W),fe)},_=()=>{D("clearHoverDate")},N=(W,fe)=>{D("updateMonthYear",W,fe)},ne=(W,fe)=>{W.preventDefault(),ht(fe)},ve=W=>{var fe,q,me;if(se(W),W.key===Ht.home||W.key===Ht.end)return D("selectWeekDate",W.key===Ht.home,W.target.getAttribute("id"));switch((W.key===Ht.pageUp||W.key===Ht.pageDown)&&(W.shiftKey?(D("changeYear",W.key===Ht.pageUp),(fe=cp(o.value,"overlay-year"))==null||fe.focus()):(D("changeMonth",W.key===Ht.pageUp),(q=cp(o.value,W.key===Ht.pageUp?"action-prev":"action-next"))==null||q.focus()),W.target.getAttribute("id")&&((me=o.value)==null||me.focus({preventScroll:!0}))),W.key){case Ht.esc:return Se(W);case Ht.arrowLeft:return ne(W,rn.left);case Ht.arrowRight:return ne(W,rn.right);case Ht.arrowUp:return ne(W,rn.up);case Ht.arrowDown:return ne(W,rn.down);default:return}},ze=W=>{var fe;p.value.enabled&&!p.value.input&&!((fe=o.value)!=null&&fe.contains(W.target))&&Q.value&&(Q.value=!1,n("menu-blur"))};return e({updateMonthYear:N,switchView:Ce,handleFlow:te,onValueCleared:()=>{var W,fe;(fe=(W=I.value)==null?void 0:W.setStartTime)==null||fe.call(W)}}),(W,fe)=>{var q,me,Je;return s.openBlock(),s.createElementBlock("div",{id:W.uid?`dp-menu-${W.uid}`:void 0,ref_key:"dpMenuRef",ref:o,tabindex:s.unref(p).enabled?void 0:"0",role:s.unref(p).enabled?void 0:"dialog","aria-label":(q=W.ariaLabels)==null?void 0:q.menu,class:s.normalizeClass(k.value),style:s.normalizeStyle({"--dp-arrow-left":K.value}),onMouseleave:_,onClick:X,onKeydown:ve},[(W.disabled||W.readonly)&&s.unref(p).enabled||W.loading?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(oe.value)},[W.loading?(s.openBlock(),s.createElementBlock("div",VM,fe[19]||(fe[19]=[s.createElementVNode("span",{class:"dp--menu-loader"},null,-1)]))):s.createCommentVNode("",!0)],2)):s.createCommentVNode("",!0),W.$slots["menu-header"]?(s.openBlock(),s.createElementBlock("div",$M,[s.renderSlot(W.$slots,"menu-header")])):s.createCommentVNode("",!0),!s.unref(p).enabled&&!W.teleportCenter?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(Ae.value)},null,2)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"innerMenuRef",ref:S,class:s.normalizeClass({dp__menu_content_wrapper:((me=W.presetDates)==null?void 0:me.length)||!!W.$slots["left-sidebar"]||!!W.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":t.collapse&&(((Je=W.presetDates)==null?void 0:Je.length)||!!W.$slots["left-sidebar"]||!!W.$slots["right-sidebar"])}),"data-dp-mobile":s.unref(b),style:s.normalizeStyle({"--dp-menu-width":`${v.value}px`})},[W.$slots["left-sidebar"]?(s.openBlock(),s.createElementBlock("div",GM,[s.renderSlot(W.$slots,"left-sidebar",s.normalizeProps(s.guardReactiveProps(j.value)))])):s.createCommentVNode("",!0),W.presetDates.length?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass({"dp--preset-dates-collapsed":t.collapse,"dp--preset-dates":!0}),"data-dp-mobile":s.unref(b)},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(W.presetDates,(Ue,kt)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:kt},[Ue.slot?s.renderSlot(W.$slots,Ue.slot,{key:0,presetDate:be,label:Ue.label,value:Ue.value}):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",style:s.normalizeStyle(Ue.style||{}),class:s.normalizeClass(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":t.collapse}]),"data-test-id":Ue.testId??void 0,"data-dp-mobile":s.unref(b),onClick:s.withModifiers(kA=>be(Ue.value,Ue.noTz),["prevent"]),onKeydown:kA=>s.unref(on)(kA,()=>be(Ue.value,Ue.noTz),!0)},s.toDisplayString(Ue.label),47,zM))],64))),128))],10,WM)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"calendarWrapperRef",ref:w,class:"dp__instance_calendar",role:"document"},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(ee.value),s.mergeProps({ref_key:"dynCmpRef",ref:I},i.value,{"flow-step":s.unref(ue),onMount:s.unref(G),onUpdateFlowStep:s.unref(H),onResetFlow:s.unref($),onFocusMenu:ce,onSelectDate:fe[0]||(fe[0]=Ue=>W.$emit("select-date")),onDateUpdate:fe[1]||(fe[1]=Ue=>W.$emit("date-update",Ue)),onTooltipOpen:fe[2]||(fe[2]=Ue=>W.$emit("tooltip-open",Ue)),onTooltipClose:fe[3]||(fe[3]=Ue=>W.$emit("tooltip-close",Ue)),onAutoApply:fe[4]||(fe[4]=Ue=>W.$emit("auto-apply",Ue)),onRangeStart:fe[5]||(fe[5]=Ue=>W.$emit("range-start",Ue)),onRangeEnd:fe[6]||(fe[6]=Ue=>W.$emit("range-end",Ue)),onInvalidFixedRange:fe[7]||(fe[7]=Ue=>W.$emit("invalid-fixed-range",Ue)),onTimeUpdate:fe[8]||(fe[8]=Ue=>W.$emit("time-update")),onAmPmChange:fe[9]||(fe[9]=Ue=>W.$emit("am-pm-change",Ue)),onTimePickerOpen:fe[10]||(fe[10]=Ue=>W.$emit("time-picker-open",Ue)),onTimePickerClose:Ye,onRecalculatePosition:Qe,onUpdateMonthYear:fe[11]||(fe[11]=Ue=>W.$emit("update-month-year",Ue)),onAutoApplyInvalid:fe[12]||(fe[12]=Ue=>W.$emit("auto-apply-invalid",Ue)),onInvalidDate:fe[13]||(fe[13]=Ue=>W.$emit("invalid-date",Ue)),onOverlayToggle:fe[14]||(fe[14]=Ue=>W.$emit("overlay-toggle",Ue)),"onUpdate:internalModelValue":fe[15]||(fe[15]=Ue=>W.$emit("update:internal-model-value",Ue))}),s.createSlots({_:2},[s.renderList(J.value,(Ue,kt)=>({name:Ue,fn:s.withCtx(kA=>[s.renderSlot(W.$slots,Ue,s.normalizeProps(s.guardReactiveProps({...kA})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),W.$slots["right-sidebar"]?(s.openBlock(),s.createElementBlock("div",YM,[s.renderSlot(W.$slots,"right-sidebar",s.normalizeProps(s.guardReactiveProps(j.value)))])):s.createCommentVNode("",!0),W.$slots["action-extra"]?(s.openBlock(),s.createElementBlock("div",JM,[W.$slots["action-extra"]?s.renderSlot(W.$slots,"action-extra",{key:0,selectCurrentDate:ke}):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],14,KM),!W.autoApply||s.unref(g).keepActionRow?(s.openBlock(),s.createBlock(JO,s.mergeProps({key:3,"menu-mount":F.value},i.value,{"calendar-width":v.value,onClosePicker:fe[16]||(fe[16]=Ue=>W.$emit("close-picker")),onSelectDate:fe[17]||(fe[17]=Ue=>W.$emit("select-date")),onInvalidSelect:fe[18]||(fe[18]=Ue=>W.$emit("invalid-select")),onSelectNow:ke}),s.createSlots({_:2},[s.renderList(s.unref(R),(Ue,kt)=>({name:Ue,fn:s.withCtx(kA=>[s.renderSlot(W.$slots,Ue,s.normalizeProps(s.guardReactiveProps({...kA})))])}))]),1040,["menu-mount","calendar-width"])):s.createCommentVNode("",!0)],46,PM)}}});var na=(t=>(t.center="center",t.left="left",t.right="right",t))(na||{});const XM=({menuRef:t,menuRefInner:e,inputRef:A,pickerWrapperRef:n,inline:r,emit:o,props:i,slots:a})=>{const{defaultedConfig:l}=Gt(i),u=s.ref({}),f=s.ref(!1),h=s.ref({top:"0",left:"0"}),p=s.ref(!1),g=s.toRef(i,"teleportCenter");s.watch(g,()=>{h.value=JSON.parse(JSON.stringify({})),I()});const B=$=>{if(i.teleport){const te=$.getBoundingClientRect();return{left:te.left+window.scrollX,top:te.top+window.scrollY}}return{top:0,left:0}},y=($,te)=>{h.value.left=`${$+te-u.value.width}px`},b=$=>{h.value.left=`${$}px`},w=($,te)=>{i.position===na.left&&b($),i.position===na.right&&y($,te),i.position===na.center&&(h.value.left=`${$+te/2-u.value.width/2}px`)},v=$=>{const{width:te,height:ee}=$.getBoundingClientRect(),{top:K,left:ce}=B($);return{top:+K,left:+ce,width:te,height:ee}},S=()=>{h.value.left="50%",h.value.top="50%",h.value.transform="translate(-50%, -50%)",h.value.position="fixed",delete h.value.opacity},F=()=>{const $=BA(A);h.value=i.altPosition($)},I=($=!0)=>{var te;if(!r.value.enabled){if(g.value)return S();if(i.altPosition!==null)return F();if($){const ee=i.teleport?(te=e.value)==null?void 0:te.$el:t.value;ee&&(u.value=ee.getBoundingClientRect()),o("recalculate-position")}return ae()}},Q=({inputEl:$,left:te,width:ee})=>{window.screen.width>768&&!f.value&&w(te,ee),O($)},x=$=>{const{top:te,left:ee,height:K,width:ce}=v($);h.value.top=`${K+te+ +i.offset}px`,p.value=!1,f.value||(h.value.left=`${ee+ce/2-u.value.width/2}px`),Q({inputEl:$,left:ee,width:ce})},M=$=>{const{top:te,left:ee,width:K}=v($);h.value.top=`${te-+i.offset-u.value.height}px`,p.value=!0,Q({inputEl:$,left:ee,width:K})},O=$=>{if(i.autoPosition){const{left:te,width:ee}=v($),{left:K,right:ce}=u.value;if(!f.value){if(Math.abs(K)!==Math.abs(ce)){if(K<=0)return f.value=!0,b(te);if(ce>=document.documentElement.clientWidth)return f.value=!0,y(te,ee)}return w(te,ee)}}},P=()=>{const $=BA(A);if($){if(i.autoPosition===wr.top)return wr.top;if(i.autoPosition===wr.bottom)return wr.bottom;const{height:te}=u.value,{top:ee,height:K}=$.getBoundingClientRect(),ce=window.innerHeight-ee-K,j=ee;return te<=ce?wr.bottom:te>ce&&te<=j?wr.top:ce>=j?wr.bottom:wr.top}return wr.bottom},ie=$=>P()===wr.bottom?x($):M($),ae=()=>{const $=BA(A);if($)return i.autoPosition?ie($):x($)},ue=function($){if($){const te=$.scrollHeight>$.clientHeight,ee=window.getComputedStyle($).overflowY.indexOf("hidden")!==-1;return te&&!ee}return!0},H=function($){return!$||$===document.body||$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:ue($)?$:H($.assignedSlot&&l.value.shadowDom?$.assignedSlot.parentNode:$.parentNode)},G=$=>{if($)switch(i.position){case na.left:return{left:0,transform:"translateX(0)"};case na.right:return{left:`${$.width}px`,transform:"translateX(-100%)"};default:return{left:`${$.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:p,menuStyle:h,xCorrect:f,setMenuPosition:I,getScrollableParent:H,shadowRender:($,te,ee)=>{var K,ce,j;const Qe=document.createElement("div"),R=(K=BA(A))==null?void 0:K.getBoundingClientRect();Qe.setAttribute("id","dp--temp-container");const J=(ce=n.value)!=null&&ce.clientWidth?n.value:document.body;J.append(Qe);const Ae=G(R),oe=l.value.shadowDom?Object.keys(a).filter(X=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(X)):Object.keys(a),k=s.h(te,{...ee,shadow:!0,style:{opacity:0,position:"absolute",...Ae}},Object.fromEntries(oe.map(X=>[X,a[X]])));$!=null&&(k.appContext=$.appContext),s.render(k,Qe),u.value=(j=k.el)==null?void 0:j.getBoundingClientRect(),s.render(null,Qe),J.removeChild(Qe)}}},Zo=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],jM=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],qM={all:()=>Zo,monthYear:()=>Zo.filter(t=>t.use.includes("month-year")),input:()=>jM,timePicker:()=>Zo.filter(t=>t.use.includes("time")),action:()=>Zo.filter(t=>t.use.includes("action")),calendar:()=>Zo.filter(t=>t.use.includes("calendar")),menu:()=>Zo.filter(t=>t.use.includes("menu")),shared:()=>Zo.filter(t=>t.use.includes("shared")),yearMode:()=>Zo.filter(t=>t.use.includes("year-mode"))},_n=(t,e,A)=>{const n=[];return qM[e]().forEach(r=>{t[r.name]&&n.push(r.name)}),A!=null&&A.length&&A.forEach(r=>{r.slot&&n.push(r.slot)}),n},gl=t=>{const e=s.computed(()=>n=>t.value?n?t.value.open:t.value.close:""),A=s.computed(()=>n=>t.value?n?t.value.menuAppearTop:t.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!t.value,menuTransition:A}},Bl=(t,e,A)=>{const{defaultedRange:n,defaultedTz:r}=Gt(t),o=ye(wn(ye(),r.value.timezone)),i=s.ref([{month:ut(o),year:qe(o)}]),a=p=>{const g={hours:mo(o),minutes:Yo(o),seconds:0};return n.value.enabled?[g[p],g[p]]:g[p]},l=s.reactive({hours:a("hours"),minutes:a("minutes"),seconds:a("seconds")});s.watch(n,(p,g)=>{p.enabled!==g.enabled&&(l.hours=a("hours"),l.minutes=a("minutes"),l.seconds=a("seconds"))},{deep:!0});const u=s.computed({get:()=>t.internalModelValue,set:p=>{!t.readonly&&!t.disabled&&e("update:internal-model-value",p)}}),f=s.computed(()=>p=>i.value[p]?i.value[p].month:0),h=s.computed(()=>p=>i.value[p]?i.value[p].year:0);return s.watch(u,(p,g)=>{A&&JSON.stringify(p??{})!==JSON.stringify(g??{})&&A()},{deep:!0}),{calendars:i,time:l,modelValue:u,month:f,year:h,today:o}},ZM=(t,e)=>{const{defaultedMultiCalendars:A,defaultedMultiDates:n,defaultedUI:r,defaultedHighlight:o,defaultedTz:i,propDates:a,defaultedRange:l}=Gt(e),{isDisabled:u}=ei(e),f=s.ref(null),h=s.ref(wn(new Date,i.value.timezone)),p=k=>{!k.current&&e.hideOffsetDates||(f.value=k.value)},g=()=>{f.value=null},B=k=>Array.isArray(t.value)&&l.value.enabled&&t.value[0]&&f.value?k?aA(f.value,t.value[0]):eA(f.value,t.value[0]):!0,y=(k,X)=>{const Se=()=>t.value?X?t.value[0]||null:t.value[1]:null,ht=t.value&&Array.isArray(t.value)?Se():null;return dt(ye(k.value),ht)},b=k=>{const X=Array.isArray(t.value)?t.value[0]:null;return k?!eA(f.value??null,X):!0},w=(k,X=!0)=>(l.value.enabled||e.weekPicker)&&Array.isArray(t.value)&&t.value.length===2?e.hideOffsetDates&&!k.current?!1:dt(ye(k.value),t.value[X?0:1]):l.value.enabled?y(k,X)&&b(X)||dt(k.value,Array.isArray(t.value)?t.value[0]:null)&&B(X):!1,v=(k,X)=>{if(Array.isArray(t.value)&&t.value[0]&&t.value.length===1){const Se=dt(k.value,f.value);return X?aA(t.value[0],k.value)&&Se:eA(t.value[0],k.value)&&Se}return!1},S=k=>!t.value||e.hideOffsetDates&&!k.current?!1:l.value.enabled?e.modelAuto&&Array.isArray(t.value)?dt(k.value,t.value[0]?t.value[0]:h.value):!1:n.value.enabled&&Array.isArray(t.value)?t.value.some(X=>dt(X,k.value)):dt(k.value,t.value?t.value:h.value),F=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){if(e.hideOffsetDates&&!k.current)return!1;const X=Xn(f.value,+l.value.autoRange),Se=go(ye(f.value),e.weekStart);return e.weekPicker?dt(Se[1],ye(k.value)):dt(X,ye(k.value))}return!1}return!1},I=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){const X=Xn(f.value,+l.value.autoRange);if(e.hideOffsetDates&&!k.current)return!1;const Se=go(ye(f.value),e.weekStart);return e.weekPicker?aA(k.value,Se[0])&&eA(k.value,Se[1]):aA(k.value,f.value)&&eA(k.value,X)}return!1}return!1},Q=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){if(e.hideOffsetDates&&!k.current)return!1;const X=go(ye(f.value),e.weekStart);return e.weekPicker?dt(X[0],k.value):dt(f.value,k.value)}return!1}return!1},x=k=>fl(t.value,f.value,k.value),M=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,O=()=>e.modelAuto?y0(e.internalModelValue):!0,P=k=>{if(e.weekPicker)return!1;const X=l.value.enabled?!w(k)&&!w(k,!1):!0;return!u(k.value)&&!S(k)&&!(!k.current&&e.hideOffsetDates)&&X},ie=k=>l.value.enabled?e.modelAuto?M()&&S(k):!1:S(k),ae=k=>o.value?BO(k.value,a.value.highlight):!1,ue=k=>{const X=u(k.value);return X&&(typeof o.value=="function"?!o.value(k.value,X):!o.value.options.highlightDisabled)},H=k=>{var X;return typeof o.value=="function"?o.value(k.value):(X=o.value.weekdays)==null?void 0:X.includes(k.value.getDay())},G=k=>(l.value.enabled||e.weekPicker)&&(!(A.value.count>0)||k.current)&&O()&&!(!k.current&&e.hideOffsetDates)&&!S(k)?x(k):!1,$=k=>{if(Array.isArray(t.value)&&t.value.length===1){const{before:X,after:Se}=L0(+l.value.maxRange,t.value[0]);return Js(k.value,X)||ji(k.value,Se)}return!1},te=k=>{if(Array.isArray(t.value)&&t.value.length===1){const{before:X,after:Se}=L0(+l.value.minRange,t.value[0]);return fl([X,Se],t.value[0],k.value)}return!1},ee=k=>l.value.enabled&&(l.value.maxRange||l.value.minRange)?l.value.maxRange&&l.value.minRange?$(k)||te(k):l.value.maxRange?$(k):te(k):!1,K=k=>{const{isRangeStart:X,isRangeEnd:Se}=R(k),ht=l.value.enabled?X||Se:!1;return{dp__cell_offset:!k.current,dp__pointer:!e.disabled&&!(!k.current&&e.hideOffsetDates)&&!u(k.value)&&!ee(k),dp__cell_disabled:u(k.value)||ee(k),dp__cell_highlight:!ue(k)&&(ae(k)||H(k))&&!ie(k)&&!ht&&!Q(k)&&!(G(k)&&e.weekPicker)&&!Se,dp__cell_highlight_active:!ue(k)&&(ae(k)||H(k))&&ie(k),dp__today:!e.noToday&&dt(k.value,h.value)&&k.current,"dp--past":eA(k.value,h.value),"dp--future":aA(k.value,h.value)}},ce=k=>({dp__active_date:ie(k),dp__date_hover:P(k)}),j=k=>{if(t.value&&!Array.isArray(t.value)){const X=go(t.value,e.weekStart);return{...Ae(k),dp__range_start:dt(X[0],k.value),dp__range_end:dt(X[1],k.value),dp__range_between_week:aA(k.value,X[0])&&eA(k.value,X[1])}}return{...Ae(k)}},Qe=k=>{if(t.value&&Array.isArray(t.value)){const X=go(t.value[0],e.weekStart),Se=t.value[1]?go(t.value[1],e.weekStart):[];return{...Ae(k),dp__range_start:dt(X[0],k.value)||dt(Se[0],k.value),dp__range_end:dt(X[1],k.value)||dt(Se[1],k.value),dp__range_between_week:aA(k.value,X[0])&&eA(k.value,X[1])||aA(k.value,Se[0])&&eA(k.value,Se[1]),dp__range_between:aA(k.value,X[1])&&eA(k.value,Se[0])}}return{...Ae(k)}},R=k=>{const X=A.value.count>0?k.current&&w(k)&&O():w(k)&&O(),Se=A.value.count>0?k.current&&w(k,!1)&&O():w(k,!1)&&O();return{isRangeStart:X,isRangeEnd:Se}},J=k=>{const{isRangeStart:X,isRangeEnd:Se}=R(k);return{dp__range_start:X,dp__range_end:Se,dp__range_between:G(k),dp__date_hover:dt(k.value,f.value)&&!X&&!Se&&!e.weekPicker,dp__date_hover_start:v(k,!0),dp__date_hover_end:v(k,!1)}},Ae=k=>({...J(k),dp__cell_auto_range:I(k),dp__cell_auto_range_start:Q(k),dp__cell_auto_range_end:F(k)}),oe=k=>l.value.enabled?l.value.autoRange?Ae(k):e.modelAuto?{...ce(k),...J(k)}:e.weekPicker?Qe(k):J(k):e.weekPicker?j(k):ce(k);return{setHoverDate:p,clearHoverDate:g,getDayClassData:k=>e.hideOffsetDates&&!k.current?{}:{...K(k),...oe(k),[e.dayClass?e.dayClass(k.value,e.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},ei=t=>{const{defaultedFilters:e,defaultedRange:A,propDates:n,defaultedMultiDates:r}=Gt(t),o=H=>n.value.disabledDates?typeof n.value.disabledDates=="function"?n.value.disabledDates(ye(H)):!!qc(H,n.value.disabledDates):!1,i=H=>n.value.maxDate?t.yearPicker?qe(H)>qe(n.value.maxDate):aA(H,n.value.maxDate):!1,a=H=>n.value.minDate?t.yearPicker?qe(H)<qe(n.value.minDate):eA(H,n.value.minDate):!1,l=H=>{const G=i(H),$=a(H),te=o(H),ee=e.value.months.map(R=>+R).includes(ut(H)),K=t.disabledWeekDays.length?t.disabledWeekDays.some(R=>+R===oL(H)):!1,ce=g(H),j=qe(H),Qe=j<+t.yearRange[0]||j>+t.yearRange[1];return!(G||$||te||ee||Qe||K||ce)},u=(H,G)=>eA(...jo(n.value.minDate,H,G))||dt(...jo(n.value.minDate,H,G)),f=(H,G)=>aA(...jo(n.value.maxDate,H,G))||dt(...jo(n.value.maxDate,H,G)),h=(H,G,$)=>{let te=!1;return n.value.maxDate&&$&&f(H,G)&&(te=!0),n.value.minDate&&!$&&u(H,G)&&(te=!0),te},p=(H,G,$,te)=>{let ee=!1;return te&&(n.value.minDate||n.value.maxDate)?n.value.minDate&&n.value.maxDate?ee=h(H,G,$):(n.value.minDate&&u(H,G)||n.value.maxDate&&f(H,G))&&(ee=!0):ee=!0,ee},g=H=>Array.isArray(n.value.allowedDates)&&!n.value.allowedDates.length?!0:n.value.allowedDates?!qc(H,n.value.allowedDates,E0(t.monthPicker,t.yearPicker)):!1,B=H=>!l(H),y=H=>A.value.noDisabledRange?!Yw({start:H[0],end:H[1]}).some(G=>B(G)):!0,b=H=>{if(H){const G=qe(H);return G>=+t.yearRange[0]&&G<=t.yearRange[1]}return!0},w=(H,G)=>!!(Array.isArray(H)&&H[G]&&(A.value.maxRange||A.value.minRange)&&b(H[G])),v=(H,G,$=0)=>{if(w(G,$)&&b(H)){const te=$w(H,G[$]),ee=U0(G[$],H),K=ee.length===1?0:ee.filter(j=>B(j)).length,ce=Math.abs(te)-(A.value.minMaxRawRange?0:K);if(A.value.minRange&&A.value.maxRange)return ce>=+A.value.minRange&&ce<=+A.value.maxRange;if(A.value.minRange)return ce>=+A.value.minRange;if(A.value.maxRange)return ce<=+A.value.maxRange}return!0},S=()=>!t.enableTimePicker||t.monthPicker||t.yearPicker||t.ignoreTimeValidation,F=H=>Array.isArray(H)?[H[0]?gp(H[0]):null,H[1]?gp(H[1]):null]:gp(H),I=(H,G,$)=>H.find(te=>+te.hours===mo(G)&&te.minutes==="*"?!0:+te.minutes===Yo(G)&&+te.hours===mo(G))&&$,Q=(H,G,$)=>{const[te,ee]=H,[K,ce]=G;return!I(te,K,$)&&!I(ee,ce,$)&&$},x=(H,G)=>{const $=Array.isArray(G)?G:[G];return Array.isArray(t.disabledTimes)?Array.isArray(t.disabledTimes[0])?Q(t.disabledTimes,$,H):!$.some(te=>I(t.disabledTimes,te,H)):H},M=(H,G)=>{const $=Array.isArray(G)?[Zi(G[0]),G[1]?Zi(G[1]):void 0]:Zi(G),te=!t.disabledTimes($);return H&&te},O=(H,G)=>t.disabledTimes?Array.isArray(t.disabledTimes)?x(G,H):M(G,H):G,P=H=>{let G=!0;if(!H||S())return!0;const $=!n.value.minDate&&!n.value.maxDate?F(H):H;return(t.maxTime||n.value.maxDate)&&(G=_0(t.maxTime,n.value.maxDate,"max",FA($),G)),(t.minTime||n.value.minDate)&&(G=_0(t.minTime,n.value.minDate,"min",FA($),G)),O(H,G)},ie=H=>{if(!t.monthPicker)return!0;let G=!0;const $=ye(Cr(H));if(n.value.minDate&&n.value.maxDate){const te=ye(Cr(n.value.minDate)),ee=ye(Cr(n.value.maxDate));return aA($,te)&&eA($,ee)||dt($,te)||dt($,ee)}if(n.value.minDate){const te=ye(Cr(n.value.minDate));G=aA($,te)||dt($,te)}if(n.value.maxDate){const te=ye(Cr(n.value.maxDate));G=eA($,te)||dt($,te)}return G},ae=s.computed(()=>H=>!t.enableTimePicker||t.ignoreTimeValidation?!0:P(H)),ue=s.computed(()=>H=>t.monthPicker?Array.isArray(H)&&(A.value.enabled||r.value.enabled)?!H.filter(G=>!ie(G)).length:ie(H):!0);return{isDisabled:B,validateDate:l,validateMonthYearInRange:p,isDateRangeAllowed:y,checkMinMaxRange:v,isValidTime:P,isTimeValid:ae,isMonthValid:ue}},ru=()=>{const t=s.computed(()=>(n,r)=>n?.includes(r)),e=s.computed(()=>(n,r)=>n.count?n.solo?!0:r===0:!0),A=s.computed(()=>(n,r)=>n.count?n.solo?!0:r===n.count-1:!0);return{hideNavigationButtons:t,showLeftIcon:e,showRightIcon:A}},eN=(t,e,A)=>{const n=s.ref(0),r=s.reactive({[qi.timePicker]:!t.enableTimePicker||t.timePicker||t.monthPicker,[qi.calendar]:!1,[qi.header]:!1}),o=s.computed(()=>t.monthPicker||t.timePicker),i=h=>{var p;if((p=t.flow)!=null&&p.length){if(!h&&o.value)return f();r[h]=!0,Object.keys(r).filter(g=>!r[g]).length||f()}},a=()=>{var h,p;(h=t.flow)!=null&&h.length&&n.value!==-1&&(n.value+=1,e("flow-step",n.value),f()),((p=t.flow)==null?void 0:p.length)===n.value&&s.nextTick().then(()=>l())},l=()=>{n.value=-1},u=(h,p,...g)=>{var B,y;t.flow[n.value]===h&&A.value&&((y=(B=A.value)[p])==null||y.call(B,...g))},f=(h=0)=>{h&&(n.value+=h),u(zA.month,"toggleMonthPicker",!0),u(zA.year,"toggleYearPicker",!0),u(zA.calendar,"toggleTimePicker",!1,!0),u(zA.time,"toggleTimePicker",!0,!0);const p=t.flow[n.value];(p===zA.hours||p===zA.minutes||p===zA.seconds)&&u(p,"toggleTimePicker",!0,!0,p)};return{childMount:i,updateFlowStep:a,resetFlow:l,handleFlow:f,flowStep:n}},tN={key:1,class:"dp__input_wrap"},AN=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],nN={key:2,class:"dp--clear-btn"},rN=["aria-label"],oN=s.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...tu},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(t,{expose:e,emit:A}){const n=A,r=t,{defaultedTextInput:o,defaultedAriaLabels:i,defaultedInline:a,defaultedConfig:l,defaultedRange:u,defaultedMultiDates:f,defaultedUI:h,getDefaultPattern:p,getDefaultStartTime:g}=Gt(r),{checkMinMaxRange:B}=ei(r),y=s.ref(),b=s.ref(null),w=s.ref(!1),v=s.ref(!1),S=s.computed(()=>({dp__pointer:!r.disabled&&!r.readonly&&!o.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!o.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:w.value||r.isMenuOpen,dp__input_reg:!o.value.enabled,...h.value.input??{}})),F=()=>{n("set-input-date",null),r.clearable&&r.autoApply&&(n("set-empty-date"),y.value=null)},I=j=>{const Qe=g();return wO(j,o.value.format??p(),Qe??I0({},r.enableSeconds),r.inputValue,v.value,r.formatLocale)},Q=j=>{const{rangeSeparator:Qe}=o.value,[R,J]=j.split(`${Qe}`);if(R){const Ae=I(R.trim()),oe=J?I(J.trim()):void 0;if(ji(Ae,oe))return;const k=Ae&&oe?[Ae,oe]:[Ae];B(oe,k,0)&&(y.value=Ae?k:null)}},x=()=>{v.value=!0},M=j=>{if(u.value.enabled)Q(j);else if(f.value.enabled){const Qe=j.split(";");y.value=Qe.map(R=>I(R.trim())).filter(R=>R)}else y.value=I(j)},O=j=>{var Qe;const R=typeof j=="string"?j:(Qe=j.target)==null?void 0:Qe.value;R!==""?(o.value.openMenu&&!r.isMenuOpen&&n("open"),M(R),n("set-input-date",y.value)):F(),v.value=!1,n("update:input-value",R),n("text-input",j,y.value)},P=j=>{o.value.enabled?(M(j.target.value),o.value.enterSubmit&&hp(y.value)&&r.inputValue!==""?(n("set-input-date",y.value,!0),y.value=null):o.value.enterSubmit&&r.inputValue===""&&(y.value=null,n("clear"))):ue(j)},ie=(j,Qe)=>{o.value.enabled&&o.value.tabSubmit&&!Qe&&M(j.target.value),o.value.tabSubmit&&hp(y.value)&&r.inputValue!==""?(n("set-input-date",y.value,!0,!0),y.value=null):o.value.tabSubmit&&r.inputValue===""&&(y.value=null,n("clear",!0))},ae=()=>{w.value=!0,n("focus"),s.nextTick().then(()=>{var j;o.value.enabled&&o.value.selectOnFocus&&((j=b.value)==null||j.select())})},ue=j=>{if(Jo(j,l.value,!0),o.value.enabled&&o.value.openMenu&&!a.value.input){if(o.value.openMenu==="open"&&!r.isMenuOpen)return n("open");if(o.value.openMenu==="toggle")return n("toggle")}else o.value.enabled||n("toggle")},H=()=>{n("real-blur"),w.value=!1,(!r.isMenuOpen||a.value.enabled&&a.value.input)&&n("blur"),r.autoApply&&o.value.enabled&&y.value&&!r.isMenuOpen&&(n("set-input-date",y.value),n("select-date"),y.value=null)},G=j=>{Jo(j,l.value,!0),n("clear")},$=()=>{n("close")},te=j=>{if(j.key==="Tab"&&ie(j),j.key==="Enter"&&P(j),j.key==="Escape"&&o.value.escClose&&$(),!o.value.enabled){if(j.code==="Tab")return;j.preventDefault()}},ee=()=>{var j;(j=b.value)==null||j.focus({preventScroll:!0})},K=j=>{y.value=j},ce=j=>{j.key===Ht.tab&&ie(j,!0)};return e({focusInput:ee,setParsedDate:K}),(j,Qe)=>{var R,J,Ae;return s.openBlock(),s.createElementBlock("div",{onClick:ue},[j.$slots.trigger&&!j.$slots["dp-input"]&&!s.unref(a).enabled?s.renderSlot(j.$slots,"trigger",{key:0}):s.createCommentVNode("",!0),!j.$slots.trigger&&(!s.unref(a).enabled||s.unref(a).input)?(s.openBlock(),s.createElementBlock("div",tN,[j.$slots["dp-input"]&&!j.$slots.trigger&&(!s.unref(a).enabled||s.unref(a).enabled&&s.unref(a).input)?s.renderSlot(j.$slots,"dp-input",{key:0,value:t.inputValue,isMenuOpen:t.isMenuOpen,onInput:O,onEnter:P,onTab:ie,onClear:G,onBlur:H,onKeypress:te,onPaste:x,onFocus:ae,openMenu:()=>j.$emit("open"),closeMenu:()=>j.$emit("close"),toggleMenu:()=>j.$emit("toggle")}):s.createCommentVNode("",!0),j.$slots["dp-input"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("input",{key:1,id:j.uid?`dp-input-${j.uid}`:void 0,ref_key:"inputRef",ref:b,"data-test-id":"dp-input",name:j.name,class:s.normalizeClass(S.value),inputmode:s.unref(o).enabled?"text":"none",placeholder:j.placeholder,disabled:j.disabled,readonly:j.readonly,required:j.required,value:t.inputValue,autocomplete:j.autocomplete,"aria-label":(R=s.unref(i))==null?void 0:R.input,"aria-disabled":j.disabled||void 0,"aria-invalid":j.state===!1?!0:void 0,onInput:O,onBlur:H,onFocus:ae,onKeypress:te,onKeydown:Qe[0]||(Qe[0]=oe=>te(oe)),onPaste:x},null,42,AN)),s.createElementVNode("div",{onClick:Qe[3]||(Qe[3]=oe=>n("toggle"))},[j.$slots["input-icon"]&&!j.hideInputIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:Qe[1]||(Qe[1]=oe=>n("toggle"))},[s.renderSlot(j.$slots,"input-icon")])):s.createCommentVNode("",!0),!j.$slots["input-icon"]&&!j.hideInputIcon&&!j.$slots["dp-input"]?(s.openBlock(),s.createBlock(s.unref(qs),{key:1,"aria-label":(J=s.unref(i))==null?void 0:J.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:Qe[2]||(Qe[2]=oe=>n("toggle"))},null,8,["aria-label"])):s.createCommentVNode("",!0)]),j.$slots["clear-icon"]&&(j.alwaysClearable||t.inputValue&&j.clearable&&!j.disabled&&!j.readonly)?(s.openBlock(),s.createElementBlock("span",nN,[s.renderSlot(j.$slots,"clear-icon",{clear:G})])):s.createCommentVNode("",!0),!j.$slots["clear-icon"]&&(j.alwaysClearable||j.clearable&&t.inputValue&&!j.disabled&&!j.readonly)?(s.openBlock(),s.createElementBlock("button",{key:3,"aria-label":(Ae=s.unref(i))==null?void 0:Ae.clearInput,class:"dp--clear-btn",type:"button",onKeydown:Qe[4]||(Qe[4]=oe=>s.unref(on)(oe,()=>G(oe),!0,ce)),onClick:Qe[5]||(Qe[5]=s.withModifiers(oe=>G(oe),["prevent"]))},[s.createVNode(s.unref(m0),{class:"dp__input_icons","data-test-id":"clear-icon"})],40,rN)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])}}}),iN=typeof window<"u"?window:void 0,Qp=()=>{},sN=t=>s.getCurrentScope()?(s.onScopeDispose(t),!0):!1,aN=(t,e,A,n)=>{if(!t)return Qp;let r=Qp;const o=s.watch(()=>s.unref(t),a=>{r(),a&&(a.removeEventListener(e,A),a.addEventListener(e,A,n),r=()=>{a.removeEventListener(e,A,n),r=Qp})},{immediate:!0,flush:"post"}),i=()=>{o(),r()};return sN(i),i},lN=(t,e,A,n={})=>{const{window:r=iN,event:o="pointerdown"}=n;return r?aN(r,o,i=>{const a=BA(t),l=BA(e);!a||!l||a===i.target||i.composedPath().includes(a)||i.composedPath().includes(l)||A(i)},{passive:!0}):void 0},cN=["data-dp-mobile"],uN=s.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...tu},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=s.ref(!1),a=s.toRef(r,"modelValue"),l=s.toRef(r,"timezone"),u=s.ref(null),f=s.ref(null),h=s.ref(null),p=s.ref(!1),g=s.ref(null),B=s.ref(!1),y=s.ref(!1),b=s.ref(!1),w=s.ref(!1),{setMenuFocused:v,setShiftKey:S}=O0(),{clearArrowNav:F}=qo(),{validateDate:I,isValidTime:Q}=ei(r),{defaultedTransitions:x,defaultedTextInput:M,defaultedInline:O,defaultedConfig:P,defaultedRange:ie,defaultedMultiDates:ae}=Gt(r),{menuTransition:ue,showTransition:H}=gl(x),{isMobile:G}=W0(P),$=s.getCurrentInstance();s.onMounted(()=>{k(r.modelValue),s.nextTick().then(()=>{if(!O.value.enabled){const he=R(g.value);he?.addEventListener("scroll",be),window?.addEventListener("resize",_)}}),O.value.enabled&&(i.value=!0),window?.addEventListener("keyup",N),window?.addEventListener("keydown",ne)}),s.onUnmounted(()=>{if(!O.value.enabled){const he=R(g.value);he?.removeEventListener("scroll",be),window?.removeEventListener("resize",_)}window?.removeEventListener("keyup",N),window?.removeEventListener("keydown",ne)});const te=_n(o,"all",r.presetDates),ee=_n(o,"input");s.watch([a,l],()=>{k(a.value)},{deep:!0});const{openOnTop:K,menuStyle:ce,xCorrect:j,setMenuPosition:Qe,getScrollableParent:R,shadowRender:J}=XM({menuRef:u,menuRefInner:f,inputRef:h,pickerWrapperRef:g,inline:O,emit:n,props:r,slots:o}),{inputValue:Ae,internalModelValue:oe,parseExternalModelValue:k,emitModelValue:X,formatInputValue:Se,checkBeforeEmit:ht}=GO(n,r,p),se=s.computed(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:O.value.enabled,"dp--flex-display-collapsed":b.value,dp__flex_display_with_input:O.value.input})),Ye=s.computed(()=>r.dark?"dp__theme_dark":"dp__theme_light"),ge=s.computed(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||O.value.enabled}:{}),Ce=s.computed(()=>({class:"dp__outer_menu_wrap"})),D=s.computed(()=>O.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),ke=()=>{var he,xe;return((xe=(he=h.value)==null?void 0:he.$el)==null?void 0:xe.getBoundingClientRect())??{width:0,left:0,right:0}},be=()=>{i.value&&(P.value.closeOnScroll?kt():Qe())},_=()=>{var he;i.value&&Qe();const xe=((he=f.value)==null?void 0:he.$el.getBoundingClientRect().width)??0;b.value=document.body.offsetWidth<=xe},N=he=>{he.key==="Tab"&&!O.value.enabled&&!r.teleport&&P.value.tabOutClosesMenu&&(g.value.contains(document.activeElement)||kt()),y.value=he.shiftKey},ne=he=>{y.value=he.shiftKey},ve=()=>{!r.disabled&&!r.readonly&&(J($,z0,r),Qe(!1),i.value=!0,i.value&&n("open"),i.value||Ue(),k(r.modelValue))},ze=()=>{var he,xe;Ae.value="",Ue(),(he=f.value)==null||he.onValueCleared(),(xe=h.value)==null||xe.setParsedDate(null),n("update:model-value",null),n("update:model-timezone-value",null),n("cleared"),P.value.closeOnClearValue&&kt()},W=()=>{const he=oe.value;return!he||!Array.isArray(he)&&I(he)?!0:Array.isArray(he)?ae.value.enabled||he.length===2&&I(he[0])&&I(he[1])?!0:ie.value.partialRange&&!r.timePicker?I(he[0]):!1:!1},fe=()=>{ht()&&W()?(X(),kt()):n("invalid-select",oe.value)},q=he=>{me(),X(),P.value.closeOnAutoApply&&!he&&kt()},me=()=>{h.value&&M.value.enabled&&h.value.setParsedDate(oe.value)},Je=(he=!1)=>{r.autoApply&&Q(oe.value)&&W()&&(ie.value.enabled&&Array.isArray(oe.value)?(ie.value.partialRange||oe.value.length===2)&&q(he):q(he))},Ue=()=>{M.value.enabled||(oe.value=null)},kt=(he=!1)=>{var xe,He;he&&oe.value&&P.value.setDateOnMenuClose&&fe(),O.value.enabled||(i.value&&(i.value=!1,j.value=!1,v(!1),S(!1),F(),n("closed"),Ae.value&&k(a.value)),Ue(),n("blur"),(He=(xe=f.value)==null?void 0:xe.$el)==null||He.remove())},kA=(he,xe,He=!1)=>{if(!he){oe.value=null;return}const Or=Array.isArray(he)?!he.some(co=>!I(co)):I(he),ar=Q(he);Or&&ar?(w.value=!0,oe.value=he,xe?(B.value=He,fe(),n("text-submit")):r.autoApply&&Je(),s.nextTick().then(()=>{w.value=!1})):n("invalid-date",he)},Fn=()=>{r.autoApply&&Q(oe.value)&&X(),me()},tn=()=>i.value?kt():ve(),Mo=he=>{oe.value=he},lo=()=>{M.value.enabled&&(p.value=!0,Se()),n("focus")},Ds=()=>{if(M.value.enabled&&(p.value=!1,k(r.modelValue),B.value)){const he=gO(g.value,y.value);he?.focus()}n("blur")},Ls=he=>{f.value&&f.value.updateMonthYear(0,{month:w0(he.month),year:w0(he.year)})},Os=he=>{k(he??r.modelValue)},Z=(he,xe)=>{var He;(He=f.value)==null||He.switchView(he,xe)},Fe=(he,xe)=>P.value.onClickOutside?P.value.onClickOutside(he,xe):kt(!0),Ve=(he=0)=>{var xe;(xe=f.value)==null||xe.handleFlow(he)},At=()=>u;return lN(u,h,he=>Fe(W,he)),e({closeMenu:kt,selectDate:fe,clearValue:ze,openMenu:ve,onScroll:be,formatInputValue:Se,updateInternalModelValue:Mo,setMonthYear:Ls,parseModel:Os,switchView:Z,toggleMenu:tn,handleFlow:Ve,getDpWrapMenuRef:At}),(he,xe)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"pickerWrapperRef",ref:g,class:s.normalizeClass(se.value),"data-datepicker-instance":"","data-dp-mobile":s.unref(G)},[s.createVNode(oN,s.mergeProps({ref_key:"inputRef",ref:h,"input-value":s.unref(Ae),"onUpdate:inputValue":xe[0]||(xe[0]=He=>s.isRef(Ae)?Ae.value=He:null),"is-menu-open":i.value},he.$props,{onClear:ze,onOpen:ve,onSetInputDate:kA,onSetEmptyDate:s.unref(X),onSelectDate:fe,onToggle:tn,onClose:kt,onFocus:lo,onBlur:Ds,onRealBlur:xe[1]||(xe[1]=He=>p.value=!1),onTextInput:xe[2]||(xe[2]=He=>he.$emit("text-input",He))}),s.createSlots({_:2},[s.renderList(s.unref(ee),(He,Or)=>({name:He,fn:s.withCtx(ar=>[s.renderSlot(he.$slots,He,s.normalizeProps(s.guardReactiveProps(ar)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(s.openBlock(),s.createBlock(s.resolveDynamicComponent(he.teleport?s.Teleport:"div"),s.normalizeProps(s.guardReactiveProps(ge.value)),{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(ue)(s.unref(K)),css:s.unref(H)&&!s.unref(O).enabled},{default:s.withCtx(()=>[i.value?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:u},Ce.value,{class:{"dp--menu-wrapper":!s.unref(O).enabled},style:s.unref(O).enabled?void 0:s.unref(ce)}),[s.createVNode(z0,s.mergeProps({ref_key:"dpMenuRef",ref:f},he.$props,{"internal-model-value":s.unref(oe),"onUpdate:internalModelValue":xe[3]||(xe[3]=He=>s.isRef(oe)?oe.value=He:null),class:{[Ye.value]:!0,"dp--menu-wrapper":he.teleport},"open-on-top":s.unref(K),"no-overlay-focus":D.value,collapse:b.value,"get-input-rect":ke,"is-text-input-date":w.value,onClosePicker:kt,onSelectDate:fe,onAutoApply:Je,onTimeUpdate:Fn,onFlowStep:xe[4]||(xe[4]=He=>he.$emit("flow-step",He)),onUpdateMonthYear:xe[5]||(xe[5]=He=>he.$emit("update-month-year",He)),onInvalidSelect:xe[6]||(xe[6]=He=>he.$emit("invalid-select",s.unref(oe))),onAutoApplyInvalid:xe[7]||(xe[7]=He=>he.$emit("invalid-select",He)),onInvalidFixedRange:xe[8]||(xe[8]=He=>he.$emit("invalid-fixed-range",He)),onRecalculatePosition:s.unref(Qe),onTooltipOpen:xe[9]||(xe[9]=He=>he.$emit("tooltip-open",He)),onTooltipClose:xe[10]||(xe[10]=He=>he.$emit("tooltip-close",He)),onTimePickerOpen:xe[11]||(xe[11]=He=>he.$emit("time-picker-open",He)),onTimePickerClose:xe[12]||(xe[12]=He=>he.$emit("time-picker-close",He)),onAmPmChange:xe[13]||(xe[13]=He=>he.$emit("am-pm-change",He)),onRangeStart:xe[14]||(xe[14]=He=>he.$emit("range-start",He)),onRangeEnd:xe[15]||(xe[15]=He=>he.$emit("range-end",He)),onDateUpdate:xe[16]||(xe[16]=He=>he.$emit("date-update",He)),onInvalidDate:xe[17]||(xe[17]=He=>he.$emit("invalid-date",He)),onOverlayToggle:xe[18]||(xe[18]=He=>he.$emit("overlay-toggle",He)),onMenuBlur:xe[19]||(xe[19]=He=>he.$emit("blur"))}),s.createSlots({_:2},[s.renderList(s.unref(te),(He,Or)=>({name:He,fn:s.withCtx(ar=>[s.renderSlot(he.$slots,He,s.normalizeProps(s.guardReactiveProps({...ar})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):s.createCommentVNode("",!0)]),_:3},8,["name","css"])]),_:3},16))],10,cN))}}),ra=(()=>{const t=uN;return t.install=e=>{e.component("Vue3DatePicker",t)},t})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}))).forEach(([t,e])=>{t!=="default"&&(ra[t]=e)});/*!
1
+ (function(je,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(je=typeof globalThis<"u"?globalThis:je||self,s(je.AblokComponents={},je.Vue))})(this,(function(je,s){"use strict";const g_={class:"icon",preserveAspectRatio:"xMaxYMin"},B_=["xlink:href"],y_=s.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(e,A)=>(s.openBlock(),s.createElementBlock("i",{class:s.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(s.openBlock(),s.createElementBlock("svg",g_,[s.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,B_)]))],2))}}),w_={class:"loading-spinner d-block"},C_=s.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(e,A)=>(s.openBlock(),s.createElementBlock("span",w_,[A[0]||(A[0]=s.createElementVNode("span",{class:"loading-spinner__animation"},[s.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[s.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"},[s.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1)),s.renderSlot(e.$slots,"default")]))}}),b_=["src","alt"],v_=s.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}},setup(t){const e=s.ref(!1);return(A,n)=>{const r=s.resolveComponent("loading-spinner");return t.src?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["base-image",{"base-image--zoom":t.zoom}])},[t.spinner&&!e.value?(s.openBlock(),s.createBlock(r,{key:0})):s.createCommentVNode("",!0),s.createElementVNode("img",{class:s.normalizeClass(["",{"opacity-0":!e.value,"opacity-1":e.value}]),src:t.src,alt:t.alt,onLoad:n[0]||(n[0]=(()=>e.value=!0))},null,42,b_)],2)):s.createCommentVNode("",!0)}}}),E_=["innerHTML"],k_=s.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(t){const e=t,A=s.computed(()=>e.tag||"p");return(n,r)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(A.value),{class:s.normalizeClass(["headline",`${n.size} headline--${n.size}${n.className||""}`])},{default:s.withCtx(()=>[s.renderSlot(n.$slots,"default",{},()=>[s.createElementVNode("span",{class:"headline__text",innerHTML:n.text},null,8,E_)])]),_:3},8,["class"]))}}),S_=["innerHTML"],Q_=s.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(t){return(e,A)=>(s.openBlock(),s.createElementBlock("p",{class:s.normalizeClass(["base-paragraph",`${e.size||""} ${e.className||""}`]),innerHTML:e.text},null,10,S_))}});function Bt(){return Math.random().toString(16).slice(2)}const F_={class:"accordion-item"},U_=["id"],I_=["data-bs-target","aria-controls"],x_={class:"flex-grow-1"},T_=["id","aria-labelledby","data-bs-parent"],__=["innerHTML"],D_=s.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e;function r(){n("update:modelValue",!A.modelValue)}return(o,i)=>(s.openBlock(),s.createElementBlock("div",F_,[s.createElementVNode("div",{class:"accordion-header",id:`heading-${t.id}`},[s.createElementVNode("button",{class:s.normalizeClass(["accordion-button",!t.modelValue&&"collapsed"]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#target${t.id}`,"aria-expanded":"true","aria-controls":`target${t.id}`,onClick:r},[s.renderSlot(o.$slots,"toggle",{},()=>[s.createElementVNode("span",x_,s.toDisplayString(t.title),1)])],10,I_)],8,U_),s.createElementVNode("div",{class:s.normalizeClass(["accordion-collapse collapse",t.modelValue&&"show"]),id:`target${t.id}`,"aria-labelledby":`heading${t.id}`,"data-bs-parent":t.parent},[s.createElementVNode("div",{class:s.normalizeClass(["accordion-body",t.noPadding?"p-0":""])},[s.renderSlot(o.$slots,"body",{},()=>[s.createElementVNode("article",{innerHTML:t.body},null,8,__)])],2)],10,T_)]))}}),L_=(t,e)=>{const A=t.__vccOpts||t;for(const[n,r]of e)A[n]=r;return A},O_={},M_={class:"accordion"};function N_(t,e){return s.openBlock(),s.createElementBlock("div",M_,[s.renderSlot(t.$slots,"default")])}const H_=L_(O_,[["render",N_]]),R_=["type","disabled"],P_=s.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 e=t,A=s.computed(()=>e.caption&&!e.circle);return(n,r)=>{const o=s.resolveComponent("loading-spinner"),i=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("button",{type:t.type,disabled:t.disabled,class:s.normalizeClass(["btn",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,"rounded-circle":t.circle,[`btn-${t.color}`]:!t.outlined,[`btn-outline-${t.color}`]:t.outlined,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[t.pending?s.renderSlot(n.$slots,"pending-icon",{key:0},()=>[s.createVNode(o)]):s.createCommentVNode("",!0),s.renderSlot(n.$slots,"default",{},()=>[t.icon?(s.openBlock(),s.createBlock(i,{key:0,symbol:t.icon,class:"base-button__caption"},null,8,["symbol"])):s.createCommentVNode("",!0),A.value?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},s.toDisplayString(t.caption),3)):s.createCommentVNode("",!0)])],10,R_)}}}),V_={class:"input-group input__input-group"},$_=["type","id","name","placeholder","pattern","disabled","readonly","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],K_=["for","innerHTML"],G_=s.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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"}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.computed({get(){return A.modelValue},set(a){a=A.type==="number"?A.max&&Number(a)>A.max?A.max:A.min!==void 0&&Number(a)<A.min?A.min:Number(a):a,n("update:modelValue",a)}}),i=s.computed(()=>{if(A.type==="number"){const{min:a,max:l}=A;return{...a!==void 0?{min:a}:{},...l!==void 0?{max:l}:{}}}return{}});return s.onMounted(()=>{let a=l=>{o.value=typeof l.detail=="string"||typeof l.detail=="number"?`${l.detail}`:""};r.value.addEventListener("focusin",l=>{window.addEventListener("update-focussed-input",a)}),r.value.addEventListener("focusout",l=>{window.removeEventListener("update-focussed-input",a)})}),(a,l)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input",`input--${t.type}`])},[s.createElementVNode("div",V_,[s.renderSlot(a.$slots,"input-prepend",{slotScope:"props"}),s.withDirectives(s.createElementVNode("input",s.mergeProps({ref_key:"input",ref:r,"onUpdate:modelValue":l[0]||(l[0]=u=>o.value=u),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},i.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}),null,16,$_),[[s.vModelDynamic,o.value]]),s.renderSlot(a.$slots,"input-append",{slotScope:"props"})]),s.renderSlot(a.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id,class:s.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,K_)):s.createCommentVNode("",!0)])],2))}}),W_={class:"input input--textarea"},z_=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],Y_=["for","innerHTML"],J_=s.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",W_,[s.renderSlot(o.$slots,"input-prepend"),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),type:t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:s.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,z_),[[s.vModelText,r.value]]),s.renderSlot(o.$slots,"input-append"),s.renderSlot(o.$slots,"label",{},()=>[s.createElementVNode("label",{for:t.id,class:s.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,Y_)])]))}}),X_={class:"form-check input input--checkbox"},j_=["value","id","name","required","disabled","true-value","false-value"],q_=["for","innerHTML"],Z_=s.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:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue||A.checked},set(o){n("update:checked",o),n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",X_,[s.withDirectives(s.createElementVNode("input",{ref:"input","onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),value:t.value,id:t.id,name:t.name,type:"checkbox",required:t.required,disabled:t.disabled,class:"form-check-input","true-value":t.trueValue,"false-value":t.falseValue},null,8,j_),[[s.vModelCheckbox,r.value]]),s.createElementVNode("label",{class:"input__label form-check-label",for:t.id,innerHTML:t.label},null,8,q_),i[1]||(i[1]=s.createElementVNode("span",{class:"input__error"},"error",-1))]))}}),eD={class:"input-group input__input-group"},tD=["id","name","placeholder","pattern","disabled","read-only","required","aria-label"],AD=["for","innerHTML"],nD=s.defineComponent({__name:"input-datetime",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e,r=s.computed({get(){const o=A.modelValue&&new Date(`${A.modelValue}Z`),i=o&&new Date(o.getTime()+new Date().getTimezoneOffset()*-60*1e3).toISOString();return i&&i.replace("Z","")},set(o){const i=o&&new Date(o);o=i&&i.toISOString(),n("update:modelValue",o&&o.replace("Z",""))}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input",`input--${t.type}`])},[s.createElementVNode("div",eD,[s.renderSlot(o.$slots,"input-prepend",{slotScope:"props"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),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,tD),[[s.vModelText,r.value]]),s.renderSlot(o.$slots,"input-append",{slotScope:"props"})]),s.renderSlot(o.$slots,"label",{},()=>[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,AD)):s.createCommentVNode("",!0)])],2))}}),Mw=6048e5,rD=864e5,oD=6e4,Nw=36e5,iD=1e3,Hw=Symbol.for("constructDateFrom");function Qt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Hw in t?t[Hw](e):t instanceof Date?new t.constructor(e):new Date(e)}function $e(t,e){return Qt(e||t,t)}function Xn(t,e,A){const n=$e(t,A?.in);return isNaN(e)?Qt(A?.in||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function gr(t,e,A){const n=$e(t,A?.in);if(isNaN(e))return Qt(t,NaN);if(!e)return n;const r=n.getDate(),o=Qt(t,n.getTime());o.setMonth(n.getMonth()+e+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Rw(t,e,A){const{years:n=0,months:r=0,weeks:o=0,days:i=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=$e(t,A?.in),h=r||n?gr(f,r+n*12):f,p=i||o?Xn(h,i+o*7):h,g=l+a*60,y=(u+g*60)*1e3;return Qt(t,+p+y)}function sD(t,e,A){return Qt(t,+$e(t)+e)}function aD(t,e,A){return sD(t,e*Nw)}let lD={};function Yi(){return lD}function Br(t,e){const A=Yi(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,r=$e(t,e?.in),o=r.getDay(),i=(o<n?7:0)+o-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Ws(t,e){return Br(t,{...e,weekStartsOn:1})}function Pw(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=Qt(A,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Ws(r),i=Qt(A,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=Ws(i);return A.getTime()>=o.getTime()?n+1:A.getTime()>=a.getTime()?n:n-1}function Xc(t){const e=$e(t),A=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return A.setUTCFullYear(e.getFullYear()),+t-+A}function sl(t,...e){const A=Qt.bind(null,e.find(n=>typeof n=="object"));return e.map(A)}function Vw(t,e){const A=$e(t,e?.in);return A.setHours(0,0,0,0),A}function $w(t,e,A){const[n,r]=sl(A?.in,t,e),o=Vw(n),i=Vw(r),a=+o-Xc(o),l=+i-Xc(i);return Math.round((a-l)/rD)}function cD(t,e){const A=Pw(t,e),n=Qt(t,0);return n.setFullYear(A,0,4),n.setHours(0,0,0,0),Ws(n)}function uD(t,e,A){return gr(t,e*3,A)}function Gh(t,e,A){return gr(t,e*12,A)}function Kw(t,e){const A=+$e(t)-+$e(e);return A<0?-1:A>0?1:A}function Gw(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function al(t){return!(!Gw(t)&&typeof t!="number"||isNaN(+$e(t)))}function Ww(t,e){const A=$e(t,e?.in);return Math.trunc(A.getMonth()/3)+1}function dD(t,e,A){const[n,r]=sl(A?.in,t,e);return n.getFullYear()-r.getFullYear()}function fD(t,e,A){const[n,r]=sl(A?.in,t,e),o=Kw(n,r),i=Math.abs(dD(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=Kw(n,r)===-o,l=o*(i-+a);return l===0?0:l}function zw(t,e){const[A,n]=sl(t,e.start,e.end);return{start:A,end:n}}function Yw(t,e){const{start:A,end:n}=zw(e?.in,t);let r=+A>+n;const o=r?+A:+n,i=r?n:A;i.setHours(0,0,0,0);let a=1;const l=[];for(;+i<=o;)l.push(Qt(A,i)),i.setDate(i.getDate()+a),i.setHours(0,0,0,0);return r?l.reverse():l}function Ji(t,e){const A=$e(t,e?.in),n=A.getMonth(),r=n-n%3;return A.setMonth(r,1),A.setHours(0,0,0,0),A}function hD(t,e){const{start:A,end:n}=zw(e?.in,t);let r=+A>+n;const o=r?+Ji(A):+Ji(n);let i=Ji(r?n:A),a=1;const l=[];for(;+i<=o;)l.push(Qt(A,i)),i=uD(i,a);return r?l.reverse():l}function pD(t,e){const A=$e(t,e?.in);return A.setDate(1),A.setHours(0,0,0,0),A}function Jw(t,e){const A=$e(t,e?.in),n=A.getFullYear();return A.setFullYear(n+1,0,0),A.setHours(23,59,59,999),A}function ll(t,e){const A=$e(t,e?.in);return A.setFullYear(A.getFullYear(),0,1),A.setHours(0,0,0,0),A}function Xw(t,e){const A=Yi(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??A.weekStartsOn??A.locale?.options?.weekStartsOn??0,r=$e(t,e?.in),o=r.getDay(),i=(o<n?-7:0)+6-(o-n);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}function jw(t,e){const A=$e(t,e?.in),n=A.getMonth(),r=n-n%3+3;return A.setMonth(r,0),A.setHours(23,59,59,999),A}const 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"}},gD=(t,e,A)=>{let n;const r=mD[t];return typeof r=="string"?n=r:e===1?n=r.one:n=r.other.replace("{{count}}",e.toString()),A?.addSuffix?A.comparison&&A.comparison>0?"in "+n:n+" ago":n};function Wh(t){return(e={})=>{const A=e.width?String(e.width):t.defaultWidth;return t.formats[A]||t.formats[t.defaultWidth]}}const BD={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"},wD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CD={date:Wh({formats:BD,defaultWidth:"full"}),time:Wh({formats:yD,defaultWidth:"full"}),dateTime:Wh({formats:wD,defaultWidth:"full"})},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=(t,e,A,n)=>bD[t];function cl(t){return(e,A)=>{const n=A?.context?String(A.context):"standalone";let r;if(n==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,a=A?.width?String(A.width):i;r=t.formattingValues[a]||t.formattingValues[i]}else{const i=t.defaultWidth,a=A?.width?String(A.width):t.defaultWidth;r=t.values[a]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(e):e;return r[o]}}const ED={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kD={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SD={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"]},QD={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"]},FD={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"}},UD={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"}},ID={ordinalNumber:(t,e)=>{const A=Number(t),n=A%100;if(n>20||n<10)switch(n%10){case 1:return A+"st";case 2:return A+"nd";case 3:return A+"rd"}return A+"th"},era:cl({values:ED,defaultWidth:"wide"}),quarter:cl({values:kD,defaultWidth:"wide",argumentCallback:t=>t-1}),month:cl({values:SD,defaultWidth:"wide"}),day:cl({values:QD,defaultWidth:"wide"}),dayPeriod:cl({values:FD,defaultWidth:"wide",formattingValues:UD,defaultFormattingWidth:"wide"})};function ul(t){return(e,A={})=>{const n=A.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const i=o[0],a=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?TD(a,h=>h.test(i)):xD(a,h=>h.test(i));let u;u=t.valueCallback?t.valueCallback(l):l,u=A.valueCallback?A.valueCallback(u):u;const f=e.slice(i.length);return{value:u,rest:f}}}function xD(t,e){for(const A in t)if(Object.prototype.hasOwnProperty.call(t,A)&&e(t[A]))return A}function TD(t,e){for(let A=0;A<t.length;A++)if(e(t[A]))return A}function _D(t){return(e,A={})=>{const n=e.match(t.matchPattern);if(!n)return null;const r=n[0],o=e.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=A.valueCallback?A.valueCallback(i):i;const a=e.slice(r.length);return{value:i,rest:a}}}const DD=/^(\d+)(th|st|nd|rd)?/i,LD=/\d+/i,OD={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},MD={any:[/^b/i,/^(a|c)/i]},ND={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},HD={any:[/1/i,/2/i,/3/i,/4/i]},RD={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},PD={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]},VD={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]},KD={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},GD={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}},WD={ordinalNumber:_D({matchPattern:DD,parsePattern:LD,valueCallback:t=>parseInt(t,10)}),era:ul({matchPatterns:OD,defaultMatchWidth:"wide",parsePatterns:MD,defaultParseWidth:"any"}),quarter:ul({matchPatterns:ND,defaultMatchWidth:"wide",parsePatterns:HD,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ul({matchPatterns:RD,defaultMatchWidth:"wide",parsePatterns:PD,defaultParseWidth:"any"}),day:ul({matchPatterns:VD,defaultMatchWidth:"wide",parsePatterns:$D,defaultParseWidth:"any"}),dayPeriod:ul({matchPatterns:KD,defaultMatchWidth:"any",parsePatterns:GD,defaultParseWidth:"any"})},qw={code:"en-US",formatDistance:gD,formatLong:CD,formatRelative:vD,localize:ID,match:WD,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zD(t,e){const A=$e(t,e?.in);return $w(A,ll(A))+1}function zh(t,e){const A=$e(t,e?.in),n=+Ws(A)-+cD(A);return Math.round(n/Mw)+1}function Yh(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=Yi(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Qt(e?.in||t,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const a=Br(i,e),l=Qt(e?.in||t,0);l.setFullYear(n,0,o),l.setHours(0,0,0,0);const u=Br(l,e);return+A>=+a?n+1:+A>=+u?n:n-1}function YD(t,e){const A=Yi(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??A.firstWeekContainsDate??A.locale?.options?.firstWeekContainsDate??1,r=Yh(t,e),o=Qt(e?.in||t,0);return o.setFullYear(r,0,n),o.setHours(0,0,0,0),Br(o,e)}function Jh(t,e){const A=$e(t,e?.in),n=+Br(A,e)-+YD(A,e);return Math.round(n/Mw)+1}function Ft(t,e){const A=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return A+n}const zo={y(t,e){const A=t.getFullYear(),n=A>0?A:1-A;return Ft(e==="yy"?n%100:n,e.length)},M(t,e){const A=t.getMonth();return e==="M"?String(A+1):Ft(A+1,2)},d(t,e){return Ft(t.getDate(),e.length)},a(t,e){const A=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return A.toUpperCase();case"aaa":return A;case"aaaaa":return A[0];case"aaaa":default:return A==="am"?"a.m.":"p.m."}},h(t,e){return Ft(t.getHours()%12||12,e.length)},H(t,e){return Ft(t.getHours(),e.length)},m(t,e){return Ft(t.getMinutes(),e.length)},s(t,e){return Ft(t.getSeconds(),e.length)},S(t,e){const A=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,A-3));return Ft(r,e.length)}},zs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zw={G:function(t,e,A){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return A.era(n,{width:"abbreviated"});case"GGGGG":return A.era(n,{width:"narrow"});case"GGGG":default:return A.era(n,{width:"wide"})}},y:function(t,e,A){if(e==="yo"){const n=t.getFullYear(),r=n>0?n:1-n;return A.ordinalNumber(r,{unit:"year"})}return zo.y(t,e)},Y:function(t,e,A,n){const r=Yh(t,n),o=r>0?r:1-r;if(e==="YY"){const i=o%100;return Ft(i,2)}return e==="Yo"?A.ordinalNumber(o,{unit:"year"}):Ft(o,e.length)},R:function(t,e){const A=Pw(t);return Ft(A,e.length)},u:function(t,e){const A=t.getFullYear();return Ft(A,e.length)},Q:function(t,e,A){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ft(n,2);case"Qo":return A.ordinalNumber(n,{unit:"quarter"});case"QQQ":return A.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return A.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return A.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,A){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ft(n,2);case"qo":return A.ordinalNumber(n,{unit:"quarter"});case"qqq":return A.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return A.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return A.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,A){const n=t.getMonth();switch(e){case"M":case"MM":return zo.M(t,e);case"Mo":return A.ordinalNumber(n+1,{unit:"month"});case"MMM":return A.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return A.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return A.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,A){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ft(n+1,2);case"Lo":return A.ordinalNumber(n+1,{unit:"month"});case"LLL":return A.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return A.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return A.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,A,n){const r=Jh(t,n);return e==="wo"?A.ordinalNumber(r,{unit:"week"}):Ft(r,e.length)},I:function(t,e,A){const n=zh(t);return e==="Io"?A.ordinalNumber(n,{unit:"week"}):Ft(n,e.length)},d:function(t,e,A){return e==="do"?A.ordinalNumber(t.getDate(),{unit:"date"}):zo.d(t,e)},D:function(t,e,A){const n=zD(t);return e==="Do"?A.ordinalNumber(n,{unit:"dayOfYear"}):Ft(n,e.length)},E:function(t,e,A){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return A.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return A.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return A.day(n,{width:"short",context:"formatting"});case"EEEE":default:return A.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,A,n){const r=t.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Ft(o,2);case"eo":return A.ordinalNumber(o,{unit:"day"});case"eee":return A.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return A.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return A.day(r,{width:"short",context:"formatting"});case"eeee":default:return A.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,A,n){const r=t.getDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Ft(o,e.length);case"co":return A.ordinalNumber(o,{unit:"day"});case"ccc":return A.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return A.day(r,{width:"narrow",context:"standalone"});case"cccccc":return A.day(r,{width:"short",context:"standalone"});case"cccc":default:return A.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,A){const n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return Ft(r,e.length);case"io":return A.ordinalNumber(r,{unit:"day"});case"iii":return A.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return A.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return A.day(n,{width:"short",context:"formatting"});case"iiii":default:return A.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,A){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,A){const n=t.getHours();let r;switch(n===12?r=zs.noon:n===0?r=zs.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,A){const n=t.getHours();let r;switch(n>=17?r=zs.evening:n>=12?r=zs.afternoon:n>=4?r=zs.morning:r=zs.night,e){case"B":case"BB":case"BBB":return A.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return A.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return A.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,A){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),A.ordinalNumber(n,{unit:"hour"})}return zo.h(t,e)},H:function(t,e,A){return e==="Ho"?A.ordinalNumber(t.getHours(),{unit:"hour"}):zo.H(t,e)},K:function(t,e,A){const n=t.getHours()%12;return e==="Ko"?A.ordinalNumber(n,{unit:"hour"}):Ft(n,e.length)},k:function(t,e,A){let n=t.getHours();return n===0&&(n=24),e==="ko"?A.ordinalNumber(n,{unit:"hour"}):Ft(n,e.length)},m:function(t,e,A){return e==="mo"?A.ordinalNumber(t.getMinutes(),{unit:"minute"}):zo.m(t,e)},s:function(t,e,A){return e==="so"?A.ordinalNumber(t.getSeconds(),{unit:"second"}):zo.s(t,e)},S:function(t,e){return zo.S(t,e)},X:function(t,e,A){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return t0(n);case"XXXX":case"XX":return Xi(n);case"XXXXX":case"XXX":default:return Xi(n,":")}},x:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"x":return t0(n);case"xxxx":case"xx":return Xi(n);case"xxxxx":case"xxx":default:return Xi(n,":")}},O:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+e0(n,":");case"OOOO":default:return"GMT"+Xi(n,":")}},z:function(t,e,A){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+e0(n,":");case"zzzz":default:return"GMT"+Xi(n,":")}},t:function(t,e,A){const n=Math.trunc(+t/1e3);return Ft(n,e.length)},T:function(t,e,A){return Ft(+t,e.length)}};function e0(t,e=""){const A=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),o=n%60;return o===0?A+String(r):A+String(r)+e+Ft(o,2)}function t0(t,e){return t%60===0?(t>0?"-":"+")+Ft(Math.abs(t)/60,2):Xi(t,e)}function Xi(t,e=""){const A=t>0?"-":"+",n=Math.abs(t),r=Ft(Math.trunc(n/60),2),o=Ft(n%60,2);return A+r+e+o}const A0=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},n0=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Xh={p:n0,P:(t,e)=>{const A=t.match(/(P+)(p+)?/)||[],n=A[1],r=A[2];if(!r)return A0(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",A0(n,e)).replace("{{time}}",n0(r,e))}},JD=/^D+$/,XD=/^Y+$/,jD=["D","DD","YY","YYYY"];function r0(t){return JD.test(t)}function o0(t){return XD.test(t)}function jh(t,e,A){const n=qD(t,e,A);if(console.warn(n),jD.includes(t))throw new RangeError(n)}function qD(t,e,A){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${A}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ZD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tL=/^'([^]*?)'?$/,AL=/''/g,nL=/[a-zA-Z]/;function Pr(t,e,A){const n=Yi(),r=A?.locale??n.locale??qw,o=A?.firstWeekContainsDate??A?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=$e(t,A?.in);if(!al(a))throw new RangeError("Invalid time value");let l=e.match(eL).map(f=>{const h=f[0];if(h==="p"||h==="P"){const p=Xh[h];return p(f,r.formatLong)}return f}).join("").match(ZD).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const h=f[0];if(h==="'")return{isToken:!1,value:rL(f)};if(Zw[h])return{isToken:!0,value:f};if(h.match(nL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const u={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return l.map(f=>{if(!f.isToken)return f.value;const h=f.value;(!A?.useAdditionalWeekYearTokens&&o0(h)||!A?.useAdditionalDayOfYearTokens&&r0(h))&&jh(h,e,String(t));const p=Zw[h[0]];return p(a,h,r.localize,u)}).join("")}function rL(t){const e=t.match(tL);return e?e[1].replace(AL,"'"):t}function oL(t,e){return $e(t,e?.in).getDay()}function iL(t,e){const A=$e(t,e?.in),n=A.getFullYear(),r=A.getMonth(),o=Qt(A,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function sL(){return Object.assign({},Yi())}function mo(t,e){return $e(t,e?.in).getHours()}function aL(t,e){const A=$e(t,e?.in).getDay();return A===0?7:A}function Yo(t,e){return $e(t,e?.in).getMinutes()}function ut(t,e){return $e(t,e?.in).getMonth()}function Ys(t){return $e(t).getSeconds()}function qe(t,e){return $e(t,e?.in).getFullYear()}function ji(t,e){return+$e(t)>+$e(e)}function Js(t,e){return+$e(t)<+$e(e)}function Xs(t,e){return+$e(t)==+$e(e)}function lL(t,e){const A=cL(e)?new e(0):Qt(e,0);return A.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),A.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),A}function cL(t){return typeof t=="function"&&t.prototype?.constructor===t}const uL=10;class i0{subPriority=0;validate(e,A){return!0}}class dL extends i0{constructor(e,A,n,r,o){super(),this.value=e,this.validateValue=A,this.setValue=n,this.priority=r,o&&(this.subPriority=o)}validate(e,A){return this.validateValue(e,this.value,A)}set(e,A,n){return this.setValue(e,A,this.value,n)}}class fL extends i0{priority=uL;subPriority=-1;constructor(e,A){super(),this.context=e||(n=>Qt(A,n))}set(e,A){return A.timestampIsSet?e:Qt(e,lL(e,this.context))}}let Ct=class{run(e,A,n,r){const o=this.parse(e,A,n,r);return o?{setter:new dL(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,A,n){return!0}};class hL extends Ct{priority=140;parse(e,A,n){switch(A){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,A,n){return A.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const iA={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Vr={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function sA(t,e){return t&&{value:e(t.value),rest:t.rest}}function Xt(t,e){const A=e.match(t);return A?{value:parseInt(A[0],10),rest:e.slice(A[0].length)}:null}function $r(t,e){const A=e.match(t);if(!A)return null;if(A[0]==="Z")return{value:0,rest:e.slice(1)};const n=A[1]==="+"?1:-1,r=A[2]?parseInt(A[2],10):0,o=A[3]?parseInt(A[3],10):0,i=A[5]?parseInt(A[5],10):0;return{value:n*(r*Nw+o*oD+i*iD),rest:e.slice(A[0].length)}}function s0(t){return Xt(iA.anyDigitsSigned,t)}function eA(t,e){switch(t){case 1:return Xt(iA.singleDigit,e);case 2:return Xt(iA.twoDigits,e);case 3:return Xt(iA.threeDigits,e);case 4:return Xt(iA.fourDigits,e);default:return Xt(new RegExp("^\\d{1,"+t+"}"),e)}}function jc(t,e){switch(t){case 1:return Xt(iA.singleDigitSigned,e);case 2:return Xt(iA.twoDigitsSigned,e);case 3:return Xt(iA.threeDigitsSigned,e);case 4:return Xt(iA.fourDigitsSigned,e);default:return Xt(new RegExp("^-?\\d{1,"+t+"}"),e)}}function qh(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function a0(t,e){const A=e>0,n=A?e:1-e;let r;if(n<=50)r=t||100;else{const o=n+50,i=Math.trunc(o/100)*100,a=t>=o%100;r=t+i-(a?100:0)}return A?r:1-r}function l0(t){return t%400===0||t%4===0&&t%100!==0}class pL extends Ct{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,A,n){const r=o=>({year:o,isTwoDigitYear:A==="yy"});switch(A){case"y":return sA(eA(4,e),r);case"yo":return sA(n.ordinalNumber(e,{unit:"year"}),r);default:return sA(eA(A.length,e),r)}}validate(e,A){return A.isTwoDigitYear||A.year>0}set(e,A,n){const r=e.getFullYear();if(n.isTwoDigitYear){const i=a0(n.year,r);return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}const o=!("era"in A)||A.era===1?n.year:1-n.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class mL extends Ct{priority=130;parse(e,A,n){const r=o=>({year:o,isTwoDigitYear:A==="YY"});switch(A){case"Y":return sA(eA(4,e),r);case"Yo":return sA(n.ordinalNumber(e,{unit:"year"}),r);default:return sA(eA(A.length,e),r)}}validate(e,A){return A.isTwoDigitYear||A.year>0}set(e,A,n,r){const o=Yh(e,r);if(n.isTwoDigitYear){const a=a0(n.year,o);return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Br(e,r)}const i=!("era"in A)||A.era===1?n.year:1-n.year;return e.setFullYear(i,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Br(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class gL extends Ct{priority=130;parse(e,A){return jc(A==="R"?4:A.length,e)}set(e,A,n){const r=Qt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ws(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class BL extends Ct{priority=130;parse(e,A){return jc(A==="u"?4:A.length,e)}set(e,A,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class yL extends Ct{priority=120;parse(e,A,n){switch(A){case"Q":case"QQ":return eA(A.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=1&&A<=4}set(e,A,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class wL extends Ct{priority=120;parse(e,A,n){switch(A){case"q":case"qq":return eA(A.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=1&&A<=4}set(e,A,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class CL extends Ct{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,A,n){const r=o=>o-1;switch(A){case"M":return sA(Xt(iA.month,e),r);case"MM":return sA(eA(2,e),r);case"Mo":return sA(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class bL extends Ct{priority=110;parse(e,A,n){const r=o=>o-1;switch(A){case"L":return sA(Xt(iA.month,e),r);case"LL":return sA(eA(2,e),r);case"Lo":return sA(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function vL(t,e,A){const n=$e(t,A?.in),r=Jh(n,A)-e;return n.setDate(n.getDate()-r*7),$e(n,A?.in)}class EL extends Ct{priority=100;parse(e,A,n){switch(A){case"w":return Xt(iA.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return eA(A.length,e)}}validate(e,A){return A>=1&&A<=53}set(e,A,n,r){return Br(vL(e,n,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function kL(t,e,A){const n=$e(t,A?.in),r=zh(n,A)-e;return n.setDate(n.getDate()-r*7),n}class SL extends Ct{priority=100;parse(e,A,n){switch(A){case"I":return Xt(iA.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return eA(A.length,e)}}validate(e,A){return A>=1&&A<=53}set(e,A,n){return Ws(kL(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const QL=[31,28,31,30,31,30,31,31,30,31,30,31],FL=[31,29,31,30,31,30,31,31,30,31,30,31];class UL extends Ct{priority=90;subPriority=1;parse(e,A,n){switch(A){case"d":return Xt(iA.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return eA(A.length,e)}}validate(e,A){const n=e.getFullYear(),r=l0(n),o=e.getMonth();return r?A>=1&&A<=FL[o]:A>=1&&A<=QL[o]}set(e,A,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class IL extends Ct{priority=90;subpriority=1;parse(e,A,n){switch(A){case"D":case"DD":return Xt(iA.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return eA(A.length,e)}}validate(e,A){const n=e.getFullYear();return l0(n)?A>=1&&A<=366:A>=1&&A<=365}set(e,A,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Zh(t,e,A){const n=Yi(),r=A?.weekStartsOn??A?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=$e(t,A?.in),i=o.getDay(),l=(e%7+7)%7,u=7-r,f=e<0||e>6?e-(i+u)%7:(l+u)%7-(i+u)%7;return Xn(o,f,A)}class xL extends Ct{priority=90;parse(e,A,n){switch(A){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class TL extends Ct{priority=90;parse(e,A,n,r){const o=i=>{const a=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+a};switch(A){case"e":case"ee":return sA(eA(A.length,e),o);case"eo":return sA(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _L extends Ct{priority=90;parse(e,A,n,r){const o=i=>{const a=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+a};switch(A){case"c":case"cc":return sA(eA(A.length,e),o);case"co":return sA(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,A){return A>=0&&A<=6}set(e,A,n,r){return e=Zh(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function DL(t,e,A){const n=$e(t,A?.in),r=aL(n,A),o=e-r;return Xn(n,o,A)}class LL extends Ct{priority=90;parse(e,A,n){const r=o=>o===0?7:o;switch(A){case"i":case"ii":return eA(A.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return sA(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return sA(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return sA(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return sA(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,A){return A>=1&&A<=7}set(e,A,n){return e=DL(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class OL extends Ct{priority=80;parse(e,A,n){switch(A){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class ML extends Ct{priority=80;parse(e,A,n){switch(A){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class NL extends Ct{priority=80;parse(e,A,n){switch(A){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,A,n){return e.setHours(qh(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class HL extends Ct{priority=70;parse(e,A,n){switch(A){case"h":return Xt(iA.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return eA(A.length,e)}}validate(e,A){return A>=1&&A<=12}set(e,A,n){const r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class RL extends Ct{priority=70;parse(e,A,n){switch(A){case"H":return Xt(iA.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return eA(A.length,e)}}validate(e,A){return A>=0&&A<=23}set(e,A,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class PL extends Ct{priority=70;parse(e,A,n){switch(A){case"K":return Xt(iA.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return eA(A.length,e)}}validate(e,A){return A>=0&&A<=11}set(e,A,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class VL extends Ct{priority=70;parse(e,A,n){switch(A){case"k":return Xt(iA.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return eA(A.length,e)}}validate(e,A){return A>=1&&A<=24}set(e,A,n){const r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class $L extends Ct{priority=60;parse(e,A,n){switch(A){case"m":return Xt(iA.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return eA(A.length,e)}}validate(e,A){return A>=0&&A<=59}set(e,A,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}class KL extends Ct{priority=50;parse(e,A,n){switch(A){case"s":return Xt(iA.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return eA(A.length,e)}}validate(e,A){return A>=0&&A<=59}set(e,A,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class GL extends Ct{priority=30;parse(e,A){const n=r=>Math.trunc(r*Math.pow(10,-A.length+3));return sA(eA(A.length,e),n)}set(e,A,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class WL extends Ct{priority=10;parse(e,A){switch(A){case"X":return $r(Vr.basicOptionalMinutes,e);case"XX":return $r(Vr.basic,e);case"XXXX":return $r(Vr.basicOptionalSeconds,e);case"XXXXX":return $r(Vr.extendedOptionalSeconds,e);case"XXX":default:return $r(Vr.extended,e)}}set(e,A,n){return A.timestampIsSet?e:Qt(e,e.getTime()-Xc(e)-n)}incompatibleTokens=["t","T","x"]}class zL extends Ct{priority=10;parse(e,A){switch(A){case"x":return $r(Vr.basicOptionalMinutes,e);case"xx":return $r(Vr.basic,e);case"xxxx":return $r(Vr.basicOptionalSeconds,e);case"xxxxx":return $r(Vr.extendedOptionalSeconds,e);case"xxx":default:return $r(Vr.extended,e)}}set(e,A,n){return A.timestampIsSet?e:Qt(e,e.getTime()-Xc(e)-n)}incompatibleTokens=["t","T","X"]}class YL extends Ct{priority=40;parse(e){return s0(e)}set(e,A,n){return[Qt(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class JL extends Ct{priority=20;parse(e){return s0(e)}set(e,A,n){return[Qt(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const XL={G:new hL,y:new pL,Y:new mL,R:new gL,u:new BL,Q:new yL,q:new wL,M:new CL,L:new bL,w:new EL,I:new SL,d:new UL,D:new IL,E:new xL,e:new TL,c:new _L,i:new LL,a:new OL,b:new ML,B:new NL,h:new HL,H:new RL,K:new PL,k:new VL,m:new $L,s:new KL,S:new GL,X:new WL,x:new zL,t:new YL,T:new JL},jL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZL=/^'([^]*?)'?$/,eO=/''/g,tO=/\S/,AO=/[a-zA-Z]/;function ep(t,e,A,n){const r=()=>Qt(n?.in||A,NaN),o=sL(),i=n?.locale??o.locale??qw,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!e)return t?r():$e(A,n?.in);const u={firstWeekContainsDate:a,weekStartsOn:l,locale:i},f=[new fL(n?.in,A)],h=e.match(qL).map(b=>{const w=b[0];if(w in Xh){const v=Xh[w];return v(b,i.formatLong)}return b}).join("").match(jL),p=[];for(let b of h){!n?.useAdditionalWeekYearTokens&&o0(b)&&jh(b,e,t),!n?.useAdditionalDayOfYearTokens&&r0(b)&&jh(b,e,t);const w=b[0],v=XL[w];if(v){const{incompatibleTokens:S}=v;if(Array.isArray(S)){const I=p.find(Q=>S.includes(Q.token)||Q.token===w);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${b}\` at the same time`)}else if(v.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);p.push({token:w,fullToken:b});const F=v.run(t,b,i.match,u);if(!F)return r();f.push(F.setter),t=F.rest}else{if(w.match(AO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(b==="''"?b="'":w==="'"&&(b=nO(b)),t.indexOf(b)===0)t=t.slice(b.length);else return r()}}if(t.length>0&&tO.test(t))return r();const g=f.map(b=>b.priority).sort((b,w)=>w-b).filter((b,w,v)=>v.indexOf(b)===w).map(b=>f.filter(w=>w.priority===b).sort((w,v)=>v.subPriority-w.subPriority)).map(b=>b[0]);let B=$e(A,n?.in);if(isNaN(+B))return r();const y={};for(const b of g){if(!b.validate(B,u))return r();const w=b.set(B,y,u);Array.isArray(w)?(B=w[0],Object.assign(y,w[1])):B=w}return B}function nO(t){return t.match(ZL)[1].replace(eO,"'")}function c0(t,e,A){const[n,r]=sl(A?.in,t,e);return+Ji(n)==+Ji(r)}function u0(t,e,A){return Xn(t,-e,A)}function d0(t,e,A){const n=$e(t,A?.in),r=n.getFullYear(),o=n.getDate(),i=Qt(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=iL(i);return n.setMonth(e,Math.min(o,a)),n}function Tt(t,e,A){let n=$e(t,A?.in);return isNaN(+n)?Qt(t,NaN):(e.year!=null&&n.setFullYear(e.year),e.month!=null&&(n=d0(n,e.month)),e.date!=null&&n.setDate(e.date),e.hours!=null&&n.setHours(e.hours),e.minutes!=null&&n.setMinutes(e.minutes),e.seconds!=null&&n.setSeconds(e.seconds),e.milliseconds!=null&&n.setMilliseconds(e.milliseconds),n)}function rO(t,e,A){const n=$e(t,A?.in);return n.setHours(e),n}function f0(t,e,A){const n=$e(t,A?.in);return n.setMilliseconds(e),n}function oO(t,e,A){const n=$e(t,A?.in);return n.setMinutes(e),n}function h0(t,e,A){const n=$e(t,A?.in);return n.setSeconds(e),n}function Kr(t,e,A){const n=$e(t,A?.in);return isNaN(+n)?Qt(t,NaN):(n.setFullYear(e),n)}function js(t,e,A){return gr(t,-e,A)}function iO(t,e,A){const{years:n=0,months:r=0,weeks:o=0,days:i=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=js(t,r+n*12,A),h=u0(f,i+o*7,A),p=l+a*60,B=(u+p*60)*1e3;return Qt(t,+h-B)}function p0(t,e,A){return Gh(t,-e,A)}function qs(){const t=s.useAttrs();return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...t},[s.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),s.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),s.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),s.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}qs.compatConfig={MODE:3};function m0(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),s.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}m0.compatConfig={MODE:3};function tp(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}tp.compatConfig={MODE:3};function Ap(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}Ap.compatConfig={MODE:3};function np(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),s.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}np.compatConfig={MODE:3};function rp(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}rp.compatConfig={MODE:3};function op(){return s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[s.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}op.compatConfig={MODE:3};const wn=(t,e)=>e?new Date(t.toLocaleString("en-US",{timeZone:e})):new Date(t),ip=(t,e,A)=>sp(t,e,A)||ye(),sO=(t,e,A)=>{const n=e.dateInTz?wn(new Date(t),e.dateInTz):ye(t);return A?UA(n,!0):n},sp=(t,e,A)=>{if(!t)return null;const n=A?UA(ye(t),!0):ye(t);return e?e.exactMatch?sO(t,e,A):wn(n,e.timezone):n},aO=t=>{const e=new Date(t.getFullYear(),0,1).getTimezoneOffset();return t.getTimezoneOffset()<e},lO=(t,e)=>{if(!t)return 0;const A=new Date,n=new Date(A.toLocaleString("en-US",{timeZone:"UTC"})),r=new Date(A.toLocaleString("en-US",{timeZone:t})),o=(aO(e??r)?r:e??r).getTimezoneOffset()/60;return(+n-+r)/(1e3*60*60)-o};var yr=(t=>(t.month="month",t.year="year",t))(yr||{}),wr=(t=>(t.top="top",t.bottom="bottom",t))(wr||{}),qi=(t=>(t.header="header",t.calendar="calendar",t.timePicker="timePicker",t))(qi||{}),zA=(t=>(t.month="month",t.year="year",t.calendar="calendar",t.time="time",t.minutes="minutes",t.hours="hours",t.seconds="seconds",t))(zA||{});const cO=["timestamp","date","iso"];var rn=(t=>(t.up="up",t.down="down",t.left="left",t.right="right",t))(rn||{}),Ht=(t=>(t.arrowUp="ArrowUp",t.arrowDown="ArrowDown",t.arrowLeft="ArrowLeft",t.arrowRight="ArrowRight",t.enter="Enter",t.space=" ",t.esc="Escape",t.tab="Tab",t.home="Home",t.end="End",t.pageUp="PageUp",t.pageDown="PageDown",t))(Ht||{}),Zs=(t=>(t.MONTH_AND_YEAR="MM-yyyy",t.YEAR="yyyy",t.DATE="dd-MM-yyyy",t))(Zs||{});function g0(t){return e=>{const A=new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`));return t==="ar"?A.slice(2,5):A.slice(0,2)}}function uO(t){return e=>Pr(wn(new Date(`2017-01-0${e}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:t})}const dO=(t,e,A)=>{const n=[1,2,3,4,5,6,7];let r;if(t!==null)try{r=n.map(uO(t))}catch{r=n.map(g0(e))}else r=n.map(g0(e));const o=r.slice(0,A),i=r.slice(A+1,r.length);return[r[A]].concat(...i).concat(...o)},ap=(t,e,A)=>{const n=[];for(let r=+t[0];r<=+t[1];r++)n.push({value:+r,text:v0(r,e)});return A?n.reverse():n},B0=(t,e,A)=>{const n=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const i=o<10?`0${o}`:o;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(t!==null)try{const o=A==="long"?"LLLL":"LLL";return n.map((i,a)=>{const l=Pr(wn(i,"UTC"),o,{locale:t});return{text:l.charAt(0).toUpperCase()+l.substring(1),value:a}})}catch{}const r=new Intl.DateTimeFormat(e,{month:A,timeZone:"UTC"});return n.map((o,i)=>{const a=r.format(o);return{text:a.charAt(0).toUpperCase()+a.substring(1),value:i}})},fO=t=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][t],BA=t=>{const e=s.unref(t);return e!=null&&e.$el?e?.$el:e},hO=t=>({type:"dot",...t??{}}),y0=t=>Array.isArray(t)?!!t[0]&&!!t[1]:!1,lp={prop:t=>`"${t}" prop must be enabled!`,dateArr:t=>`You need to use array as "model-value" binding in order to support "${t}"`},FA=t=>t,w0=t=>t===0?t:!t||isNaN(+t)?null:+t,C0=t=>t===null,b0=t=>{if(t)return[...t.querySelectorAll("input, button, select, textarea, a[href]")][0]},pO=t=>{const e=[],A=n=>n.filter(r=>r);for(let n=0;n<t.length;n+=3){const r=[t[n],t[n+1],t[n+2]];e.push(A(r))}return e},dl=(t,e,A)=>{const n=A!=null,r=e!=null;if(!n&&!r)return!1;const o=+A,i=+e;return n&&r?+t>o||+t<i:n?+t>o:r?+t<i:!1},ea=(t,e)=>pO(t).map(A=>A.map(n=>{const{active:r,disabled:o,isBetween:i,highlighted:a}=e(n);return{...n,active:r,disabled:o,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&r,dp__cell_in_between:i,"dp--highlighted":a}}})),Jo=(t,e,A=!1)=>{t&&e.allowStopPropagation&&(A&&t.stopImmediatePropagation(),t.stopPropagation())},mO=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function gO(t,e){let A=[...document.querySelectorAll(mO())];A=A.filter(r=>!t.contains(r)||r.hasAttribute("data-datepicker-instance"));const n=A.indexOf(t);if(n>=0&&(e?n-1>=0:n+1<=A.length))return A[n+(e?-1:1)]}const cp=(t,e)=>t?.querySelector(`[data-dp-element="${e}"]`),v0=(t,e)=>new Intl.NumberFormat(e,{useGrouping:!1,style:"decimal"}).format(t),up=(t,e)=>Pr(t,e??Zs.DATE),dp=t=>Array.isArray(t),qc=(t,e,A)=>e.get(up(t,A)),BO=(t,e)=>t?e?e instanceof Map?!!qc(t,e):e(ye(t)):!1:!0,on=(t,e,A=!1,n)=>{if(t.key===Ht.enter||t.key===Ht.space)return A&&t.preventDefault(),e();if(n)return n(t)},yO=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,E0=(t,e)=>t?Zs.MONTH_AND_YEAR:e?Zs.YEAR:Zs.DATE,k0=t=>t<10?`0${t}`:t,S0=(t,e,A,n,r,o)=>{const i=ep(t,e.slice(0,t.length),new Date,{locale:o});return al(i)&&Gw(i)?n||r?i:Tt(i,{hours:+A.hours,minutes:+A?.minutes,seconds:+A?.seconds,milliseconds:0}):null},wO=(t,e,A,n,r,o)=>{const i=Array.isArray(A)?A[0]:A;if(typeof e=="string")return S0(t,e,i,n,r,o);if(Array.isArray(e)){let a=null;for(const l of e)if(a=S0(t,l,i,n,r,o),a)break;return a}return typeof e=="function"?e(t):null},ye=t=>t?new Date(t):new Date,CO=(t,e,A)=>{if(e){const r=(t.getMonth()+1).toString().padStart(2,"0"),o=t.getDate().toString().padStart(2,"0"),i=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),l=A?t.getSeconds().toString().padStart(2,"0"):"00";return`${t.getFullYear()}-${r}-${o}T${i}:${a}:${l}.000Z`}const n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());return new Date(n).toISOString()},UA=(t,e)=>{const A=ye(JSON.parse(JSON.stringify(t))),n=Tt(A,{hours:0,minutes:0,seconds:0,milliseconds:0});return e?pD(n):n},Xo=(t,e,A,n)=>{let r=t?ye(t):ye();return(e||e===0)&&(r=rO(r,+e)),(A||A===0)&&(r=oO(r,+A)),(n||n===0)&&(r=h0(r,+n)),f0(r,0)},tA=(t,e)=>!t||!e?!1:Js(UA(t),UA(e)),dt=(t,e)=>!t||!e?!1:Xs(UA(t),UA(e)),aA=(t,e)=>!t||!e?!1:ji(UA(t),UA(e)),fl=(t,e,A)=>t!=null&&t[0]&&t!=null&&t[1]?aA(A,t[0])&&tA(A,t[1]):t!=null&&t[0]&&e?aA(A,t[0])&&tA(A,e)||tA(A,t[0])&&aA(A,e):!1,Cr=t=>{const e=Tt(new Date(t),{date:1});return UA(e)},fp=(t,e,A)=>e&&(A||A===0)?Object.fromEntries(["hours","minutes","seconds"].map(n=>n===e?[n,A]:[n,isNaN(+t[n])?void 0:+t[n]])):{hours:isNaN(+t.hours)?void 0:+t.hours,minutes:isNaN(+t.minutes)?void 0:+t.minutes,seconds:isNaN(+t.seconds)?void 0:+t.seconds},Zi=t=>({hours:mo(t),minutes:Yo(t),seconds:Ys(t)}),Q0=(t,e)=>{if(e){const A=qe(ye(e));if(A>t)return 12;if(A===t)return ut(ye(e))}},F0=(t,e)=>{if(e){const A=qe(ye(e));return A<t?-1:A===t?ut(ye(e)):void 0}},ta=t=>{if(t)return qe(ye(t))},U0=(t,e)=>{const A=aA(t,e)?e:t,n=aA(e,t)?e:t;return Yw({start:A,end:n})},bO=t=>{const e=gr(t,1);return{month:ut(e),year:qe(e)}},go=(t,e)=>{const A=Br(t,{weekStartsOn:+e}),n=Xw(t,{weekStartsOn:+e});return[A,n]},I0=(t,e)=>{const A={hours:mo(ye()),minutes:Yo(ye()),seconds:e?Ys(ye()):0};return Object.assign(A,t)},jo=(t,e,A)=>[Tt(ye(t),{date:1}),Tt(ye(),{month:e,year:A,date:1})],Bo=(t,e,A)=>{let n=t?ye(t):ye();return(e||e===0)&&(n=d0(n,e)),A&&(n=Kr(n,A)),n},x0=(t,e,A,n,r)=>{if(!n||r&&!e||!r&&!A)return!1;const o=r?gr(t,1):js(t,1),i=[ut(o),qe(o)];return r?!EO(...i,e):!vO(...i,A)},vO=(t,e,A)=>tA(...jo(A,t,e))||dt(...jo(A,t,e)),EO=(t,e,A)=>aA(...jo(A,t,e))||dt(...jo(A,t,e)),T0=(t,e,A,n,r,o,i)=>{if(typeof e=="function"&&!i)return e(t);const a=A?{locale:A}:void 0;return Array.isArray(t)?`${Pr(t[0],o,a)}${r&&!t[1]?"":n}${t[1]?Pr(t[1],o,a):""}`:Pr(t,o,a)},Aa=t=>{if(t)return null;throw new Error(lp.prop("partial-range"))},Zc=(t,e)=>{if(e)return t();throw new Error(lp.prop("range"))},hp=t=>Array.isArray(t)?al(t[0])&&(t[1]?al(t[1]):!0):t?al(t):!1,kO=(t,e)=>Tt(e??ye(),{hours:+t.hours||0,minutes:+t.minutes||0,seconds:+t.seconds||0}),pp=(t,e,A,n)=>{if(!t)return!0;if(n){const r=A==="max"?Js(t,e):ji(t,e),o={seconds:0,milliseconds:0};return r||Xs(Tt(t,o),Tt(e,o))}return A==="max"?t.getTime()<=e.getTime():t.getTime()>=e.getTime()},mp=(t,e,A)=>t?kO(t,e):ye(A??e),_0=(t,e,A,n,r)=>{if(Array.isArray(n)){const i=mp(t,n[0],e),a=mp(t,n[1],e);return pp(n[0],i,A,!!e)&&pp(n[1],a,A,!!e)&&r}const o=mp(t,n,e);return pp(n,o,A,!!e)&&r},gp=t=>Tt(ye(),Zi(t)),SO=(t,e,A)=>{if(t instanceof Map){const n=`${k0(A+1)}-${e}`;return t.size?t.has(n):!1}return typeof t=="function"?t(UA(Tt(ye(),{month:A,year:e}),!0)):!1},QO=(t,e,A)=>{if(t instanceof Map){const n=`${k0(A+1)}-${e}`;return t.size?t.has(n):!0}return!0},D0=(t,e,A)=>typeof t=="function"?t({month:e,year:A}):!!t.months.find(n=>n.month===e&&n.year===A),Bp=(t,e)=>typeof t=="function"?t(e):t.years.includes(e),yp=t=>`dp-${Pr(t,"yyyy-MM-dd")}`,L0=(t,e)=>{const A=u0(UA(e),t),n=Xn(UA(e),t);return{before:A,after:n}},hl=s.reactive({menuFocused:!1,shiftKeyInMenu:!1}),O0=()=>{const t=A=>{hl.menuFocused=A},e=A=>{hl.shiftKeyInMenu!==A&&(hl.shiftKeyInMenu=A)};return{control:s.computed(()=>({shiftKeyInMenu:hl.shiftKeyInMenu,menuFocused:hl.menuFocused})),setMenuFocused:t,setShiftKey:e}},Rt=s.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),wp=s.ref(null),eu=s.ref(!1),Cp=s.ref(!1),bp=s.ref(!1),vp=s.ref(!1),YA=s.ref(0),lA=s.ref(0),qo=()=>{const t=s.computed(()=>eu.value?[...Rt.selectionGrid,Rt.actionRow].filter(h=>h.length):Cp.value?[...Rt.timePicker[0],...Rt.timePicker[1],vp.value?[]:[wp.value],Rt.actionRow].filter(h=>h.length):bp.value?[...Rt.monthPicker,Rt.actionRow]:[Rt.monthYear,...Rt.calendar,Rt.time,Rt.actionRow].filter(h=>h.length)),e=h=>{YA.value=h?YA.value+1:YA.value-1;let p=null;t.value[lA.value]&&(p=t.value[lA.value][YA.value]),!p&&t.value[lA.value+(h?1:-1)]?(lA.value=lA.value+(h?1:-1),YA.value=h?0:t.value[lA.value].length-1):p||(YA.value=h?YA.value-1:YA.value+1)},A=h=>{lA.value===0&&!h||lA.value===t.value.length&&h||(lA.value=h?lA.value+1:lA.value-1,t.value[lA.value]?t.value[lA.value]&&!t.value[lA.value][YA.value]&&YA.value!==0&&(YA.value=t.value[lA.value].length-1):lA.value=h?lA.value-1:lA.value+1)},n=h=>{let p=null;t.value[lA.value]&&(p=t.value[lA.value][YA.value]),p?p.focus({preventScroll:!eu.value}):YA.value=h?YA.value-1:YA.value+1},r=()=>{e(!0),n(!0)},o=()=>{e(!1),n(!1)},i=()=>{A(!1),n(!0)},a=()=>{A(!0),n(!0)},l=(h,p)=>{Rt[p]=h},u=(h,p)=>{Rt[p]=h},f=()=>{YA.value=0,lA.value=0};return{buildMatrix:l,buildMultiLevelMatrix:u,setTimePickerBackRef:h=>{wp.value=h},setSelectionGrid:h=>{eu.value=h,f(),h||(Rt.selectionGrid=[])},setTimePicker:(h,p=!1)=>{Cp.value=h,vp.value=p,f(),h||(Rt.timePicker[0]=[],Rt.timePicker[1]=[])},setTimePickerElements:(h,p=0)=>{Rt.timePicker[p]=h},arrowRight:r,arrowLeft:o,arrowUp:i,arrowDown:a,clearArrowNav:()=>{Rt.monthYear=[],Rt.calendar=[],Rt.time=[],Rt.actionRow=[],Rt.selectionGrid=[],Rt.timePicker[0]=[],Rt.timePicker[1]=[],eu.value=!1,Cp.value=!1,vp.value=!1,bp.value=!1,f(),wp.value=null},setMonthPicker:h=>{bp.value=h,f()},refSets:Rt}},M0=t=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...t??{}}),FO=t=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:e=>`Month picker${e?" overlay":""}`,yearPicker:e=>`Year picker${e?" overlay":""}`,timeOverlay:e=>`${e} overlay`,...t??{}}),N0=t=>t?typeof t=="boolean"?t?2:0:+t>=2?+t:2:0,UO=t=>{const e=typeof t=="object"&&t,A={static:!0,solo:!1};if(!t)return{...A,count:N0(!1)};const n=e?t:{},r=e?n.count??!0:t,o=N0(r);return Object.assign(A,n,{count:o})},IO=(t,e,A)=>t||(typeof A=="string"?A:e),xO=t=>typeof t=="boolean"?t?M0({}):!1:M0(t),TO=t=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - ",escClose:!0};return typeof t=="object"?{...e,...t??{},enabled:!0}:{...e,enabled:t}},_O=t=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...t??{}}),DO=t=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...t??{}}),LO=t=>{const e={input:!1};return typeof t=="object"?{...e,...t??{},enabled:!0}:{enabled:t,...e}},OO=t=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,mobileBreakpoint:600,setDateOnMenuClose:!1,...t??{}}),MO=t=>{const e={dates:Array.isArray(t)?t.map(A=>ye(A)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof t=="function"?t:{...e,...t??{}}},NO=t=>typeof t=="object"?{type:t?.type??"local",hideOnOffsetDates:t?.hideOnOffsetDates??!1}:{type:t,hideOnOffsetDates:!1},HO=t=>{const e={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof t=="object"?{enabled:!0,...e,...t}:{enabled:t,...e}},RO=t=>t?typeof t=="string"?{timezone:t,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:t.timezone,exactMatch:t.exactMatch??!1,dateInTz:t.dateInTz??void 0,emitTimezone:t.emitTimezone??void 0,convertModel:t.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},Ep=(t,e,A,n)=>new Map(t.map(r=>{const o=ip(r,e,n);return[up(o,A),o]})),PO=(t,e)=>t.length?new Map(t.map(A=>{const n=ip(A.date,e);return[up(n,Zs.DATE),A]})):null,VO=t=>{var e;const A=E0(t.isMonthPicker,t.isYearPicker);return{minDate:sp(t.minDate,t.timezone,t.isSpecific),maxDate:sp(t.maxDate,t.timezone,t.isSpecific),disabledDates:dp(t.disabledDates)?Ep(t.disabledDates,t.timezone,A,t.isSpecific):t.disabledDates,allowedDates:dp(t.allowedDates)?Ep(t.allowedDates,t.timezone,A,t.isSpecific):null,highlight:typeof t.highlight=="object"&&dp((e=t.highlight)==null?void 0:e.dates)?Ep(t.highlight.dates,t.timezone,A):t.highlight,markers:PO(t.markers,t.timezone)}},$O=t=>typeof t=="boolean"?{enabled:t,dragSelect:!0,limit:null}:{enabled:!!t,limit:t.limit?+t.limit:null,dragSelect:t.dragSelect??!0},KO=t=>({...Object.fromEntries(Object.keys(t).map(e=>{const A=e,n=t[A],r=typeof t[A]=="string"?{[n]:!0}:Object.fromEntries(n.map(o=>[o,!0]));return[e,r]}))}),Gt=t=>{const e=()=>{const Q=t.enableSeconds?":ss":"",x=t.enableMinutes?":mm":"";return t.is24?`HH${x}${Q}`:`hh${x}${Q} aa`},A=()=>{var Q;return t.format?t.format:t.monthPicker?"MM/yyyy":t.timePicker?e():t.weekPicker?`${((Q=b.value)==null?void 0:Q.type)==="iso"?"II":"ww"}-RR`:t.yearPicker?"yyyy":t.quarterPicker?"QQQ/yyyy":t.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy"},n=Q=>I0(Q,t.enableSeconds),r=()=>F.value.enabled?t.startTime&&Array.isArray(t.startTime)?[n(t.startTime[0]),n(t.startTime[1])]:null:t.startTime&&!Array.isArray(t.startTime)?n(t.startTime):null,o=s.computed(()=>UO(t.multiCalendars)),i=s.computed(()=>r()),a=s.computed(()=>FO(t.ariaLabels)),l=s.computed(()=>_O(t.filters)),u=s.computed(()=>xO(t.transitions)),f=s.computed(()=>DO(t.actionRow)),h=s.computed(()=>IO(t.previewFormat,t.format,A())),p=s.computed(()=>TO(t.textInput)),g=s.computed(()=>LO(t.inline)),B=s.computed(()=>OO(t.config)),y=s.computed(()=>MO(t.highlight)),b=s.computed(()=>NO(t.weekNumbers)),w=s.computed(()=>RO(t.timezone)),v=s.computed(()=>$O(t.multiDates)),S=s.computed(()=>VO({minDate:t.minDate,maxDate:t.maxDate,disabledDates:t.disabledDates,allowedDates:t.allowedDates,highlight:y.value,markers:t.markers,timezone:w.value,isSpecific:t.monthPicker||t.yearPicker||t.quarterPicker,isMonthPicker:t.monthPicker,isYearPicker:t.yearPicker})),F=s.computed(()=>HO(t.range)),I=s.computed(()=>KO(t.ui));return{defaultedTransitions:u,defaultedMultiCalendars:o,defaultedStartTime:i,defaultedAriaLabels:a,defaultedFilters:l,defaultedActionRow:f,defaultedPreviewFormat:h,defaultedTextInput:p,defaultedInline:g,defaultedConfig:B,defaultedHighlight:y,defaultedWeekNumbers:b,defaultedRange:F,propDates:S,defaultedTz:w,defaultedMultiDates:v,defaultedUI:I,getDefaultPattern:A,getDefaultStartTime:r,handleEventPropagation:Q=>{B.value.allowStopPropagation&&Q.stopPropagation(),B.value.allowPreventDefault&&Q.preventDefault()}}},GO=(t,e,A)=>{const n=s.ref(),{defaultedTextInput:r,defaultedRange:o,defaultedTz:i,defaultedMultiDates:a,getDefaultPattern:l}=Gt(e),u=s.ref(""),f=s.toRef(e,"format"),h=s.toRef(e,"formatLocale");s.watch(n,()=>{typeof e.onInternalModelChange=="function"&&t("internal-model-change",n.value,oe(!0))},{deep:!0}),s.watch(o,(k,X)=>{k.enabled!==X.enabled&&(n.value=null)}),s.watch(f,()=>{ee()});const p=k=>i.value.timezone&&i.value.convertModel?wn(k,i.value.timezone):k,g=k=>{if(i.value.timezone&&i.value.convertModel){const X=lO(i.value.timezone,k);return aD(k,X)}return k},B=(k,X,Se=!1)=>T0(k,e.format,e.formatLocale,r.value.rangeSeparator,e.modelAuto,X??l(),Se),y=k=>k?e.modelType?ce(k):{hours:mo(k),minutes:Yo(k),seconds:e.enableSeconds?Ys(k):0}:null,b=k=>e.modelType?ce(k):{month:ut(k),year:qe(k)},w=k=>Array.isArray(k)?a.value.enabled?k.map(X=>v(X,Kr(ye(),X))):Zc(()=>[Kr(ye(),k[0]),k[1]?Kr(ye(),k[1]):Aa(o.value.partialRange)],o.value.enabled):Kr(ye(),+k),v=(k,X)=>(typeof k=="string"||typeof k=="number")&&e.modelType?K(k):X,S=k=>Array.isArray(k)?[v(k[0],Xo(null,+k[0].hours,+k[0].minutes,k[0].seconds)),v(k[1],Xo(null,+k[1].hours,+k[1].minutes,k[1].seconds))]:v(k,Xo(null,k.hours,k.minutes,k.seconds)),F=k=>{const X=Tt(ye(),{date:1});return Array.isArray(k)?a.value.enabled?k.map(Se=>v(Se,Bo(X,+Se.month,+Se.year))):Zc(()=>[v(k[0],Bo(X,+k[0].month,+k[0].year)),v(k[1],k[1]?Bo(X,+k[1].month,+k[1].year):Aa(o.value.partialRange))],o.value.enabled):v(k,Bo(X,+k.month,+k.year))},I=k=>{if(Array.isArray(k))return k.map(X=>K(X));throw new Error(lp.dateArr("multi-dates"))},Q=k=>{if(Array.isArray(k)&&o.value.enabled){const X=k[0],Se=k[1];return[ye(Array.isArray(X)?X[0]:null),Array.isArray(Se)&&Se.length?ye(Se[0]):null]}return ye(k[0])},x=k=>e.modelAuto?Array.isArray(k)?[K(k[0]),K(k[1])]:e.autoApply?[K(k)]:[K(k),null]:Array.isArray(k)?Zc(()=>k[1]?[K(k[0]),k[1]?K(k[1]):Aa(o.value.partialRange)]:[K(k[0])],o.value.enabled):K(k),M=()=>{Array.isArray(n.value)&&o.value.enabled&&n.value.length===1&&n.value.push(Aa(o.value.partialRange))},O=()=>{const k=n.value;return[ce(k[0]),k[1]?ce(k[1]):Aa(o.value.partialRange)]},P=()=>Array.isArray(n.value)?n.value[1]?O():ce(FA(n.value[0])):[],ie=()=>(n.value||[]).map(k=>ce(k)),ae=(k=!1)=>(k||M(),e.modelAuto?P():a.value.enabled?ie():Array.isArray(n.value)?Zc(()=>O(),o.value.enabled):ce(FA(n.value))),ue=k=>!k||Array.isArray(k)&&!k.length?null:e.timePicker?S(FA(k)):e.monthPicker?F(FA(k)):e.yearPicker?w(FA(k)):a.value.enabled?I(FA(k)):e.weekPicker?Q(FA(k)):x(FA(k)),H=k=>{const X=ue(k);hp(FA(X))?(n.value=FA(X),ee()):(n.value=null,u.value="")},G=()=>{const k=X=>Pr(X,r.value.format);return`${k(n.value[0])} ${r.value.rangeSeparator} ${n.value[1]?k(n.value[1]):""}`},$=()=>A.value&&n.value?Array.isArray(n.value)?G():Pr(n.value,r.value.format):B(n.value),te=()=>n.value?a.value.enabled?n.value.map(k=>B(k)).join("; "):r.value.enabled&&typeof r.value.format=="string"?$():B(n.value):"",ee=()=>{!e.format||typeof e.format=="string"||r.value.enabled&&typeof r.value.format=="string"?u.value=te():u.value=e.format(n.value)},K=k=>{if(e.utc){const X=new Date(k);return e.utc==="preserve"?new Date(X.getTime()+X.getTimezoneOffset()*6e4):X}return e.modelType?cO.includes(e.modelType)?p(new Date(k)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?p(ep(k,l(),new Date,{locale:h.value})):p(ep(k,e.modelType,new Date,{locale:h.value})):p(new Date(k))},ce=k=>k?e.utc?CO(k,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+g(k):e.modelType==="iso"?g(k).toISOString():e.modelType==="format"&&(typeof e.format=="string"||!e.format)?B(g(k)):B(g(k),e.modelType,!0):g(k):"",j=(k,X=!1,Se=!1)=>{if(Se)return k;if(t("update:model-value",k),i.value.emitTimezone&&X){const ht=Array.isArray(k)?k.map(se=>wn(FA(se),i.value.emitTimezone)):wn(FA(k),i.value.emitTimezone);t("update:model-timezone-value",ht)}},Qe=k=>Array.isArray(n.value)?a.value.enabled?n.value.map(X=>k(X)):[k(n.value[0]),n.value[1]?k(n.value[1]):Aa(o.value.partialRange)]:k(FA(n.value)),R=()=>{if(Array.isArray(n.value)){const k=go(n.value[0],e.weekStart),X=n.value[1]?go(n.value[1],e.weekStart):[];return[k.map(Se=>ye(Se)),X.map(Se=>ye(Se))]}return go(n.value,e.weekStart).map(k=>ye(k))},J=(k,X)=>j(FA(Qe(k)),!1,X),Ae=k=>{const X=R();return k?X:t("update:model-value",R())},oe=(k=!1)=>(k||ee(),e.monthPicker?J(b,k):e.timePicker?J(y,k):e.yearPicker?J(qe,k):e.weekPicker?Ae(k):j(ae(k),!0,k));return{inputValue:u,internalModelValue:n,checkBeforeEmit:()=>n.value?o.value.enabled?o.value.partialRange?n.value.length>=1:n.value.length===2:!!n.value:!1,parseExternalModelValue:H,formatInputValue:ee,emitModelValue:oe}},WO=(t,e)=>{const{defaultedFilters:A,propDates:n}=Gt(t),{validateMonthYearInRange:r}=ei(t),o=(f,h)=>{let p=f;return A.value.months.includes(ut(p))?(p=h?gr(f,1):js(f,1),o(p,h)):p},i=(f,h)=>{let p=f;return A.value.years.includes(qe(p))?(p=h?Gh(f,1):p0(f,1),i(p,h)):p},a=(f,h=!1)=>{const p=Tt(ye(),{month:t.month,year:t.year});let g=f?gr(p,1):js(p,1);t.disableYearSelect&&(g=Kr(g,t.year));let B=ut(g),y=qe(g);A.value.months.includes(B)&&(g=o(g,f),B=ut(g),y=qe(g)),A.value.years.includes(y)&&(g=i(g,f),y=qe(g)),r(B,y,f,t.preventMinMaxNavigation)&&l(B,y,h)},l=(f,h,p)=>{e("update-month-year",{month:f,year:h,fromNav:p})},u=s.computed(()=>f=>x0(Tt(ye(),{month:t.month,year:t.year}),n.value.maxDate,n.value.minDate,t.preventMinMaxNavigation,f));return{handleMonthYearChange:a,isDisabled:u,updateMonthYear:l}},tu={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:[Boolean,String],default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},alwaysClearable:{type:Boolean,default:!1},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},br={...tu,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1},isMobile:{type:Boolean,default:void 0}},zO=["title"],YO=["disabled"],JO=s.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...br},emits:["close-picker","select-date","select-now","invalid-select"],setup(t,{emit:e}){const A=e,n=t,{defaultedActionRow:r,defaultedPreviewFormat:o,defaultedMultiCalendars:i,defaultedTextInput:a,defaultedInline:l,defaultedRange:u,defaultedMultiDates:f}=Gt(n),{isTimeValid:h,isMonthValid:p}=ei(n),{buildMatrix:g}=qo(),B=s.ref(null),y=s.ref(null),b=s.ref(!1),w=s.ref({}),v=s.ref(null),S=s.ref(null);s.onMounted(()=>{n.arrowNavigation&&g([BA(B),BA(y)],"actionRow"),F(),window.addEventListener("resize",F)}),s.onUnmounted(()=>{window.removeEventListener("resize",F)});const F=()=>{b.value=!1,setTimeout(()=>{var H,G;const $=(H=v.value)==null?void 0:H.getBoundingClientRect(),te=(G=S.value)==null?void 0:G.getBoundingClientRect();$&&te&&(w.value.maxWidth=`${te.width-$.width-20}px`),b.value=!0},0)},I=s.computed(()=>u.value.enabled&&!u.value.partialRange&&n.internalModelValue?n.internalModelValue.length===2:!0),Q=s.computed(()=>!h.value(n.internalModelValue)||!p.value(n.internalModelValue)||!I.value),x=()=>{const H=o.value;return n.timePicker||n.monthPicker,H(FA(n.internalModelValue))},M=()=>{const H=n.internalModelValue;return i.value.count>0?`${O(H[0])} - ${O(H[1])}`:[O(H[0]),O(H[1])]},O=H=>T0(H,o.value,n.formatLocale,a.value.rangeSeparator,n.modelAuto,o.value),P=s.computed(()=>!n.internalModelValue||!n.menuMount?"":typeof o.value=="string"?Array.isArray(n.internalModelValue)?n.internalModelValue.length===2&&n.internalModelValue[1]?M():f.value.enabled?n.internalModelValue.map(H=>`${O(H)}`):n.modelAuto?`${O(n.internalModelValue[0])}`:`${O(n.internalModelValue[0])} -`:O(n.internalModelValue):x()),ie=()=>f.value.enabled?"; ":" - ",ae=s.computed(()=>Array.isArray(P.value)?P.value.join(ie()):P.value),ue=()=>{h.value(n.internalModelValue)&&p.value(n.internalModelValue)&&I.value?A("select-date"):A("invalid-select")};return(H,G)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"actionRowRef",ref:S,class:"dp__action_row"},[H.$slots["action-row"]?s.renderSlot(H.$slots,"action-row",s.normalizeProps(s.mergeProps({key:0},{internalModelValue:H.internalModelValue,disabled:Q.value,selectDate:()=>H.$emit("select-date"),closePicker:()=>H.$emit("close-picker")}))):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.unref(r).showPreview?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__selection_preview",title:ae.value,style:s.normalizeStyle(w.value)},[H.$slots["action-preview"]&&b.value?s.renderSlot(H.$slots,"action-preview",{key:0,value:H.internalModelValue}):s.createCommentVNode("",!0),!H.$slots["action-preview"]&&b.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ae.value),1)],64)):s.createCommentVNode("",!0)],12,zO)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"actionBtnContainer",ref:v,class:"dp__action_buttons","data-dp-element":"action-row"},[H.$slots["action-buttons"]?s.renderSlot(H.$slots,"action-buttons",{key:0,value:H.internalModelValue}):s.createCommentVNode("",!0),H.$slots["action-buttons"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[!s.unref(l).enabled&&s.unref(r).showCancel?(s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"cancelButtonRef",ref:B,type:"button",class:"dp__action_button dp__action_cancel",onClick:G[0]||(G[0]=$=>H.$emit("close-picker")),onKeydown:G[1]||(G[1]=$=>s.unref(on)($,()=>H.$emit("close-picker")))},s.toDisplayString(H.cancelText),545)):s.createCommentVNode("",!0),s.unref(r).showNow?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:G[2]||(G[2]=$=>H.$emit("select-now")),onKeydown:G[3]||(G[3]=$=>s.unref(on)($,()=>H.$emit("select-now")))},s.toDisplayString(H.nowButtonLabel),33)):s.createCommentVNode("",!0),s.unref(r).showSelect?(s.openBlock(),s.createElementBlock("button",{key:2,ref_key:"selectButtonRef",ref:y,type:"button",class:"dp__action_button dp__action_select",disabled:Q.value,"data-test-id":"select-button",onKeydown:G[4]||(G[4]=$=>s.unref(on)($,()=>ue())),onClick:ue},s.toDisplayString(H.selectText),41,YO)):s.createCommentVNode("",!0)],64))],512)],64))],512))}}),XO=["role","aria-label","tabindex"],jO={class:"dp__selection_grid_header"},qO=["aria-selected","aria-disabled","data-test-id","onClick","onKeydown","onMouseover"],ZO=["aria-label"],pl=s.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(t,{expose:e,emit:A}){const{setSelectionGrid:n,buildMultiLevelMatrix:r,setMonthPicker:o}=qo(),i=A,a=t,{defaultedAriaLabels:l,defaultedTextInput:u,defaultedConfig:f,handleEventPropagation:h}=Gt(a),{hideNavigationButtons:p}=ru(),g=s.ref(!1),B=s.ref(null),y=s.ref(null),b=s.ref([]),w=s.ref(),v=s.ref(null),S=s.ref(0),F=s.ref(null);s.onBeforeUpdate(()=>{B.value=null}),s.onMounted(()=>{s.nextTick().then(()=>ae()),a.noOverlayFocus||Q(),I(!0)}),s.onUnmounted(()=>I(!1));const I=R=>{var J;a.arrowNavigation&&((J=a.headerRefs)!=null&&J.length?o(R):n(R))},Q=()=>{var R;const J=BA(y);J&&(u.value.enabled||(B.value?(R=B.value)==null||R.focus({preventScroll:!0}):J.focus({preventScroll:!0})),g.value=J.clientHeight<J.scrollHeight)},x=s.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!a.useRelative,"dp--overlay-relative":a.useRelative})),M=s.computed(()=>a.useRelative?{height:`${a.height}px`,width:"var(--dp-menu-min-width)"}:void 0),O=s.computed(()=>({dp__overlay_col:!0})),P=s.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:g.value,dp__button_bottom:a.isLast})),ie=s.computed(()=>{var R,J;return{dp__overlay_container:!0,dp__container_flex:((R=a.items)==null?void 0:R.length)<=6,dp__container_block:((J=a.items)==null?void 0:J.length)>6}});s.watch(()=>a.items,()=>ae(!1),{deep:!0});const ae=(R=!0)=>{s.nextTick().then(()=>{const J=BA(B),Ae=BA(y),oe=BA(v),k=BA(F),X=oe?oe.getBoundingClientRect().height:0;Ae&&(Ae.getBoundingClientRect().height?S.value=Ae.getBoundingClientRect().height-X:S.value=f.value.modeHeight-X),J&&k&&R&&(k.scrollTop=J.offsetTop-k.offsetTop-(S.value/2-J.getBoundingClientRect().height)-X)})},ue=R=>{R.disabled||i("selected",R.value)},H=()=>{i("toggle"),i("reset-flow")},G=R=>{a.escClose&&(H(),h(R))},$=(R,J,Ae,oe)=>{R&&((J.active||J.value===a.focusValue)&&(B.value=R),a.arrowNavigation&&(Array.isArray(b.value[Ae])?b.value[Ae][oe]=R:b.value[Ae]=[R],te()))},te=()=>{var R,J;const Ae=(R=a.headerRefs)!=null&&R.length?[a.headerRefs].concat(b.value):b.value.concat([a.skipButtonRef?[]:[v.value]]);r(FA(Ae),(J=a.headerRefs)!=null&&J.length?"monthPicker":"selectionGrid")},ee=R=>{a.arrowNavigation||Jo(R,f.value,!0)},K=R=>{w.value=R,i("hover-value",R)},ce=()=>{if(H(),!a.isLast){const R=cp(a.menuWrapRef??null,"action-row");if(R){const J=b0(R);J?.focus()}}},j=R=>{switch(R.key){case Ht.esc:return G(R);case Ht.arrowLeft:return ee(R);case Ht.arrowRight:return ee(R);case Ht.arrowUp:return ee(R);case Ht.arrowDown:return ee(R);default:return}},Qe=R=>{if(R.key===Ht.enter)return H();if(R.key===Ht.tab)return ce()};return e({focusGrid:Q}),(R,J)=>{var Ae;return s.openBlock(),s.createElementBlock("div",{ref_key:"gridWrapRef",ref:y,class:s.normalizeClass(x.value),style:s.normalizeStyle(M.value),role:R.useRelative?void 0:"dialog","aria-label":R.overlayLabel,tabindex:R.useRelative?void 0:"0",onKeydown:j,onClick:J[0]||(J[0]=s.withModifiers(()=>{},["prevent"]))},[s.createElementVNode("div",{ref_key:"containerRef",ref:F,class:s.normalizeClass(ie.value),style:s.normalizeStyle({"--dp-overlay-height":`${S.value}px`}),role:"grid"},[s.createElementVNode("div",jO,[s.renderSlot(R.$slots,"header")]),R.$slots.overlay?s.renderSlot(R.$slots,"overlay",{key:0}):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(R.items,(oe,k)=>(s.openBlock(),s.createElementBlock("div",{key:k,class:s.normalizeClass(["dp__overlay_row",{dp__flex_row:R.items.length>=3}]),role:"row"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(oe,(X,Se)=>(s.openBlock(),s.createElementBlock("div",{key:X.value,ref_for:!0,ref:ht=>$(ht,X,k,Se),role:"gridcell",class:s.normalizeClass(O.value),"aria-selected":X.active||void 0,"aria-disabled":X.disabled||void 0,tabindex:"0","data-test-id":X.text,onClick:s.withModifiers(ht=>ue(X),["prevent"]),onKeydown:ht=>s.unref(on)(ht,()=>ue(X),!0),onMouseover:ht=>K(X.value)},[s.createElementVNode("div",{class:s.normalizeClass(X.className)},[R.$slots.item?s.renderSlot(R.$slots,"item",{key:0,item:X}):s.createCommentVNode("",!0),R.$slots.item?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(X.text),1)],64))],2)],42,qO))),128))],2))),128))],6),R.$slots["button-icon"]?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"toggleButton",ref:v,type:"button","aria-label":(Ae=s.unref(l))==null?void 0:Ae.toggleOverlay,class:s.normalizeClass(P.value),tabindex:"0",onClick:H,onKeydown:Qe},[s.renderSlot(R.$slots,"button-icon")],42,ZO)),[[s.vShow,!s.unref(p)(R.hideNavigation,R.type)]]):s.createCommentVNode("",!0)],46,XO)}}}),eM=["data-dp-mobile"],Au=s.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean},isMobile:{type:Boolean}},setup(t){const e=t,A=s.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),n=s.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(r,o)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse}),"data-dp-mobile":r.isMobile},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(i,a)=>(s.openBlock(),s.createElementBlock("div",{key:i,class:s.normalizeClass(n.value)},[s.renderSlot(r.$slots,"default",{instance:i,index:a})],2))),128))],10,eM))}}),tM=["data-dp-element","aria-label","aria-disabled"],ml=s.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(t,{emit:e}){const A=e,n=s.ref(null);return s.onMounted(()=>A("set-ref",n)),(r,o)=>(s.openBlock(),s.createElementBlock("button",{ref_key:"elRef",ref:n,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:o[0]||(o[0]=i=>r.$emit("activate")),onKeydown:o[1]||(o[1]=i=>s.unref(on)(i,()=>r.$emit("activate"),!0))},[s.createElementVNode("span",{class:s.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[s.renderSlot(r.$slots,"default")],2)],40,tM))}}),AM=["aria-label","data-test-id"],H0=s.defineComponent({__name:"YearModePicker",props:{...br,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(t,{emit:e}){const A=e,n=t,{showRightIcon:r,showLeftIcon:o}=ru(),{defaultedConfig:i,defaultedMultiCalendars:a,defaultedAriaLabels:l,defaultedTransitions:u,defaultedUI:f}=Gt(n),{showTransition:h,transitionName:p}=gl(u),g=s.ref(!1),B=(w=!1,v)=>{g.value=!g.value,A("toggle-year-picker",{flow:w,show:v})},y=w=>{g.value=!1,A("year-select",w)},b=(w=!1)=>{A("handle-year",w)};return(w,v)=>{var S,F,I,Q,x;return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{class:s.normalizeClass(["dp--year-mode-picker",{"dp--hidden-el":g.value}])},[s.unref(o)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:0,ref:"mpPrevIconRef","aria-label":(S=s.unref(l))==null?void 0:S.prevYear,disabled:t.isDisabled(!1),class:s.normalizeClass((F=s.unref(f))==null?void 0:F.navBtnPrev),onActivate:v[0]||(v[0]=M=>b(!1))},{default:s.withCtx(()=>[w.$slots["arrow-left"]?s.renderSlot(w.$slots,"arrow-left",{key:0}):s.createCommentVNode("",!0),w.$slots["arrow-left"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(tp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.createElementVNode("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${t.year}-${(I=s.unref(l))==null?void 0:I.openYearsOverlay}`,"data-test-id":`year-mode-btn-${t.instance}`,onClick:v[1]||(v[1]=()=>B(!1)),onKeydown:v[2]||(v[2]=s.withKeys(()=>B(!1),["enter"]))},[w.$slots.year?s.renderSlot(w.$slots,"year",{key:0,year:t.year}):s.createCommentVNode("",!0),w.$slots.year?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(t.year),1)],64))],40,AM),s.unref(r)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:1,ref:"mpNextIconRef","aria-label":(Q=s.unref(l))==null?void 0:Q.nextYear,disabled:t.isDisabled(!0),class:s.normalizeClass((x=s.unref(f))==null?void 0:x.navBtnNext),onActivate:v[3]||(v[3]=M=>b(!0))},{default:s.withCtx(()=>[w.$slots["arrow-right"]?s.renderSlot(w.$slots,"arrow-right",{key:0}):s.createCommentVNode("",!0),w.$slots["arrow-right"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(Ap),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0)],2),s.createVNode(s.Transition,{name:s.unref(p)(t.showYearPicker),css:s.unref(h)},{default:s.withCtx(()=>{var M,O;return[t.showYearPicker?(s.openBlock(),s.createBlock(pl,{key:0,items:t.items,"text-input":w.textInput,"esc-close":w.escClose,config:w.config,"is-last":w.autoApply&&!s.unref(i).keepActionRow,"hide-navigation":w.hideNavigation,"aria-labels":w.ariaLabels,"overlay-label":(O=(M=s.unref(l))==null?void 0:M.yearPicker)==null?void 0:O.call(M,!0),type:"year",onToggle:B,onSelected:v[4]||(v[4]=P=>y(P))},s.createSlots({"button-icon":s.withCtx(()=>[w.$slots["calendar-icon"]?s.renderSlot(w.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),w.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))]),_:2},[w.$slots["year-overlay-value"]?{name:"item",fn:s.withCtx(({item:P})=>[s.renderSlot(w.$slots,"year-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):s.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64)}}}),kp=(t,e,A)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(n=>dt(t,n))){const n=e.value.filter(r=>!dt(r,t));e.value=n.length?n:null}else(A&&+A>e.value.length||!A)&&e.value.push(t);else e.value=[t]},Sp=(t,e,A)=>{let n=t.value?t.value.slice():[];return n.length===2&&n[1]!==null&&(n=[]),n.length?(tA(e,n[0])?n.unshift(e):n[1]=e,A("range-end",e)):(n=[e],A("range-start",e)),n},nu=(t,e,A,n)=>{t&&(t[0]&&t[1]&&A&&e("auto-apply"),t[0]&&!t[1]&&n&&A&&e("auto-apply"))},R0=t=>{Array.isArray(t.value)&&t.value.length<=2&&t.range?t.modelValue.value=t.value.map(e=>wn(ye(e),t.timezone)):Array.isArray(t.value)||(t.modelValue.value=wn(ye(t.value),t.timezone))},P0=(t,e,A,n)=>Array.isArray(e.value)&&(e.value.length===2||e.value.length===1&&n.value.partialRange)?n.value.fixedStart&&(aA(t,e.value[0])||dt(t,e.value[0]))?[e.value[0],t]:n.value.fixedEnd&&(tA(t,e.value[1])||dt(t,e.value[1]))?[t,e.value[1]]:(A("invalid-fixed-range",t),e.value):[],V0=({multiCalendars:t,range:e,highlight:A,propDates:n,calendars:r,modelValue:o,props:i,filters:a,year:l,month:u,emit:f})=>{const h=s.computed(()=>ap(i.yearRange,i.locale,i.reverseYears)),p=s.ref([!1]),g=s.computed(()=>(P,ie)=>{const ae=Tt(Cr(new Date),{month:u.value(P),year:l.value(P)}),ue=ie?Jw(ae):ll(ae);return x0(ue,n.value.maxDate,n.value.minDate,i.preventMinMaxNavigation,ie)}),B=()=>Array.isArray(o.value)&&t.value.solo&&o.value[1],y=()=>{for(let P=0;P<t.value.count;P++)if(P===0)r.value[P]=r.value[0];else if(P===t.value.count-1&&B())r.value[P]={month:ut(o.value[1]),year:qe(o.value[1])};else{const ie=Tt(ye(),r.value[P-1]);r.value[P]={month:ut(ie),year:qe(Gh(ie,1))}}},b=P=>{if(!P)return y();const ie=Tt(ye(),r.value[P]);return r.value[0].year=qe(p0(ie,t.value.count-1)),y()},w=(P,ie)=>{const ae=fD(ie,P);return e.value.showLastInRange&&ae>1?ie:P},v=P=>i.focusStartDate||t.value.solo?P[0]:P[1]?w(P[0],P[1]):P[0],S=()=>{if(o.value){const P=Array.isArray(o.value)?v(o.value):o.value;r.value[0]={month:ut(P),year:qe(P)}}},F=()=>{S(),t.value.count&&y()};s.watch(o,(P,ie)=>{i.isTextInputDate&&JSON.stringify(P??{})!==JSON.stringify(ie??{})&&F()}),s.onMounted(()=>{F()});const I=(P,ie)=>{r.value[ie].year=P,f("update-month-year",{instance:ie,year:P,month:r.value[ie].month}),t.value.count&&!t.value.solo&&b(ie)},Q=s.computed(()=>P=>ea(h.value,ie=>{var ae;const ue=l.value(P)===ie.value,H=dl(ie.value,ta(n.value.minDate),ta(n.value.maxDate))||((ae=a.value.years)==null?void 0:ae.includes(l.value(P))),G=Bp(A.value,ie.value);return{active:ue,disabled:H,highlighted:G}})),x=(P,ie)=>{I(P,ie),O(ie)},M=(P,ie=!1)=>{if(!g.value(P,ie)){const ae=ie?l.value(P)+1:l.value(P)-1;I(ae,P)}},O=(P,ie=!1,ae)=>{ie||f("reset-flow"),ae!==void 0?p.value[P]=ae:p.value[P]=!p.value[P],p.value[P]?f("overlay-toggle",{open:!0,overlay:zA.year}):(f("overlay-closed"),f("overlay-toggle",{open:!1,overlay:zA.year}))};return{isDisabled:g,groupedYears:Q,showYearPicker:p,selectYear:I,toggleYearPicker:O,handleYearSelect:x,handleYear:M}},nM=(t,e)=>{const{defaultedMultiCalendars:A,defaultedAriaLabels:n,defaultedTransitions:r,defaultedConfig:o,defaultedRange:i,defaultedHighlight:a,propDates:l,defaultedTz:u,defaultedFilters:f,defaultedMultiDates:h}=Gt(t),p=()=>{t.isTextInputDate&&F(qe(ye(t.startDate)),0)},{modelValue:g,year:B,month:y,calendars:b}=Bl(t,e,p),w=s.computed(()=>B0(t.formatLocale,t.locale,t.monthNameFormat)),v=s.ref(null),{checkMinMaxRange:S}=ei(t),{selectYear:F,groupedYears:I,showYearPicker:Q,toggleYearPicker:x,handleYearSelect:M,handleYear:O,isDisabled:P}=V0({modelValue:g,multiCalendars:A,range:i,highlight:a,calendars:b,year:B,propDates:l,month:y,filters:f,props:t,emit:e});s.onMounted(()=>{t.startDate&&(g.value&&t.focusStartDate||!g.value)&&F(qe(ye(t.startDate)),0)});const ie=J=>J?{month:ut(J),year:qe(J)}:{month:null,year:null},ae=()=>g.value?Array.isArray(g.value)?g.value.map(J=>ie(J)):ie(g.value):ie(),ue=(J,Ae)=>{const oe=b.value[J],k=ae();return Array.isArray(k)?k.some(X=>X.year===oe?.year&&X.month===Ae):oe?.year===k.year&&Ae===k.month},H=(J,Ae,oe)=>{var k,X;const Se=ae();return Array.isArray(Se)?B.value(Ae)===((k=Se[oe])==null?void 0:k.year)&&J===((X=Se[oe])==null?void 0:X.month):!1},G=(J,Ae)=>{if(i.value.enabled){const oe=ae();if(Array.isArray(g.value)&&Array.isArray(oe)){const k=H(J,Ae,0)||H(J,Ae,1),X=Bo(Cr(ye()),J,B.value(Ae));return fl(g.value,v.value,X)&&!k}return!1}return!1},$=s.computed(()=>J=>ea(w.value,Ae=>{var oe;const k=ue(J,Ae.value),X=dl(Ae.value,Q0(B.value(J),l.value.minDate),F0(B.value(J),l.value.maxDate))||SO(l.value.disabledDates,B.value(J),Ae.value)||((oe=f.value.months)==null?void 0:oe.includes(Ae.value))||!QO(l.value.allowedDates,B.value(J),Ae.value),Se=G(Ae.value,J),ht=D0(a.value,Ae.value,B.value(J));return{active:k,disabled:X,isBetween:Se,highlighted:ht}})),te=(J,Ae)=>Bo(Cr(ye()),J,B.value(Ae)),ee=(J,Ae)=>{const oe=g.value?g.value:Cr(new Date);g.value=Bo(oe,J,B.value(Ae)),e("auto-apply"),e("update-flow-step")},K=(J,Ae)=>{const oe=te(J,Ae);i.value.fixedEnd||i.value.fixedStart?g.value=P0(oe,g,e,i):g.value?S(oe,g.value)&&(g.value=Sp(g,te(J,Ae),e)):g.value=[te(J,Ae)],s.nextTick().then(()=>{nu(g.value,e,t.autoApply,t.modelAuto)})},ce=(J,Ae)=>{kp(te(J,Ae),g,h.value.limit),e("auto-apply",!0)},j=(J,Ae)=>(b.value[Ae].month=J,R(Ae,b.value[Ae].year,J),h.value.enabled?ce(J,Ae):i.value.enabled?K(J,Ae):ee(J,Ae)),Qe=(J,Ae)=>{F(J,Ae),R(Ae,J,null)},R=(J,Ae,oe)=>{let k=oe;if(!k&&k!==0){const X=ae();k=Array.isArray(X)?X[J].month:X.month}e("update-month-year",{instance:J,year:Ae,month:k})};return{groupedMonths:$,groupedYears:I,year:B,isDisabled:P,defaultedMultiCalendars:A,defaultedAriaLabels:n,defaultedTransitions:r,defaultedConfig:o,showYearPicker:Q,modelValue:g,presetDate:(J,Ae)=>{R0({value:J,modelValue:g,range:i.value.enabled,timezone:Ae?void 0:u.value.timezone}),e("auto-apply")},setHoverDate:(J,Ae)=>{v.value=te(J,Ae)},selectMonth:j,selectYear:Qe,toggleYearPicker:x,handleYearSelect:M,handleYear:O,getModelMonthYear:ae}},rM=s.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...br},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=s.useSlots(),o=_n(r,"yearMode"),i=t;s.onMounted(()=>{i.shadow||n("mount",null)});const{groupedMonths:a,groupedYears:l,year:u,isDisabled:f,defaultedMultiCalendars:h,defaultedConfig:p,showYearPicker:g,modelValue:B,presetDate:y,setHoverDate:b,selectMonth:w,selectYear:v,toggleYearPicker:S,handleYearSelect:F,handleYear:I,getModelMonthYear:Q}=nM(i,n);return e({getSidebarProps:()=>({modelValue:B,year:u,getModelMonthYear:Q,selectMonth:w,selectYear:v,handleYear:I}),presetDate:y,toggleYearPicker:x=>S(0,x)}),(x,M)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":s.unref(h).count,collapse:x.collapse,stretch:"","is-mobile":x.isMobile},{default:s.withCtx(({instance:O})=>[x.$slots["top-extra"]?s.renderSlot(x.$slots,"top-extra",{key:0,value:x.internalModelValue}):s.createCommentVNode("",!0),x.$slots["month-year"]?s.renderSlot(x.$slots,"month-year",s.normalizeProps(s.mergeProps({key:1},{year:s.unref(u),months:s.unref(a)(O),years:s.unref(l)(O),selectMonth:s.unref(w),selectYear:s.unref(v),instance:O}))):(s.openBlock(),s.createBlock(pl,{key:2,items:s.unref(a)(O),"arrow-navigation":x.arrowNavigation,"is-last":x.autoApply&&!s.unref(p).keepActionRow,"esc-close":x.escClose,height:s.unref(p).modeHeight,config:x.config,"no-overlay-focus":!!(x.noOverlayFocus||x.textInput),"use-relative":"",type:"month",onSelected:P=>s.unref(w)(P,O),onHoverValue:P=>s.unref(b)(P,O)},s.createSlots({header:s.withCtx(()=>[s.createVNode(H0,s.mergeProps(x.$props,{items:s.unref(l)(O),instance:O,"show-year-picker":s.unref(g)[O],year:s.unref(u)(O),"is-disabled":P=>s.unref(f)(O,P),onHandleYear:P=>s.unref(I)(O,P),onYearSelect:P=>s.unref(F)(P,O),onToggleYearPicker:P=>s.unref(S)(O,P?.flow,P?.show)}),s.createSlots({_:2},[s.renderList(s.unref(o),(P,ie)=>({name:P,fn:s.withCtx(ae=>[s.renderSlot(x.$slots,P,s.normalizeProps(s.guardReactiveProps(ae)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[x.$slots["month-overlay-value"]?{name:"item",fn:s.withCtx(({item:P})=>[s.renderSlot(x.$slots,"month-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse","is-mobile"]))}}),oM=(t,e)=>{const A=()=>{t.isTextInputDate&&(f.value=qe(ye(t.startDate)))},{modelValue:n}=Bl(t,e,A),r=s.ref(null),{defaultedHighlight:o,defaultedMultiDates:i,defaultedFilters:a,defaultedRange:l,propDates:u}=Gt(t),f=s.ref();s.onMounted(()=>{t.startDate&&(n.value&&t.focusStartDate||!n.value)&&(f.value=qe(ye(t.startDate)))});const h=w=>Array.isArray(n.value)?n.value.some(v=>qe(v)===w):n.value?qe(n.value)===w:!1,p=w=>l.value.enabled&&Array.isArray(n.value)?fl(n.value,r.value,b(w)):!1,g=w=>u.value.allowedDates instanceof Map?u.value.allowedDates.size?u.value.allowedDates.has(`${w}`):!1:!0,B=w=>u.value.disabledDates instanceof Map?u.value.disabledDates.size?u.value.disabledDates.has(`${w}`):!1:!0,y=s.computed(()=>ea(ap(t.yearRange,t.locale,t.reverseYears),w=>{const v=h(w.value),S=dl(w.value,ta(u.value.minDate),ta(u.value.maxDate))||a.value.years.includes(w.value)||!g(w.value)||B(w.value),F=p(w.value)&&!v,I=Bp(o.value,w.value);return{active:v,disabled:S,isBetween:F,highlighted:I}})),b=w=>Kr(Cr(ll(new Date)),w);return{groupedYears:y,modelValue:n,focusYear:f,setHoverValue:w=>{r.value=Kr(Cr(new Date),w)},selectYear:w=>{var v;if(e("update-month-year",{instance:0,year:w}),i.value.enabled)return n.value?Array.isArray(n.value)&&(((v=n.value)==null?void 0:v.map(S=>qe(S))).includes(w)?n.value=n.value.filter(S=>qe(S)!==w):n.value.push(Kr(UA(ye()),w))):n.value=[Kr(UA(ll(ye())),w)],e("auto-apply",!0);l.value.enabled?(n.value=Sp(n,b(w),e),s.nextTick().then(()=>{nu(n.value,e,t.autoApply,t.modelAuto)})):(n.value=b(w),e("auto-apply"))}}},iM=s.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...br},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(t,{expose:e,emit:A}){const n=A,r=t,{groupedYears:o,modelValue:i,focusYear:a,selectYear:l,setHoverValue:u}=oM(r,n),{defaultedConfig:f}=Gt(r);return e({getSidebarProps:()=>({modelValue:i,selectYear:l})}),(h,p)=>(s.openBlock(),s.createElementBlock("div",null,[h.$slots["top-extra"]?s.renderSlot(h.$slots,"top-extra",{key:0,value:h.internalModelValue}):s.createCommentVNode("",!0),h.$slots["month-year"]?s.renderSlot(h.$slots,"month-year",s.normalizeProps(s.mergeProps({key:1},{years:s.unref(o),selectYear:s.unref(l)}))):(s.openBlock(),s.createBlock(pl,{key:2,items:s.unref(o),"is-last":h.autoApply&&!s.unref(f).keepActionRow,height:s.unref(f).modeHeight,config:h.config,"no-overlay-focus":!!(h.noOverlayFocus||h.textInput),"focus-value":s.unref(a),type:"year","use-relative":"",onSelected:s.unref(l),onHoverValue:s.unref(u)},s.createSlots({_:2},[h.$slots["year-overlay-value"]?{name:"item",fn:s.withCtx(({item:g})=>[s.renderSlot(h.$slots,"year-overlay-value",{text:g.text,value:g.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),sM={key:0,class:"dp__time_input"},aM=["data-compact","data-collapsed"],lM=["data-test-id","aria-label","onKeydown","onClick","onMousedown"],cM=["aria-label","disabled","data-test-id","onKeydown","onClick"],uM=["data-test-id","aria-label","onKeydown","onClick","onMousedown"],dM={key:0},fM=["aria-label","data-compact"],hM=s.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...br},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(t,{expose:e,emit:A}){const n=A,r=t,{setTimePickerElements:o,setTimePickerBackRef:i}=qo(),{defaultedAriaLabels:a,defaultedTransitions:l,defaultedFilters:u,defaultedConfig:f,defaultedRange:h,defaultedMultiCalendars:p}=Gt(r),{transitionName:g,showTransition:B}=gl(l),y=s.reactive({hours:!1,minutes:!1,seconds:!1}),b=s.ref("AM"),w=s.ref(null),v=s.ref([]),S=s.ref(),F=s.ref(!1);s.onMounted(()=>{n("mounted")});const I=D=>Tt(new Date,{hours:D.hours,minutes:D.minutes,seconds:r.enableSeconds?D.seconds:0,milliseconds:0}),Q=s.computed(()=>D=>K(D,r[D])||M(D,r[D])),x=s.computed(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),M=(D,ke)=>h.value.enabled&&!h.value.disableTimeRangeValidation?!r.validateTime(D,ke):!1,O=(D,ke)=>{if(h.value.enabled&&!h.value.disableTimeRangeValidation){const be=ke?+r[`${D}Increment`]:-+r[`${D}Increment`],_=r[D]+be;return!r.validateTime(D,_)}return!1},P=s.computed(()=>D=>!J(+r[D]+ +r[`${D}Increment`],D)||O(D,!0)),ie=s.computed(()=>D=>!J(+r[D]-+r[`${D}Increment`],D)||O(D,!1)),ae=(D,ke)=>Rw(Tt(ye(),D),ke),ue=(D,ke)=>iO(Tt(ye(),D),ke),H=s.computed(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),G=s.computed(()=>r.timePickerInline&&h.value.enabled&&!p.value.count),$=s.computed(()=>{const D=[{type:"hours"}];return r.enableMinutes&&D.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&D.push({type:"",separator:!0},{type:"seconds"}),D}),te=s.computed(()=>$.value.filter(D=>!D.separator)),ee=s.computed(()=>D=>{if(D==="hours"){const ke=ht(+r.hours);return{text:ke<10?`0${ke}`:`${ke}`,value:ke}}return{text:r[D]<10?`0${r[D]}`:`${r[D]}`,value:r[D]}}),K=(D,ke)=>{var be;if(!r.disabledTimesConfig)return!1;const _=r.disabledTimesConfig(r.order,D==="hours"?ke:void 0);return _[D]?!!((be=_[D])!=null&&be.includes(ke)):!0},ce=(D,ke)=>ke!=="hours"||b.value==="AM"?D:D+12,j=D=>{const ke=r.is24?24:12,be=D==="hours"?ke:60,_=+r[`${D}GridIncrement`],N=D==="hours"&&!r.is24?_:0,ne=[];for(let ve=N;ve<be;ve+=_)ne.push({value:r.is24?ve:ce(ve,D),text:ve<10?`0${ve}`:`${ve}`});return D==="hours"&&!r.is24&&ne.unshift({value:b.value==="PM"?12:0,text:"12"}),ea(ne,ve=>({active:!1,disabled:u.value.times[D].includes(ve.value)||!J(ve.value,D)||K(D,ve.value)||M(D,ve.value)}))},Qe=D=>D>=0?D:59,R=D=>D>=0?D:23,J=(D,ke)=>{const be=r.minTime?I(fp(r.minTime)):null,_=r.maxTime?I(fp(r.maxTime)):null,N=I(fp(x.value,ke,ke==="minutes"||ke==="seconds"?Qe(D):R(D)));return be&&_?(Js(N,_)||Xs(N,_))&&(ji(N,be)||Xs(N,be)):be?ji(N,be)||Xs(N,be):_?Js(N,_)||Xs(N,_):!0},Ae=D=>r[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],oe=D=>{Ae(D)||(y[D]=!y[D],y[D]?(F.value=!0,n("overlay-opened",D)):(F.value=!1,n("overlay-closed",D)))},k=D=>D==="hours"?mo:D==="minutes"?Yo:Ys,X=()=>{S.value&&clearTimeout(S.value)},Se=(D,ke=!0,be)=>{const _=ke?ae:ue,N=ke?+r[`${D}Increment`]:-+r[`${D}Increment`];J(+r[D]+N,D)&&n(`update:${D}`,k(D)(_({[D]:+r[D]},{[D]:+r[`${D}Increment`]}))),!(be!=null&&be.keyboard)&&f.value.timeArrowHoldThreshold&&(S.value=setTimeout(()=>{Se(D,ke)},f.value.timeArrowHoldThreshold))},ht=D=>r.is24?D:(D>=12?b.value="PM":b.value="AM",fO(D)),se=()=>{b.value==="PM"?(b.value="AM",n("update:hours",r.hours-12)):(b.value="PM",n("update:hours",r.hours+12)),n("am-pm-change",b.value)},Ye=D=>{y[D]=!0},ge=(D,ke,be)=>{if(D&&r.arrowNavigation){Array.isArray(v.value[ke])?v.value[ke][be]=D:v.value[ke]=[D];const _=v.value.reduce((N,ne)=>ne.map((ve,ze)=>[...N[ze]||[],ne[ze]]),[]);i(r.closeTimePickerBtn),w.value&&(_[1]=_[1].concat(w.value)),o(_,r.order)}},Ce=(D,ke)=>(oe(D),n(`update:${D}`,ke));return e({openChildCmp:Ye}),(D,ke)=>{var be;return D.disabled?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",sM,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList($.value,(_,N)=>{var ne,ve,ze;return s.openBlock(),s.createElementBlock("div",{key:N,class:s.normalizeClass(H.value),"data-compact":G.value&&!D.enableSeconds,"data-collapsed":G.value&&D.enableSeconds},[_.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[F.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(":")],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,0),type:"button",class:s.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:P.value(_.type),"dp--hidden-el":F.value}),"data-test-id":`${_.type}-time-inc-btn-${r.order}`,"aria-label":(ne=s.unref(a))==null?void 0:ne.incrementValue(_.type),tabindex:"0",onKeydown:W=>s.unref(on)(W,()=>Se(_.type,!0,{keyboard:!0}),!0),onClick:W=>s.unref(f).timeArrowHoldThreshold?void 0:Se(_.type,!0),onMousedown:W=>s.unref(f).timeArrowHoldThreshold?Se(_.type,!0):void 0,onMouseup:X},[r.timePickerInline?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[D.$slots["tp-inline-arrow-up"]?s.renderSlot(D.$slots,"tp-inline-arrow-up",{key:0}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[ke[2]||(ke[2]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),ke[3]||(ke[3]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D.$slots["arrow-up"]?s.renderSlot(D.$slots,"arrow-up",{key:0}):s.createCommentVNode("",!0),D.$slots["arrow-up"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(rp),{key:1}))],64))],42,lM),s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,1),type:"button","aria-label":`${ee.value(_.type).text}-${(ve=s.unref(a))==null?void 0:ve.openTpOverlay(_.type)}`,class:s.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":Q.value(_.type),"dp--time-overlay-btn":!Q.value(_.type),"dp--hidden-el":F.value}),disabled:Ae(_.type),tabindex:"0","data-test-id":`${_.type}-toggle-overlay-btn-${r.order}`,onKeydown:W=>s.unref(on)(W,()=>oe(_.type),!0),onClick:W=>oe(_.type)},[D.$slots[_.type]?s.renderSlot(D.$slots,_.type,{key:0,text:ee.value(_.type).text,value:ee.value(_.type).value}):s.createCommentVNode("",!0),D.$slots[_.type]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ee.value(_.type).text),1)],64))],42,cM),s.createElementVNode("button",{ref_for:!0,ref:W=>ge(W,N,2),type:"button",class:s.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:ie.value(_.type),"dp--hidden-el":F.value}),"data-test-id":`${_.type}-time-dec-btn-${r.order}`,"aria-label":(ze=s.unref(a))==null?void 0:ze.decrementValue(_.type),tabindex:"0",onKeydown:W=>s.unref(on)(W,()=>Se(_.type,!1,{keyboard:!0}),!0),onClick:W=>s.unref(f).timeArrowHoldThreshold?void 0:Se(_.type,!1),onMousedown:W=>s.unref(f).timeArrowHoldThreshold?Se(_.type,!1):void 0,onMouseup:X},[r.timePickerInline?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[D.$slots["tp-inline-arrow-down"]?s.renderSlot(D.$slots,"tp-inline-arrow-down",{key:0}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[ke[4]||(ke[4]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),ke[5]||(ke[5]=s.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D.$slots["arrow-down"]?s.renderSlot(D.$slots,"arrow-down",{key:0}):s.createCommentVNode("",!0),D.$slots["arrow-down"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(op),{key:1}))],64))],42,uM)],64))],10,aM)}),128)),D.is24?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",dM,[D.$slots["am-pm-button"]?s.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:se,value:b.value}):s.createCommentVNode("",!0),D.$slots["am-pm-button"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:w,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(be=s.unref(a))==null?void 0:be.amPmButton,tabindex:"0","data-compact":G.value,onClick:se,onKeydown:ke[0]||(ke[0]=_=>s.unref(on)(_,()=>se(),!0))},s.toDisplayString(b.value),41,fM))])),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(te.value,(_,N)=>(s.openBlock(),s.createBlock(s.Transition,{key:N,name:s.unref(g)(y[_.type]),css:s.unref(B)},{default:s.withCtx(()=>{var ne,ve;return[y[_.type]?(s.openBlock(),s.createBlock(pl,{key:0,items:j(_.type),"is-last":D.autoApply&&!s.unref(f).keepActionRow,"esc-close":D.escClose,type:_.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,"aria-labels":D.ariaLabels,"overlay-label":(ve=(ne=s.unref(a)).timeOverlay)==null?void 0:ve.call(ne,_.type),onSelected:ze=>Ce(_.type,ze),onToggle:ze=>oe(_.type),onResetFlow:ke[1]||(ke[1]=ze=>D.$emit("reset-flow"))},s.createSlots({"button-icon":s.withCtx(()=>[D.$slots["clock-icon"]?s.renderSlot(D.$slots,"clock-icon",{key:0}):s.createCommentVNode("",!0),D.$slots["clock-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.timePickerInline?s.unref(qs):s.unref(np)),{key:1}))]),_:2},[D.$slots[`${_.type}-overlay-value`]?{name:"item",fn:s.withCtx(({item:ze})=>[s.renderSlot(D.$slots,`${_.type}-overlay-value`,{text:ze.text,value:ze.value})]),key:"0"}:void 0,D.$slots[`${_.type}-overlay-header`]?{name:"header",fn:s.withCtx(()=>[s.renderSlot(D.$slots,`${_.type}-overlay-header`,{toggle:()=>oe(_.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):s.createCommentVNode("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),pM=["data-dp-mobile"],mM=["aria-label","tabindex"],gM=["role","aria-label","tabindex"],BM=["aria-label"],$0=s.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...br},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(t,{expose:e,emit:A}){const n=A,r=t,{buildMatrix:o,setTimePicker:i}=qo(),a=s.useSlots(),{defaultedTransitions:l,defaultedAriaLabels:u,defaultedTextInput:f,defaultedConfig:h,defaultedRange:p}=Gt(r),{transitionName:g,showTransition:B}=gl(l),{hideNavigationButtons:y}=ru(),b=s.ref(null),w=s.ref(null),v=s.ref([]),S=s.ref(null),F=s.ref(!1);s.onMounted(()=>{n("mount"),!r.timePicker&&r.arrowNavigation?o([BA(b.value)],"time"):i(!0,r.timePicker)});const I=s.computed(()=>p.value.enabled&&r.modelAuto?y0(r.internalModelValue):!0),Q=s.ref(!1),x=K=>({hours:Array.isArray(r.hours)?r.hours[K]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[K]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[K]:r.seconds}),M=s.computed(()=>{const K=[];if(p.value.enabled)for(let ce=0;ce<2;ce++)K.push(x(ce));else K.push(x(0));return K}),O=(K,ce=!1,j="")=>{ce||n("reset-flow"),Q.value=K,n(K?"overlay-opened":"overlay-closed",zA.time),r.arrowNavigation&&i(K),s.nextTick(()=>{j!==""&&v.value[0]&&v.value[0].openChildCmp(j)})},P=s.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!h.value.keepActionRow})),ie=_n(a,"timePicker"),ae=(K,ce,j)=>p.value.enabled?ce===0?[K,M.value[1][j]]:[M.value[0][j],K]:K,ue=K=>{n("update:hours",K)},H=K=>{n("update:minutes",K)},G=K=>{n("update:seconds",K)},$=()=>{if(S.value&&!f.value.enabled&&!r.noOverlayFocus){const K=b0(S.value);K&&K.focus({preventScroll:!0})}},te=K=>{F.value=!1,n("overlay-closed",K)},ee=K=>{F.value=!0,n("overlay-opened",K)};return e({toggleTimePicker:O}),(K,ce)=>{var j;return s.openBlock(),s.createElementBlock("div",{class:"dp--tp-wrap","data-dp-mobile":K.isMobile},[!K.timePicker&&!K.timePickerInline?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:0,ref_key:"openTimePickerBtn",ref:b,type:"button",class:s.normalizeClass({...P.value,"dp--hidden-el":Q.value}),"aria-label":(j=s.unref(u))==null?void 0:j.openTimePicker,tabindex:K.noOverlayFocus?void 0:0,"data-test-id":"open-time-picker-btn",onKeydown:ce[0]||(ce[0]=Qe=>s.unref(on)(Qe,()=>O(!0))),onClick:ce[1]||(ce[1]=Qe=>O(!0))},[K.$slots["clock-icon"]?s.renderSlot(K.$slots,"clock-icon",{key:0}):s.createCommentVNode("",!0),K.$slots["clock-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(np),{key:1}))],42,mM)),[[s.vShow,!s.unref(y)(K.hideNavigation,"time")]]):s.createCommentVNode("",!0),s.createVNode(s.Transition,{name:s.unref(g)(Q.value),css:s.unref(B)&&!K.timePickerInline},{default:s.withCtx(()=>{var Qe,R;return[Q.value||K.timePicker||K.timePickerInline?(s.openBlock(),s.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:S,role:K.timePickerInline?void 0:"dialog",class:s.normalizeClass({dp__overlay:!K.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!K.timePickerInline,"dp--overlay-relative":r.timePicker}),style:s.normalizeStyle(K.timePicker?{height:`${s.unref(h).modeHeight}px`}:void 0),"aria-label":(Qe=s.unref(u))==null?void 0:Qe.timePicker,tabindex:K.timePickerInline?void 0:0},[s.createElementVNode("div",{class:s.normalizeClass(K.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[K.$slots["time-picker-overlay"]?s.renderSlot(K.$slots,"time-picker-overlay",{key:0,hours:t.hours,minutes:t.minutes,seconds:t.seconds,setHours:ue,setMinutes:H,setSeconds:G}):s.createCommentVNode("",!0),K.$slots["time-picker-overlay"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(K.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(M.value,(J,Ae)=>s.withDirectives((s.openBlock(),s.createBlock(hM,s.mergeProps({key:Ae,ref_for:!0},{...K.$props,order:Ae,hours:J.hours,minutes:J.minutes,seconds:J.seconds,closeTimePickerBtn:w.value,disabledTimesConfig:t.disabledTimesConfig,disabled:Ae===0?s.unref(p).fixedStart:s.unref(p).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:v,"validate-time":(oe,k)=>t.validateTime(oe,ae(k,Ae,oe)),"onUpdate:hours":oe=>ue(ae(oe,Ae,"hours")),"onUpdate:minutes":oe=>H(ae(oe,Ae,"minutes")),"onUpdate:seconds":oe=>G(ae(oe,Ae,"seconds")),onMounted:$,onOverlayClosed:te,onOverlayOpened:ee,onAmPmChange:ce[2]||(ce[2]=oe=>K.$emit("am-pm-change",oe))}),s.createSlots({_:2},[s.renderList(s.unref(ie),(oe,k)=>({name:oe,fn:s.withCtx(X=>[s.renderSlot(K.$slots,oe,s.mergeProps({ref_for:!0},X))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[s.vShow,Ae===0?!0:I.value]])),128))],2)),!K.timePicker&&!K.timePickerInline?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:2,ref_key:"closeTimePickerBtn",ref:w,type:"button",class:s.normalizeClass({...P.value,"dp--hidden-el":F.value}),"aria-label":(R=s.unref(u))==null?void 0:R.closeTimePicker,tabindex:"0",onKeydown:ce[3]||(ce[3]=J=>s.unref(on)(J,()=>O(!1))),onClick:ce[4]||(ce[4]=J=>O(!1))},[K.$slots["calendar-icon"]?s.renderSlot(K.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),K.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))],42,BM)),[[s.vShow,!s.unref(y)(K.hideNavigation,"time")]]):s.createCommentVNode("",!0)],2)],14,gM)):s.createCommentVNode("",!0)]}),_:3},8,["name","css"])],8,pM)}}}),K0=(t,e,A,n)=>{const{defaultedRange:r}=Gt(t),o=(S,F)=>Array.isArray(e[S])?e[S][F]:e[S],i=S=>t.enableSeconds?Array.isArray(e.seconds)?e.seconds[S]:e.seconds:0,a=(S,F)=>S?F!==void 0?Xo(S,o("hours",F),o("minutes",F),i(F)):Xo(S,e.hours,e.minutes,i()):h0(ye(),i(F)),l=(S,F)=>{e[S]=F},u=s.computed(()=>t.modelAuto&&r.value.enabled?Array.isArray(A.value)?A.value.length>1:!1:r.value.enabled),f=(S,F)=>{const I=Object.fromEntries(Object.keys(e).map(Q=>Q===S?[Q,F]:[Q,e[Q]].slice()));if(u.value&&!r.value.disableTimeRangeValidation){const Q=M=>A.value?Xo(A.value[M],I.hours[M],I.minutes[M],I.seconds[M]):null,x=M=>f0(A.value[M],0);return!(dt(Q(0),Q(1))&&(ji(Q(0),x(1))||Js(Q(1),x(0))))}return!0},h=(S,F)=>{f(S,F)&&(l(S,F),n&&n())},p=S=>{h("hours",S)},g=S=>{h("minutes",S)},B=S=>{h("seconds",S)},y=(S,F,I,Q)=>{F&&p(S),!F&&!I&&g(S),I&&B(S),A.value&&Q(A.value)},b=S=>{if(S){const F=Array.isArray(S),I=F?[+S[0].hours,+S[1].hours]:+S.hours,Q=F?[+S[0].minutes,+S[1].minutes]:+S.minutes,x=F?[+S[0].seconds,+S[1].seconds]:+S.seconds;l("hours",I),l("minutes",Q),t.enableSeconds&&l("seconds",x)}},w=(S,F)=>{const I={hours:Array.isArray(e.hours)?e.hours[S]:e.hours,disabledArr:[]};return(F||F===0)&&(I.hours=F),Array.isArray(t.disabledTimes)&&(I.disabledArr=r.value.enabled&&Array.isArray(t.disabledTimes[S])?t.disabledTimes[S]:t.disabledTimes),I},v=s.computed(()=>(S,F)=>{var I;if(Array.isArray(t.disabledTimes)){const{disabledArr:Q,hours:x}=w(S,F),M=Q.filter(O=>+O.hours===x);return((I=M[0])==null?void 0:I.minutes)==="*"?{hours:[x],minutes:void 0,seconds:void 0}:{hours:[],minutes:M?.map(O=>+O.minutes)??[],seconds:M?.map(O=>O.seconds?+O.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:l,updateHours:p,updateMinutes:g,updateSeconds:B,getSetDateTime:a,updateTimeValues:y,getSecondsValue:i,assignStartTime:b,validateTime:f,disabledTimesConfig:v}},yM=(t,e)=>{const A=()=>{t.isTextInputDate&&F()},{modelValue:n,time:r}=Bl(t,e,A),{defaultedStartTime:o,defaultedRange:i,defaultedTz:a}=Gt(t),{updateTimeValues:l,getSetDateTime:u,setTime:f,assignStartTime:h,disabledTimesConfig:p,validateTime:g}=K0(t,r,n,B);function B(){e("update-flow-step")}const y=Q=>{const{hours:x,minutes:M,seconds:O}=Q;return{hours:+x,minutes:+M,seconds:O?+O:0}},b=()=>{if(t.startTime){if(Array.isArray(t.startTime)){const x=y(t.startTime[0]),M=y(t.startTime[1]);return[Tt(ye(),x),Tt(ye(),M)]}const Q=y(t.startTime);return Tt(ye(),Q)}return i.value.enabled?[null,null]:null},w=()=>{if(i.value.enabled){const[Q,x]=b();n.value=[wn(u(Q,0),a.value.timezone),wn(u(x,1),a.value.timezone)]}else n.value=wn(u(b()),a.value.timezone)},v=Q=>Array.isArray(Q)?[Zi(ye(Q[0])),Zi(ye(Q[1]))]:[Zi(Q??ye())],S=(Q,x,M)=>{f("hours",Q),f("minutes",x),f("seconds",t.enableSeconds?M:0)},F=()=>{const[Q,x]=v(n.value);return i.value.enabled?S([Q.hours,x.hours],[Q.minutes,x.minutes],[Q.seconds,x.seconds]):S(Q.hours,Q.minutes,Q.seconds)};s.onMounted(()=>{if(!t.shadow)return h(o.value),n.value?F():w()});const I=()=>{Array.isArray(n.value)?n.value=n.value.map((Q,x)=>Q&&u(Q,x)):n.value=u(n.value),e("time-update")};return{modelValue:n,time:r,disabledTimesConfig:p,updateTime:(Q,x=!0,M=!1)=>{l(Q,x,M,I)},validateTime:g}},wM=s.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...br},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=_n(o,"timePicker"),a=s.ref(null),{time:l,modelValue:u,disabledTimesConfig:f,updateTime:h,validateTime:p}=yM(r,n);return s.onMounted(()=>{r.shadow||n("mount",null)}),e({getSidebarProps:()=>({modelValue:u,time:l,updateTime:h}),toggleTimePicker:(g,B=!1,y="")=>{var b;(b=a.value)==null||b.toggleTimePicker(g,B,y)}}),(g,B)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":0,stretch:"","is-mobile":g.isMobile},{default:s.withCtx(()=>[s.createVNode($0,s.mergeProps({ref_key:"tpRef",ref:a},g.$props,{hours:s.unref(l).hours,minutes:s.unref(l).minutes,seconds:s.unref(l).seconds,"internal-model-value":g.internalModelValue,"disabled-times-config":s.unref(f),"validate-time":s.unref(p),"onUpdate:hours":B[0]||(B[0]=y=>s.unref(h)(y)),"onUpdate:minutes":B[1]||(B[1]=y=>s.unref(h)(y,!1)),"onUpdate:seconds":B[2]||(B[2]=y=>s.unref(h)(y,!1,!0)),onAmPmChange:B[3]||(B[3]=y=>g.$emit("am-pm-change",y)),onResetFlow:B[4]||(B[4]=y=>g.$emit("reset-flow")),onOverlayClosed:B[5]||(B[5]=y=>g.$emit("overlay-toggle",{open:!1,overlay:y})),onOverlayOpened:B[6]||(B[6]=y=>g.$emit("overlay-toggle",{open:!0,overlay:y}))}),s.createSlots({_:2},[s.renderList(s.unref(i),(y,b)=>({name:y,fn:s.withCtx(w=>[s.renderSlot(g.$slots,y,s.normalizeProps(s.guardReactiveProps(w)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3},8,["is-mobile"]))}}),CM={class:"dp--header-wrap"},bM={key:0,class:"dp__month_year_wrap"},vM={key:0},EM={class:"dp__month_year_wrap"},kM=["data-dp-element","aria-label","data-test-id","onClick","onKeydown"],SM=s.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...br},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(t,{expose:e,emit:A}){const n=A,r=t,{defaultedTransitions:o,defaultedAriaLabels:i,defaultedMultiCalendars:a,defaultedFilters:l,defaultedConfig:u,defaultedHighlight:f,propDates:h,defaultedUI:p}=Gt(r),{transitionName:g,showTransition:B}=gl(o),{buildMatrix:y}=qo(),{handleMonthYearChange:b,isDisabled:w,updateMonthYear:v}=WO(r,n),{showLeftIcon:S,showRightIcon:F}=ru(),I=s.ref(!1),Q=s.ref(!1),x=s.ref(!1),M=s.ref([null,null,null,null]);s.onMounted(()=>{n("mount")});const O=R=>({get:()=>r[R],set:J=>{const Ae=R===yr.month?yr.year:yr.month;n("update-month-year",{[R]:J,[Ae]:r[Ae]}),R===yr.month?te(!0):ee(!0)}}),P=s.computed(O(yr.month)),ie=s.computed(O(yr.year)),ae=s.computed(()=>R=>({month:r.month,year:r.year,items:R===yr.month?r.months:r.years,instance:r.instance,updateMonthYear:v,toggle:R===yr.month?te:ee})),ue=s.computed(()=>r.months.find(J=>J.value===r.month)||{text:"",value:0}),H=s.computed(()=>ea(r.months,R=>{const J=r.month===R.value,Ae=dl(R.value,Q0(r.year,h.value.minDate),F0(r.year,h.value.maxDate))||l.value.months.includes(R.value),oe=D0(f.value,R.value,r.year);return{active:J,disabled:Ae,highlighted:oe}})),G=s.computed(()=>ea(r.years,R=>{const J=r.year===R.value,Ae=dl(R.value,ta(h.value.minDate),ta(h.value.maxDate))||l.value.years.includes(R.value),oe=Bp(f.value,R.value);return{active:J,disabled:Ae,highlighted:oe}})),$=(R,J,Ae)=>{Ae!==void 0?R.value=Ae:R.value=!R.value,R.value?(x.value=!0,n("overlay-opened",J)):(x.value=!1,n("overlay-closed",J))},te=(R=!1,J)=>{K(R),$(I,zA.month,J)},ee=(R=!1,J)=>{K(R),$(Q,zA.year,J)},K=R=>{R||n("reset-flow")},ce=(R,J)=>{r.arrowNavigation&&(M.value[J]=BA(R),y(M.value,"monthYear"))},j=s.computed(()=>{var R,J,Ae,oe,k,X;return[{type:yr.month,index:1,toggle:te,modelValue:P.value,updateModelValue:Se=>P.value=Se,text:ue.value.text,showSelectionGrid:I.value,items:H.value,ariaLabel:(R=i.value)==null?void 0:R.openMonthsOverlay,overlayLabel:((Ae=(J=i.value).monthPicker)==null?void 0:Ae.call(J,!0))??void 0},{type:yr.year,index:2,toggle:ee,modelValue:ie.value,updateModelValue:Se=>ie.value=Se,text:v0(r.year,r.locale),showSelectionGrid:Q.value,items:G.value,ariaLabel:(oe=i.value)==null?void 0:oe.openYearsOverlay,overlayLabel:((X=(k=i.value).yearPicker)==null?void 0:X.call(k,!0))??void 0}]}),Qe=s.computed(()=>r.disableYearSelect?[j.value[0]]:r.yearFirst?[...j.value].reverse():j.value);return e({toggleMonthPicker:te,toggleYearPicker:ee,handleMonthYearChange:b}),(R,J)=>{var Ae,oe,k,X,Se,ht;return s.openBlock(),s.createElementBlock("div",CM,[R.$slots["month-year"]?(s.openBlock(),s.createElementBlock("div",bM,[s.renderSlot(R.$slots,"month-year",s.normalizeProps(s.guardReactiveProps({month:t.month,year:t.year,months:t.months,years:t.years,updateMonthYear:s.unref(v),handleMonthYearChange:s.unref(b),instance:t.instance,isDisabled:s.unref(w)})))])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[R.$slots["top-extra"]?(s.openBlock(),s.createElementBlock("div",vM,[s.renderSlot(R.$slots,"top-extra",{value:R.internalModelValue})])):s.createCommentVNode("",!0),s.createElementVNode("div",EM,[s.unref(S)(s.unref(a),t.instance)&&!R.vertical?(s.openBlock(),s.createBlock(ml,{key:0,"aria-label":(Ae=s.unref(i))==null?void 0:Ae.prevMonth,disabled:s.unref(w)(!1),class:s.normalizeClass((oe=s.unref(p))==null?void 0:oe.navBtnPrev),"el-name":"action-prev",onActivate:J[0]||(J[0]=se=>s.unref(b)(!1,!0)),onSetRef:J[1]||(J[1]=se=>ce(se,0))},{default:s.withCtx(()=>[R.$slots["arrow-left"]?s.renderSlot(R.$slots,"arrow-left",{key:0}):s.createCommentVNode("",!0),R.$slots["arrow-left"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(tp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:s.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:R.disableYearSelect}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(Qe.value,(se,Ye)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:se.type},[s.createElementVNode("button",{ref_for:!0,ref:ge=>ce(ge,Ye+1),type:"button","data-dp-element":`overlay-${se.type}`,class:s.normalizeClass(["dp__btn dp__month_year_select",{"dp--hidden-el":x.value}]),"aria-label":`${se.text}-${se.ariaLabel}`,"data-test-id":`${se.type}-toggle-overlay-${t.instance}`,onClick:se.toggle,onKeydown:ge=>s.unref(on)(ge,()=>se.toggle(),!0)},[R.$slots[se.type]?s.renderSlot(R.$slots,se.type,{key:0,text:se.text,value:r[se.type]}):s.createCommentVNode("",!0),R.$slots[se.type]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(se.text),1)],64))],42,kM),s.createVNode(s.Transition,{name:s.unref(g)(se.showSelectionGrid),css:s.unref(B)},{default:s.withCtx(()=>[se.showSelectionGrid?(s.openBlock(),s.createBlock(pl,{key:0,items:se.items,"arrow-navigation":R.arrowNavigation,"hide-navigation":R.hideNavigation,"is-last":R.autoApply&&!s.unref(u).keepActionRow,"skip-button-ref":!1,config:R.config,type:se.type,"header-refs":[],"esc-close":R.escClose,"menu-wrap-ref":R.menuWrapRef,"text-input":R.textInput,"aria-labels":R.ariaLabels,"overlay-label":se.overlayLabel,onSelected:se.updateModelValue,onToggle:se.toggle},s.createSlots({"button-icon":s.withCtx(()=>[R.$slots["calendar-icon"]?s.renderSlot(R.$slots,"calendar-icon",{key:0}):s.createCommentVNode("",!0),R.$slots["calendar-icon"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(qs),{key:1}))]),_:2},[R.$slots[`${se.type}-overlay-value`]?{name:"item",fn:s.withCtx(({item:ge})=>[s.renderSlot(R.$slots,`${se.type}-overlay-value`,{text:ge.text,value:ge.value})]),key:"0"}:void 0,R.$slots[`${se.type}-overlay`]?{name:"overlay",fn:s.withCtx(()=>[s.renderSlot(R.$slots,`${se.type}-overlay`,s.mergeProps({ref_for:!0},ae.value(se.type)))]),key:"1"}:void 0,R.$slots[`${se.type}-overlay-header`]?{name:"header",fn:s.withCtx(()=>[s.renderSlot(R.$slots,`${se.type}-overlay-header`,{toggle:se.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):s.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),s.unref(S)(s.unref(a),t.instance)&&R.vertical?(s.openBlock(),s.createBlock(ml,{key:1,"aria-label":(k=s.unref(i))==null?void 0:k.prevMonth,"el-name":"action-prev",disabled:s.unref(w)(!1),class:s.normalizeClass((X=s.unref(p))==null?void 0:X.navBtnPrev),onActivate:J[2]||(J[2]=se=>s.unref(b)(!1,!0))},{default:s.withCtx(()=>[R.$slots["arrow-up"]?s.renderSlot(R.$slots,"arrow-up",{key:0}):s.createCommentVNode("",!0),R.$slots["arrow-up"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.unref(rp),{key:1}))]),_:3},8,["aria-label","disabled","class"])):s.createCommentVNode("",!0),s.unref(F)(s.unref(a),t.instance)?(s.openBlock(),s.createBlock(ml,{key:2,ref:"rightIcon","el-name":"action-next",disabled:s.unref(w)(!0),"aria-label":(Se=s.unref(i))==null?void 0:Se.nextMonth,class:s.normalizeClass((ht=s.unref(p))==null?void 0:ht.navBtnNext),onActivate:J[3]||(J[3]=se=>s.unref(b)(!0,!0)),onSetRef:J[4]||(J[4]=se=>ce(se,R.disableYearSelect?2:3))},{default:s.withCtx(()=>[R.$slots[R.vertical?"arrow-down":"arrow-right"]?s.renderSlot(R.$slots,R.vertical?"arrow-down":"arrow-right",{key:0}):s.createCommentVNode("",!0),R.$slots[R.vertical?"arrow-down":"arrow-right"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.vertical?s.unref(op):s.unref(Ap)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):s.createCommentVNode("",!0)])],64))])}}}),QM={class:"dp__calendar_header",role:"row"},FM={key:0,class:"dp__calendar_header_item",role:"gridcell"},UM=["aria-label"],IM={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},xM={class:"dp__cell_inner"},TM=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test-id","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],_M=s.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...br},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(t,{expose:e,emit:A}){const n=A,r=t,{buildMultiLevelMatrix:o}=qo(),{defaultedTransitions:i,defaultedConfig:a,defaultedAriaLabels:l,defaultedMultiCalendars:u,defaultedWeekNumbers:f,defaultedMultiDates:h,defaultedUI:p}=Gt(r),g=s.ref(null),B=s.ref({bottom:"",left:"",transform:""}),y=s.ref([]),b=s.ref(null),w=s.ref(!0),v=s.ref(""),S=s.ref({startX:0,endX:0,startY:0,endY:0}),F=s.ref([]),I=s.ref({left:"50%"}),Q=s.ref(!1),x=s.computed(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),M=s.computed(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):dO(r.formatLocale,r.locale,+r.weekStart));s.onMounted(()=>{n("mount",{cmp:"calendar",refs:y}),a.value.noSwipe||b.value&&(b.value.addEventListener("touchstart",ce,{passive:!1}),b.value.addEventListener("touchend",j,{passive:!1}),b.value.addEventListener("touchmove",Qe,{passive:!1})),r.monthChangeOnScroll&&b.value&&b.value.addEventListener("wheel",Ae,{passive:!1})}),s.onUnmounted(()=>{a.value.noSwipe||b.value&&(b.value.removeEventListener("touchstart",ce),b.value.removeEventListener("touchend",j),b.value.removeEventListener("touchmove",Qe)),r.monthChangeOnScroll&&b.value&&b.value.removeEventListener("wheel",Ae)});const O=se=>se?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",P=(se,Ye)=>{if(r.transitions){const ge=UA(Bo(ye(),r.month,r.year));v.value=aA(UA(Bo(ye(),se,Ye)),ge)?i.value[O(!0)]:i.value[O(!1)],w.value=!1,s.nextTick(()=>{w.value=!0})}},ie=s.computed(()=>({...p.value.calendar??{}})),ae=s.computed(()=>se=>{const Ye=hO(se);return{dp__marker_dot:Ye.type==="dot",dp__marker_line:Ye.type==="line"}}),ue=s.computed(()=>se=>dt(se,g.value)),H=s.computed(()=>({dp__calendar:!0,dp__calendar_next:u.value.count>0&&r.instance!==0})),G=s.computed(()=>se=>r.hideOffsetDates?se.current:!0),$=async(se,Ye)=>{const{width:ge,height:Ce}=se.getBoundingClientRect();g.value=Ye.value;let D={left:`${ge/2}px`},ke=-50;if(await s.nextTick(),F.value[0]){const{left:be,width:_}=F.value[0].getBoundingClientRect();be<0&&(D={left:"0"},ke=0,I.value.left=`${ge/2}px`),window.innerWidth<be+_&&(D={right:"0"},ke=0,I.value.left=`${_-ge/2}px`)}B.value={bottom:`${Ce}px`,...D,transform:`translateX(${ke}%)`}},te=async(se,Ye,ge)=>{var Ce,D,ke;const be=BA(y.value[Ye][ge]);be&&((Ce=se.marker)!=null&&Ce.customPosition&&(ke=(D=se.marker)==null?void 0:D.tooltip)!=null&&ke.length?B.value=se.marker.customPosition(be):await $(be,se),n("tooltip-open",se.marker))},ee=async(se,Ye,ge)=>{var Ce,D;if(Q.value&&h.value.enabled&&h.value.dragSelect)return n("select-date",se);if(n("set-hover-date",se),(D=(Ce=se.marker)==null?void 0:Ce.tooltip)!=null&&D.length){if(r.hideOffsetDates&&!se.current)return;await te(se,Ye,ge)}},K=se=>{g.value&&(g.value=null,B.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),n("tooltip-close",se.marker))},ce=se=>{S.value.startX=se.changedTouches[0].screenX,S.value.startY=se.changedTouches[0].screenY},j=se=>{S.value.endX=se.changedTouches[0].screenX,S.value.endY=se.changedTouches[0].screenY,R()},Qe=se=>{r.vertical&&!r.inline&&se.preventDefault()},R=()=>{const se=r.vertical?"Y":"X";Math.abs(S.value[`start${se}`]-S.value[`end${se}`])>10&&n("handle-swipe",S.value[`start${se}`]>S.value[`end${se}`]?"right":"left")},J=(se,Ye,ge)=>{se&&(Array.isArray(y.value[Ye])?y.value[Ye][ge]=se:y.value[Ye]=[se]),r.arrowNavigation&&o(y.value,"calendar")},Ae=se=>{r.monthChangeOnScroll&&(se.preventDefault(),n("handle-scroll",se))},oe=se=>f.value.type==="local"?Jh(se.value,{weekStartsOn:+r.weekStart}):f.value.type==="iso"?zh(se.value):typeof f.value.type=="function"?f.value.type(se.value):"",k=se=>{const Ye=se[0];return f.value.hideOnOffsetDates?se.some(ge=>ge.current)?oe(Ye):"":oe(Ye)},X=(se,Ye,ge=!0)=>{!ge&&yO()||(!h.value.enabled||a.value.allowPreventDefault)&&(Jo(se,a.value),n("select-date",Ye))},Se=se=>{Jo(se,a.value)},ht=se=>{h.value.enabled&&h.value.dragSelect?(Q.value=!0,n("select-date",se)):h.value.enabled&&n("select-date",se)};return e({triggerTransition:P}),(se,Ye)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(H.value)},[s.createElementVNode("div",{ref_key:"calendarWrapRef",ref:b,class:s.normalizeClass(ie.value),role:"grid"},[s.createElementVNode("div",QM,[se.weekNumbers?(s.openBlock(),s.createElementBlock("div",FM,s.toDisplayString(se.weekNumName),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(M.value,(ge,Ce)=>{var D,ke;return s.openBlock(),s.createElementBlock("div",{key:Ce,class:"dp__calendar_header_item",role:"gridcell","data-test-id":"calendar-header","aria-label":(ke=(D=s.unref(l))==null?void 0:D.weekDay)==null?void 0:ke.call(D,Ce)},[se.$slots["calendar-header"]?s.renderSlot(se.$slots,"calendar-header",{key:0,day:ge,index:Ce}):s.createCommentVNode("",!0),se.$slots["calendar-header"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(ge),1)],64))],8,UM)}),128))]),Ye[2]||(Ye[2]=s.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1)),s.createVNode(s.Transition,{name:v.value,css:!!se.transitions},{default:s.withCtx(()=>[w.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:Ye[1]||(Ye[1]=ge=>Q.value=!1)},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(x.value,(ge,Ce)=>(s.openBlock(),s.createElementBlock("div",{key:Ce,class:"dp__calendar_row",role:"row"},[se.weekNumbers?(s.openBlock(),s.createElementBlock("div",IM,[s.createElementVNode("div",xM,s.toDisplayString(k(ge.days)),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(ge.days,(D,ke)=>{var be,_,N;return s.openBlock(),s.createElementBlock("div",{id:s.unref(yp)(D.value),ref_for:!0,ref:ne=>J(ne,Ce,ke),key:ke+Ce,role:"gridcell",class:"dp__calendar_item","aria-pressed":(D.classData.dp__active_date||D.classData.dp__range_start||D.classData.dp__range_start)??void 0,"aria-disabled":D.classData.dp__cell_disabled||void 0,"aria-label":(_=(be=s.unref(l))==null?void 0:be.day)==null?void 0:_.call(be,D),tabindex:!D.current&&se.hideOffsetDates?void 0:0,"data-test-id":s.unref(yp)(D.value),onClick:s.withModifiers(ne=>X(ne,D),["prevent"]),onTouchend:ne=>X(ne,D,!1),onKeydown:ne=>s.unref(on)(ne,()=>se.$emit("select-date",D)),onMouseenter:ne=>ee(D,Ce,ke),onMouseleave:ne=>K(D),onMousedown:ne=>ht(D),onMouseup:Ye[0]||(Ye[0]=ne=>Q.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["dp__cell_inner",D.classData])},[se.$slots.day&&G.value(D)?s.renderSlot(se.$slots,"day",{key:0,day:+D.text,date:D.value}):s.createCommentVNode("",!0),se.$slots.day?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(D.text),1)],64)),D.marker&&G.value(D)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[se.$slots.marker?s.renderSlot(se.$slots,"marker",{key:0,marker:D.marker,day:+D.text,date:D.value}):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(ae.value(D.marker)),style:s.normalizeStyle(D.marker.color?{backgroundColor:D.marker.color}:{})},null,6))],64)):s.createCommentVNode("",!0),ue.value(D.value)?(s.openBlock(),s.createElementBlock("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:F,class:"dp__marker_tooltip",style:s.normalizeStyle(B.value)},[(N=D.marker)!=null&&N.tooltip?(s.openBlock(),s.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:Se},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.marker.tooltip,(ne,ve)=>(s.openBlock(),s.createElementBlock("div",{key:ve,class:"dp__tooltip_text"},[se.$slots["marker-tooltip"]?s.renderSlot(se.$slots,"marker-tooltip",{key:0,tooltip:ne,day:D.value}):s.createCommentVNode("",!0),se.$slots["marker-tooltip"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",{class:"dp__tooltip_mark",style:s.normalizeStyle(ne.color?{backgroundColor:ne.color}:{})},null,4),s.createElementVNode("div",null,s.toDisplayString(ne.text),1)],64))]))),128)),s.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:s.normalizeStyle(I.value)},null,4)])):s.createCommentVNode("",!0)],4)):s.createCommentVNode("",!0)],2)],40,TM)}),128))]))),128))],32)):s.createCommentVNode("",!0)]),_:3},8,["name","css"])],2)],2))}}),G0=t=>Array.isArray(t),DM=(t,e,A,n)=>{const r=s.ref([]),o=s.ref(new Date),i=s.ref(),a=()=>j(t.isTextInputDate),{modelValue:l,calendars:u,time:f,today:h}=Bl(t,e,a),{defaultedMultiCalendars:p,defaultedStartTime:g,defaultedRange:B,defaultedConfig:y,defaultedTz:b,propDates:w,defaultedMultiDates:v}=Gt(t),{validateMonthYearInRange:S,isDisabled:F,isDateRangeAllowed:I,checkMinMaxRange:Q}=ei(t),{updateTimeValues:x,getSetDateTime:M,setTime:O,assignStartTime:P,validateTime:ie,disabledTimesConfig:ae}=K0(t,f,l,n),ue=s.computed(()=>Z=>u.value[Z]?u.value[Z].month:0),H=s.computed(()=>Z=>u.value[Z]?u.value[Z].year:0),G=Z=>!y.value.keepViewOnOffsetClick||Z?!0:!i.value,$=(Z,Fe,Ve,At=!1)=>{var he,xe;G(At)&&(u.value[Z]||(u.value[Z]={month:0,year:0}),u.value[Z].month=C0(Fe)?(he=u.value[Z])==null?void 0:he.month:Fe,u.value[Z].year=C0(Ve)?(xe=u.value[Z])==null?void 0:xe.year:Ve)},te=()=>{t.autoApply&&e("select-date")},ee=()=>{g.value&&P(g.value)};s.onMounted(()=>{t.shadow||(l.value||(Ye(),ee()),j(!0),t.focusStartDate&&t.startDate&&Ye())});const K=s.computed(()=>{var Z;return(Z=t.flow)!=null&&Z.length&&!t.partialFlow?t.flowStep===t.flow.length:!0}),ce=()=>{t.autoApply&&K.value&&e("auto-apply",t.partialFlow?t.flowStep!==t.flow.length:!1)},j=(Z=!1)=>{if(l.value)return Array.isArray(l.value)?(r.value=l.value,X(Z)):J(l.value,Z);if(p.value.count&&Z&&!t.startDate)return R(ye(),Z)},Qe=()=>Array.isArray(l.value)&&B.value.enabled?ut(l.value[0])===ut(l.value[1]??l.value[0]):!1,R=(Z=new Date,Fe=!1)=>{if((!p.value.count||!p.value.static||Fe)&&$(0,ut(Z),qe(Z)),p.value.count&&(!l.value||Qe()||!p.value.solo)&&(!p.value.solo||Fe))for(let Ve=1;Ve<p.value.count;Ve++){const At=Tt(ye(),{month:ue.value(Ve-1),year:H.value(Ve-1)}),he=Rw(At,{months:1});u.value[Ve]={month:ut(he),year:qe(he)}}},J=(Z,Fe)=>{R(Z),O("hours",mo(Z)),O("minutes",Yo(Z)),O("seconds",Ys(Z)),p.value.count&&Fe&&se()},Ae=Z=>{if(p.value.count){if(p.value.solo)return 0;const Fe=ut(Z[0]),Ve=ut(Z[1]);return Math.abs(Ve-Fe)<p.value.count?0:1}return 1},oe=(Z,Fe)=>{Z[1]&&B.value.showLastInRange?R(Z[Ae(Z)],Fe):R(Z[0],Fe);const Ve=(At,he)=>[At(Z[0]),Z[1]?At(Z[1]):f[he][1]];O("hours",Ve(mo,"hours")),O("minutes",Ve(Yo,"minutes")),O("seconds",Ve(Ys,"seconds"))},k=(Z,Fe)=>{if((B.value.enabled||t.weekPicker)&&!v.value.enabled)return oe(Z,Fe);if(v.value.enabled&&Fe){const Ve=Z[Z.length-1];return J(Ve,Fe)}},X=Z=>{const Fe=l.value;k(Fe,Z),p.value.count&&p.value.solo&&se()},Se=(Z,Fe)=>{const Ve=Tt(ye(),{month:ue.value(Fe),year:H.value(Fe)}),At=Z<0?gr(Ve,1):js(Ve,1);S(ut(At),qe(At),Z<0,t.preventMinMaxNavigation)&&($(Fe,ut(At),qe(At)),e("update-month-year",{instance:Fe,month:ut(At),year:qe(At)}),p.value.count&&!p.value.solo&&ht(Fe),A())},ht=Z=>{for(let Fe=Z-1;Fe>=0;Fe--){const Ve=js(Tt(ye(),{month:ue.value(Fe+1),year:H.value(Fe+1)}),1);$(Fe,ut(Ve),qe(Ve))}for(let Fe=Z+1;Fe<=p.value.count-1;Fe++){const Ve=gr(Tt(ye(),{month:ue.value(Fe-1),year:H.value(Fe-1)}),1);$(Fe,ut(Ve),qe(Ve))}},se=()=>{if(Array.isArray(l.value)&&l.value.length===2){const Z=ye(ye(l.value[1]?l.value[1]:gr(l.value[0],1))),[Fe,Ve]=[ut(l.value[0]),qe(l.value[0])],[At,he]=[ut(l.value[1]),qe(l.value[1])];(Fe!==At||Fe===At&&Ve!==he)&&p.value.solo&&$(1,ut(Z),qe(Z))}else l.value&&!Array.isArray(l.value)&&($(0,ut(l.value),qe(l.value)),R(ye()))},Ye=()=>{t.startDate&&($(0,ut(ye(t.startDate)),qe(ye(t.startDate))),p.value.count&&ht(0))},ge=(Z,Fe)=>{if(t.monthChangeOnScroll){const Ve=new Date().getTime()-o.value.getTime(),At=Math.abs(Z.deltaY);let he=500;At>1&&(he=100),At>100&&(he=0),Ve>he&&(o.value=new Date,Se(t.monthChangeOnScroll!=="inverse"?-Z.deltaY:Z.deltaY,Fe))}},Ce=(Z,Fe,Ve=!1)=>{t.monthChangeOnArrows&&t.vertical===Ve&&D(Z,Fe)},D=(Z,Fe)=>{Se(Z==="right"?-1:1,Fe)},ke=Z=>{if(w.value.markers)return qc(Z.value,w.value.markers)},be=(Z,Fe)=>{switch(t.sixWeeks===!0?"append":t.sixWeeks){case"prepend":return[!0,!1];case"center":return[Z==0,!0];case"fair":return[Z==0||Fe>Z,!0];case"append":return[!1,!1];default:return[!1,!1]}},_=(Z,Fe,Ve,At)=>{if(t.sixWeeks&&Z.length<6){const he=6-Z.length,xe=(Fe.getDay()+7-At)%7,He=6-(Ve.getDay()+7-At)%7,[Or,ar]=be(xe,He);for(let co=1;co<=he;co++)if(ar?!!(co%2)==Or:Or){const uo=Z[0].days[0],Dc=N(Xn(uo.value,-7),ut(Fe));Z.unshift({days:Dc})}else{const uo=Z[Z.length-1],Dc=uo.days[uo.days.length-1],by=N(Xn(Dc.value,1),ut(Fe));Z.push({days:by})}}return Z},N=(Z,Fe)=>{const Ve=ye(Z),At=[];for(let he=0;he<7;he++){const xe=Xn(Ve,he),He=ut(xe)!==Fe;At.push({text:t.hideOffsetDates&&He?"":xe.getDate(),value:xe,current:!He,classData:{}})}return At},ne=(Z,Fe)=>{const Ve=[],At=new Date(Fe,Z),he=new Date(Fe,Z+1,0),xe=t.weekStart,He=Br(At,{weekStartsOn:xe}),Or=ar=>{const co=N(ar,Z);if(Ve.push({days:co}),!Ve[Ve.length-1].days.some(uo=>dt(UA(uo.value),UA(he)))){const uo=Xn(ar,7);Or(uo)}};return Or(He),_(Ve,At,he,xe)},ve=Z=>{const Fe=Xo(ye(Z.value),f.hours,f.minutes,Ue());e("date-update",Fe),v.value.enabled?kp(Fe,l,v.value.limit):l.value=Fe,n(),s.nextTick().then(()=>{ce()})},ze=Z=>B.value.noDisabledRange?U0(r.value[0],Z).some(Fe=>F(Fe)):!1,W=()=>{r.value=l.value?l.value.slice():[],r.value.length===2&&!(B.value.fixedStart||B.value.fixedEnd)&&(r.value=[])},fe=(Z,Fe)=>{const Ve=[ye(Z.value),Xn(ye(Z.value),+B.value.autoRange)];I(Ve)?(Fe&&q(Z.value),r.value=Ve):e("invalid-date",Z.value)},q=Z=>{const Fe=ut(ye(Z)),Ve=qe(ye(Z));if($(0,Fe,Ve),p.value.count>0)for(let At=1;At<p.value.count;At++){const he=bO(Tt(ye(Z),{year:H.value(At-1),month:ue.value(At-1)}));$(At,he.month,he.year)}},me=Z=>{if(ze(Z.value)||!Q(Z.value,l.value,B.value.fixedStart?0:1))return e("invalid-date",Z.value);r.value=P0(ye(Z.value),l,e,B)},Je=(Z,Fe)=>{if(W(),B.value.autoRange)return fe(Z,Fe);if(B.value.fixedStart||B.value.fixedEnd)return me(Z);r.value[0]?Q(ye(Z.value),l.value)&&!ze(Z.value)?tA(ye(Z.value),ye(r.value[0]))?(r.value.unshift(ye(Z.value)),e("range-end",r.value[0])):(r.value[1]=ye(Z.value),e("range-end",r.value[1])):(t.autoApply&&e("auto-apply-invalid",Z.value),e("invalid-date",Z.value)):(r.value[0]=ye(Z.value),e("range-start",r.value[0]))},Ue=(Z=!0)=>t.enableSeconds?Array.isArray(f.seconds)?Z?f.seconds[0]:f.seconds[1]:f.seconds:0,kt=Z=>{r.value[Z]=Xo(r.value[Z],f.hours[Z],f.minutes[Z],Ue(Z!==1))},kA=()=>{var Z,Fe;r.value[0]&&r.value[1]&&+((Z=r.value)==null?void 0:Z[0])>+((Fe=r.value)==null?void 0:Fe[1])&&(r.value.reverse(),e("range-start",r.value[0]),e("range-end",r.value[1]))},Fn=()=>{r.value.length&&(r.value[0]&&!r.value[1]?kt(0):(kt(0),kt(1),n()),kA(),l.value=r.value.slice(),nu(r.value,e,t.autoApply,t.modelAuto))},tn=(Z,Fe=!1)=>{if(F(Z.value)||!Z.current&&t.hideOffsetDates)return e("invalid-date",Z.value);if(i.value=JSON.parse(JSON.stringify(Z)),!B.value.enabled)return ve(Z);G0(f.hours)&&G0(f.minutes)&&!v.value.enabled&&(Je(Z,Fe),Fn())},Mo=(Z,Fe)=>{var Ve;$(Z,Fe.month,Fe.year,!0),p.value.count&&!p.value.solo&&ht(Z),e("update-month-year",{instance:Z,month:Fe.month,year:Fe.year}),A(p.value.solo?Z:void 0);const At=(Ve=t.flow)!=null&&Ve.length?t.flow[t.flowStep]:void 0;!Fe.fromNav&&(At===zA.month||At===zA.year)&&n()},lo=(Z,Fe)=>{R0({value:Z,modelValue:l,range:B.value.enabled,timezone:Fe?void 0:b.value.timezone}),te(),t.multiCalendars&&s.nextTick().then(()=>j(!0))},Ds=()=>{const Z=ip(ye(),b.value);!B.value.enabled&&!v.value.enabled?l.value=Z:l.value&&Array.isArray(l.value)&&l.value[0]?v.value.enabled?l.value=[...l.value,Z]:l.value=tA(Z,l.value[0])?[Z,l.value[0]]:[l.value[0],Z]:l.value=[Z],te()},Ls=()=>{if(Array.isArray(l.value))if(v.value.enabled){const Z=Os();l.value[l.value.length-1]=M(Z)}else l.value=l.value.map((Z,Fe)=>Z&&M(Z,Fe));else l.value=M(l.value);e("time-update")},Os=()=>Array.isArray(l.value)&&l.value.length?l.value[l.value.length-1]:null;return{calendars:u,modelValue:l,month:ue,year:H,time:f,disabledTimesConfig:ae,today:h,validateTime:ie,getCalendarDays:ne,getMarker:ke,handleScroll:ge,handleSwipe:D,handleArrow:Ce,selectDate:tn,updateMonthYear:Mo,presetDate:lo,selectCurrentDate:Ds,updateTime:(Z,Fe=!0,Ve=!1)=>{x(Z,Fe,Ve,Ls)},assignMonthAndYear:R,setStartTime:ee}},LM={key:0},OM=s.defineComponent({__name:"DatePicker",props:{...br},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:A}){const n=A,r=t,{calendars:o,month:i,year:a,modelValue:l,time:u,disabledTimesConfig:f,today:h,validateTime:p,getCalendarDays:g,getMarker:B,handleArrow:y,handleScroll:b,handleSwipe:w,selectDate:v,updateMonthYear:S,presetDate:F,selectCurrentDate:I,updateTime:Q,assignMonthAndYear:x,setStartTime:M}=DM(r,n,Qe,R),O=s.useSlots(),{setHoverDate:P,getDayClassData:ie,clearHoverDate:ae}=ZM(l,r),{defaultedMultiCalendars:ue}=Gt(r),H=s.ref([]),G=s.ref([]),$=s.ref(null),te=_n(O,"calendar"),ee=_n(O,"monthYear"),K=_n(O,"timePicker"),ce=ge=>{r.shadow||n("mount",ge)};s.watch(o,()=>{r.shadow||setTimeout(()=>{n("recalculate-position")},0)},{deep:!0}),s.watch(ue,(ge,Ce)=>{ge.count-Ce.count>0&&x()},{deep:!0});const j=s.computed(()=>ge=>g(i.value(ge),a.value(ge)).map(Ce=>({...Ce,days:Ce.days.map(D=>(D.marker=B(D),D.classData=ie(D),D))})));function Qe(ge){var Ce;ge||ge===0?(Ce=G.value[ge])==null||Ce.triggerTransition(i.value(ge),a.value(ge)):G.value.forEach((D,ke)=>D.triggerTransition(i.value(ke),a.value(ke)))}function R(){n("update-flow-step")}const J=(ge,Ce=!1)=>{v(ge,Ce),r.spaceConfirm&&n("select-date")},Ae=(ge,Ce,D=0)=>{var ke;(ke=H.value[D])==null||ke.toggleMonthPicker(ge,Ce)},oe=(ge,Ce,D=0)=>{var ke;(ke=H.value[D])==null||ke.toggleYearPicker(ge,Ce)},k=(ge,Ce,D)=>{var ke;(ke=$.value)==null||ke.toggleTimePicker(ge,Ce,D)},X=(ge,Ce)=>{var D;if(!r.range){const ke=l.value?l.value:h,be=Ce?new Date(Ce):ke,_=ge?Br(be,{weekStartsOn:1}):Xw(be,{weekStartsOn:1});v({value:_,current:ut(be)===i.value(0),text:"",classData:{}}),(D=document.getElementById(yp(_)))==null||D.focus()}},Se=ge=>{var Ce;(Ce=H.value[0])==null||Ce.handleMonthYearChange(ge,!0)},ht=ge=>{S(0,{month:i.value(0),year:a.value(0)+(ge?1:-1),fromNav:!0})},se=(ge,Ce)=>{ge===zA.time&&n(`time-picker-${Ce?"open":"close"}`),n("overlay-toggle",{open:Ce,overlay:ge})},Ye=ge=>{n("overlay-toggle",{open:!1,overlay:ge}),n("focus-menu")};return e({clearHoverDate:ae,presetDate:F,selectCurrentDate:I,toggleMonthPicker:Ae,toggleYearPicker:oe,toggleTimePicker:k,handleArrow:y,updateMonthYear:S,getSidebarProps:()=>({modelValue:l,month:i,year:a,time:u,updateTime:Q,updateMonthYear:S,selectDate:v,presetDate:F}),changeMonth:Se,changeYear:ht,selectWeekDate:X,setStartTime:M}),(ge,Ce)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(Au,{"multi-calendars":s.unref(ue).count,collapse:ge.collapse,"is-mobile":ge.isMobile},{default:s.withCtx(({instance:D,index:ke})=>[ge.disableMonthYearSelect?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(SM,s.mergeProps({key:0,ref:be=>{be&&(H.value[ke]=be)},months:s.unref(B0)(ge.formatLocale,ge.locale,ge.monthNameFormat),years:s.unref(ap)(ge.yearRange,ge.locale,ge.reverseYears),month:s.unref(i)(D),year:s.unref(a)(D),instance:D},ge.$props,{onMount:Ce[0]||(Ce[0]=be=>ce(s.unref(qi).header)),onResetFlow:Ce[1]||(Ce[1]=be=>ge.$emit("reset-flow")),onUpdateMonthYear:be=>s.unref(S)(D,be),onOverlayClosed:Ye,onOverlayOpened:Ce[2]||(Ce[2]=be=>ge.$emit("overlay-toggle",{open:!0,overlay:be}))}),s.createSlots({_:2},[s.renderList(s.unref(ee),(be,_)=>({name:be,fn:s.withCtx(N=>[s.renderSlot(ge.$slots,be,s.normalizeProps(s.guardReactiveProps(N)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),s.createVNode(_M,s.mergeProps({ref:be=>{be&&(G.value[ke]=be)},"mapped-dates":j.value(D),month:s.unref(i)(D),year:s.unref(a)(D),instance:D},ge.$props,{onSelectDate:be=>s.unref(v)(be,D!==1),onHandleSpace:be=>J(be,D!==1),onSetHoverDate:Ce[3]||(Ce[3]=be=>s.unref(P)(be)),onHandleScroll:be=>s.unref(b)(be,D),onHandleSwipe:be=>s.unref(w)(be,D),onMount:Ce[4]||(Ce[4]=be=>ce(s.unref(qi).calendar)),onResetFlow:Ce[5]||(Ce[5]=be=>ge.$emit("reset-flow")),onTooltipOpen:Ce[6]||(Ce[6]=be=>ge.$emit("tooltip-open",be)),onTooltipClose:Ce[7]||(Ce[7]=be=>ge.$emit("tooltip-close",be))}),s.createSlots({_:2},[s.renderList(s.unref(te),(be,_)=>({name:be,fn:s.withCtx(N=>[s.renderSlot(ge.$slots,be,s.normalizeProps(s.guardReactiveProps({...N})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse","is-mobile"]),ge.enableTimePicker?(s.openBlock(),s.createElementBlock("div",LM,[ge.$slots["time-picker"]?s.renderSlot(ge.$slots,"time-picker",s.normalizeProps(s.mergeProps({key:0},{time:s.unref(u),updateTime:s.unref(Q)}))):(s.openBlock(),s.createBlock($0,s.mergeProps({key:1,ref_key:"timePickerRef",ref:$},ge.$props,{hours:s.unref(u).hours,minutes:s.unref(u).minutes,seconds:s.unref(u).seconds,"internal-model-value":ge.internalModelValue,"disabled-times-config":s.unref(f),"validate-time":s.unref(p),onMount:Ce[8]||(Ce[8]=D=>ce(s.unref(qi).timePicker)),"onUpdate:hours":Ce[9]||(Ce[9]=D=>s.unref(Q)(D)),"onUpdate:minutes":Ce[10]||(Ce[10]=D=>s.unref(Q)(D,!1)),"onUpdate:seconds":Ce[11]||(Ce[11]=D=>s.unref(Q)(D,!1,!0)),onResetFlow:Ce[12]||(Ce[12]=D=>ge.$emit("reset-flow")),onOverlayClosed:Ce[13]||(Ce[13]=D=>se(D,!1)),onOverlayOpened:Ce[14]||(Ce[14]=D=>se(D,!0)),onAmPmChange:Ce[15]||(Ce[15]=D=>ge.$emit("am-pm-change",D))}),s.createSlots({_:2},[s.renderList(s.unref(K),(D,ke)=>({name:D,fn:s.withCtx(be=>[s.renderSlot(ge.$slots,D,s.normalizeProps(s.guardReactiveProps(be)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):s.createCommentVNode("",!0)],64))}}),MM=(t,e)=>{const A=s.ref(),{defaultedMultiCalendars:n,defaultedConfig:r,defaultedHighlight:o,defaultedRange:i,propDates:a,defaultedFilters:l,defaultedMultiDates:u}=Gt(t),{modelValue:f,year:h,month:p,calendars:g}=Bl(t,e),{isDisabled:B}=ei(t),{selectYear:y,groupedYears:b,showYearPicker:w,isDisabled:v,toggleYearPicker:S,handleYearSelect:F,handleYear:I}=V0({modelValue:f,multiCalendars:n,range:i,highlight:o,calendars:g,propDates:a,month:p,year:h,filters:l,props:t,emit:e}),Q=(G,$)=>[G,$].map(te=>Pr(te,"MMMM",{locale:t.formatLocale})).join("-"),x=s.computed(()=>G=>f.value?Array.isArray(f.value)?f.value.some($=>c0(G,$)):c0(f.value,G):!1),M=G=>{if(i.value.enabled){if(Array.isArray(f.value)){const $=dt(G,f.value[0])||dt(G,f.value[1]);return fl(f.value,A.value,G)&&!$}return!1}return!1},O=(G,$)=>G.quarter===Ww($)&&G.year===qe($),P=G=>typeof o.value=="function"?o.value({quarter:Ww(G),year:qe(G)}):!!o.value.quarters.find($=>O($,G)),ie=s.computed(()=>G=>{const $=Tt(new Date,{year:h.value(G)});return hD({start:ll($),end:Jw($)}).map(te=>{const ee=Ji(te),K=jw(te),ce=B(te),j=M(ee),Qe=P(ee);return{text:Q(ee,K),value:ee,active:x.value(ee),highlighted:Qe,disabled:ce,isBetween:j}})}),ae=G=>{kp(G,f,u.value.limit),e("auto-apply",!0)},ue=G=>{f.value=Sp(f,G,e),nu(f.value,e,t.autoApply,t.modelAuto)},H=G=>{f.value=G,e("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:n,groupedYears:b,year:h,isDisabled:v,quarters:ie,showYearPicker:w,modelValue:f,setHoverDate:G=>{A.value=G},selectYear:y,selectQuarter:(G,$,te)=>{if(!te)return g.value[$].month=ut(jw(G)),u.value.enabled?ae(G):i.value.enabled?ue(G):H(G)},toggleYearPicker:S,handleYearSelect:F,handleYear:I}},NM={class:"dp--quarter-items"},HM=["data-test-id","disabled","onClick","onMouseover"],RM=s.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...br},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=_n(o,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:l,groupedYears:u,year:f,isDisabled:h,quarters:p,modelValue:g,showYearPicker:B,setHoverDate:y,selectQuarter:b,toggleYearPicker:w,handleYearSelect:v,handleYear:S}=MM(r,n);return e({getSidebarProps:()=>({modelValue:g,year:f,selectQuarter:b,handleYearSelect:v,handleYear:S})}),(F,I)=>(s.openBlock(),s.createBlock(Au,{"multi-calendars":s.unref(a).count,collapse:F.collapse,stretch:"","is-mobile":F.isMobile},{default:s.withCtx(({instance:Q})=>[s.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:s.normalizeStyle({minHeight:`${s.unref(l).modeHeight}px`})},[F.$slots["top-extra"]?s.renderSlot(F.$slots,"top-extra",{key:0,value:F.internalModelValue}):s.createCommentVNode("",!0),s.createElementVNode("div",null,[s.createVNode(H0,s.mergeProps(F.$props,{items:s.unref(u)(Q),instance:Q,"show-year-picker":s.unref(B)[Q],year:s.unref(f)(Q),"is-disabled":x=>s.unref(h)(Q,x),onHandleYear:x=>s.unref(S)(Q,x),onYearSelect:x=>s.unref(v)(x,Q),onToggleYearPicker:x=>s.unref(w)(Q,x?.flow,x?.show)}),s.createSlots({_:2},[s.renderList(s.unref(i),(x,M)=>({name:x,fn:s.withCtx(O=>[s.renderSlot(F.$slots,x,s.normalizeProps(s.guardReactiveProps(O)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),s.createElementVNode("div",NM,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p)(Q),(x,M)=>(s.openBlock(),s.createElementBlock("div",{key:M},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":x.active,"dp--qr-btn-between":x.isBetween,"dp--qr-btn-disabled":x.disabled,"dp--highlighted":x.highlighted}]),"data-test-id":x.value,disabled:x.disabled,onClick:O=>s.unref(b)(x.value,Q,x.disabled),onMouseover:O=>s.unref(y)(x.value)},[F.$slots.quarter?s.renderSlot(F.$slots,"quarter",{key:0,value:x.value,text:x.text}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(x.text),1)],64))],42,HM)]))),128))])],4)]),_:3},8,["multi-calendars","collapse","is-mobile"]))}}),W0=(t,e)=>{const A=s.ref(0);s.onMounted(()=>{n(),window.addEventListener("resize",n,{passive:!0})}),s.onUnmounted(()=>{window.removeEventListener("resize",n)});const n=()=>{A.value=window.document.documentElement.clientWidth};return{isMobile:s.computed(()=>A.value<=t.value.mobileBreakpoint&&!e?!0:void 0)}},PM=["id","tabindex","role","aria-label"],VM={key:0,class:"dp--menu-load-container"},$M={key:1,class:"dp--menu-header"},KM=["data-dp-mobile"],GM={key:0,class:"dp__sidebar_left"},WM=["data-dp-mobile"],zM=["data-test-id","data-dp-mobile","onClick","onKeydown"],YM={key:2,class:"dp__sidebar_right"},JM={key:3,class:"dp__action_extra"},z0=s.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...tu,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle","menu-blur"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.ref(null),i=s.computed(()=>{const{openOnTop:W,...fe}=r;return{...fe,isMobile:b.value,flowStep:ue.value,menuWrapRef:o.value}}),{setMenuFocused:a,setShiftKey:l,control:u}=O0(),f=s.useSlots(),{defaultedTextInput:h,defaultedInline:p,defaultedConfig:g,defaultedUI:B,handleEventPropagation:y}=Gt(r),{isMobile:b}=W0(g,r.shadow),w=s.ref(null),v=s.ref(0),S=s.ref(null),F=s.ref(!1),I=s.ref(null),Q=s.ref(!1),x=W=>{Q.value=!0,g.value.allowPreventDefault&&W.preventDefault(),Jo(W,g.value,!0)};s.onMounted(()=>{if(!r.shadow){F.value=!0,M(),window.addEventListener("resize",M);const W=BA(o);W&&!h.value.enabled&&!p.value.enabled&&(a(!0),ce()),W&&(W.addEventListener("pointerdown",x),W.addEventListener("mousedown",x))}document.addEventListener("mousedown",ze)}),s.onUnmounted(()=>{window.removeEventListener("resize",M),document.removeEventListener("mousedown",ze);const W=BA(o);W&&(W.removeEventListener("pointerdown",x),W.removeEventListener("mousedown",x))});const M=()=>{const W=BA(S);W&&(v.value=W.getBoundingClientRect().width)},{arrowRight:O,arrowLeft:P,arrowDown:ie,arrowUp:ae}=qo(),{flowStep:ue,updateFlowStep:H,childMount:G,resetFlow:$,handleFlow:te}=eN(r,n,I),ee=s.computed(()=>r.monthPicker?rM:r.yearPicker?iM:r.timePicker?wM:r.quarterPicker?RM:OM),K=s.computed(()=>{var W;if(g.value.arrowLeft)return g.value.arrowLeft;const fe=(W=o.value)==null?void 0:W.getBoundingClientRect(),q=r.getInputRect();return q?.width<v?.value&&q?.left<=(fe?.left??0)?`${q?.width/2}px`:q?.right>=(fe?.right??0)&&q?.width<v?.value?`${v?.value-q?.width/2}px`:"50%"}),ce=()=>{const W=BA(o);W&&W.focus({preventScroll:!0})},j=s.computed(()=>{var W;return((W=I.value)==null?void 0:W.getSidebarProps())||{}}),Qe=()=>{r.openOnTop&&n("recalculate-position")},R=_n(f,"action"),J=s.computed(()=>r.monthPicker||r.yearPicker?_n(f,"monthYear"):r.timePicker?_n(f,"timePicker"):_n(f,"shared")),Ae=s.computed(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),oe=s.computed(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),k=s.computed(()=>({dp__menu:!0,dp__menu_index:!p.value.enabled,dp__relative:p.value.enabled,...B.value.menu??{}})),X=W=>{Jo(W,g.value,!0)},Se=W=>{r.escClose&&(n("close-picker"),y(W))},ht=W=>{if(r.arrowNavigation){if(W===rn.up)return ae();if(W===rn.down)return ie();if(W===rn.left)return P();if(W===rn.right)return O()}else W===rn.left||W===rn.up?D("handleArrow",rn.left,0,W===rn.up):D("handleArrow",rn.right,0,W===rn.down)},se=W=>{l(W.shiftKey),!r.disableMonthYearSelect&&W.code===Ht.tab&&W.target.classList.contains("dp__menu")&&u.value.shiftKeyInMenu&&(W.preventDefault(),Jo(W,g.value,!0),n("close-picker"))},Ye=()=>{ce(),n("time-picker-close")},ge=W=>{var fe,q,me;(fe=I.value)==null||fe.toggleTimePicker(!1,!1),(q=I.value)==null||q.toggleMonthPicker(!1,!1,W),(me=I.value)==null||me.toggleYearPicker(!1,!1,W)},Ce=(W,fe=0)=>{var q,me,Je;return W==="month"?(q=I.value)==null?void 0:q.toggleMonthPicker(!1,!0,fe):W==="year"?(me=I.value)==null?void 0:me.toggleYearPicker(!1,!0,fe):W==="time"?(Je=I.value)==null?void 0:Je.toggleTimePicker(!0,!1):ge(fe)},D=(W,...fe)=>{var q,me;(q=I.value)!=null&&q[W]&&((me=I.value)==null||me[W](...fe))},ke=()=>{D("selectCurrentDate")},be=(W,fe)=>{D("presetDate",s.toValue(W),fe)},_=()=>{D("clearHoverDate")},N=(W,fe)=>{D("updateMonthYear",W,fe)},ne=(W,fe)=>{W.preventDefault(),ht(fe)},ve=W=>{var fe,q,me;if(se(W),W.key===Ht.home||W.key===Ht.end)return D("selectWeekDate",W.key===Ht.home,W.target.getAttribute("id"));switch((W.key===Ht.pageUp||W.key===Ht.pageDown)&&(W.shiftKey?(D("changeYear",W.key===Ht.pageUp),(fe=cp(o.value,"overlay-year"))==null||fe.focus()):(D("changeMonth",W.key===Ht.pageUp),(q=cp(o.value,W.key===Ht.pageUp?"action-prev":"action-next"))==null||q.focus()),W.target.getAttribute("id")&&((me=o.value)==null||me.focus({preventScroll:!0}))),W.key){case Ht.esc:return Se(W);case Ht.arrowLeft:return ne(W,rn.left);case Ht.arrowRight:return ne(W,rn.right);case Ht.arrowUp:return ne(W,rn.up);case Ht.arrowDown:return ne(W,rn.down);default:return}},ze=W=>{var fe;p.value.enabled&&!p.value.input&&!((fe=o.value)!=null&&fe.contains(W.target))&&Q.value&&(Q.value=!1,n("menu-blur"))};return e({updateMonthYear:N,switchView:Ce,handleFlow:te,onValueCleared:()=>{var W,fe;(fe=(W=I.value)==null?void 0:W.setStartTime)==null||fe.call(W)}}),(W,fe)=>{var q,me,Je;return s.openBlock(),s.createElementBlock("div",{id:W.uid?`dp-menu-${W.uid}`:void 0,ref_key:"dpMenuRef",ref:o,tabindex:s.unref(p).enabled?void 0:"0",role:s.unref(p).enabled?void 0:"dialog","aria-label":(q=W.ariaLabels)==null?void 0:q.menu,class:s.normalizeClass(k.value),style:s.normalizeStyle({"--dp-arrow-left":K.value}),onMouseleave:_,onClick:X,onKeydown:ve},[(W.disabled||W.readonly)&&s.unref(p).enabled||W.loading?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(oe.value)},[W.loading?(s.openBlock(),s.createElementBlock("div",VM,fe[19]||(fe[19]=[s.createElementVNode("span",{class:"dp--menu-loader"},null,-1)]))):s.createCommentVNode("",!0)],2)):s.createCommentVNode("",!0),W.$slots["menu-header"]?(s.openBlock(),s.createElementBlock("div",$M,[s.renderSlot(W.$slots,"menu-header")])):s.createCommentVNode("",!0),!s.unref(p).enabled&&!W.teleportCenter?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(Ae.value)},null,2)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"innerMenuRef",ref:S,class:s.normalizeClass({dp__menu_content_wrapper:((me=W.presetDates)==null?void 0:me.length)||!!W.$slots["left-sidebar"]||!!W.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":t.collapse&&(((Je=W.presetDates)==null?void 0:Je.length)||!!W.$slots["left-sidebar"]||!!W.$slots["right-sidebar"])}),"data-dp-mobile":s.unref(b),style:s.normalizeStyle({"--dp-menu-width":`${v.value}px`})},[W.$slots["left-sidebar"]?(s.openBlock(),s.createElementBlock("div",GM,[s.renderSlot(W.$slots,"left-sidebar",s.normalizeProps(s.guardReactiveProps(j.value)))])):s.createCommentVNode("",!0),W.presetDates.length?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass({"dp--preset-dates-collapsed":t.collapse,"dp--preset-dates":!0}),"data-dp-mobile":s.unref(b)},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(W.presetDates,(Ue,kt)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:kt},[Ue.slot?s.renderSlot(W.$slots,Ue.slot,{key:0,presetDate:be,label:Ue.label,value:Ue.value}):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",style:s.normalizeStyle(Ue.style||{}),class:s.normalizeClass(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":t.collapse}]),"data-test-id":Ue.testId??void 0,"data-dp-mobile":s.unref(b),onClick:s.withModifiers(kA=>be(Ue.value,Ue.noTz),["prevent"]),onKeydown:kA=>s.unref(on)(kA,()=>be(Ue.value,Ue.noTz),!0)},s.toDisplayString(Ue.label),47,zM))],64))),128))],10,WM)):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"calendarWrapperRef",ref:w,class:"dp__instance_calendar",role:"document"},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(ee.value),s.mergeProps({ref_key:"dynCmpRef",ref:I},i.value,{"flow-step":s.unref(ue),onMount:s.unref(G),onUpdateFlowStep:s.unref(H),onResetFlow:s.unref($),onFocusMenu:ce,onSelectDate:fe[0]||(fe[0]=Ue=>W.$emit("select-date")),onDateUpdate:fe[1]||(fe[1]=Ue=>W.$emit("date-update",Ue)),onTooltipOpen:fe[2]||(fe[2]=Ue=>W.$emit("tooltip-open",Ue)),onTooltipClose:fe[3]||(fe[3]=Ue=>W.$emit("tooltip-close",Ue)),onAutoApply:fe[4]||(fe[4]=Ue=>W.$emit("auto-apply",Ue)),onRangeStart:fe[5]||(fe[5]=Ue=>W.$emit("range-start",Ue)),onRangeEnd:fe[6]||(fe[6]=Ue=>W.$emit("range-end",Ue)),onInvalidFixedRange:fe[7]||(fe[7]=Ue=>W.$emit("invalid-fixed-range",Ue)),onTimeUpdate:fe[8]||(fe[8]=Ue=>W.$emit("time-update")),onAmPmChange:fe[9]||(fe[9]=Ue=>W.$emit("am-pm-change",Ue)),onTimePickerOpen:fe[10]||(fe[10]=Ue=>W.$emit("time-picker-open",Ue)),onTimePickerClose:Ye,onRecalculatePosition:Qe,onUpdateMonthYear:fe[11]||(fe[11]=Ue=>W.$emit("update-month-year",Ue)),onAutoApplyInvalid:fe[12]||(fe[12]=Ue=>W.$emit("auto-apply-invalid",Ue)),onInvalidDate:fe[13]||(fe[13]=Ue=>W.$emit("invalid-date",Ue)),onOverlayToggle:fe[14]||(fe[14]=Ue=>W.$emit("overlay-toggle",Ue)),"onUpdate:internalModelValue":fe[15]||(fe[15]=Ue=>W.$emit("update:internal-model-value",Ue))}),s.createSlots({_:2},[s.renderList(J.value,(Ue,kt)=>({name:Ue,fn:s.withCtx(kA=>[s.renderSlot(W.$slots,Ue,s.normalizeProps(s.guardReactiveProps({...kA})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),W.$slots["right-sidebar"]?(s.openBlock(),s.createElementBlock("div",YM,[s.renderSlot(W.$slots,"right-sidebar",s.normalizeProps(s.guardReactiveProps(j.value)))])):s.createCommentVNode("",!0),W.$slots["action-extra"]?(s.openBlock(),s.createElementBlock("div",JM,[W.$slots["action-extra"]?s.renderSlot(W.$slots,"action-extra",{key:0,selectCurrentDate:ke}):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],14,KM),!W.autoApply||s.unref(g).keepActionRow?(s.openBlock(),s.createBlock(JO,s.mergeProps({key:3,"menu-mount":F.value},i.value,{"calendar-width":v.value,onClosePicker:fe[16]||(fe[16]=Ue=>W.$emit("close-picker")),onSelectDate:fe[17]||(fe[17]=Ue=>W.$emit("select-date")),onInvalidSelect:fe[18]||(fe[18]=Ue=>W.$emit("invalid-select")),onSelectNow:ke}),s.createSlots({_:2},[s.renderList(s.unref(R),(Ue,kt)=>({name:Ue,fn:s.withCtx(kA=>[s.renderSlot(W.$slots,Ue,s.normalizeProps(s.guardReactiveProps({...kA})))])}))]),1040,["menu-mount","calendar-width"])):s.createCommentVNode("",!0)],46,PM)}}});var na=(t=>(t.center="center",t.left="left",t.right="right",t))(na||{});const XM=({menuRef:t,menuRefInner:e,inputRef:A,pickerWrapperRef:n,inline:r,emit:o,props:i,slots:a})=>{const{defaultedConfig:l}=Gt(i),u=s.ref({}),f=s.ref(!1),h=s.ref({top:"0",left:"0"}),p=s.ref(!1),g=s.toRef(i,"teleportCenter");s.watch(g,()=>{h.value=JSON.parse(JSON.stringify({})),I()});const B=$=>{if(i.teleport){const te=$.getBoundingClientRect();return{left:te.left+window.scrollX,top:te.top+window.scrollY}}return{top:0,left:0}},y=($,te)=>{h.value.left=`${$+te-u.value.width}px`},b=$=>{h.value.left=`${$}px`},w=($,te)=>{i.position===na.left&&b($),i.position===na.right&&y($,te),i.position===na.center&&(h.value.left=`${$+te/2-u.value.width/2}px`)},v=$=>{const{width:te,height:ee}=$.getBoundingClientRect(),{top:K,left:ce}=B($);return{top:+K,left:+ce,width:te,height:ee}},S=()=>{h.value.left="50%",h.value.top="50%",h.value.transform="translate(-50%, -50%)",h.value.position="fixed",delete h.value.opacity},F=()=>{const $=BA(A);h.value=i.altPosition($)},I=($=!0)=>{var te;if(!r.value.enabled){if(g.value)return S();if(i.altPosition!==null)return F();if($){const ee=i.teleport?(te=e.value)==null?void 0:te.$el:t.value;ee&&(u.value=ee.getBoundingClientRect()),o("recalculate-position")}return ae()}},Q=({inputEl:$,left:te,width:ee})=>{window.screen.width>768&&!f.value&&w(te,ee),O($)},x=$=>{const{top:te,left:ee,height:K,width:ce}=v($);h.value.top=`${K+te+ +i.offset}px`,p.value=!1,f.value||(h.value.left=`${ee+ce/2-u.value.width/2}px`),Q({inputEl:$,left:ee,width:ce})},M=$=>{const{top:te,left:ee,width:K}=v($);h.value.top=`${te-+i.offset-u.value.height}px`,p.value=!0,Q({inputEl:$,left:ee,width:K})},O=$=>{if(i.autoPosition){const{left:te,width:ee}=v($),{left:K,right:ce}=u.value;if(!f.value){if(Math.abs(K)!==Math.abs(ce)){if(K<=0)return f.value=!0,b(te);if(ce>=document.documentElement.clientWidth)return f.value=!0,y(te,ee)}return w(te,ee)}}},P=()=>{const $=BA(A);if($){if(i.autoPosition===wr.top)return wr.top;if(i.autoPosition===wr.bottom)return wr.bottom;const{height:te}=u.value,{top:ee,height:K}=$.getBoundingClientRect(),ce=window.innerHeight-ee-K,j=ee;return te<=ce?wr.bottom:te>ce&&te<=j?wr.top:ce>=j?wr.bottom:wr.top}return wr.bottom},ie=$=>P()===wr.bottom?x($):M($),ae=()=>{const $=BA(A);if($)return i.autoPosition?ie($):x($)},ue=function($){if($){const te=$.scrollHeight>$.clientHeight,ee=window.getComputedStyle($).overflowY.indexOf("hidden")!==-1;return te&&!ee}return!0},H=function($){return!$||$===document.body||$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:ue($)?$:H($.assignedSlot&&l.value.shadowDom?$.assignedSlot.parentNode:$.parentNode)},G=$=>{if($)switch(i.position){case na.left:return{left:0,transform:"translateX(0)"};case na.right:return{left:`${$.width}px`,transform:"translateX(-100%)"};default:return{left:`${$.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:p,menuStyle:h,xCorrect:f,setMenuPosition:I,getScrollableParent:H,shadowRender:($,te,ee)=>{var K,ce,j;const Qe=document.createElement("div"),R=(K=BA(A))==null?void 0:K.getBoundingClientRect();Qe.setAttribute("id","dp--temp-container");const J=(ce=n.value)!=null&&ce.clientWidth?n.value:document.body;J.append(Qe);const Ae=G(R),oe=l.value.shadowDom?Object.keys(a).filter(X=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(X)):Object.keys(a),k=s.h(te,{...ee,shadow:!0,style:{opacity:0,position:"absolute",...Ae}},Object.fromEntries(oe.map(X=>[X,a[X]])));$!=null&&(k.appContext=$.appContext),s.render(k,Qe),u.value=(j=k.el)==null?void 0:j.getBoundingClientRect(),s.render(null,Qe),J.removeChild(Qe)}}},Zo=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],jM=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],qM={all:()=>Zo,monthYear:()=>Zo.filter(t=>t.use.includes("month-year")),input:()=>jM,timePicker:()=>Zo.filter(t=>t.use.includes("time")),action:()=>Zo.filter(t=>t.use.includes("action")),calendar:()=>Zo.filter(t=>t.use.includes("calendar")),menu:()=>Zo.filter(t=>t.use.includes("menu")),shared:()=>Zo.filter(t=>t.use.includes("shared")),yearMode:()=>Zo.filter(t=>t.use.includes("year-mode"))},_n=(t,e,A)=>{const n=[];return qM[e]().forEach(r=>{t[r.name]&&n.push(r.name)}),A!=null&&A.length&&A.forEach(r=>{r.slot&&n.push(r.slot)}),n},gl=t=>{const e=s.computed(()=>n=>t.value?n?t.value.open:t.value.close:""),A=s.computed(()=>n=>t.value?n?t.value.menuAppearTop:t.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!t.value,menuTransition:A}},Bl=(t,e,A)=>{const{defaultedRange:n,defaultedTz:r}=Gt(t),o=ye(wn(ye(),r.value.timezone)),i=s.ref([{month:ut(o),year:qe(o)}]),a=p=>{const g={hours:mo(o),minutes:Yo(o),seconds:0};return n.value.enabled?[g[p],g[p]]:g[p]},l=s.reactive({hours:a("hours"),minutes:a("minutes"),seconds:a("seconds")});s.watch(n,(p,g)=>{p.enabled!==g.enabled&&(l.hours=a("hours"),l.minutes=a("minutes"),l.seconds=a("seconds"))},{deep:!0});const u=s.computed({get:()=>t.internalModelValue,set:p=>{!t.readonly&&!t.disabled&&e("update:internal-model-value",p)}}),f=s.computed(()=>p=>i.value[p]?i.value[p].month:0),h=s.computed(()=>p=>i.value[p]?i.value[p].year:0);return s.watch(u,(p,g)=>{A&&JSON.stringify(p??{})!==JSON.stringify(g??{})&&A()},{deep:!0}),{calendars:i,time:l,modelValue:u,month:f,year:h,today:o}},ZM=(t,e)=>{const{defaultedMultiCalendars:A,defaultedMultiDates:n,defaultedUI:r,defaultedHighlight:o,defaultedTz:i,propDates:a,defaultedRange:l}=Gt(e),{isDisabled:u}=ei(e),f=s.ref(null),h=s.ref(wn(new Date,i.value.timezone)),p=k=>{!k.current&&e.hideOffsetDates||(f.value=k.value)},g=()=>{f.value=null},B=k=>Array.isArray(t.value)&&l.value.enabled&&t.value[0]&&f.value?k?aA(f.value,t.value[0]):tA(f.value,t.value[0]):!0,y=(k,X)=>{const Se=()=>t.value?X?t.value[0]||null:t.value[1]:null,ht=t.value&&Array.isArray(t.value)?Se():null;return dt(ye(k.value),ht)},b=k=>{const X=Array.isArray(t.value)?t.value[0]:null;return k?!tA(f.value??null,X):!0},w=(k,X=!0)=>(l.value.enabled||e.weekPicker)&&Array.isArray(t.value)&&t.value.length===2?e.hideOffsetDates&&!k.current?!1:dt(ye(k.value),t.value[X?0:1]):l.value.enabled?y(k,X)&&b(X)||dt(k.value,Array.isArray(t.value)?t.value[0]:null)&&B(X):!1,v=(k,X)=>{if(Array.isArray(t.value)&&t.value[0]&&t.value.length===1){const Se=dt(k.value,f.value);return X?aA(t.value[0],k.value)&&Se:tA(t.value[0],k.value)&&Se}return!1},S=k=>!t.value||e.hideOffsetDates&&!k.current?!1:l.value.enabled?e.modelAuto&&Array.isArray(t.value)?dt(k.value,t.value[0]?t.value[0]:h.value):!1:n.value.enabled&&Array.isArray(t.value)?t.value.some(X=>dt(X,k.value)):dt(k.value,t.value?t.value:h.value),F=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){if(e.hideOffsetDates&&!k.current)return!1;const X=Xn(f.value,+l.value.autoRange),Se=go(ye(f.value),e.weekStart);return e.weekPicker?dt(Se[1],ye(k.value)):dt(X,ye(k.value))}return!1}return!1},I=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){const X=Xn(f.value,+l.value.autoRange);if(e.hideOffsetDates&&!k.current)return!1;const Se=go(ye(f.value),e.weekStart);return e.weekPicker?aA(k.value,Se[0])&&tA(k.value,Se[1]):aA(k.value,f.value)&&tA(k.value,X)}return!1}return!1},Q=k=>{if(l.value.autoRange||e.weekPicker){if(f.value){if(e.hideOffsetDates&&!k.current)return!1;const X=go(ye(f.value),e.weekStart);return e.weekPicker?dt(X[0],k.value):dt(f.value,k.value)}return!1}return!1},x=k=>fl(t.value,f.value,k.value),M=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,O=()=>e.modelAuto?y0(e.internalModelValue):!0,P=k=>{if(e.weekPicker)return!1;const X=l.value.enabled?!w(k)&&!w(k,!1):!0;return!u(k.value)&&!S(k)&&!(!k.current&&e.hideOffsetDates)&&X},ie=k=>l.value.enabled?e.modelAuto?M()&&S(k):!1:S(k),ae=k=>o.value?BO(k.value,a.value.highlight):!1,ue=k=>{const X=u(k.value);return X&&(typeof o.value=="function"?!o.value(k.value,X):!o.value.options.highlightDisabled)},H=k=>{var X;return typeof o.value=="function"?o.value(k.value):(X=o.value.weekdays)==null?void 0:X.includes(k.value.getDay())},G=k=>(l.value.enabled||e.weekPicker)&&(!(A.value.count>0)||k.current)&&O()&&!(!k.current&&e.hideOffsetDates)&&!S(k)?x(k):!1,$=k=>{if(Array.isArray(t.value)&&t.value.length===1){const{before:X,after:Se}=L0(+l.value.maxRange,t.value[0]);return Js(k.value,X)||ji(k.value,Se)}return!1},te=k=>{if(Array.isArray(t.value)&&t.value.length===1){const{before:X,after:Se}=L0(+l.value.minRange,t.value[0]);return fl([X,Se],t.value[0],k.value)}return!1},ee=k=>l.value.enabled&&(l.value.maxRange||l.value.minRange)?l.value.maxRange&&l.value.minRange?$(k)||te(k):l.value.maxRange?$(k):te(k):!1,K=k=>{const{isRangeStart:X,isRangeEnd:Se}=R(k),ht=l.value.enabled?X||Se:!1;return{dp__cell_offset:!k.current,dp__pointer:!e.disabled&&!(!k.current&&e.hideOffsetDates)&&!u(k.value)&&!ee(k),dp__cell_disabled:u(k.value)||ee(k),dp__cell_highlight:!ue(k)&&(ae(k)||H(k))&&!ie(k)&&!ht&&!Q(k)&&!(G(k)&&e.weekPicker)&&!Se,dp__cell_highlight_active:!ue(k)&&(ae(k)||H(k))&&ie(k),dp__today:!e.noToday&&dt(k.value,h.value)&&k.current,"dp--past":tA(k.value,h.value),"dp--future":aA(k.value,h.value)}},ce=k=>({dp__active_date:ie(k),dp__date_hover:P(k)}),j=k=>{if(t.value&&!Array.isArray(t.value)){const X=go(t.value,e.weekStart);return{...Ae(k),dp__range_start:dt(X[0],k.value),dp__range_end:dt(X[1],k.value),dp__range_between_week:aA(k.value,X[0])&&tA(k.value,X[1])}}return{...Ae(k)}},Qe=k=>{if(t.value&&Array.isArray(t.value)){const X=go(t.value[0],e.weekStart),Se=t.value[1]?go(t.value[1],e.weekStart):[];return{...Ae(k),dp__range_start:dt(X[0],k.value)||dt(Se[0],k.value),dp__range_end:dt(X[1],k.value)||dt(Se[1],k.value),dp__range_between_week:aA(k.value,X[0])&&tA(k.value,X[1])||aA(k.value,Se[0])&&tA(k.value,Se[1]),dp__range_between:aA(k.value,X[1])&&tA(k.value,Se[0])}}return{...Ae(k)}},R=k=>{const X=A.value.count>0?k.current&&w(k)&&O():w(k)&&O(),Se=A.value.count>0?k.current&&w(k,!1)&&O():w(k,!1)&&O();return{isRangeStart:X,isRangeEnd:Se}},J=k=>{const{isRangeStart:X,isRangeEnd:Se}=R(k);return{dp__range_start:X,dp__range_end:Se,dp__range_between:G(k),dp__date_hover:dt(k.value,f.value)&&!X&&!Se&&!e.weekPicker,dp__date_hover_start:v(k,!0),dp__date_hover_end:v(k,!1)}},Ae=k=>({...J(k),dp__cell_auto_range:I(k),dp__cell_auto_range_start:Q(k),dp__cell_auto_range_end:F(k)}),oe=k=>l.value.enabled?l.value.autoRange?Ae(k):e.modelAuto?{...ce(k),...J(k)}:e.weekPicker?Qe(k):J(k):e.weekPicker?j(k):ce(k);return{setHoverDate:p,clearHoverDate:g,getDayClassData:k=>e.hideOffsetDates&&!k.current?{}:{...K(k),...oe(k),[e.dayClass?e.dayClass(k.value,e.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},ei=t=>{const{defaultedFilters:e,defaultedRange:A,propDates:n,defaultedMultiDates:r}=Gt(t),o=H=>n.value.disabledDates?typeof n.value.disabledDates=="function"?n.value.disabledDates(ye(H)):!!qc(H,n.value.disabledDates):!1,i=H=>n.value.maxDate?t.yearPicker?qe(H)>qe(n.value.maxDate):aA(H,n.value.maxDate):!1,a=H=>n.value.minDate?t.yearPicker?qe(H)<qe(n.value.minDate):tA(H,n.value.minDate):!1,l=H=>{const G=i(H),$=a(H),te=o(H),ee=e.value.months.map(R=>+R).includes(ut(H)),K=t.disabledWeekDays.length?t.disabledWeekDays.some(R=>+R===oL(H)):!1,ce=g(H),j=qe(H),Qe=j<+t.yearRange[0]||j>+t.yearRange[1];return!(G||$||te||ee||Qe||K||ce)},u=(H,G)=>tA(...jo(n.value.minDate,H,G))||dt(...jo(n.value.minDate,H,G)),f=(H,G)=>aA(...jo(n.value.maxDate,H,G))||dt(...jo(n.value.maxDate,H,G)),h=(H,G,$)=>{let te=!1;return n.value.maxDate&&$&&f(H,G)&&(te=!0),n.value.minDate&&!$&&u(H,G)&&(te=!0),te},p=(H,G,$,te)=>{let ee=!1;return te&&(n.value.minDate||n.value.maxDate)?n.value.minDate&&n.value.maxDate?ee=h(H,G,$):(n.value.minDate&&u(H,G)||n.value.maxDate&&f(H,G))&&(ee=!0):ee=!0,ee},g=H=>Array.isArray(n.value.allowedDates)&&!n.value.allowedDates.length?!0:n.value.allowedDates?!qc(H,n.value.allowedDates,E0(t.monthPicker,t.yearPicker)):!1,B=H=>!l(H),y=H=>A.value.noDisabledRange?!Yw({start:H[0],end:H[1]}).some(G=>B(G)):!0,b=H=>{if(H){const G=qe(H);return G>=+t.yearRange[0]&&G<=t.yearRange[1]}return!0},w=(H,G)=>!!(Array.isArray(H)&&H[G]&&(A.value.maxRange||A.value.minRange)&&b(H[G])),v=(H,G,$=0)=>{if(w(G,$)&&b(H)){const te=$w(H,G[$]),ee=U0(G[$],H),K=ee.length===1?0:ee.filter(j=>B(j)).length,ce=Math.abs(te)-(A.value.minMaxRawRange?0:K);if(A.value.minRange&&A.value.maxRange)return ce>=+A.value.minRange&&ce<=+A.value.maxRange;if(A.value.minRange)return ce>=+A.value.minRange;if(A.value.maxRange)return ce<=+A.value.maxRange}return!0},S=()=>!t.enableTimePicker||t.monthPicker||t.yearPicker||t.ignoreTimeValidation,F=H=>Array.isArray(H)?[H[0]?gp(H[0]):null,H[1]?gp(H[1]):null]:gp(H),I=(H,G,$)=>H.find(te=>+te.hours===mo(G)&&te.minutes==="*"?!0:+te.minutes===Yo(G)&&+te.hours===mo(G))&&$,Q=(H,G,$)=>{const[te,ee]=H,[K,ce]=G;return!I(te,K,$)&&!I(ee,ce,$)&&$},x=(H,G)=>{const $=Array.isArray(G)?G:[G];return Array.isArray(t.disabledTimes)?Array.isArray(t.disabledTimes[0])?Q(t.disabledTimes,$,H):!$.some(te=>I(t.disabledTimes,te,H)):H},M=(H,G)=>{const $=Array.isArray(G)?[Zi(G[0]),G[1]?Zi(G[1]):void 0]:Zi(G),te=!t.disabledTimes($);return H&&te},O=(H,G)=>t.disabledTimes?Array.isArray(t.disabledTimes)?x(G,H):M(G,H):G,P=H=>{let G=!0;if(!H||S())return!0;const $=!n.value.minDate&&!n.value.maxDate?F(H):H;return(t.maxTime||n.value.maxDate)&&(G=_0(t.maxTime,n.value.maxDate,"max",FA($),G)),(t.minTime||n.value.minDate)&&(G=_0(t.minTime,n.value.minDate,"min",FA($),G)),O(H,G)},ie=H=>{if(!t.monthPicker)return!0;let G=!0;const $=ye(Cr(H));if(n.value.minDate&&n.value.maxDate){const te=ye(Cr(n.value.minDate)),ee=ye(Cr(n.value.maxDate));return aA($,te)&&tA($,ee)||dt($,te)||dt($,ee)}if(n.value.minDate){const te=ye(Cr(n.value.minDate));G=aA($,te)||dt($,te)}if(n.value.maxDate){const te=ye(Cr(n.value.maxDate));G=tA($,te)||dt($,te)}return G},ae=s.computed(()=>H=>!t.enableTimePicker||t.ignoreTimeValidation?!0:P(H)),ue=s.computed(()=>H=>t.monthPicker?Array.isArray(H)&&(A.value.enabled||r.value.enabled)?!H.filter(G=>!ie(G)).length:ie(H):!0);return{isDisabled:B,validateDate:l,validateMonthYearInRange:p,isDateRangeAllowed:y,checkMinMaxRange:v,isValidTime:P,isTimeValid:ae,isMonthValid:ue}},ru=()=>{const t=s.computed(()=>(n,r)=>n?.includes(r)),e=s.computed(()=>(n,r)=>n.count?n.solo?!0:r===0:!0),A=s.computed(()=>(n,r)=>n.count?n.solo?!0:r===n.count-1:!0);return{hideNavigationButtons:t,showLeftIcon:e,showRightIcon:A}},eN=(t,e,A)=>{const n=s.ref(0),r=s.reactive({[qi.timePicker]:!t.enableTimePicker||t.timePicker||t.monthPicker,[qi.calendar]:!1,[qi.header]:!1}),o=s.computed(()=>t.monthPicker||t.timePicker),i=h=>{var p;if((p=t.flow)!=null&&p.length){if(!h&&o.value)return f();r[h]=!0,Object.keys(r).filter(g=>!r[g]).length||f()}},a=()=>{var h,p;(h=t.flow)!=null&&h.length&&n.value!==-1&&(n.value+=1,e("flow-step",n.value),f()),((p=t.flow)==null?void 0:p.length)===n.value&&s.nextTick().then(()=>l())},l=()=>{n.value=-1},u=(h,p,...g)=>{var B,y;t.flow[n.value]===h&&A.value&&((y=(B=A.value)[p])==null||y.call(B,...g))},f=(h=0)=>{h&&(n.value+=h),u(zA.month,"toggleMonthPicker",!0),u(zA.year,"toggleYearPicker",!0),u(zA.calendar,"toggleTimePicker",!1,!0),u(zA.time,"toggleTimePicker",!0,!0);const p=t.flow[n.value];(p===zA.hours||p===zA.minutes||p===zA.seconds)&&u(p,"toggleTimePicker",!0,!0,p)};return{childMount:i,updateFlowStep:a,resetFlow:l,handleFlow:f,flowStep:n}},tN={key:1,class:"dp__input_wrap"},AN=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],nN={key:2,class:"dp--clear-btn"},rN=["aria-label"],oN=s.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...tu},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(t,{expose:e,emit:A}){const n=A,r=t,{defaultedTextInput:o,defaultedAriaLabels:i,defaultedInline:a,defaultedConfig:l,defaultedRange:u,defaultedMultiDates:f,defaultedUI:h,getDefaultPattern:p,getDefaultStartTime:g}=Gt(r),{checkMinMaxRange:B}=ei(r),y=s.ref(),b=s.ref(null),w=s.ref(!1),v=s.ref(!1),S=s.computed(()=>({dp__pointer:!r.disabled&&!r.readonly&&!o.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!o.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:w.value||r.isMenuOpen,dp__input_reg:!o.value.enabled,...h.value.input??{}})),F=()=>{n("set-input-date",null),r.clearable&&r.autoApply&&(n("set-empty-date"),y.value=null)},I=j=>{const Qe=g();return wO(j,o.value.format??p(),Qe??I0({},r.enableSeconds),r.inputValue,v.value,r.formatLocale)},Q=j=>{const{rangeSeparator:Qe}=o.value,[R,J]=j.split(`${Qe}`);if(R){const Ae=I(R.trim()),oe=J?I(J.trim()):void 0;if(ji(Ae,oe))return;const k=Ae&&oe?[Ae,oe]:[Ae];B(oe,k,0)&&(y.value=Ae?k:null)}},x=()=>{v.value=!0},M=j=>{if(u.value.enabled)Q(j);else if(f.value.enabled){const Qe=j.split(";");y.value=Qe.map(R=>I(R.trim())).filter(R=>R)}else y.value=I(j)},O=j=>{var Qe;const R=typeof j=="string"?j:(Qe=j.target)==null?void 0:Qe.value;R!==""?(o.value.openMenu&&!r.isMenuOpen&&n("open"),M(R),n("set-input-date",y.value)):F(),v.value=!1,n("update:input-value",R),n("text-input",j,y.value)},P=j=>{o.value.enabled?(M(j.target.value),o.value.enterSubmit&&hp(y.value)&&r.inputValue!==""?(n("set-input-date",y.value,!0),y.value=null):o.value.enterSubmit&&r.inputValue===""&&(y.value=null,n("clear"))):ue(j)},ie=(j,Qe)=>{o.value.enabled&&o.value.tabSubmit&&!Qe&&M(j.target.value),o.value.tabSubmit&&hp(y.value)&&r.inputValue!==""?(n("set-input-date",y.value,!0,!0),y.value=null):o.value.tabSubmit&&r.inputValue===""&&(y.value=null,n("clear",!0))},ae=()=>{w.value=!0,n("focus"),s.nextTick().then(()=>{var j;o.value.enabled&&o.value.selectOnFocus&&((j=b.value)==null||j.select())})},ue=j=>{if(Jo(j,l.value,!0),o.value.enabled&&o.value.openMenu&&!a.value.input){if(o.value.openMenu==="open"&&!r.isMenuOpen)return n("open");if(o.value.openMenu==="toggle")return n("toggle")}else o.value.enabled||n("toggle")},H=()=>{n("real-blur"),w.value=!1,(!r.isMenuOpen||a.value.enabled&&a.value.input)&&n("blur"),r.autoApply&&o.value.enabled&&y.value&&!r.isMenuOpen&&(n("set-input-date",y.value),n("select-date"),y.value=null)},G=j=>{Jo(j,l.value,!0),n("clear")},$=()=>{n("close")},te=j=>{if(j.key==="Tab"&&ie(j),j.key==="Enter"&&P(j),j.key==="Escape"&&o.value.escClose&&$(),!o.value.enabled){if(j.code==="Tab")return;j.preventDefault()}},ee=()=>{var j;(j=b.value)==null||j.focus({preventScroll:!0})},K=j=>{y.value=j},ce=j=>{j.key===Ht.tab&&ie(j,!0)};return e({focusInput:ee,setParsedDate:K}),(j,Qe)=>{var R,J,Ae;return s.openBlock(),s.createElementBlock("div",{onClick:ue},[j.$slots.trigger&&!j.$slots["dp-input"]&&!s.unref(a).enabled?s.renderSlot(j.$slots,"trigger",{key:0}):s.createCommentVNode("",!0),!j.$slots.trigger&&(!s.unref(a).enabled||s.unref(a).input)?(s.openBlock(),s.createElementBlock("div",tN,[j.$slots["dp-input"]&&!j.$slots.trigger&&(!s.unref(a).enabled||s.unref(a).enabled&&s.unref(a).input)?s.renderSlot(j.$slots,"dp-input",{key:0,value:t.inputValue,isMenuOpen:t.isMenuOpen,onInput:O,onEnter:P,onTab:ie,onClear:G,onBlur:H,onKeypress:te,onPaste:x,onFocus:ae,openMenu:()=>j.$emit("open"),closeMenu:()=>j.$emit("close"),toggleMenu:()=>j.$emit("toggle")}):s.createCommentVNode("",!0),j.$slots["dp-input"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("input",{key:1,id:j.uid?`dp-input-${j.uid}`:void 0,ref_key:"inputRef",ref:b,"data-test-id":"dp-input",name:j.name,class:s.normalizeClass(S.value),inputmode:s.unref(o).enabled?"text":"none",placeholder:j.placeholder,disabled:j.disabled,readonly:j.readonly,required:j.required,value:t.inputValue,autocomplete:j.autocomplete,"aria-label":(R=s.unref(i))==null?void 0:R.input,"aria-disabled":j.disabled||void 0,"aria-invalid":j.state===!1?!0:void 0,onInput:O,onBlur:H,onFocus:ae,onKeypress:te,onKeydown:Qe[0]||(Qe[0]=oe=>te(oe)),onPaste:x},null,42,AN)),s.createElementVNode("div",{onClick:Qe[3]||(Qe[3]=oe=>n("toggle"))},[j.$slots["input-icon"]&&!j.hideInputIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:Qe[1]||(Qe[1]=oe=>n("toggle"))},[s.renderSlot(j.$slots,"input-icon")])):s.createCommentVNode("",!0),!j.$slots["input-icon"]&&!j.hideInputIcon&&!j.$slots["dp-input"]?(s.openBlock(),s.createBlock(s.unref(qs),{key:1,"aria-label":(J=s.unref(i))==null?void 0:J.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:Qe[2]||(Qe[2]=oe=>n("toggle"))},null,8,["aria-label"])):s.createCommentVNode("",!0)]),j.$slots["clear-icon"]&&(j.alwaysClearable||t.inputValue&&j.clearable&&!j.disabled&&!j.readonly)?(s.openBlock(),s.createElementBlock("span",nN,[s.renderSlot(j.$slots,"clear-icon",{clear:G})])):s.createCommentVNode("",!0),!j.$slots["clear-icon"]&&(j.alwaysClearable||j.clearable&&t.inputValue&&!j.disabled&&!j.readonly)?(s.openBlock(),s.createElementBlock("button",{key:3,"aria-label":(Ae=s.unref(i))==null?void 0:Ae.clearInput,class:"dp--clear-btn",type:"button",onKeydown:Qe[4]||(Qe[4]=oe=>s.unref(on)(oe,()=>G(oe),!0,ce)),onClick:Qe[5]||(Qe[5]=s.withModifiers(oe=>G(oe),["prevent"]))},[s.createVNode(s.unref(m0),{class:"dp__input_icons","data-test-id":"clear-icon"})],40,rN)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])}}}),iN=typeof window<"u"?window:void 0,Qp=()=>{},sN=t=>s.getCurrentScope()?(s.onScopeDispose(t),!0):!1,aN=(t,e,A,n)=>{if(!t)return Qp;let r=Qp;const o=s.watch(()=>s.unref(t),a=>{r(),a&&(a.removeEventListener(e,A),a.addEventListener(e,A,n),r=()=>{a.removeEventListener(e,A,n),r=Qp})},{immediate:!0,flush:"post"}),i=()=>{o(),r()};return sN(i),i},lN=(t,e,A,n={})=>{const{window:r=iN,event:o="pointerdown"}=n;return r?aN(r,o,i=>{const a=BA(t),l=BA(e);!a||!l||a===i.target||i.composedPath().includes(a)||i.composedPath().includes(l)||A(i)},{passive:!0}):void 0},cN=["data-dp-mobile"],uN=s.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...tu},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(t,{expose:e,emit:A}){const n=A,r=t,o=s.useSlots(),i=s.ref(!1),a=s.toRef(r,"modelValue"),l=s.toRef(r,"timezone"),u=s.ref(null),f=s.ref(null),h=s.ref(null),p=s.ref(!1),g=s.ref(null),B=s.ref(!1),y=s.ref(!1),b=s.ref(!1),w=s.ref(!1),{setMenuFocused:v,setShiftKey:S}=O0(),{clearArrowNav:F}=qo(),{validateDate:I,isValidTime:Q}=ei(r),{defaultedTransitions:x,defaultedTextInput:M,defaultedInline:O,defaultedConfig:P,defaultedRange:ie,defaultedMultiDates:ae}=Gt(r),{menuTransition:ue,showTransition:H}=gl(x),{isMobile:G}=W0(P),$=s.getCurrentInstance();s.onMounted(()=>{k(r.modelValue),s.nextTick().then(()=>{if(!O.value.enabled){const he=R(g.value);he?.addEventListener("scroll",be),window?.addEventListener("resize",_)}}),O.value.enabled&&(i.value=!0),window?.addEventListener("keyup",N),window?.addEventListener("keydown",ne)}),s.onUnmounted(()=>{if(!O.value.enabled){const he=R(g.value);he?.removeEventListener("scroll",be),window?.removeEventListener("resize",_)}window?.removeEventListener("keyup",N),window?.removeEventListener("keydown",ne)});const te=_n(o,"all",r.presetDates),ee=_n(o,"input");s.watch([a,l],()=>{k(a.value)},{deep:!0});const{openOnTop:K,menuStyle:ce,xCorrect:j,setMenuPosition:Qe,getScrollableParent:R,shadowRender:J}=XM({menuRef:u,menuRefInner:f,inputRef:h,pickerWrapperRef:g,inline:O,emit:n,props:r,slots:o}),{inputValue:Ae,internalModelValue:oe,parseExternalModelValue:k,emitModelValue:X,formatInputValue:Se,checkBeforeEmit:ht}=GO(n,r,p),se=s.computed(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:O.value.enabled,"dp--flex-display-collapsed":b.value,dp__flex_display_with_input:O.value.input})),Ye=s.computed(()=>r.dark?"dp__theme_dark":"dp__theme_light"),ge=s.computed(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||O.value.enabled}:{}),Ce=s.computed(()=>({class:"dp__outer_menu_wrap"})),D=s.computed(()=>O.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),ke=()=>{var he,xe;return((xe=(he=h.value)==null?void 0:he.$el)==null?void 0:xe.getBoundingClientRect())??{width:0,left:0,right:0}},be=()=>{i.value&&(P.value.closeOnScroll?kt():Qe())},_=()=>{var he;i.value&&Qe();const xe=((he=f.value)==null?void 0:he.$el.getBoundingClientRect().width)??0;b.value=document.body.offsetWidth<=xe},N=he=>{he.key==="Tab"&&!O.value.enabled&&!r.teleport&&P.value.tabOutClosesMenu&&(g.value.contains(document.activeElement)||kt()),y.value=he.shiftKey},ne=he=>{y.value=he.shiftKey},ve=()=>{!r.disabled&&!r.readonly&&(J($,z0,r),Qe(!1),i.value=!0,i.value&&n("open"),i.value||Ue(),k(r.modelValue))},ze=()=>{var he,xe;Ae.value="",Ue(),(he=f.value)==null||he.onValueCleared(),(xe=h.value)==null||xe.setParsedDate(null),n("update:model-value",null),n("update:model-timezone-value",null),n("cleared"),P.value.closeOnClearValue&&kt()},W=()=>{const he=oe.value;return!he||!Array.isArray(he)&&I(he)?!0:Array.isArray(he)?ae.value.enabled||he.length===2&&I(he[0])&&I(he[1])?!0:ie.value.partialRange&&!r.timePicker?I(he[0]):!1:!1},fe=()=>{ht()&&W()?(X(),kt()):n("invalid-select",oe.value)},q=he=>{me(),X(),P.value.closeOnAutoApply&&!he&&kt()},me=()=>{h.value&&M.value.enabled&&h.value.setParsedDate(oe.value)},Je=(he=!1)=>{r.autoApply&&Q(oe.value)&&W()&&(ie.value.enabled&&Array.isArray(oe.value)?(ie.value.partialRange||oe.value.length===2)&&q(he):q(he))},Ue=()=>{M.value.enabled||(oe.value=null)},kt=(he=!1)=>{var xe,He;he&&oe.value&&P.value.setDateOnMenuClose&&fe(),O.value.enabled||(i.value&&(i.value=!1,j.value=!1,v(!1),S(!1),F(),n("closed"),Ae.value&&k(a.value)),Ue(),n("blur"),(He=(xe=f.value)==null?void 0:xe.$el)==null||He.remove())},kA=(he,xe,He=!1)=>{if(!he){oe.value=null;return}const Or=Array.isArray(he)?!he.some(co=>!I(co)):I(he),ar=Q(he);Or&&ar?(w.value=!0,oe.value=he,xe?(B.value=He,fe(),n("text-submit")):r.autoApply&&Je(),s.nextTick().then(()=>{w.value=!1})):n("invalid-date",he)},Fn=()=>{r.autoApply&&Q(oe.value)&&X(),me()},tn=()=>i.value?kt():ve(),Mo=he=>{oe.value=he},lo=()=>{M.value.enabled&&(p.value=!0,Se()),n("focus")},Ds=()=>{if(M.value.enabled&&(p.value=!1,k(r.modelValue),B.value)){const he=gO(g.value,y.value);he?.focus()}n("blur")},Ls=he=>{f.value&&f.value.updateMonthYear(0,{month:w0(he.month),year:w0(he.year)})},Os=he=>{k(he??r.modelValue)},Z=(he,xe)=>{var He;(He=f.value)==null||He.switchView(he,xe)},Fe=(he,xe)=>P.value.onClickOutside?P.value.onClickOutside(he,xe):kt(!0),Ve=(he=0)=>{var xe;(xe=f.value)==null||xe.handleFlow(he)},At=()=>u;return lN(u,h,he=>Fe(W,he)),e({closeMenu:kt,selectDate:fe,clearValue:ze,openMenu:ve,onScroll:be,formatInputValue:Se,updateInternalModelValue:Mo,setMonthYear:Ls,parseModel:Os,switchView:Z,toggleMenu:tn,handleFlow:Ve,getDpWrapMenuRef:At}),(he,xe)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"pickerWrapperRef",ref:g,class:s.normalizeClass(se.value),"data-datepicker-instance":"","data-dp-mobile":s.unref(G)},[s.createVNode(oN,s.mergeProps({ref_key:"inputRef",ref:h,"input-value":s.unref(Ae),"onUpdate:inputValue":xe[0]||(xe[0]=He=>s.isRef(Ae)?Ae.value=He:null),"is-menu-open":i.value},he.$props,{onClear:ze,onOpen:ve,onSetInputDate:kA,onSetEmptyDate:s.unref(X),onSelectDate:fe,onToggle:tn,onClose:kt,onFocus:lo,onBlur:Ds,onRealBlur:xe[1]||(xe[1]=He=>p.value=!1),onTextInput:xe[2]||(xe[2]=He=>he.$emit("text-input",He))}),s.createSlots({_:2},[s.renderList(s.unref(ee),(He,Or)=>({name:He,fn:s.withCtx(ar=>[s.renderSlot(he.$slots,He,s.normalizeProps(s.guardReactiveProps(ar)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(s.openBlock(),s.createBlock(s.resolveDynamicComponent(he.teleport?s.Teleport:"div"),s.normalizeProps(s.guardReactiveProps(ge.value)),{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(ue)(s.unref(K)),css:s.unref(H)&&!s.unref(O).enabled},{default:s.withCtx(()=>[i.value?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:u},Ce.value,{class:{"dp--menu-wrapper":!s.unref(O).enabled},style:s.unref(O).enabled?void 0:s.unref(ce)}),[s.createVNode(z0,s.mergeProps({ref_key:"dpMenuRef",ref:f},he.$props,{"internal-model-value":s.unref(oe),"onUpdate:internalModelValue":xe[3]||(xe[3]=He=>s.isRef(oe)?oe.value=He:null),class:{[Ye.value]:!0,"dp--menu-wrapper":he.teleport},"open-on-top":s.unref(K),"no-overlay-focus":D.value,collapse:b.value,"get-input-rect":ke,"is-text-input-date":w.value,onClosePicker:kt,onSelectDate:fe,onAutoApply:Je,onTimeUpdate:Fn,onFlowStep:xe[4]||(xe[4]=He=>he.$emit("flow-step",He)),onUpdateMonthYear:xe[5]||(xe[5]=He=>he.$emit("update-month-year",He)),onInvalidSelect:xe[6]||(xe[6]=He=>he.$emit("invalid-select",s.unref(oe))),onAutoApplyInvalid:xe[7]||(xe[7]=He=>he.$emit("invalid-select",He)),onInvalidFixedRange:xe[8]||(xe[8]=He=>he.$emit("invalid-fixed-range",He)),onRecalculatePosition:s.unref(Qe),onTooltipOpen:xe[9]||(xe[9]=He=>he.$emit("tooltip-open",He)),onTooltipClose:xe[10]||(xe[10]=He=>he.$emit("tooltip-close",He)),onTimePickerOpen:xe[11]||(xe[11]=He=>he.$emit("time-picker-open",He)),onTimePickerClose:xe[12]||(xe[12]=He=>he.$emit("time-picker-close",He)),onAmPmChange:xe[13]||(xe[13]=He=>he.$emit("am-pm-change",He)),onRangeStart:xe[14]||(xe[14]=He=>he.$emit("range-start",He)),onRangeEnd:xe[15]||(xe[15]=He=>he.$emit("range-end",He)),onDateUpdate:xe[16]||(xe[16]=He=>he.$emit("date-update",He)),onInvalidDate:xe[17]||(xe[17]=He=>he.$emit("invalid-date",He)),onOverlayToggle:xe[18]||(xe[18]=He=>he.$emit("overlay-toggle",He)),onMenuBlur:xe[19]||(xe[19]=He=>he.$emit("blur"))}),s.createSlots({_:2},[s.renderList(s.unref(te),(He,Or)=>({name:He,fn:s.withCtx(ar=>[s.renderSlot(he.$slots,He,s.normalizeProps(s.guardReactiveProps({...ar})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):s.createCommentVNode("",!0)]),_:3},8,["name","css"])]),_:3},16))],10,cN))}}),ra=(()=>{const t=uN;return t.install=e=>{e.component("Vue3DatePicker",t)},t})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}))).forEach(([t,e])=>{t!=="default"&&(ra[t]=e)});/*!
2
2
  * shared v11.1.11
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
@@ -26,15 +26,15 @@ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guid
26
26
  `)}}is.empty=new is(!0);class rP{constructor(e,A){this.string=e,this.nodeTypes=A,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 ib(t){let e=[];do e.push(oP(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function oP(t){let e=[];do e.push(iP(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function iP(t){let e=lP(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=sP(t,e);else break;return e}function sb(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function sP(t,e){let A=sb(t),n=A;return t.eat(",")&&(t.next!="}"?n=sb(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:A,max:n,expr:e}}function aP(t,e){let A=t.nodeTypes,n=A[e];if(n)return[n];let r=[];for(let o in A){let i=A[o];i.isInGroup(e)&&r.push(i)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function lP(t){if(t.eat("(")){let e=ib(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=aP(t,t.next).map(A=>(t.inline==null?t.inline=A.isInline:t.inline!=A.isInline&&t.err("Mixing inline and block content"),{type:"name",value:A}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function cP(t){let e=[[]];return r(o(t,0),A()),e;function A(){return e.push([])-1}function n(i,a,l){let u={term:l,to:a};return e[i].push(u),u}function r(i,a){i.forEach(l=>l.to=a)}function o(i,a){if(i.type=="choice")return i.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(i.type=="seq")for(let l=0;;l++){let u=o(i.exprs[l],a);if(l==i.exprs.length-1)return u;r(u,a=A())}else if(i.type=="star"){let l=A();return n(a,l),r(o(i.expr,l),l),[n(l)]}else if(i.type=="plus"){let l=A();return r(o(i.expr,a),l),r(o(i.expr,l),l),[n(l)]}else{if(i.type=="opt")return[n(a)].concat(o(i.expr,a));if(i.type=="range"){let l=a;for(let u=0;u<i.min;u++){let f=A();r(o(i.expr,l),f),l=f}if(i.max==-1)r(o(i.expr,l),l);else for(let u=i.min;u<i.max;u++){let f=A();n(l,f),r(o(i.expr,l),f),l=f}return[n(l)]}else{if(i.type=="name")return[n(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function ab(t,e){return e-t}function lb(t,e){let A=[];return n(e),A.sort(ab);function n(r){let o=t[r];if(o.length==1&&!o[0].term)return n(o[0].to);A.push(r);for(let i=0;i<o.length;i++){let{term:a,to:l}=o[i];!a&&A.indexOf(l)==-1&&n(l)}}}function uP(t){let e=Object.create(null);return A(lb(t,0));function A(n){let r=[];n.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<r.length;f++)r[f][0]==a&&(u=r[f][1]);lb(t,l).forEach(f=>{u||r.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let o=e[n.join(",")]=new is(n.indexOf(t.length-1)>-1);for(let i=0;i<r.length;i++){let a=r[i][1].sort(ab);o.next.push({type:r[i][0],next:e[a.join(",")]||A(a)})}return o}}function dP(t,e){for(let A=0,n=[t];A<n.length;A++){let r=n[A],o=!r.validEnd,i=[];for(let a=0;a<r.next.length;a++){let{type:l,next:u}=r.next[a];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),n.indexOf(u)==-1&&n.push(u)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function cb(t){let e=Object.create(null);for(let A in t){let n=t[A];if(!n.hasDefault)return null;e[A]=n.default}return e}function ub(t,e){let A=Object.create(null);for(let n in t){let r=e&&e[n];if(r===void 0){let o=t[n];if(o.hasDefault)r=o.default;else throw new RangeError("No value supplied for attribute "+n)}A[n]=r}return A}function db(t,e,A,n){for(let r in e)if(!(r in t))throw new RangeError(`Unsupported attribute ${r} for ${A} of type ${r}`);for(let r in t){let o=t[r];o.validate&&o.validate(e[r])}}function fb(t,e){let A=Object.create(null);if(e)for(let n in e)A[n]=new hP(t,n,e[n]);return A}let hb=class f_{constructor(e,A,n){this.name=e,this.schema=A,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=fb(e,n.attrs),this.defaultAttrs=cb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==is.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:ub(this.attrs,e)}create(e=null,A,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ri(this,this.computeAttrs(e),we.from(A),Lt.setFrom(n))}createChecked(e=null,A,n){return A=we.from(A),this.checkContent(A),new ri(this,this.computeAttrs(e),A,Lt.setFrom(n))}createAndFill(e=null,A,n){if(e=this.computeAttrs(e),A=we.from(A),A.size){let i=this.contentMatch.fillBefore(A);if(!i)return null;A=i.append(A)}let r=this.contentMatch.matchFragment(A),o=r&&r.fillBefore(we.empty,!0);return o?new ri(this,e,A.append(o),Lt.setFrom(n)):null}validContent(e){let A=this.contentMatch.matchFragment(e);if(!A||!A.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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){db(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 A=0;A<e.length;A++)if(!this.allowsMarkType(e[A].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let A;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?A&&A.push(e[n]):A||(A=e.slice(0,n));return A?A.length?A:Lt.none:e}static compile(e,A){let n=Object.create(null);e.forEach((o,i)=>n[o]=new f_(o,A,i));let r=A.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function fP(t,e,A){let n=A.split("|");return r=>{let o=r===null?"null":typeof r;if(n.indexOf(o)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${o}`)}}class hP{constructor(e,A,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?fP(e,A,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Eu{constructor(e,A,n,r){this.name=e,this.rank=A,this.schema=n,this.spec=r,this.attrs=fb(e,r.attrs),this.excluded=null;let o=cb(this.attrs);this.instance=o?new Lt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Lt(this,ub(this.attrs,e))}static compile(e,A){let n=Object.create(null),r=0;return e.forEach((o,i)=>n[o]=new Eu(o,r++,A,i)),n}removeFromSet(e){for(var A=0;A<e.length;A++)e[A].type==this&&(e=e.slice(0,A).concat(e.slice(A+1)),A--);return e}isInSet(e){for(let A=0;A<e.length;A++)if(e[A].type==this)return e[A]}checkAttrs(e){db(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class pb{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let A=this.spec={};for(let r in e)A[r]=e[r];A.nodes=RA.from(e.nodes),A.marks=RA.from(e.marks||{}),this.nodes=hb.compile(this.spec.nodes,this),this.marks=Eu.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=n[i]||(n[i]=is.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?mb(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let r in this.marks){let o=this.marks[r],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:mb(this,i.split(" "))}this.nodeFromJSON=r=>ri.fromJSON(this,r),this.markFromJSON=r=>Lt.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,A=null,n,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof hb){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(A,n,r)}text(e,A){let n=this.nodes.text;return new vu(n,n.defaultAttrs,e,Lt.setFrom(A))}mark(e,A){return typeof e=="string"&&(e=this.marks[e]),e.create(A)}nodeType(e){let A=this.nodes[e];if(!A)throw new RangeError("Unknown node type: "+e);return A}}function mb(t,e){let A=[];for(let n=0;n<e.length;n++){let r=e[n],o=t.marks[r],i=o;if(o)A.push(o);else for(let a in t.marks){let l=t.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&A.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return A}function pP(t){return t.tag!=null}function mP(t){return t.style!=null}class oi{constructor(e,A){this.schema=e,this.rules=A,this.tags=[],this.styles=[];let n=this.matchedStyles=[];A.forEach(r=>{if(pP(r))this.tags.push(r);else if(mP(r)){let o=/[^=]*/.exec(r.style)[0];n.indexOf(o)<0&&n.push(o),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,A={}){let n=new wb(this,A,!1);return n.addAll(e,Lt.none,A.from,A.to),n.finish()}parseSlice(e,A={}){let n=new wb(this,A,!0);return n.addAll(e,Lt.none,A.from,A.to),De.maxOpen(n.finish())}matchTag(e,A,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let o=this.tags[r];if(yP(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||A.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,A,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let i=this.styles[o],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!n.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=A))){if(i.getAttrs){let l=i.getAttrs(A);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let A=[];function n(r){let o=r.priority==null?50:r.priority,i=0;for(;i<A.length;i++){let a=A[i];if((a.priority==null?50:a.priority)<o)break}A.splice(i,0,r)}for(let r in e.marks){let o=e.marks[r].spec.parseDOM;o&&o.forEach(i=>{n(i=Cb(i)),i.mark||i.ignore||i.clearMark||(i.mark=r)})}for(let r in e.nodes){let o=e.nodes[r].spec.parseDOM;o&&o.forEach(i=>{n(i=Cb(i)),i.node||i.ignore||i.mark||(i.node=r)})}return A}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new oi(e,oi.schemaRules(e)))}}const gb={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},gP={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Bb={ol:!0,ul:!0},Ql=1,jp=2,Fl=4;function yb(t,e,A){return e!=null?(e?Ql:0)|(e==="full"?jp:0):t&&t.whitespace=="pre"?Ql|jp:A&~Fl}class ku{constructor(e,A,n,r,o,i){this.type=e,this.attrs=A,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=Lt.none,this.match=o||(i&Fl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let A=this.type.contentMatch.fillBefore(we.from(e));if(A)this.match=this.type.contentMatch.matchFragment(A);else{let n=this.type.contentMatch,r;return(r=n.findWrapping(e.type))?(this.match=n,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ql)){let n=this.content[this.content.length-1],r;if(n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))){let o=n;n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let A=we.from(this.content);return!e&&this.match&&(A=A.append(this.match.fillBefore(we.empty,!0))),this.type?this.type.create(this.attrs,A,this.marks):A}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!gb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class wb{constructor(e,A,n){this.parser=e,this.options=A,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=A.topNode,o,i=yb(null,A.preserveWhitespace,0)|(n?Fl:0);r?o=new ku(r.type,r.attrs,Lt.none,!0,A.topMatch||r.type.contentMatch,i):n?o=new ku(null,null,Lt.none,!0,null,i):o=new ku(e.schema.topNodeType,null,Lt.none,!0,null,i),this.nodes=[o],this.find=A.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,A){e.nodeType==3?this.addTextNode(e,A):e.nodeType==1&&this.addElement(e,A)}addTextNode(e,A){let n=e.nodeValue,r=this.top,o=r.options&jp?"full":this.localPreserveWS||(r.options&Ql)>0;if(o==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)o!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
27
27
  `);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],a=e.previousSibling;(!i||a&&a.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),A,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,A,n){let r=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;Bb.hasOwnProperty(i)&&this.parser.normalizeLists&&BP(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:gP.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,A);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,f=this.needsBlock;if(gb.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,A);break e}let h=l&&l.skip?A:this.readStyles(e,A);h&&this.addAll(e,h),u&&this.sync(o),this.needsBlock=f}else{let u=this.readStyles(e,A);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(e,A){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
28
28
  `),A)}ignoreFallback(e,A){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),A,!0)}readStyles(e,A){let n=e.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let o=this.parser.matchedStyles[r],i=n.getPropertyValue(o);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(o,i,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?A=A.filter(u=>!l.clearMark(u)):A=A.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return A}addElementByRule(e,A,n,r){let o,i;if(A.node)if(i=this.parser.schema.nodes[A.node],i.isLeaf)this.insertNode(i.create(A.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(i,A.attrs||null,n,A.preserveWhitespace);l&&(o=!0,n=l)}else{let l=this.parser.schema.marks[A.mark];n=n.concat(l.create(A.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(A.getContent)this.findInside(e),A.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof A.contentElement=="string"?l=e.querySelector(A.contentElement):typeof A.contentElement=="function"?l=A.contentElement(e):A.contentElement&&(l=A.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,A,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,a=r==null?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,A);this.findAtPoint(e,o)}findPlace(e,A,n){let r,o;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],u=l.findWrapping(e);if(u&&(!r||r.length>u.length+a)&&(r=u,o=l,!u.length))break;if(l.solid){if(n)break;a+=2}}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)A=this.enterInner(r[i],null,A,!1);return A}insertNode(e,A,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(A=this.enterInner(o,null,A))}let r=this.findPlace(e,A,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Lt.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):bb(a.type,e.type))&&(i=a.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,A,n,r){let o=this.findPlace(e.create(A),n,!1);return o&&(o=this.enterInner(e,A,n,!0,r)),o}enterInner(e,A,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=yb(e,o,i.options);i.options&Fl&&i.content.length==0&&(a|=Fl);let l=Lt.none;return n=n.filter(u=>(i.type?i.type.allowsMarkType(u.type):bb(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ku(e,A,l,r,null,a)),this.open++,n}closeExtra(e=!1){let A=this.nodes.length-1;if(A>this.open){for(;A>this.open;A--)this.nodes[A-1].content.push(this.nodes[A].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 A=this.open;A>=0;A--){if(this.nodes[A]==e)return this.open=A,!0;this.localPreserveWS&&(this.nodes[A].options|=Ql)}return!1}get currentPos(){this.closeExtra();let e=0;for(let A=this.open;A>=0;A--){let n=this.nodes[A].content;for(let r=n.length-1;r>=0;r--)e+=n[r].nodeSize;A&&e++}return e}findAtPoint(e,A){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==A&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let A=0;A<this.find.length;A++)this.find[A].pos==null&&e.nodeType==1&&e.contains(this.find[A].node)&&(this.find[A].pos=this.currentPos)}findAround(e,A,n){if(e!=A&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&A.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let A=0;A<this.find.length;A++)this.find[A].node==e&&(this.find[A].pos=this.currentPos-(e.nodeValue.length-this.find[A].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let A=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(a,l)=>{for(;a>=0;a--){let u=A[a];if(u==""){if(a==A.length-1||a==0)continue;for(;l>=o;l--)if(i(a-1,l))return!0;return!1}else{let f=l>0||l==0&&r?this.nodes[l].type:n&&l>=o?n.node(l-o).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;l--}}return!0};return i(A.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let A=e.depth;A>=0;A--){let n=e.node(A).contentMatchAt(e.indexAfter(A)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let A in this.parser.schema.nodes){let n=this.parser.schema.nodes[A];if(n.isTextblock&&n.defaultAttrs)return n}}}function BP(t){for(let e=t.firstChild,A=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Bb.hasOwnProperty(n)&&A?(A.appendChild(e),e=A):n=="li"?A=e:n&&(A=null)}}function yP(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Cb(t){let e={};for(let A in t)e[A]=t[A];return e}function bb(t,e){let A=e.schema.nodes;for(let n in A){let r=A[n];if(!r.allowsMarkType(t))continue;let o=[],i=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:f}=a.edge(l);if(u==e||o.indexOf(f)<0&&i(f))return!0}};if(i(r.contentMatch))return!0}}class ss{constructor(e,A){this.nodes=e,this.marks=A}serializeFragment(e,A={},n){n||(n=qp(A).createDocumentFragment());let r=n,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let a=0,l=0;for(;a<o.length&&l<i.marks.length;){let u=i.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)r=o.pop()[1];for(;l<i.marks.length;){let u=i.marks[l++],f=this.serializeMark(u,i.isInline,A);f&&(o.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(i,A))}),n}serializeNodeInner(e,A){let{dom:n,contentDOM:r}=Su(qp(A),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,A,r)}return n}serializeNode(e,A={}){let n=this.serializeNodeInner(e,A);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,A);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,A,n={}){let r=this.marks[e.type.name];return r&&Su(qp(n),r(e,A),null,e.attrs)}static renderSpec(e,A,n=null,r){return Su(e,A,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ss(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let A=vb(e.nodes);return A.text||(A.text=n=>n.text),A}static marksFromSchema(e){return vb(e.marks)}}function vb(t){let e={};for(let A in t){let n=t[A].spec.toDOM;n&&(e[A]=n)}return e}function qp(t){return t.document||window.document}const Eb=new WeakMap;function wP(t){let e=Eb.get(t);return e===void 0&&Eb.set(t,e=CP(t)),e}function CP(t){let e=null;function A(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let r=0;r<n.length;r++)A(n[r]);else for(let r in n)A(n[r])}return A(t),e}function Su(t,e,A,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let r=e[0],o;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(o=wP(n))&&o.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 i=r.indexOf(" ");i>0&&(A=r.slice(0,i),r=r.slice(i+1));let a,l=A?t.createElementNS(A,r):t.createElement(r),u=e[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let h in u)if(u[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=f;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:B}=Su(t,p,A,n);if(l.appendChild(g),B){if(a)throw new RangeError("Multiple content holes");a=B}}}return{dom:l,contentDOM:a}}const kb=65535,Sb=Math.pow(2,16);function bP(t,e){return t+e*Sb}function Qb(t){return t&kb}function vP(t){return(t-(t&kb))/Sb}const Fb=1,Ub=2,Qu=4,Ib=8;class Zp{constructor(e,A,n){this.pos=e,this.delInfo=A,this.recover=n}get deleted(){return(this.delInfo&Ib)>0}get deletedBefore(){return(this.delInfo&(Fb|Qu))>0}get deletedAfter(){return(this.delInfo&(Ub|Qu))>0}get deletedAcross(){return(this.delInfo&Qu)>0}}class Ln{constructor(e,A=!1){if(this.ranges=e,this.inverted=A,!e.length&&Ln.empty)return Ln.empty}recover(e){let A=0,n=Qb(e);if(!this.inverted)for(let r=0;r<n;r++)A+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[n*3]+A+vP(e)}mapResult(e,A=1){return this._map(e,A,!1)}map(e,A=1){return this._map(e,A,!0)}_map(e,A,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o],f=this.ranges[a+i],h=l+u;if(e<=h){let p=u?e==l?-1:e==h?1:A:A,g=l+r+(p<0?0:f);if(n)return g;let B=e==(A<0?l:h)?null:bP(a/3,e-l),y=e==l?Ub:e==h?Fb:Qu;return(A<0?e!=l:e!=h)&&(y|=Ib),new Zp(g,y,B)}r+=f-u}return n?e+r:new Zp(e+r,0,null)}touches(e,A){let n=0,r=Qb(A),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[a+o],f=l+u;if(e<=f&&a==r*3)return!0;n+=this.ranges[a+i]-u}return!1}forEach(e){let A=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),u=this.ranges[r+A],f=this.ranges[r+n];e(a,a+u,l,l+f),o+=f-u}}invert(){return new Ln(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ln.empty:new Ln(e<0?[0,-e,0]:[0,0,e])}}Ln.empty=new Ln([]);class Ul{constructor(e,A,n=0,r=e?e.length:0){this.mirror=A,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||A)}get maps(){return this._maps}slice(e=0,A=this.maps.length){return new Ul(this._maps,this.mirror,e,A)}appendMap(e,A){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),A!=null&&this.setMirror(this._maps.length-1,A)}appendMapping(e){for(let A=0,n=this._maps.length;A<e._maps.length;A++){let r=e.getMirror(A);this.appendMap(e._maps[A],r!=null&&r<A?n+r:void 0)}}getMirror(e){if(this.mirror){for(let A=0;A<this.mirror.length;A++)if(this.mirror[A]==e)return this.mirror[A+(A%2?-1:1)]}}setMirror(e,A){this.mirror||(this.mirror=[]),this.mirror.push(e,A)}appendMappingInverted(e){for(let A=e.maps.length-1,n=this._maps.length+e._maps.length;A>=0;A--){let r=e.getMirror(A);this.appendMap(e._maps[A].invert(),r!=null&&r>A?n-r-1:void 0)}}invert(){let e=new Ul;return e.appendMappingInverted(this),e}map(e,A=1){if(this.mirror)return this._map(e,A,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,A);return e}mapResult(e,A=1){return this._map(e,A,!1)}_map(e,A,n){let r=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],a=i.mapResult(e,A);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return n?e:new Zp(e,r,null)}}const em=Object.create(null);class XA{getMap(){return Ln.empty}merge(e){return null}static fromJSON(e,A){if(!A||!A.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=em[A.stepType];if(!n)throw new RangeError(`No step type ${A.stepType} defined`);return n.fromJSON(e,A)}static jsonID(e,A){if(e in em)throw new RangeError("Duplicate use of step JSON ID "+e);return em[e]=A,A.prototype.jsonID=e,A}}class yA{constructor(e,A){this.doc=e,this.failed=A}static ok(e){return new yA(e,null)}static fail(e){return new yA(null,e)}static fromReplace(e,A,n,r){try{return yA.ok(e.replace(A,n,r))}catch(o){if(o instanceof wu)return yA.fail(o.message);throw o}}}function tm(t,e,A){let n=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(tm(o.content,e,o))),o.isInline&&(o=e(o,A,r)),n.push(o)}return we.fromArray(n)}class ii extends XA{constructor(e,A,n){super(),this.from=e,this.to=A,this.mark=n}apply(e){let A=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new De(tm(A.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),r),A.openStart,A.openEnd);return yA.fromReplace(e,this.from,this.to,o)}invert(){return new kr(this.from,this.to,this.mark)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deleted&&n.deleted||A.pos>=n.pos?null:new ii(A.pos,n.pos,this.mark)}merge(e){return e instanceof ii&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ii(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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ii(A.from,A.to,e.markFromJSON(A.mark))}}XA.jsonID("addMark",ii);class kr extends XA{constructor(e,A,n){super(),this.from=e,this.to=A,this.mark=n}apply(e){let A=e.slice(this.from,this.to),n=new De(tm(A.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),A.openStart,A.openEnd);return yA.fromReplace(e,this.from,this.to,n)}invert(){return new ii(this.from,this.to,this.mark)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deleted&&n.deleted||A.pos>=n.pos?null:new kr(A.pos,n.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new kr(A.from,A.to,e.markFromJSON(A.mark))}}XA.jsonID("removeMark",kr);class si extends XA{constructor(e,A){super(),this.pos=e,this.mark=A}apply(e){let A=e.nodeAt(this.pos);if(!A)return yA.fail("No node at mark step's position");let n=A.type.create(A.attrs,null,this.mark.addToSet(A.marks));return yA.fromReplace(e,this.pos,this.pos+1,new De(we.from(n),0,A.isLeaf?0:1))}invert(e){let A=e.nodeAt(this.pos);if(A){let n=this.mark.addToSet(A.marks);if(n.length==A.marks.length){for(let r=0;r<A.marks.length;r++)if(!A.marks[r].isInSet(n))return new si(this.pos,A.marks[r]);return new si(this.pos,this.mark)}}return new as(this.pos,this.mark)}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new si(A.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new si(A.pos,e.markFromJSON(A.mark))}}XA.jsonID("addNodeMark",si);class as extends XA{constructor(e,A){super(),this.pos=e,this.mark=A}apply(e){let A=e.nodeAt(this.pos);if(!A)return yA.fail("No node at mark step's position");let n=A.type.create(A.attrs,null,this.mark.removeFromSet(A.marks));return yA.fromReplace(e,this.pos,this.pos+1,new De(we.from(n),0,A.isLeaf?0:1))}invert(e){let A=e.nodeAt(this.pos);return!A||!this.mark.isInSet(A.marks)?this:new si(this.pos,this.mark)}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new as(A.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new as(A.pos,e.markFromJSON(A.mark))}}XA.jsonID("removeNodeMark",as);class TA extends XA{constructor(e,A,n,r=!1){super(),this.from=e,this.to=A,this.slice=n,this.structure=r}apply(e){return this.structure&&Am(e,this.from,this.to)?yA.fail("Structure replace would overwrite content"):yA.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ln([this.from,this.to-this.from,this.slice.size])}invert(e){return new TA(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return A.deletedAcross&&n.deletedAcross?null:new TA(A.pos,Math.max(A.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof TA)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let A=this.slice.size+e.slice.size==0?De.empty:new De(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new TA(this.from,this.to+(e.to-e.from),A,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let A=this.slice.size+e.slice.size==0?De.empty:new De(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new TA(e.from,this.to,A,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,A){if(typeof A.from!="number"||typeof A.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new TA(A.from,A.to,De.fromJSON(e,A.slice),!!A.structure)}}XA.jsonID("replace",TA);class _A extends XA{constructor(e,A,n,r,o,i,a=!1){super(),this.from=e,this.to=A,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(Am(e,this.from,this.gapFrom)||Am(e,this.gapTo,this.to)))return yA.fail("Structure gap-replace would overwrite content");let A=e.slice(this.gapFrom,this.gapTo);if(A.openStart||A.openEnd)return yA.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,A.content);return n?yA.fromReplace(e,this.from,this.to,n):yA.fail("Content does not fit in gap")}getMap(){return new Ln([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let A=this.gapTo-this.gapFrom;return new _A(this.from,this.from+this.slice.size+A,this.from+this.insert,this.from+this.insert+A,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let A=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?A.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return A.deletedAcross&&n.deletedAcross||r<A.pos||o>n.pos?null:new _A(A.pos,n.pos,r,o,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,A){if(typeof A.from!="number"||typeof A.to!="number"||typeof A.gapFrom!="number"||typeof A.gapTo!="number"||typeof A.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _A(A.from,A.to,A.gapFrom,A.gapTo,De.fromJSON(e,A.slice),A.insert,!!A.structure)}}XA.jsonID("replaceAround",_A);function Am(t,e,A){let n=t.resolve(e),r=A-e,o=n.depth;for(;r>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,r--;if(r>0){let i=n.node(o).maybeChild(n.indexAfter(o));for(;r>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,r--}}return!1}function EP(t,e,A,n){let r=[],o=[],i,a;t.doc.nodesBetween(e,A,(l,u,f)=>{if(!l.isInline)return;let h=l.marks;if(!n.isInSet(h)&&f.type.allowsMarkType(n.type)){let p=Math.max(u,e),g=Math.min(u+l.nodeSize,A),B=n.addToSet(h);for(let y=0;y<h.length;y++)h[y].isInSet(B)||(i&&i.to==p&&i.mark.eq(h[y])?i.to=g:r.push(i=new kr(p,g,h[y])));a&&a.to==p?a.to=g:o.push(a=new ii(p,g,n))}}),r.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function kP(t,e,A,n){let r=[],o=0;t.doc.nodesBetween(e,A,(i,a)=>{if(!i.isInline)return;o++;let l=null;if(n instanceof Eu){let u=i.marks,f;for(;f=n.isInSet(u);)(l||(l=[])).push(f),u=f.removeFromSet(u)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let u=Math.min(a+i.nodeSize,A);for(let f=0;f<l.length;f++){let h=l[f],p;for(let g=0;g<r.length;g++){let B=r[g];B.step==o-1&&h.eq(r[g].style)&&(p=B)}p?(p.to=u,p.step=o):r.push({style:h,from:Math.max(a,e),to:u,step:o})}}}),r.forEach(i=>t.step(new kr(i.from,i.to,i.style)))}function nm(t,e,A,n=A.contentMatch,r=!0){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),f=a+u.nodeSize,h=n.matchType(u.type);if(!h)i.push(new TA(a,f,De.empty));else{n=h;for(let p=0;p<u.marks.length;p++)A.allowsMarkType(u.marks[p].type)||t.step(new kr(a,f,u.marks[p]));if(r&&u.isText&&A.whitespace!="pre"){let p,g=/\r?\n|\r/g,B;for(;p=g.exec(u.text);)B||(B=new De(we.from(A.schema.text(" ",A.allowedMarks(u.marks))),0,0)),i.push(new TA(a+p.index,a+p.index+p[0].length,B))}}a=f}if(!n.validEnd){let l=n.fillBefore(we.empty,!0);t.replace(a,a,new De(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function SP(t,e,A){return(e==0||t.canReplace(e,t.childCount))&&(A==t.childCount||t.canReplace(0,A))}function aa(t){let A=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,A))return n;if(n==0||r.type.spec.isolating||!SP(r,o,i))break}return null}function QP(t,e,A){let{$from:n,$to:r,depth:o}=e,i=n.before(o+1),a=r.after(o+1),l=i,u=a,f=we.empty,h=0;for(let B=o,y=!1;B>A;B--)y||n.index(B)>0?(y=!0,f=we.from(n.node(B).copy(f)),h++):l--;let p=we.empty,g=0;for(let B=o,y=!1;B>A;B--)y||r.after(B+1)<r.end(B)?(y=!0,p=we.from(r.node(B).copy(p)),g++):u++;t.step(new _A(l,u,i,a,new De(f.append(p),h,g),f.size-h,!0))}function rm(t,e,A=null,n=t){let r=FP(t,e),o=r&&UP(n,e);return o?r.map(xb).concat({type:e,attrs:A}).concat(o.map(xb)):null}function xb(t){return{type:t,attrs:null}}function FP(t,e){let{parent:A,startIndex:n,endIndex:r}=t,o=A.contentMatchAt(n).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return A.canReplaceWith(n,r,i)?o:null}function UP(t,e){let{parent:A,startIndex:n,endIndex:r}=t,o=A.child(n),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let u=n;l&&u<r;u++)l=l.matchType(A.child(u).type);return!l||!l.validEnd?null:i}function IP(t,e,A){let n=we.empty;for(let i=A.length-1;i>=0;i--){if(n.size){let a=A[i].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=we.from(A[i].type.create(A[i].attrs,n))}let r=e.start,o=e.end;t.step(new _A(r,o,r,o,new De(n,0,0),A.length,!0))}function xP(t,e,A,n,r){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,A,(i,a)=>{let l=typeof r=="function"?r(i):r;if(i.isTextblock&&!i.hasMarkup(n,l)&&TP(t.doc,t.mapping.slice(o).map(a),n)){let u=null;if(n.schema.linebreakReplacement){let g=n.whitespace=="pre",B=!!n.contentMatch.matchType(n.schema.linebreakReplacement);g&&!B?u=!1:!g&&B&&(u=!0)}u===!1&&_b(t,i,a,o),nm(t,t.mapping.slice(o).map(a,1),n,void 0,u===null);let f=t.mapping.slice(o),h=f.map(a,1),p=f.map(a+i.nodeSize,1);return t.step(new _A(h,p,h+1,p-1,new De(we.from(n.create(l,null,i.marks)),0,0),1,!0)),u===!0&&Tb(t,i,a,o),!1}})}function Tb(t,e,A,n){e.forEach((r,o)=>{if(r.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(r.text);){let l=t.mapping.slice(n).map(A+1+o+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function _b(t,e,A,n){e.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let i=t.mapping.slice(n).map(A+1+o);t.replaceWith(i,i+1,e.type.schema.text(`
29
- `))}})}function TP(t,e,A){let n=t.resolve(e),r=n.index();return n.parent.canReplaceWith(r,r+1,A)}function _P(t,e,A,n,r){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");A||(A=o.type);let i=A.create(n,null,r||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,i);if(!A.validContent(o.content))throw new RangeError("Invalid content for node type "+A.name);t.step(new _A(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new De(we.from(i),0,0),1,!0))}function vo(t,e,A=1,n){let r=t.resolve(e),o=r.depth-A,i=n&&n[n.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!i.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=A-2;u>o;u--,f--){let h=r.node(u),p=r.index(u);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(p,h.childCount),B=n&&n[f+1];B&&(g=g.replaceChild(0,B.type.create(B.attrs)));let y=n&&n[f]||h;if(!h.canReplace(p+1,h.childCount)||!y.type.validContent(g))return!1}let a=r.indexAfter(o),l=n&&n[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function DP(t,e,A=1,n){let r=t.doc.resolve(e),o=we.empty,i=we.empty;for(let a=r.depth,l=r.depth-A,u=A-1;a>l;a--,u--){o=we.from(r.node(a).copy(o));let f=n&&n[u];i=we.from(f?f.type.create(f.attrs,i):r.node(a).copy(i))}t.step(new TA(e,e,new De(o.append(i),A,A),!0))}function ai(t,e){let A=t.resolve(e),n=A.index();return Db(A.nodeBefore,A.nodeAfter)&&A.parent.canReplace(n,n+1)}function LP(t,e){e.content.size||t.type.compatibleContent(e.type);let A=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=o.type==n?t.type.schema.nodes.text:o.type;if(A=A.matchType(i),!A||!t.type.allowsMarks(o.marks))return!1}return A.validEnd}function Db(t,e){return!!(t&&e&&!t.isLeaf&&LP(t,e))}function Fu(t,e,A=-1){let n=t.resolve(e);for(let r=n.depth;;r--){let o,i,a=n.index(r);if(r==n.depth?(o=n.nodeBefore,i=n.nodeAfter):A>0?(o=n.node(r+1),a++,i=n.node(r).maybeChild(a)):(o=n.node(r).maybeChild(a-1),i=n.node(r+1)),o&&!o.isTextblock&&Db(o,i)&&n.node(r).canReplace(a,a+1))return e;if(r==0)break;e=A<0?n.before(r):n.after(r)}}function OP(t,e,A){let n=null,{linebreakReplacement:r}=t.doc.type.schema,o=t.doc.resolve(e-A),i=o.node().type;if(r&&i.inlineContent){let f=i.whitespace=="pre",h=!!i.contentMatch.matchType(r);f&&!h?n=!1:!f&&h&&(n=!0)}let a=t.steps.length;if(n===!1){let f=t.doc.resolve(e+A);_b(t,f.node(),f.before(),a)}i.inlineContent&&nm(t,e+A-1,i,o.node().contentMatchAt(o.index()),n==null);let l=t.mapping.slice(a),u=l.map(e-A);if(t.step(new TA(u,l.map(e+A,-1),De.empty,!0)),n===!0){let f=t.doc.resolve(u);Tb(t,f.node(),f.before(),t.steps.length)}return t}function MP(t,e,A){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),A))return e;if(n.parentOffset==0)for(let r=n.depth-1;r>=0;r--){let o=n.index(r);if(n.node(r).canReplaceWith(o,o,A))return n.before(r+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let r=n.depth-1;r>=0;r--){let o=n.indexAfter(r);if(n.node(r).canReplaceWith(o,o,A))return n.after(r+1);if(o<n.node(r).childCount)return null}return null}function Lb(t,e,A){let n=t.resolve(e);if(!A.content.size)return e;let r=A.content;for(let o=0;o<A.openStart;o++)r=r.firstChild.content;for(let o=1;o<=(A.openStart==0&&A.size?2:1);o++)for(let i=n.depth;i>=0;i--){let a=i==n.depth?0:n.pos<=(n.start(i+1)+n.end(i+1))/2?-1:1,l=n.index(i)+(a>0?1:0),u=n.node(i),f=!1;if(o==1)f=u.canReplace(l,l,r);else{let h=u.contentMatchAt(l).findWrapping(r.firstChild.type);f=h&&u.canReplaceWith(l,l,h[0])}if(f)return a==0?n.pos:a<0?n.before(i+1):n.after(i+1)}return null}function Uu(t,e,A=e,n=De.empty){if(e==A&&!n.size)return null;let r=t.resolve(e),o=t.resolve(A);return Ob(r,o,n)?new TA(e,A,n):new NP(r,o,n).fit()}function Ob(t,e,A){return!A.openStart&&!A.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),A.content)}class NP{constructor(e,A,n){this.$from=e,this.$to=A,this.unplaced=n,this.frontier=[],this.placed=we.empty;for(let r=0;r<=e.depth;r++){let o=e.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=we.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),A=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,a=r.depth;for(;i&&a&&o.childCount==1;)o=o.firstChild.content,i--,a--;let l=new De(o,i,a);return e>-1?new _A(n.pos,e,this.$to.pos,this.$to.end(),l,A):l.size||n.pos!=this.$to.pos?new TA(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let A=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=A.firstChild;if(A.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}A=o.content}for(let A=1;A<=2;A++)for(let n=A==1?e:this.unplaced.openStart;n>=0;n--){let r,o=null;n?(o=om(this.unplaced.content,n-1).firstChild,r=o.content):r=this.unplaced.content;let i=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],f,h=null;if(A==1&&(i?u.matchType(i.type)||(h=u.fillBefore(we.from(i),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:a,parent:o,inject:h};if(A==2&&i&&(f=u.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:a,parent:o,wrap:f};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:A,openEnd:n}=this.unplaced,r=om(e,A);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new De(e,A+1,Math.max(n,r.size+A>=e.size-n?A+1:0)),!0)}dropNode(){let{content:e,openStart:A,openEnd:n}=this.unplaced,r=om(e,A);if(r.childCount<=1&&A>0){let o=e.size-A<=A+r.size;this.unplaced=new De(Il(e,A-1,1),A-1,o?A-1:n)}else this.unplaced=new De(Il(e,A,1),A,n)}placeNodes({sliceDepth:e,frontierDepth:A,parent:n,inject:r,wrap:o}){for(;this.depth>A;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let i=this.unplaced,a=n?n.content:i.content,l=i.openStart-e,u=0,f=[],{match:h,type:p}=this.frontier[A];if(r){for(let y=0;y<r.childCount;y++)f.push(r.child(y));h=h.matchFragment(r)}let g=a.size+e-(i.content.size-i.openEnd);for(;u<a.childCount;){let y=a.child(u),b=h.matchType(y.type);if(!b)break;u++,(u>1||l==0||y.content.size)&&(h=b,f.push(Mb(y.mark(p.allowedMarks(y.marks)),u==1?l:0,u==a.childCount?g:-1)))}let B=u==a.childCount;B||(g=-1),this.placed=xl(this.placed,A,we.from(f)),this.frontier[A].match=h,B&&g<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,b=a;y<g;y++){let w=b.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),b=w.content}this.unplaced=B?e==0?De.empty:new De(Il(i.content,e-1,1),e-1,g<0?i.openEnd:e-1):new De(Il(i.content,e,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],A;if(!e.type.isTextblock||!im(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(A=this.findCloseLevel(this.$to))&&A.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let A=Math.min(this.depth,e.depth);A>=0;A--){let{match:n,type:r}=this.frontier[A],o=A<e.depth&&e.end(A+1)==e.pos+(e.depth-(A+1)),i=im(e,A,r,n,o);if(i){for(let a=A-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],f=im(e,a,u,l,!0);if(!f||f.childCount)continue e}return{depth:A,fit:i,move:o?e.doc.resolve(e.after(A+1)):e}}}}close(e){let A=this.findCloseLevel(e);if(!A)return null;for(;this.depth>A.depth;)this.closeFrontierNode();A.fit.childCount&&(this.placed=xl(this.placed,A.depth,A.fit)),e=A.move;for(let n=A.depth+1;n<=e.depth;n++){let r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}openFrontierNode(e,A=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xl(this.placed,this.depth,we.from(e.create(A,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let A=this.frontier.pop().match.fillBefore(we.empty,!0);A.childCount&&(this.placed=xl(this.placed,this.frontier.length,A))}}function Il(t,e,A){return e==0?t.cutByIndex(A,t.childCount):t.replaceChild(0,t.firstChild.copy(Il(t.firstChild.content,e-1,A)))}function xl(t,e,A){return e==0?t.append(A):t.replaceChild(t.childCount-1,t.lastChild.copy(xl(t.lastChild.content,e-1,A)))}function om(t,e){for(let A=0;A<e;A++)t=t.firstChild.content;return t}function Mb(t,e,A){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Mb(n.firstChild,e-1,n.childCount==1?A-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),A<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(we.empty,!0)))),t.copy(n)}function im(t,e,A,n,r){let o=t.node(e),i=r?t.indexAfter(e):t.index(e);if(i==o.childCount&&!A.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,i);return a&&!HP(A,o.content,i)?a:null}function HP(t,e,A){for(let n=A;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function RP(t){return t.spec.defining||t.spec.definingForContent}function PP(t,e,A,n){if(!n.size)return t.deleteRange(e,A);let r=t.doc.resolve(e),o=t.doc.resolve(A);if(Ob(r,o,n))return t.step(new TA(e,A,n));let i=Hb(r,t.doc.resolve(A));i[i.length-1]==0&&i.pop();let a=-(r.depth+1);i.unshift(a);for(let p=r.depth,g=r.pos-1;p>0;p--,g--){let B=r.node(p).type.spec;if(B.defining||B.definingAsContext||B.isolating)break;i.indexOf(p)>-1?a=p:r.before(p)==g&&i.splice(1,0,-p)}let l=i.indexOf(a),u=[],f=n.openStart;for(let p=n.content,g=0;;g++){let B=p.firstChild;if(u.push(B),g==n.openStart)break;p=B.content}for(let p=f-1;p>=0;p--){let g=u[p],B=RP(g.type);if(B&&!g.sameMarkup(r.node(Math.abs(a)-1)))f=p;else if(B||!g.type.isTextblock)break}for(let p=n.openStart;p>=0;p--){let g=(p+f+1)%(n.openStart+1),B=u[g];if(B)for(let y=0;y<i.length;y++){let b=i[(y+l)%i.length],w=!0;b<0&&(w=!1,b=-b);let v=r.node(b-1),S=r.index(b-1);if(v.canReplaceWith(S,S,B.type,B.marks))return t.replace(r.before(b),w?o.after(b):A,new De(Nb(n.content,0,n.openStart,g),g,n.openEnd))}}let h=t.steps.length;for(let p=i.length-1;p>=0&&(t.replace(e,A,n),!(t.steps.length>h));p--){let g=i[p];g<0||(e=r.before(g),A=o.after(g))}}function Nb(t,e,A,n,r){if(e<A){let o=t.firstChild;t=t.replaceChild(0,o.copy(Nb(o.content,e+1,A,n,o)))}if(e>n){let o=r.contentMatchAt(0),i=o.fillBefore(t).append(t);t=i.append(o.matchFragment(i).fillBefore(we.empty,!0))}return t}function VP(t,e,A,n){if(!n.isInline&&e==A&&t.doc.resolve(e).parent.content.size){let r=MP(t.doc,e,n.type);r!=null&&(e=A=r)}t.replaceRange(e,A,new De(we.from(n),0,0))}function $P(t,e,A){let n=t.doc.resolve(e),r=t.doc.resolve(A),o=Hb(n,r);for(let i=0;i<o.length;i++){let a=o[i],l=i==o.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),r.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return t.delete(n.before(a),r.after(a))}for(let i=1;i<=n.depth&&i<=r.depth;i++)if(e-n.start(i)==n.depth-i&&A>n.end(i)&&r.end(i)-A!=r.depth-i&&n.start(i-1)==r.start(i-1)&&n.node(i-1).canReplace(n.index(i-1),r.index(i-1)))return t.delete(n.before(i),A);t.delete(e,A)}function Hb(t,e){let A=[],n=Math.min(t.depth,e.depth);for(let r=n;r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&A.push(r)}return A}class la extends XA{constructor(e,A,n){super(),this.pos=e,this.attr=A,this.value=n}apply(e){let A=e.nodeAt(this.pos);if(!A)return yA.fail("No node at attribute step's position");let n=Object.create(null);for(let o in A.attrs)n[o]=A.attrs[o];n[this.attr]=this.value;let r=A.type.create(n,null,A.marks);return yA.fromReplace(e,this.pos,this.pos+1,new De(we.from(r),0,A.isLeaf?0:1))}getMap(){return Ln.empty}invert(e){return new la(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new la(A.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,A){if(typeof A.pos!="number"||typeof A.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new la(A.pos,A.attr,A.value)}}XA.jsonID("attr",la);class Tl extends XA{constructor(e,A){super(),this.attr=e,this.value=A}apply(e){let A=Object.create(null);for(let r in e.attrs)A[r]=e.attrs[r];A[this.attr]=this.value;let n=e.type.create(A,e.content,e.marks);return yA.ok(n)}getMap(){return Ln.empty}invert(e){return new Tl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,A){if(typeof A.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Tl(A.attr,A.value)}}XA.jsonID("docAttr",Tl);let ca=class extends Error{};ca=function t(e){let A=Error.call(this,e);return A.__proto__=t.prototype,A},ca.prototype=Object.create(Error.prototype),ca.prototype.constructor=ca,ca.prototype.name="TransformError";class Rb{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let A=this.maybeStep(e);if(A.failed)throw new ca(A.failed);return this}maybeStep(e){let A=e.apply(this.doc);return A.failed||this.addStep(e,A.doc),A}get docChanged(){return this.steps.length>0}addStep(e,A){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=A}replace(e,A=e,n=De.empty){let r=Uu(this.doc,e,A,n);return r&&this.step(r),this}replaceWith(e,A,n){return this.replace(e,A,new De(we.from(n),0,0))}delete(e,A){return this.replace(e,A,De.empty)}insert(e,A){return this.replaceWith(e,e,A)}replaceRange(e,A,n){return PP(this,e,A,n),this}replaceRangeWith(e,A,n){return VP(this,e,A,n),this}deleteRange(e,A){return $P(this,e,A),this}lift(e,A){return QP(this,e,A),this}join(e,A=1){return OP(this,e,A),this}wrap(e,A){return IP(this,e,A),this}setBlockType(e,A=e,n,r=null){return xP(this,e,A,n,r),this}setNodeMarkup(e,A,n=null,r){return _P(this,e,A,n,r),this}setNodeAttribute(e,A,n){return this.step(new la(e,A,n)),this}setDocAttribute(e,A){return this.step(new Tl(e,A)),this}addNodeMark(e,A){return this.step(new si(e,A)),this}removeNodeMark(e,A){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(A instanceof Lt)A.isInSet(n.marks)&&this.step(new as(e,A));else{let r=n.marks,o,i=[];for(;o=A.isInSet(r);)i.push(new as(e,o)),r=o.removeFromSet(r);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,A=1,n){return DP(this,e,A,n),this}addMark(e,A,n){return EP(this,e,A,n),this}removeMark(e,A,n){return kP(this,e,A,n),this}clearIncompatible(e,A,n){return nm(this,e,A,n),this}}const sm=Object.create(null);class nt{constructor(e,A,n){this.$anchor=e,this.$head=A,this.ranges=n||[new KP(e.min(A),e.max(A))]}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 A=0;A<e.length;A++)if(e[A].$from.pos!=e[A].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,A=De.empty){let n=A.content.lastChild,r=null;for(let a=0;a<A.openEnd;a++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:u}=i[a],f=e.mapping.slice(o);e.replaceRange(f.map(l.pos),f.map(u.pos),a?De.empty:A),a==0&&$b(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,A){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:a}=r[o],l=e.mapping.slice(n),u=l.map(i.pos),f=l.map(a.pos);o?e.deleteRange(u,f):(e.replaceRangeWith(u,f,A),$b(e,n,A.isInline?-1:1))}}static findFrom(e,A,n=!1){let r=e.parent.inlineContent?new Ze(e):ua(e.node(0),e.parent,e.pos,e.index(),A,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let i=A<0?ua(e.node(0),e.node(o),e.before(o+1),e.index(o),A,n):ua(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,A,n);if(i)return i}return null}static near(e,A=1){return this.findFrom(e,A)||this.findFrom(e,-A)||new On(e.node(0))}static atStart(e){return ua(e,e,0,0,1)||new On(e)}static atEnd(e){return ua(e,e,e.content.size,e.childCount,-1)||new On(e)}static fromJSON(e,A){if(!A||!A.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=sm[A.type];if(!n)throw new RangeError(`No selection type ${A.type} defined`);return n.fromJSON(e,A)}static jsonID(e,A){if(e in sm)throw new RangeError("Duplicate use of selection JSON ID "+e);return sm[e]=A,A.prototype.jsonID=e,A}getBookmark(){return Ze.between(this.$anchor,this.$head).getBookmark()}}nt.prototype.visible=!0;class KP{constructor(e,A){this.$from=e,this.$to=A}}let Pb=!1;function Vb(t){!Pb&&!t.parent.inlineContent&&(Pb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ze extends nt{constructor(e,A=e){Vb(e),Vb(A),super(e,A)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,A){let n=e.resolve(A.map(this.head));if(!n.parent.inlineContent)return nt.near(n);let r=e.resolve(A.map(this.anchor));return new Ze(r.parent.inlineContent?r:n,n)}replace(e,A=De.empty){if(super.replace(e,A),A==De.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Iu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,A){if(typeof A.anchor!="number"||typeof A.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ze(e.resolve(A.anchor),e.resolve(A.head))}static create(e,A,n=A){let r=e.resolve(A);return new this(r,n==A?r:e.resolve(n))}static between(e,A,n){let r=e.pos-A.pos;if((!n||r)&&(n=r>=0?1:-1),!A.parent.inlineContent){let o=nt.findFrom(A,n,!0)||nt.findFrom(A,-n,!0);if(o)A=o.$head;else return nt.near(A,n)}return e.parent.inlineContent||(r==0?e=A:(e=(nt.findFrom(e,-n,!0)||nt.findFrom(e,n,!0)).$anchor,e.pos<A.pos!=r<0&&(e=A))),new Ze(e,A)}}nt.jsonID("text",Ze);class Iu{constructor(e,A){this.anchor=e,this.head=A}map(e){return new Iu(e.map(this.anchor),e.map(this.head))}resolve(e){return Ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class Pe extends nt{constructor(e){let A=e.nodeAfter,n=e.node(0).resolve(e.pos+A.nodeSize);super(e,n),this.node=A}map(e,A){let{deleted:n,pos:r}=A.mapResult(this.anchor),o=e.resolve(r);return n?nt.near(o):new Pe(o)}content(){return new De(we.from(this.node),0,0)}eq(e){return e instanceof Pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new am(this.anchor)}static fromJSON(e,A){if(typeof A.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Pe(e.resolve(A.anchor))}static create(e,A){return new Pe(e.resolve(A))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Pe.prototype.visible=!1,nt.jsonID("node",Pe);class am{constructor(e){this.anchor=e}map(e){let{deleted:A,pos:n}=e.mapResult(this.anchor);return A?new Iu(n,n):new am(n)}resolve(e){let A=e.resolve(this.anchor),n=A.nodeAfter;return n&&Pe.isSelectable(n)?new Pe(A):nt.near(A)}}class On extends nt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,A=De.empty){if(A==De.empty){e.delete(0,e.doc.content.size);let n=nt.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,A)}toJSON(){return{type:"all"}}static fromJSON(e){return new On(e)}map(e){return new On(e)}eq(e){return e instanceof On}getBookmark(){return GP}}nt.jsonID("all",On);const GP={map(){return this},resolve(t){return new On(t)}};function ua(t,e,A,n,r,o=!1){if(e.inlineContent)return Ze.create(t,A);for(let i=n-(r>0?0:1);r>0?i<e.childCount:i>=0;i+=r){let a=e.child(i);if(a.isAtom){if(!o&&Pe.isSelectable(a))return Pe.create(t,A-(r<0?a.nodeSize:0))}else{let l=ua(t,a,A+r,r<0?a.childCount:0,r,o);if(l)return l}A+=a.nodeSize*r}return null}function $b(t,e,A){let n=t.steps.length-1;if(n<e)return;let r=t.steps[n];if(!(r instanceof TA||r instanceof _A))return;let o=t.mapping.maps[n],i;o.forEach((a,l,u,f)=>{i==null&&(i=f)}),t.setSelection(nt.near(t.doc.resolve(i),A))}const Kb=1,xu=2,Gb=4;class WP extends Rb{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|Kb)&~xu,this.storedMarks=null,this}get selectionSet(){return(this.updated&Kb)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=xu,this}ensureMarks(e){return Lt.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&xu)>0}addStep(e,A){super.addStep(e,A),this.updated=this.updated&~xu,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,A=!0){let n=this.selection;return A&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Lt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,A,n){let r=this.doc.type.schema;if(A==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n==null&&(n=A),n=n??A,!e)return this.deleteRange(A,n);let o=this.storedMarks;if(!o){let i=this.doc.resolve(A);o=n==A?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(A,n,r.text(e,o)),this.selection.empty||this.setSelection(nt.near(this.selection.$to)),this}}setMeta(e,A){return this.meta[typeof e=="string"?e:e.key]=A,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|=Gb,this}get scrolledIntoView(){return(this.updated&Gb)>0}}function Wb(t,e){return!e||!t?t:t.bind(e)}class _l{constructor(e,A,n){this.name=e,this.init=Wb(A.init,n),this.apply=Wb(A.apply,n)}}const zP=[new _l("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new _l("selection",{init(t,e){return t.selection||nt.atStart(e.doc)},apply(t){return t.selection}}),new _l("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,A,n){return n.selection.$cursor?t.storedMarks:null}}),new _l("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class lm{constructor(e,A){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=zP.slice(),A&&A.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new _l(n.key,n.spec.state,n))})}}class da{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,A=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=A){let r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let A=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=r?r[i].n:0,u=r?r[i].state:this,f=l<A.length&&a.spec.appendTransaction.call(a,l?A.slice(l):A,u,n);if(f&&n.filterTransaction(f,i)){if(f.setMeta("appendedTransaction",e),!r){r=[];for(let h=0;h<this.config.plugins.length;h++)r.push(h<i?{state:n,n:A.length}:{state:this,n:0})}A.push(f),n=n.applyInner(f),o=!0}r&&(r[i]={state:n,n:A.length})}}if(!o)return{state:n,transactions:A}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let A=new da(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];A[o.name]=o.apply(e,this[o.name],this,A)}return A}get tr(){return new WP(this)}static create(e){let A=new lm(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new da(A);for(let r=0;r<A.fields.length;r++)n[A.fields[r].name]=A.fields[r].init(e,n);return n}reconfigure(e){let A=new lm(this.schema,e.plugins),n=A.fields,r=new da(A);for(let o=0;o<n.length;o++){let i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r}toJSON(e){let A={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(A.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(A[n]=o.toJSON.call(r,this[r.key]))}return A}static fromJSON(e,A,n){if(!A)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new lm(e.schema,e.plugins),o=new da(r);return r.fields.forEach(i=>{if(i.name=="doc")o.doc=ri.fromJSON(e.schema,A.doc);else if(i.name=="selection")o.selection=nt.fromJSON(o.doc,A.selection);else if(i.name=="storedMarks")A.storedMarks&&(o.storedMarks=A.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],u=l.spec.state;if(l.key==i.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(A,a)){o[i.name]=u.fromJSON.call(l,e,A[a],o);return}}o[i.name]=i.init(e,o)}}),o}}function zb(t,e,A){for(let n in t){let r=t[n];r instanceof Function?r=r.bind(e):n=="handleDOMEvents"&&(r=zb(r,e,{})),A[n]=r}return A}class tA{constructor(e){this.spec=e,this.props={},e.props&&zb(e.props,this,this.props),this.key=e.key?e.key.key:Yb("plugin")}getState(e){return e[this.key]}}const cm=Object.create(null);function Yb(t){return t in cm?t+"$"+ ++cm[t]:(cm[t]=0,t+"$")}class DA{constructor(e="key"){this.key=Yb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const PA=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},fa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let um=null;const Eo=function(t,e,A){let n=um||(um=document.createRange());return n.setEnd(t,A??t.nodeValue.length),n.setStart(t,e||0),n},YP=function(){um=null},ls=function(t,e,A,n){return A&&(Jb(t,e,A,n,-1)||Jb(t,e,A,n,1))},JP=/^(img|br|input|textarea|hr)$/i;function Jb(t,e,A,n,r){for(var o;;){if(t==A&&e==n)return!0;if(e==(r<0?0:qn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Dl(t)||JP.test(t.nodeName)||t.contentEditable=="false")return!1;e=PA(t)+(r<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(r<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((o=i.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=r;else return!1;else t=i,e=r<0?qn(t):0}else return!1}}function qn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function XP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=qn(t)}else if(t.parentNode&&!Dl(t))e=PA(t),t=t.parentNode;else return null}}function jP(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Dl(t))e=PA(t)+1,t=t.parentNode;else return null}}function qP(t,e,A){for(let n=e==0,r=e==qn(t);n||r;){if(t==A)return!0;let o=PA(t);if(t=t.parentNode,!t)return!1;n=n&&o==0,r=r&&o==qn(t)}}function Dl(t){let e;for(let A=t;A&&!(e=A.pmViewDesc);A=A.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tu=function(t){return t.focusNode&&ls(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function cs(t,e){let A=document.createEvent("Event");return A.initEvent("keydown",!0,!0),A.keyCode=t,A.key=A.code=e,A}function ZP(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function e2(t,e,A){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,A);if(n)return{node:n.offsetNode,offset:Math.min(qn(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,A);if(n)return{node:n.startContainer,offset:Math.min(qn(n.startContainer),n.startOffset)}}}const Yr=typeof navigator<"u"?navigator:null,Xb=typeof document<"u"?document:null,li=Yr&&Yr.userAgent||"",dm=/Edge\/(\d+)/.exec(li),jb=/MSIE \d/.exec(li),fm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(li),bn=!!(jb||fm||dm),ci=jb?document.documentMode:fm?+fm[1]:dm?+dm[1]:0,Sr=!bn&&/gecko\/(\d+)/i.test(li);Sr&&+(/Firefox\/(\d+)/.exec(li)||[0,0])[1];const hm=!bn&&/Chrome\/(\d+)/.exec(li),jA=!!hm,qb=hm?+hm[1]:0,an=!bn&&!!Yr&&/Apple Computer/.test(Yr.vendor),ha=an&&(/Mobile\/\w+/.test(li)||!!Yr&&Yr.maxTouchPoints>2),Zn=ha||(Yr?/Mac/.test(Yr.platform):!1),t2=Yr?/Win/.test(Yr.platform):!1,ko=/Android \d/.test(li),Ll=!!Xb&&"webkitFontSmoothing"in Xb.documentElement.style,A2=Ll?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function n2(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function So(t,e){return typeof t=="number"?t:t[e]}function r2(t){let e=t.getBoundingClientRect(),A=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*A,top:e.top,bottom:e.top+t.clientHeight*n}}function Zb(t,e,A){let n=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let i=A||t.dom;i;){if(i.nodeType!=1){i=fa(i);continue}let a=i,l=a==o.body,u=l?n2(o):r2(a),f=0,h=0;if(e.top<u.top+So(n,"top")?h=-(u.top-e.top+So(r,"top")):e.bottom>u.bottom-So(n,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+So(r,"top")-u.top:e.bottom-u.bottom+So(r,"bottom")),e.left<u.left+So(n,"left")?f=-(u.left-e.left+So(r,"left")):e.right>u.right-So(n,"right")&&(f=e.right-u.right+So(r,"right")),f||h)if(l)o.defaultView.scrollBy(f,h);else{let g=a.scrollLeft,B=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let y=a.scrollLeft-g,b=a.scrollTop-B;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}let p=l?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(p))break;i=p=="absolute"?i.offsetParent:fa(i)}}function o2(t){let e=t.dom.getBoundingClientRect(),A=Math.max(0,e.top),n,r;for(let o=(e.left+e.right)/2,i=A+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(o,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=A-20){n=a,r=l.top;break}}return{refDOM:n,refTop:r,stack:ev(t.dom)}}function ev(t){let e=[],A=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=A);n=fa(n));return e}function i2({refDOM:t,refTop:e,stack:A}){let n=t?t.getBoundingClientRect().top:0;tv(A,n==0?0:n-e)}function tv(t,e){for(let A=0;A<t.length;A++){let{dom:n,top:r,left:o}=t[A];n.scrollTop!=r+e&&(n.scrollTop=r+e),n.scrollLeft!=o&&(n.scrollLeft=o)}}let pa=null;function s2(t){if(t.setActive)return t.setActive();if(pa)return t.focus(pa);let e=ev(t);t.focus(pa==null?{get preventScroll(){return pa={preventScroll:!0},!0}}:void 0),pa||(pa=!1,tv(e,0))}function Av(t,e){let A,n=2e8,r,o=0,i=e.top,a=e.top,l,u;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let p;if(f.nodeType==1)p=f.getClientRects();else if(f.nodeType==3)p=Eo(f).getClientRects();else continue;for(let g=0;g<p.length;g++){let B=p[g];if(B.top<=i&&B.bottom>=a){i=Math.max(B.bottom,i),a=Math.min(B.top,a);let y=B.left>e.left?B.left-e.left:B.right<e.left?e.left-B.right:0;if(y<n){A=f,n=y,r=y&&A.nodeType==3?{left:B.right<e.left?B.right:B.left,top:e.top}:e,f.nodeType==1&&y&&(o=h+(e.left>=(B.left+B.right)/2?1:0));continue}}else B.top>e.top&&!l&&B.left<=e.left&&B.right>=e.left&&(l=f,u={left:Math.max(B.left,Math.min(B.right,e.left)),top:B.top});!A&&(e.left>=B.right&&e.top>=B.top||e.left>=B.left&&e.top>=B.bottom)&&(o=h+1)}}return!A&&l&&(A=l,r=u,n=0),A&&A.nodeType==3?a2(A,r):!A||n&&A.nodeType==1?{node:t,offset:o}:Av(A,r)}function a2(t,e){let A=t.nodeValue.length,n=document.createRange();for(let r=0;r<A;r++){n.setEnd(t,r+1),n.setStart(t,r);let o=ui(n,1);if(o.top!=o.bottom&&pm(e,o))return{node:t,offset:r+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function pm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function l2(t,e){let A=t.parentNode;return A&&/^li$/i.test(A.nodeName)&&e.left<t.getBoundingClientRect().left?A:t}function c2(t,e,A){let{node:n,offset:r}=Av(e,A),o=-1;if(n.nodeType==1&&!n.firstChild){let i=n.getBoundingClientRect();o=i.left!=i.right&&A.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(n,r,o)}function u2(t,e,A,n){let r=-1;for(let o=e,i=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&l.left>n.left||l.top>n.top?r=a.posBefore:(!i&&l.right<n.left||l.bottom<n.top)&&(r=a.posAfter),i=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,A,-1)}function nv(t,e,A){let n=t.childNodes.length;if(n&&A.top<A.bottom)for(let r=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-A.top)/(A.bottom-A.top))-2)),o=r;;){let i=t.childNodes[o];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(pm(e,u))return nv(i,e,u)}}if((o=(o+1)%n)==r)break}return t}function d2(t,e){let A=t.dom.ownerDocument,n,r=0,o=e2(A,e.left,e.top);o&&({node:n,offset:r}=o);let i=(t.root.elementFromPoint?t.root:A).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let u=t.dom.getBoundingClientRect();if(!pm(e,u)||(i=nv(t.dom,e,u),!i))return null}if(an)for(let u=i;n&&u;u=fa(u))u.draggable&&(n=void 0);if(i=l2(i,e),n){if(Sr&&n.nodeType==1&&(r=Math.min(r,n.childNodes.length),r<n.childNodes.length)){let f=n.childNodes[r],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&r++}let u;Ll&&r&&n.nodeType==1&&(u=n.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&r--,n==t.dom&&r==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(r==0||n.nodeType!=1||n.childNodes[r-1].nodeName!="BR")&&(a=u2(t,n,r,e))}a==null&&(a=c2(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function rv(t){return t.top<t.bottom||t.left<t.right}function ui(t,e){let A=t.getClientRects();if(A.length){let n=A[e<0?0:A.length-1];if(rv(n))return n}return Array.prototype.find.call(A,rv)||t.getBoundingClientRect()}const f2=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ov(t,e,A){let{node:n,offset:r,atom:o}=t.docView.domFromPos(e,A<0?-1:1),i=Ll||Sr;if(n.nodeType==3)if(i&&(f2.test(n.nodeValue)||(A<0?!r:r==n.nodeValue.length))){let l=ui(Eo(n,r,r),A);if(Sr&&r&&/\s/.test(n.nodeValue[r-1])&&r<n.nodeValue.length){let u=ui(Eo(n,r-1,r-1),-1);if(u.top==l.top){let f=ui(Eo(n,r,r+1),-1);if(f.top!=l.top)return Ol(f,f.left<u.left)}}return l}else{let l=r,u=r,f=A<0?1:-1;return A<0&&!r?(u++,f=-1):A>=0&&r==n.nodeValue.length?(l--,f=1):A<0?l--:u++,Ol(ui(Eo(n,l,u),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&r&&(A<0||r==qn(n))){let l=n.childNodes[r-1];if(l.nodeType==1)return mm(l.getBoundingClientRect(),!1)}if(o==null&&r<qn(n)){let l=n.childNodes[r];if(l.nodeType==1)return mm(l.getBoundingClientRect(),!0)}return mm(n.getBoundingClientRect(),A>=0)}if(o==null&&r&&(A<0||r==qn(n))){let l=n.childNodes[r-1],u=l.nodeType==3?Eo(l,qn(l)-(i?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Ol(ui(u,1),!1)}if(o==null&&r<qn(n)){let l=n.childNodes[r];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Eo(l,0,i?0:1):l.nodeType==1?l:null:null;if(u)return Ol(ui(u,-1),!0)}return Ol(ui(n.nodeType==3?Eo(n):n,-A),A>=0)}function Ol(t,e){if(t.width==0)return t;let A=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:A,right:A}}function mm(t,e){if(t.height==0)return t;let A=e?t.top:t.bottom;return{top:A,bottom:A,left:t.left,right:t.right}}function iv(t,e,A){let n=t.state,r=t.root.activeElement;n!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return A()}finally{n!=e&&t.updateState(n),r!=t.dom&&r&&r.focus()}}function h2(t,e,A){let n=e.selection,r=A=="up"?n.$from:n.$to;return iv(t,e,()=>{let{node:o}=t.docView.domFromPos(r.pos,A=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let i=ov(t,r.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Eo(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let f=l[u];if(f.bottom>f.top+1&&(A=="up"?i.top-f.top>(f.bottom-i.top)*2:f.bottom-i.bottom>(i.bottom-f.top)*2))return!1}}return!0})}const p2=/[\u0590-\u08ac]/;function m2(t,e,A){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let r=n.parentOffset,o=!r,i=r==n.parent.content.size,a=t.domSelection();return a?!p2.test(n.parent.textContent)||!a.modify?A=="left"||A=="backward"?o:i:iv(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",A,"character");let g=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:B,focusOffset:y}=t.domSelectionRange(),b=B&&!g.contains(B.nodeType==1?B:B.parentNode)||l==B&&u==y;try{a.collapse(f,h),l&&(l!=f||u!=h)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),b}):n.pos==n.start()||n.pos==n.end()}let sv=null,av=null,lv=!1;function g2(t,e,A){return sv==e&&av==A?lv:(sv=e,av=A,lv=A=="up"||A=="down"?h2(t,e,A):m2(t,e,A))}const er=0,cv=1,us=2,Jr=3;class Ml{constructor(e,A,n,r){this.parent=e,this.children=A,this.dom=n,this.contentDOM=r,this.dirty=er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,A,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let A=0;A<this.children.length;A++)e+=this.children[A].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 A=0,n=this.posAtStart;;A++){let r=this.children[A];if(r==e)return n;n+=r.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,A,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let o,i;if(e==this.contentDOM)o=e.childNodes[A-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{let o,i;if(e==this.contentDOM)o=e.childNodes[A];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(i):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=A>PA(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(A==0)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!1;break}if(o.previousSibling)break}if(r==null&&A==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!0;break}if(o.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,A=!1){for(let n=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),i;if(o&&(!A||o.node))if(n&&(i=o.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))n=!1;else return o}}getDesc(e){let A=e.pmViewDesc;for(let n=A;n;n=n.parent)if(n==this)return A}posFromDOM(e,A,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,A,n)}return-1}descAt(e){for(let A=0,n=0;A<this.children.length;A++){let r=this.children[A],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let i=0;i<r.children.length;i++){let a=r.children[i];if(a.size){r=a;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,A){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let i=this.children[n],a=o+i.size;if(a>e||i instanceof fv){r=e-o;break}o=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,A);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof uv&&o.side>=0;n--);if(A<=0){let o,i=!0;for(;o=n?this.children[n-1]:null,!(!o||o.dom.parentNode==this.contentDOM);n--,i=!1);return o&&A&&i&&!o.border&&!o.domAtom?o.domFromPos(o.size,A):{node:this.contentDOM,offset:o?PA(o.dom)+1:0}}else{let o,i=!0;for(;o=n<this.children.length?this.children[n]:null,!(!o||o.dom.parentNode==this.contentDOM);n++,i=!1);return o&&i&&!o.border&&!o.domAtom?o.domFromPos(0,A):{node:this.contentDOM,offset:o?PA(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,A,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:A,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let l=this.children[a],u=i+l.size;if(r==-1&&e<=u){let f=i+l.border;if(e>=f&&A<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,A,f);e=i;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=PA(p.dom)+1;break}e-=p.size}r==-1&&(r=0)}if(r>-1&&(u>A||a==this.children.length-1)){A=u;for(let f=a+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=PA(h.dom);break}A+=h.size}o==-1&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:e,to:A,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let A=this.children[e<0?0:this.children.length-1];return A.size==0||A.emptyChildAt(e)}domAfterPos(e){let{node:A,offset:n}=this.domFromPos(e,0);if(A.nodeType!=1||n==A.childNodes.length)throw new RangeError("No node after pos "+e);return A.childNodes[n]}setSelection(e,A,n,r=!1){let o=Math.min(e,A),i=Math.max(e,A);for(let g=0,B=0;g<this.children.length;g++){let y=this.children[g],b=B+y.size;if(o>B&&i<b)return y.setSelection(e-B-y.border,A-B-y.border,n,r);B=b}let a=this.domFromPos(e,e?-1:1),l=A==e?a:this.domFromPos(A,A?-1:1),u=n.root.getSelection(),f=n.domSelectionRange(),h=!1;if((Sr||an)&&e==A){let{node:g,offset:B}=a;if(g.nodeType==3){if(h=!!(B&&g.nodeValue[B-1]==`
29
+ `))}})}function TP(t,e,A){let n=t.resolve(e),r=n.index();return n.parent.canReplaceWith(r,r+1,A)}function _P(t,e,A,n,r){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");A||(A=o.type);let i=A.create(n,null,r||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,i);if(!A.validContent(o.content))throw new RangeError("Invalid content for node type "+A.name);t.step(new _A(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new De(we.from(i),0,0),1,!0))}function vo(t,e,A=1,n){let r=t.resolve(e),o=r.depth-A,i=n&&n[n.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!i.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=A-2;u>o;u--,f--){let h=r.node(u),p=r.index(u);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(p,h.childCount),B=n&&n[f+1];B&&(g=g.replaceChild(0,B.type.create(B.attrs)));let y=n&&n[f]||h;if(!h.canReplace(p+1,h.childCount)||!y.type.validContent(g))return!1}let a=r.indexAfter(o),l=n&&n[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function DP(t,e,A=1,n){let r=t.doc.resolve(e),o=we.empty,i=we.empty;for(let a=r.depth,l=r.depth-A,u=A-1;a>l;a--,u--){o=we.from(r.node(a).copy(o));let f=n&&n[u];i=we.from(f?f.type.create(f.attrs,i):r.node(a).copy(i))}t.step(new TA(e,e,new De(o.append(i),A,A),!0))}function ai(t,e){let A=t.resolve(e),n=A.index();return Db(A.nodeBefore,A.nodeAfter)&&A.parent.canReplace(n,n+1)}function LP(t,e){e.content.size||t.type.compatibleContent(e.type);let A=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=o.type==n?t.type.schema.nodes.text:o.type;if(A=A.matchType(i),!A||!t.type.allowsMarks(o.marks))return!1}return A.validEnd}function Db(t,e){return!!(t&&e&&!t.isLeaf&&LP(t,e))}function Fu(t,e,A=-1){let n=t.resolve(e);for(let r=n.depth;;r--){let o,i,a=n.index(r);if(r==n.depth?(o=n.nodeBefore,i=n.nodeAfter):A>0?(o=n.node(r+1),a++,i=n.node(r).maybeChild(a)):(o=n.node(r).maybeChild(a-1),i=n.node(r+1)),o&&!o.isTextblock&&Db(o,i)&&n.node(r).canReplace(a,a+1))return e;if(r==0)break;e=A<0?n.before(r):n.after(r)}}function OP(t,e,A){let n=null,{linebreakReplacement:r}=t.doc.type.schema,o=t.doc.resolve(e-A),i=o.node().type;if(r&&i.inlineContent){let f=i.whitespace=="pre",h=!!i.contentMatch.matchType(r);f&&!h?n=!1:!f&&h&&(n=!0)}let a=t.steps.length;if(n===!1){let f=t.doc.resolve(e+A);_b(t,f.node(),f.before(),a)}i.inlineContent&&nm(t,e+A-1,i,o.node().contentMatchAt(o.index()),n==null);let l=t.mapping.slice(a),u=l.map(e-A);if(t.step(new TA(u,l.map(e+A,-1),De.empty,!0)),n===!0){let f=t.doc.resolve(u);Tb(t,f.node(),f.before(),t.steps.length)}return t}function MP(t,e,A){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),A))return e;if(n.parentOffset==0)for(let r=n.depth-1;r>=0;r--){let o=n.index(r);if(n.node(r).canReplaceWith(o,o,A))return n.before(r+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let r=n.depth-1;r>=0;r--){let o=n.indexAfter(r);if(n.node(r).canReplaceWith(o,o,A))return n.after(r+1);if(o<n.node(r).childCount)return null}return null}function Lb(t,e,A){let n=t.resolve(e);if(!A.content.size)return e;let r=A.content;for(let o=0;o<A.openStart;o++)r=r.firstChild.content;for(let o=1;o<=(A.openStart==0&&A.size?2:1);o++)for(let i=n.depth;i>=0;i--){let a=i==n.depth?0:n.pos<=(n.start(i+1)+n.end(i+1))/2?-1:1,l=n.index(i)+(a>0?1:0),u=n.node(i),f=!1;if(o==1)f=u.canReplace(l,l,r);else{let h=u.contentMatchAt(l).findWrapping(r.firstChild.type);f=h&&u.canReplaceWith(l,l,h[0])}if(f)return a==0?n.pos:a<0?n.before(i+1):n.after(i+1)}return null}function Uu(t,e,A=e,n=De.empty){if(e==A&&!n.size)return null;let r=t.resolve(e),o=t.resolve(A);return Ob(r,o,n)?new TA(e,A,n):new NP(r,o,n).fit()}function Ob(t,e,A){return!A.openStart&&!A.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),A.content)}class NP{constructor(e,A,n){this.$from=e,this.$to=A,this.unplaced=n,this.frontier=[],this.placed=we.empty;for(let r=0;r<=e.depth;r++){let o=e.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=we.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),A=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,a=r.depth;for(;i&&a&&o.childCount==1;)o=o.firstChild.content,i--,a--;let l=new De(o,i,a);return e>-1?new _A(n.pos,e,this.$to.pos,this.$to.end(),l,A):l.size||n.pos!=this.$to.pos?new TA(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let A=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=A.firstChild;if(A.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}A=o.content}for(let A=1;A<=2;A++)for(let n=A==1?e:this.unplaced.openStart;n>=0;n--){let r,o=null;n?(o=om(this.unplaced.content,n-1).firstChild,r=o.content):r=this.unplaced.content;let i=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],f,h=null;if(A==1&&(i?u.matchType(i.type)||(h=u.fillBefore(we.from(i),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:a,parent:o,inject:h};if(A==2&&i&&(f=u.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:a,parent:o,wrap:f};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:A,openEnd:n}=this.unplaced,r=om(e,A);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new De(e,A+1,Math.max(n,r.size+A>=e.size-n?A+1:0)),!0)}dropNode(){let{content:e,openStart:A,openEnd:n}=this.unplaced,r=om(e,A);if(r.childCount<=1&&A>0){let o=e.size-A<=A+r.size;this.unplaced=new De(Il(e,A-1,1),A-1,o?A-1:n)}else this.unplaced=new De(Il(e,A,1),A,n)}placeNodes({sliceDepth:e,frontierDepth:A,parent:n,inject:r,wrap:o}){for(;this.depth>A;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let i=this.unplaced,a=n?n.content:i.content,l=i.openStart-e,u=0,f=[],{match:h,type:p}=this.frontier[A];if(r){for(let y=0;y<r.childCount;y++)f.push(r.child(y));h=h.matchFragment(r)}let g=a.size+e-(i.content.size-i.openEnd);for(;u<a.childCount;){let y=a.child(u),b=h.matchType(y.type);if(!b)break;u++,(u>1||l==0||y.content.size)&&(h=b,f.push(Mb(y.mark(p.allowedMarks(y.marks)),u==1?l:0,u==a.childCount?g:-1)))}let B=u==a.childCount;B||(g=-1),this.placed=xl(this.placed,A,we.from(f)),this.frontier[A].match=h,B&&g<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,b=a;y<g;y++){let w=b.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),b=w.content}this.unplaced=B?e==0?De.empty:new De(Il(i.content,e-1,1),e-1,g<0?i.openEnd:e-1):new De(Il(i.content,e,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],A;if(!e.type.isTextblock||!im(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(A=this.findCloseLevel(this.$to))&&A.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let A=Math.min(this.depth,e.depth);A>=0;A--){let{match:n,type:r}=this.frontier[A],o=A<e.depth&&e.end(A+1)==e.pos+(e.depth-(A+1)),i=im(e,A,r,n,o);if(i){for(let a=A-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],f=im(e,a,u,l,!0);if(!f||f.childCount)continue e}return{depth:A,fit:i,move:o?e.doc.resolve(e.after(A+1)):e}}}}close(e){let A=this.findCloseLevel(e);if(!A)return null;for(;this.depth>A.depth;)this.closeFrontierNode();A.fit.childCount&&(this.placed=xl(this.placed,A.depth,A.fit)),e=A.move;for(let n=A.depth+1;n<=e.depth;n++){let r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}openFrontierNode(e,A=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xl(this.placed,this.depth,we.from(e.create(A,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let A=this.frontier.pop().match.fillBefore(we.empty,!0);A.childCount&&(this.placed=xl(this.placed,this.frontier.length,A))}}function Il(t,e,A){return e==0?t.cutByIndex(A,t.childCount):t.replaceChild(0,t.firstChild.copy(Il(t.firstChild.content,e-1,A)))}function xl(t,e,A){return e==0?t.append(A):t.replaceChild(t.childCount-1,t.lastChild.copy(xl(t.lastChild.content,e-1,A)))}function om(t,e){for(let A=0;A<e;A++)t=t.firstChild.content;return t}function Mb(t,e,A){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Mb(n.firstChild,e-1,n.childCount==1?A-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),A<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(we.empty,!0)))),t.copy(n)}function im(t,e,A,n,r){let o=t.node(e),i=r?t.indexAfter(e):t.index(e);if(i==o.childCount&&!A.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,i);return a&&!HP(A,o.content,i)?a:null}function HP(t,e,A){for(let n=A;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function RP(t){return t.spec.defining||t.spec.definingForContent}function PP(t,e,A,n){if(!n.size)return t.deleteRange(e,A);let r=t.doc.resolve(e),o=t.doc.resolve(A);if(Ob(r,o,n))return t.step(new TA(e,A,n));let i=Hb(r,t.doc.resolve(A));i[i.length-1]==0&&i.pop();let a=-(r.depth+1);i.unshift(a);for(let p=r.depth,g=r.pos-1;p>0;p--,g--){let B=r.node(p).type.spec;if(B.defining||B.definingAsContext||B.isolating)break;i.indexOf(p)>-1?a=p:r.before(p)==g&&i.splice(1,0,-p)}let l=i.indexOf(a),u=[],f=n.openStart;for(let p=n.content,g=0;;g++){let B=p.firstChild;if(u.push(B),g==n.openStart)break;p=B.content}for(let p=f-1;p>=0;p--){let g=u[p],B=RP(g.type);if(B&&!g.sameMarkup(r.node(Math.abs(a)-1)))f=p;else if(B||!g.type.isTextblock)break}for(let p=n.openStart;p>=0;p--){let g=(p+f+1)%(n.openStart+1),B=u[g];if(B)for(let y=0;y<i.length;y++){let b=i[(y+l)%i.length],w=!0;b<0&&(w=!1,b=-b);let v=r.node(b-1),S=r.index(b-1);if(v.canReplaceWith(S,S,B.type,B.marks))return t.replace(r.before(b),w?o.after(b):A,new De(Nb(n.content,0,n.openStart,g),g,n.openEnd))}}let h=t.steps.length;for(let p=i.length-1;p>=0&&(t.replace(e,A,n),!(t.steps.length>h));p--){let g=i[p];g<0||(e=r.before(g),A=o.after(g))}}function Nb(t,e,A,n,r){if(e<A){let o=t.firstChild;t=t.replaceChild(0,o.copy(Nb(o.content,e+1,A,n,o)))}if(e>n){let o=r.contentMatchAt(0),i=o.fillBefore(t).append(t);t=i.append(o.matchFragment(i).fillBefore(we.empty,!0))}return t}function VP(t,e,A,n){if(!n.isInline&&e==A&&t.doc.resolve(e).parent.content.size){let r=MP(t.doc,e,n.type);r!=null&&(e=A=r)}t.replaceRange(e,A,new De(we.from(n),0,0))}function $P(t,e,A){let n=t.doc.resolve(e),r=t.doc.resolve(A),o=Hb(n,r);for(let i=0;i<o.length;i++){let a=o[i],l=i==o.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),r.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return t.delete(n.before(a),r.after(a))}for(let i=1;i<=n.depth&&i<=r.depth;i++)if(e-n.start(i)==n.depth-i&&A>n.end(i)&&r.end(i)-A!=r.depth-i&&n.start(i-1)==r.start(i-1)&&n.node(i-1).canReplace(n.index(i-1),r.index(i-1)))return t.delete(n.before(i),A);t.delete(e,A)}function Hb(t,e){let A=[],n=Math.min(t.depth,e.depth);for(let r=n;r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&A.push(r)}return A}class la extends XA{constructor(e,A,n){super(),this.pos=e,this.attr=A,this.value=n}apply(e){let A=e.nodeAt(this.pos);if(!A)return yA.fail("No node at attribute step's position");let n=Object.create(null);for(let o in A.attrs)n[o]=A.attrs[o];n[this.attr]=this.value;let r=A.type.create(n,null,A.marks);return yA.fromReplace(e,this.pos,this.pos+1,new De(we.from(r),0,A.isLeaf?0:1))}getMap(){return Ln.empty}invert(e){return new la(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let A=e.mapResult(this.pos,1);return A.deletedAfter?null:new la(A.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,A){if(typeof A.pos!="number"||typeof A.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new la(A.pos,A.attr,A.value)}}XA.jsonID("attr",la);class Tl extends XA{constructor(e,A){super(),this.attr=e,this.value=A}apply(e){let A=Object.create(null);for(let r in e.attrs)A[r]=e.attrs[r];A[this.attr]=this.value;let n=e.type.create(A,e.content,e.marks);return yA.ok(n)}getMap(){return Ln.empty}invert(e){return new Tl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,A){if(typeof A.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Tl(A.attr,A.value)}}XA.jsonID("docAttr",Tl);let ca=class extends Error{};ca=function t(e){let A=Error.call(this,e);return A.__proto__=t.prototype,A},ca.prototype=Object.create(Error.prototype),ca.prototype.constructor=ca,ca.prototype.name="TransformError";class Rb{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let A=this.maybeStep(e);if(A.failed)throw new ca(A.failed);return this}maybeStep(e){let A=e.apply(this.doc);return A.failed||this.addStep(e,A.doc),A}get docChanged(){return this.steps.length>0}addStep(e,A){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=A}replace(e,A=e,n=De.empty){let r=Uu(this.doc,e,A,n);return r&&this.step(r),this}replaceWith(e,A,n){return this.replace(e,A,new De(we.from(n),0,0))}delete(e,A){return this.replace(e,A,De.empty)}insert(e,A){return this.replaceWith(e,e,A)}replaceRange(e,A,n){return PP(this,e,A,n),this}replaceRangeWith(e,A,n){return VP(this,e,A,n),this}deleteRange(e,A){return $P(this,e,A),this}lift(e,A){return QP(this,e,A),this}join(e,A=1){return OP(this,e,A),this}wrap(e,A){return IP(this,e,A),this}setBlockType(e,A=e,n,r=null){return xP(this,e,A,n,r),this}setNodeMarkup(e,A,n=null,r){return _P(this,e,A,n,r),this}setNodeAttribute(e,A,n){return this.step(new la(e,A,n)),this}setDocAttribute(e,A){return this.step(new Tl(e,A)),this}addNodeMark(e,A){return this.step(new si(e,A)),this}removeNodeMark(e,A){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(A instanceof Lt)A.isInSet(n.marks)&&this.step(new as(e,A));else{let r=n.marks,o,i=[];for(;o=A.isInSet(r);)i.push(new as(e,o)),r=o.removeFromSet(r);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,A=1,n){return DP(this,e,A,n),this}addMark(e,A,n){return EP(this,e,A,n),this}removeMark(e,A,n){return kP(this,e,A,n),this}clearIncompatible(e,A,n){return nm(this,e,A,n),this}}const sm=Object.create(null);class nt{constructor(e,A,n){this.$anchor=e,this.$head=A,this.ranges=n||[new KP(e.min(A),e.max(A))]}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 A=0;A<e.length;A++)if(e[A].$from.pos!=e[A].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,A=De.empty){let n=A.content.lastChild,r=null;for(let a=0;a<A.openEnd;a++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:u}=i[a],f=e.mapping.slice(o);e.replaceRange(f.map(l.pos),f.map(u.pos),a?De.empty:A),a==0&&$b(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,A){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:a}=r[o],l=e.mapping.slice(n),u=l.map(i.pos),f=l.map(a.pos);o?e.deleteRange(u,f):(e.replaceRangeWith(u,f,A),$b(e,n,A.isInline?-1:1))}}static findFrom(e,A,n=!1){let r=e.parent.inlineContent?new Ze(e):ua(e.node(0),e.parent,e.pos,e.index(),A,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let i=A<0?ua(e.node(0),e.node(o),e.before(o+1),e.index(o),A,n):ua(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,A,n);if(i)return i}return null}static near(e,A=1){return this.findFrom(e,A)||this.findFrom(e,-A)||new On(e.node(0))}static atStart(e){return ua(e,e,0,0,1)||new On(e)}static atEnd(e){return ua(e,e,e.content.size,e.childCount,-1)||new On(e)}static fromJSON(e,A){if(!A||!A.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=sm[A.type];if(!n)throw new RangeError(`No selection type ${A.type} defined`);return n.fromJSON(e,A)}static jsonID(e,A){if(e in sm)throw new RangeError("Duplicate use of selection JSON ID "+e);return sm[e]=A,A.prototype.jsonID=e,A}getBookmark(){return Ze.between(this.$anchor,this.$head).getBookmark()}}nt.prototype.visible=!0;class KP{constructor(e,A){this.$from=e,this.$to=A}}let Pb=!1;function Vb(t){!Pb&&!t.parent.inlineContent&&(Pb=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ze extends nt{constructor(e,A=e){Vb(e),Vb(A),super(e,A)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,A){let n=e.resolve(A.map(this.head));if(!n.parent.inlineContent)return nt.near(n);let r=e.resolve(A.map(this.anchor));return new Ze(r.parent.inlineContent?r:n,n)}replace(e,A=De.empty){if(super.replace(e,A),A==De.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Iu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,A){if(typeof A.anchor!="number"||typeof A.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ze(e.resolve(A.anchor),e.resolve(A.head))}static create(e,A,n=A){let r=e.resolve(A);return new this(r,n==A?r:e.resolve(n))}static between(e,A,n){let r=e.pos-A.pos;if((!n||r)&&(n=r>=0?1:-1),!A.parent.inlineContent){let o=nt.findFrom(A,n,!0)||nt.findFrom(A,-n,!0);if(o)A=o.$head;else return nt.near(A,n)}return e.parent.inlineContent||(r==0?e=A:(e=(nt.findFrom(e,-n,!0)||nt.findFrom(e,n,!0)).$anchor,e.pos<A.pos!=r<0&&(e=A))),new Ze(e,A)}}nt.jsonID("text",Ze);class Iu{constructor(e,A){this.anchor=e,this.head=A}map(e){return new Iu(e.map(this.anchor),e.map(this.head))}resolve(e){return Ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class Pe extends nt{constructor(e){let A=e.nodeAfter,n=e.node(0).resolve(e.pos+A.nodeSize);super(e,n),this.node=A}map(e,A){let{deleted:n,pos:r}=A.mapResult(this.anchor),o=e.resolve(r);return n?nt.near(o):new Pe(o)}content(){return new De(we.from(this.node),0,0)}eq(e){return e instanceof Pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new am(this.anchor)}static fromJSON(e,A){if(typeof A.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Pe(e.resolve(A.anchor))}static create(e,A){return new Pe(e.resolve(A))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Pe.prototype.visible=!1,nt.jsonID("node",Pe);class am{constructor(e){this.anchor=e}map(e){let{deleted:A,pos:n}=e.mapResult(this.anchor);return A?new Iu(n,n):new am(n)}resolve(e){let A=e.resolve(this.anchor),n=A.nodeAfter;return n&&Pe.isSelectable(n)?new Pe(A):nt.near(A)}}class On extends nt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,A=De.empty){if(A==De.empty){e.delete(0,e.doc.content.size);let n=nt.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,A)}toJSON(){return{type:"all"}}static fromJSON(e){return new On(e)}map(e){return new On(e)}eq(e){return e instanceof On}getBookmark(){return GP}}nt.jsonID("all",On);const GP={map(){return this},resolve(t){return new On(t)}};function ua(t,e,A,n,r,o=!1){if(e.inlineContent)return Ze.create(t,A);for(let i=n-(r>0?0:1);r>0?i<e.childCount:i>=0;i+=r){let a=e.child(i);if(a.isAtom){if(!o&&Pe.isSelectable(a))return Pe.create(t,A-(r<0?a.nodeSize:0))}else{let l=ua(t,a,A+r,r<0?a.childCount:0,r,o);if(l)return l}A+=a.nodeSize*r}return null}function $b(t,e,A){let n=t.steps.length-1;if(n<e)return;let r=t.steps[n];if(!(r instanceof TA||r instanceof _A))return;let o=t.mapping.maps[n],i;o.forEach((a,l,u,f)=>{i==null&&(i=f)}),t.setSelection(nt.near(t.doc.resolve(i),A))}const Kb=1,xu=2,Gb=4;class WP extends Rb{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|Kb)&~xu,this.storedMarks=null,this}get selectionSet(){return(this.updated&Kb)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=xu,this}ensureMarks(e){return Lt.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&xu)>0}addStep(e,A){super.addStep(e,A),this.updated=this.updated&~xu,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,A=!0){let n=this.selection;return A&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Lt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,A,n){let r=this.doc.type.schema;if(A==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n==null&&(n=A),n=n??A,!e)return this.deleteRange(A,n);let o=this.storedMarks;if(!o){let i=this.doc.resolve(A);o=n==A?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(A,n,r.text(e,o)),this.selection.empty||this.setSelection(nt.near(this.selection.$to)),this}}setMeta(e,A){return this.meta[typeof e=="string"?e:e.key]=A,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|=Gb,this}get scrolledIntoView(){return(this.updated&Gb)>0}}function Wb(t,e){return!e||!t?t:t.bind(e)}class _l{constructor(e,A,n){this.name=e,this.init=Wb(A.init,n),this.apply=Wb(A.apply,n)}}const zP=[new _l("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new _l("selection",{init(t,e){return t.selection||nt.atStart(e.doc)},apply(t){return t.selection}}),new _l("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,A,n){return n.selection.$cursor?t.storedMarks:null}}),new _l("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class lm{constructor(e,A){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=zP.slice(),A&&A.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new _l(n.key,n.spec.state,n))})}}class da{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,A=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=A){let r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let A=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=r?r[i].n:0,u=r?r[i].state:this,f=l<A.length&&a.spec.appendTransaction.call(a,l?A.slice(l):A,u,n);if(f&&n.filterTransaction(f,i)){if(f.setMeta("appendedTransaction",e),!r){r=[];for(let h=0;h<this.config.plugins.length;h++)r.push(h<i?{state:n,n:A.length}:{state:this,n:0})}A.push(f),n=n.applyInner(f),o=!0}r&&(r[i]={state:n,n:A.length})}}if(!o)return{state:n,transactions:A}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let A=new da(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];A[o.name]=o.apply(e,this[o.name],this,A)}return A}get tr(){return new WP(this)}static create(e){let A=new lm(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new da(A);for(let r=0;r<A.fields.length;r++)n[A.fields[r].name]=A.fields[r].init(e,n);return n}reconfigure(e){let A=new lm(this.schema,e.plugins),n=A.fields,r=new da(A);for(let o=0;o<n.length;o++){let i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r}toJSON(e){let A={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(A.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(A[n]=o.toJSON.call(r,this[r.key]))}return A}static fromJSON(e,A,n){if(!A)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new lm(e.schema,e.plugins),o=new da(r);return r.fields.forEach(i=>{if(i.name=="doc")o.doc=ri.fromJSON(e.schema,A.doc);else if(i.name=="selection")o.selection=nt.fromJSON(o.doc,A.selection);else if(i.name=="storedMarks")A.storedMarks&&(o.storedMarks=A.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],u=l.spec.state;if(l.key==i.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(A,a)){o[i.name]=u.fromJSON.call(l,e,A[a],o);return}}o[i.name]=i.init(e,o)}}),o}}function zb(t,e,A){for(let n in t){let r=t[n];r instanceof Function?r=r.bind(e):n=="handleDOMEvents"&&(r=zb(r,e,{})),A[n]=r}return A}class AA{constructor(e){this.spec=e,this.props={},e.props&&zb(e.props,this,this.props),this.key=e.key?e.key.key:Yb("plugin")}getState(e){return e[this.key]}}const cm=Object.create(null);function Yb(t){return t in cm?t+"$"+ ++cm[t]:(cm[t]=0,t+"$")}class DA{constructor(e="key"){this.key=Yb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const PA=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},fa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let um=null;const Eo=function(t,e,A){let n=um||(um=document.createRange());return n.setEnd(t,A??t.nodeValue.length),n.setStart(t,e||0),n},YP=function(){um=null},ls=function(t,e,A,n){return A&&(Jb(t,e,A,n,-1)||Jb(t,e,A,n,1))},JP=/^(img|br|input|textarea|hr)$/i;function Jb(t,e,A,n,r){for(var o;;){if(t==A&&e==n)return!0;if(e==(r<0?0:qn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Dl(t)||JP.test(t.nodeName)||t.contentEditable=="false")return!1;e=PA(t)+(r<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(r<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((o=i.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=r;else return!1;else t=i,e=r<0?qn(t):0}else return!1}}function qn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function XP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=qn(t)}else if(t.parentNode&&!Dl(t))e=PA(t),t=t.parentNode;else return null}}function jP(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Dl(t))e=PA(t)+1,t=t.parentNode;else return null}}function qP(t,e,A){for(let n=e==0,r=e==qn(t);n||r;){if(t==A)return!0;let o=PA(t);if(t=t.parentNode,!t)return!1;n=n&&o==0,r=r&&o==qn(t)}}function Dl(t){let e;for(let A=t;A&&!(e=A.pmViewDesc);A=A.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tu=function(t){return t.focusNode&&ls(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function cs(t,e){let A=document.createEvent("Event");return A.initEvent("keydown",!0,!0),A.keyCode=t,A.key=A.code=e,A}function ZP(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function e2(t,e,A){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,A);if(n)return{node:n.offsetNode,offset:Math.min(qn(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,A);if(n)return{node:n.startContainer,offset:Math.min(qn(n.startContainer),n.startOffset)}}}const Yr=typeof navigator<"u"?navigator:null,Xb=typeof document<"u"?document:null,li=Yr&&Yr.userAgent||"",dm=/Edge\/(\d+)/.exec(li),jb=/MSIE \d/.exec(li),fm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(li),bn=!!(jb||fm||dm),ci=jb?document.documentMode:fm?+fm[1]:dm?+dm[1]:0,Sr=!bn&&/gecko\/(\d+)/i.test(li);Sr&&+(/Firefox\/(\d+)/.exec(li)||[0,0])[1];const hm=!bn&&/Chrome\/(\d+)/.exec(li),jA=!!hm,qb=hm?+hm[1]:0,an=!bn&&!!Yr&&/Apple Computer/.test(Yr.vendor),ha=an&&(/Mobile\/\w+/.test(li)||!!Yr&&Yr.maxTouchPoints>2),Zn=ha||(Yr?/Mac/.test(Yr.platform):!1),t2=Yr?/Win/.test(Yr.platform):!1,ko=/Android \d/.test(li),Ll=!!Xb&&"webkitFontSmoothing"in Xb.documentElement.style,A2=Ll?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function n2(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function So(t,e){return typeof t=="number"?t:t[e]}function r2(t){let e=t.getBoundingClientRect(),A=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*A,top:e.top,bottom:e.top+t.clientHeight*n}}function Zb(t,e,A){let n=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let i=A||t.dom;i;){if(i.nodeType!=1){i=fa(i);continue}let a=i,l=a==o.body,u=l?n2(o):r2(a),f=0,h=0;if(e.top<u.top+So(n,"top")?h=-(u.top-e.top+So(r,"top")):e.bottom>u.bottom-So(n,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+So(r,"top")-u.top:e.bottom-u.bottom+So(r,"bottom")),e.left<u.left+So(n,"left")?f=-(u.left-e.left+So(r,"left")):e.right>u.right-So(n,"right")&&(f=e.right-u.right+So(r,"right")),f||h)if(l)o.defaultView.scrollBy(f,h);else{let g=a.scrollLeft,B=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let y=a.scrollLeft-g,b=a.scrollTop-B;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}let p=l?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(p))break;i=p=="absolute"?i.offsetParent:fa(i)}}function o2(t){let e=t.dom.getBoundingClientRect(),A=Math.max(0,e.top),n,r;for(let o=(e.left+e.right)/2,i=A+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(o,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=A-20){n=a,r=l.top;break}}return{refDOM:n,refTop:r,stack:ev(t.dom)}}function ev(t){let e=[],A=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=A);n=fa(n));return e}function i2({refDOM:t,refTop:e,stack:A}){let n=t?t.getBoundingClientRect().top:0;tv(A,n==0?0:n-e)}function tv(t,e){for(let A=0;A<t.length;A++){let{dom:n,top:r,left:o}=t[A];n.scrollTop!=r+e&&(n.scrollTop=r+e),n.scrollLeft!=o&&(n.scrollLeft=o)}}let pa=null;function s2(t){if(t.setActive)return t.setActive();if(pa)return t.focus(pa);let e=ev(t);t.focus(pa==null?{get preventScroll(){return pa={preventScroll:!0},!0}}:void 0),pa||(pa=!1,tv(e,0))}function Av(t,e){let A,n=2e8,r,o=0,i=e.top,a=e.top,l,u;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let p;if(f.nodeType==1)p=f.getClientRects();else if(f.nodeType==3)p=Eo(f).getClientRects();else continue;for(let g=0;g<p.length;g++){let B=p[g];if(B.top<=i&&B.bottom>=a){i=Math.max(B.bottom,i),a=Math.min(B.top,a);let y=B.left>e.left?B.left-e.left:B.right<e.left?e.left-B.right:0;if(y<n){A=f,n=y,r=y&&A.nodeType==3?{left:B.right<e.left?B.right:B.left,top:e.top}:e,f.nodeType==1&&y&&(o=h+(e.left>=(B.left+B.right)/2?1:0));continue}}else B.top>e.top&&!l&&B.left<=e.left&&B.right>=e.left&&(l=f,u={left:Math.max(B.left,Math.min(B.right,e.left)),top:B.top});!A&&(e.left>=B.right&&e.top>=B.top||e.left>=B.left&&e.top>=B.bottom)&&(o=h+1)}}return!A&&l&&(A=l,r=u,n=0),A&&A.nodeType==3?a2(A,r):!A||n&&A.nodeType==1?{node:t,offset:o}:Av(A,r)}function a2(t,e){let A=t.nodeValue.length,n=document.createRange();for(let r=0;r<A;r++){n.setEnd(t,r+1),n.setStart(t,r);let o=ui(n,1);if(o.top!=o.bottom&&pm(e,o))return{node:t,offset:r+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function pm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function l2(t,e){let A=t.parentNode;return A&&/^li$/i.test(A.nodeName)&&e.left<t.getBoundingClientRect().left?A:t}function c2(t,e,A){let{node:n,offset:r}=Av(e,A),o=-1;if(n.nodeType==1&&!n.firstChild){let i=n.getBoundingClientRect();o=i.left!=i.right&&A.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(n,r,o)}function u2(t,e,A,n){let r=-1;for(let o=e,i=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&l.left>n.left||l.top>n.top?r=a.posBefore:(!i&&l.right<n.left||l.bottom<n.top)&&(r=a.posAfter),i=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,A,-1)}function nv(t,e,A){let n=t.childNodes.length;if(n&&A.top<A.bottom)for(let r=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-A.top)/(A.bottom-A.top))-2)),o=r;;){let i=t.childNodes[o];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(pm(e,u))return nv(i,e,u)}}if((o=(o+1)%n)==r)break}return t}function d2(t,e){let A=t.dom.ownerDocument,n,r=0,o=e2(A,e.left,e.top);o&&({node:n,offset:r}=o);let i=(t.root.elementFromPoint?t.root:A).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let u=t.dom.getBoundingClientRect();if(!pm(e,u)||(i=nv(t.dom,e,u),!i))return null}if(an)for(let u=i;n&&u;u=fa(u))u.draggable&&(n=void 0);if(i=l2(i,e),n){if(Sr&&n.nodeType==1&&(r=Math.min(r,n.childNodes.length),r<n.childNodes.length)){let f=n.childNodes[r],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&r++}let u;Ll&&r&&n.nodeType==1&&(u=n.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&r--,n==t.dom&&r==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(r==0||n.nodeType!=1||n.childNodes[r-1].nodeName!="BR")&&(a=u2(t,n,r,e))}a==null&&(a=c2(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function rv(t){return t.top<t.bottom||t.left<t.right}function ui(t,e){let A=t.getClientRects();if(A.length){let n=A[e<0?0:A.length-1];if(rv(n))return n}return Array.prototype.find.call(A,rv)||t.getBoundingClientRect()}const f2=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ov(t,e,A){let{node:n,offset:r,atom:o}=t.docView.domFromPos(e,A<0?-1:1),i=Ll||Sr;if(n.nodeType==3)if(i&&(f2.test(n.nodeValue)||(A<0?!r:r==n.nodeValue.length))){let l=ui(Eo(n,r,r),A);if(Sr&&r&&/\s/.test(n.nodeValue[r-1])&&r<n.nodeValue.length){let u=ui(Eo(n,r-1,r-1),-1);if(u.top==l.top){let f=ui(Eo(n,r,r+1),-1);if(f.top!=l.top)return Ol(f,f.left<u.left)}}return l}else{let l=r,u=r,f=A<0?1:-1;return A<0&&!r?(u++,f=-1):A>=0&&r==n.nodeValue.length?(l--,f=1):A<0?l--:u++,Ol(ui(Eo(n,l,u),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&r&&(A<0||r==qn(n))){let l=n.childNodes[r-1];if(l.nodeType==1)return mm(l.getBoundingClientRect(),!1)}if(o==null&&r<qn(n)){let l=n.childNodes[r];if(l.nodeType==1)return mm(l.getBoundingClientRect(),!0)}return mm(n.getBoundingClientRect(),A>=0)}if(o==null&&r&&(A<0||r==qn(n))){let l=n.childNodes[r-1],u=l.nodeType==3?Eo(l,qn(l)-(i?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Ol(ui(u,1),!1)}if(o==null&&r<qn(n)){let l=n.childNodes[r];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Eo(l,0,i?0:1):l.nodeType==1?l:null:null;if(u)return Ol(ui(u,-1),!0)}return Ol(ui(n.nodeType==3?Eo(n):n,-A),A>=0)}function Ol(t,e){if(t.width==0)return t;let A=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:A,right:A}}function mm(t,e){if(t.height==0)return t;let A=e?t.top:t.bottom;return{top:A,bottom:A,left:t.left,right:t.right}}function iv(t,e,A){let n=t.state,r=t.root.activeElement;n!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return A()}finally{n!=e&&t.updateState(n),r!=t.dom&&r&&r.focus()}}function h2(t,e,A){let n=e.selection,r=A=="up"?n.$from:n.$to;return iv(t,e,()=>{let{node:o}=t.docView.domFromPos(r.pos,A=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let i=ov(t,r.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Eo(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let f=l[u];if(f.bottom>f.top+1&&(A=="up"?i.top-f.top>(f.bottom-i.top)*2:f.bottom-i.bottom>(i.bottom-f.top)*2))return!1}}return!0})}const p2=/[\u0590-\u08ac]/;function m2(t,e,A){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let r=n.parentOffset,o=!r,i=r==n.parent.content.size,a=t.domSelection();return a?!p2.test(n.parent.textContent)||!a.modify?A=="left"||A=="backward"?o:i:iv(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",A,"character");let g=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:B,focusOffset:y}=t.domSelectionRange(),b=B&&!g.contains(B.nodeType==1?B:B.parentNode)||l==B&&u==y;try{a.collapse(f,h),l&&(l!=f||u!=h)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),b}):n.pos==n.start()||n.pos==n.end()}let sv=null,av=null,lv=!1;function g2(t,e,A){return sv==e&&av==A?lv:(sv=e,av=A,lv=A=="up"||A=="down"?h2(t,e,A):m2(t,e,A))}const er=0,cv=1,us=2,Jr=3;class Ml{constructor(e,A,n,r){this.parent=e,this.children=A,this.dom=n,this.contentDOM=r,this.dirty=er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,A,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let A=0;A<this.children.length;A++)e+=this.children[A].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 A=0,n=this.posAtStart;;A++){let r=this.children[A];if(r==e)return n;n+=r.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,A,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let o,i;if(e==this.contentDOM)o=e.childNodes[A-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{let o,i;if(e==this.contentDOM)o=e.childNodes[A];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(i):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=A>PA(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(A==0)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!1;break}if(o.previousSibling)break}if(r==null&&A==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!0;break}if(o.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,A=!1){for(let n=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),i;if(o&&(!A||o.node))if(n&&(i=o.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))n=!1;else return o}}getDesc(e){let A=e.pmViewDesc;for(let n=A;n;n=n.parent)if(n==this)return A}posFromDOM(e,A,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,A,n)}return-1}descAt(e){for(let A=0,n=0;A<this.children.length;A++){let r=this.children[A],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let i=0;i<r.children.length;i++){let a=r.children[i];if(a.size){r=a;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,A){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let i=this.children[n],a=o+i.size;if(a>e||i instanceof fv){r=e-o;break}o=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,A);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof uv&&o.side>=0;n--);if(A<=0){let o,i=!0;for(;o=n?this.children[n-1]:null,!(!o||o.dom.parentNode==this.contentDOM);n--,i=!1);return o&&A&&i&&!o.border&&!o.domAtom?o.domFromPos(o.size,A):{node:this.contentDOM,offset:o?PA(o.dom)+1:0}}else{let o,i=!0;for(;o=n<this.children.length?this.children[n]:null,!(!o||o.dom.parentNode==this.contentDOM);n++,i=!1);return o&&i&&!o.border&&!o.domAtom?o.domFromPos(0,A):{node:this.contentDOM,offset:o?PA(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,A,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:A,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let l=this.children[a],u=i+l.size;if(r==-1&&e<=u){let f=i+l.border;if(e>=f&&A<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,A,f);e=i;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=PA(p.dom)+1;break}e-=p.size}r==-1&&(r=0)}if(r>-1&&(u>A||a==this.children.length-1)){A=u;for(let f=a+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=PA(h.dom);break}A+=h.size}o==-1&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:e,to:A,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let A=this.children[e<0?0:this.children.length-1];return A.size==0||A.emptyChildAt(e)}domAfterPos(e){let{node:A,offset:n}=this.domFromPos(e,0);if(A.nodeType!=1||n==A.childNodes.length)throw new RangeError("No node after pos "+e);return A.childNodes[n]}setSelection(e,A,n,r=!1){let o=Math.min(e,A),i=Math.max(e,A);for(let g=0,B=0;g<this.children.length;g++){let y=this.children[g],b=B+y.size;if(o>B&&i<b)return y.setSelection(e-B-y.border,A-B-y.border,n,r);B=b}let a=this.domFromPos(e,e?-1:1),l=A==e?a:this.domFromPos(A,A?-1:1),u=n.root.getSelection(),f=n.domSelectionRange(),h=!1;if((Sr||an)&&e==A){let{node:g,offset:B}=a;if(g.nodeType==3){if(h=!!(B&&g.nodeValue[B-1]==`
30
30
  `),h&&B==g.nodeValue.length)for(let y=g,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:PA(b)+1});break}let w=y.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let y=g.childNodes[B-1];h=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Sr&&f.focusNode&&f.focusNode!=l.node&&f.focusNode.nodeType==1){let g=f.focusNode.childNodes[f.focusOffset];g&&g.contentEditable=="false"&&(r=!0)}if(!(r||h&&an)&&ls(a.node,a.offset,f.anchorNode,f.anchorOffset)&&ls(l.node,l.offset,f.focusNode,f.focusOffset))return;let p=!1;if((u.extend||e==A)&&!h){u.collapse(a.node,a.offset);try{e!=A&&u.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>A){let B=a;a=l,l=B}let g=document.createRange();g.setEnd(l.node,l.offset),g.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,A){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&A>=n:e<i&&A>n){let a=n+o.border,l=i-o.border;if(e>=a&&A<=l){this.dirty=e==n||A==i?us:cv,e==a&&A==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Jr:o.markDirty(e-a,A-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?us:Jr}n=i}this.dirty=us}markParentsDirty(){let e=1;for(let A=this.parent;A;A=A.parent,e++){let n=e==1?us:cv;A.dirty<n&&(A.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class uv extends Ml{constructor(e,A,n,r){let o,i=A.type.toDOM;if(typeof i=="function"&&(i=i(n,()=>{if(!o)return r;if(o.parent)return o.parent.posBeforeChild(o)})),!A.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=A,this.widget=A,o=this}matchesWidget(e){return this.dirty==er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let A=this.widget.spec.stopEvent;return A?A(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 B2 extends Ml{constructor(e,A,n,r){super(e,[],A,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,A){return e!=this.textDOM?this.posAtStart+(A?this.size:0):this.posAtStart+A}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ds extends Ml{constructor(e,A,n,r,o){super(e,[],n,r),this.mark=A,this.spec=o}static create(e,A,n,r){let o=r.nodeViews[A.type.name],i=o&&o(A,r,n);return(!i||!i.dom)&&(i=ss.renderSpec(document,A.type.spec.toDOM(A,n),null,A.attrs)),new ds(e,A,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Jr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Jr&&this.mark.eq(e)}markDirty(e,A){if(super.markDirty(e,A),this.dirty!=er){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=er}}slice(e,A,n){let r=ds.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;A<i&&(o=Bm(o,A,i,n)),e>0&&(o=Bm(o,0,e,n));for(let a=0;a<o.length;a++)o[a].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class di extends Ml{constructor(e,A,n,r,o,i,a,l,u){super(e,[],o,i),this.node=A,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=a}static create(e,A,n,r,o,i){let a=o.nodeViews[A.type.name],l,u=a&&a(A,o,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},n,r),f=u&&u.dom,h=u&&u.contentDOM;if(A.isText){if(!f)f=document.createTextNode(A.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=ss.renderSpec(document,A.type.spec.toDOM(A),null,A.attrs));!h&&!A.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),A.type.spec.draggable&&(f.draggable=!0));let p=f;return f=mv(f,n,A),u?l=new y2(e,A,n,r,f,h||null,p,u,o,i+1):A.isText?new _u(e,A,n,r,f,p,o):new di(e,A,n,r,f,h||null,p,o,i+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 A=this.children.length-1;A>=0;A--){let n=this.children[A];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>we.empty)}return e}matchesNode(e,A,n){return this.dirty==er&&e.eq(this.node)&&Du(A,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,A){let n=this.node.inlineContent,r=A,o=e.composing?this.localCompositionInfo(e,A):null,i=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new C2(this,i&&i.node,e);E2(this.node,this.innerDeco,(u,f,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!h&&l.syncToMarks(f==this.node.childCount?Lt.none:this.node.child(f).marks,n,e),l.placeWidget(u,e,r)},(u,f,h,p)=>{l.syncToMarks(u.marks,n,e);let g;l.findNodeMatch(u,f,h,p)||a&&e.state.selection.from>r&&e.state.selection.to<r+u.nodeSize&&(g=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,f,h,g,e)||l.updateNextNode(u,f,h,e,p,r)||l.addNode(u,f,h,e,r),r+=u.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==us)&&(i&&this.protectLocalComposition(e,i),hv(this.contentDOM,this.children,e),ha&&k2(this.dom))}localCompositionInfo(e,A){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Ze)||n<A||r>A+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let i=o.nodeValue,a=S2(this.node.content,i,n-A,r-A);return a<0?null:{node:o,pos:a,text:i}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:A,pos:n,text:r}){if(this.getDesc(A))return;let o=A;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new B2(this,o,A,r);e.input.compositionNodes.push(i),this.children=Bm(this.children,n,n+r.length,e,i)}update(e,A,n,r){return this.dirty==Jr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,A,n,r),!0)}updateInner(e,A,n,r){this.updateOuterDeco(A),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=er}updateOuterDeco(e){if(Du(e,this.outerDeco))return;let A=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=pv(this.dom,this.nodeDOM,gm(this.outerDeco,this.node,A),gm(e,this.node,A)),this.dom!=n&&(n.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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function dv(t,e,A,n,r){mv(n,e,t);let o=new di(void 0,t,e,A,n,n,n,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class _u extends di{constructor(e,A,n,r,o,i,a){super(e,A,n,r,o,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,A,n,r){return this.dirty==Jr||this.dirty!=er&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(A),(this.dirty!=er||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=er,!0)}inParent(){let e=this.parent.contentDOM;for(let A=this.nodeDOM;A;A=A.parentNode)if(A==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,A,n){return e==this.nodeDOM?this.posAtStart+Math.min(A,this.node.text.length):super.localPosFromDOM(e,A,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,A,n){let r=this.node.cut(e,A),o=document.createTextNode(r.text);return new _u(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,A){super.markDirty(e,A),this.dom!=this.nodeDOM&&(e==0||A==this.nodeDOM.nodeValue.length)&&(this.dirty=Jr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fv extends Ml{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class y2 extends di{constructor(e,A,n,r,o,i,a,l,u,f){super(e,A,n,r,o,i,a,u,f),this.spec=l}update(e,A,n,r){if(this.dirty==Jr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,A,n);return o&&this.updateInner(e,A,n,r),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,A,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,A,n,r){this.spec.setSelection?this.spec.setSelection(e,A,n.root):super.setSelection(e,A,n,r)}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 hv(t,e,A){let n=t.firstChild,r=!1;for(let o=0;o<e.length;o++){let i=e[o],a=i.dom;if(a.parentNode==t){for(;a!=n;)n=gv(n),r=!0;n=n.nextSibling}else r=!0,t.insertBefore(a,n);if(i instanceof ds){let l=n?n.previousSibling:t.lastChild;hv(i.contentDOM,i.children,A),n=l?l.nextSibling:t.firstChild}}for(;n;)n=gv(n),r=!0;r&&A.trackWrites==t&&(A.trackWrites=null)}const Nl=function(t){t&&(this.nodeName=t)};Nl.prototype=Object.create(null);const fs=[new Nl];function gm(t,e,A){if(t.length==0)return fs;let n=A?fs[0]:new Nl,r=[n];for(let o=0;o<t.length;o++){let i=t[o].type.attrs;if(i){i.nodeName&&r.push(n=new Nl(i.nodeName));for(let a in i){let l=i[a];l!=null&&(A&&r.length==1&&r.push(n=new Nl(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return r}function pv(t,e,A,n){if(A==fs&&n==fs)return e;let r=e;for(let o=0;o<n.length;o++){let i=n[o],a=A[o];if(o){let l;a&&a.nodeName==i.nodeName&&r!=t&&(l=r.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(r),a=fs[0]),r=l}w2(r,a||fs[0],i)}return r}function w2(t,e,A){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in A)&&t.removeAttribute(n);for(let n in A)n!="class"&&n!="style"&&n!="nodeName"&&A[n]!=e[n]&&t.setAttribute(n,A[n]);if(e.class!=A.class){let n=e.class?e.class.split(" ").filter(Boolean):[],r=A.class?A.class.split(" ").filter(Boolean):[];for(let o=0;o<n.length;o++)r.indexOf(n[o])==-1&&t.classList.remove(n[o]);for(let o=0;o<r.length;o++)n.indexOf(r[o])==-1&&t.classList.add(r[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=A.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(e.style);)t.style.removeProperty(r[1])}A.style&&(t.style.cssText+=A.style)}}function mv(t,e,A){return pv(t,t,fs,gm(e,A,t.nodeType!=1))}function Du(t,e){if(t.length!=e.length)return!1;for(let A=0;A<t.length;A++)if(!t[A].type.eq(e[A].type))return!1;return!0}function gv(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class C2{constructor(e,A,n){this.lock=A,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=b2(e.node.content,e)}destroyBetween(e,A){if(e!=A){for(let n=e;n<A;n++)this.top.children[n].destroy();this.top.children.splice(e,A-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,A,n){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&e[r].type.spec.spanning!==!1;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=er,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ds.create(this.top,e[o],A,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,A,n,r){let o=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,A,n))o=this.top.children.indexOf(i,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,A,n)&&!this.preMatch.matched.has(u)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,A,n,r,o){let i=this.top.children[r];return i.dirty==Jr&&i.dom==i.contentDOM&&(i.dirty=us),i.update(e,A,n,o)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let A=e.parentNode;if(!A)return-1;if(A==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r}return-1}e=A}}updateNextNode(e,A,n,r,o,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof di){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let f=l.dom,h,p=this.isLocked(f)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Jr&&Du(A,l.outerDeco));if(!p&&l.update(e,A,n,r))return this.destroyBetween(this.index,a),l.dom!=f&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(l,e,A,n,r,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=us,h.updateChildren(r,i+1),h.dirty=er),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,A,n,r,o,i){if(e.dirty||A.isAtom||!e.children.length||!e.node.content.eq(A.content)||!Du(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let a=di.create(this.top,A,n,r,o,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,A,n,r,o){let i=di.create(this.top,e,A,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,A,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let o=new uv(this.top,e,A,n);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],A=this.top;for(;e instanceof ds;)A=e,e=A.children[A.children.length-1];(!e||!(e instanceof _u)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((an||jA)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",A),this.addHackNode("BR",this.top))}addHackNode(e,A){if(A==this.top&&this.index<A.children.length&&A.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let r=new fv(this.top,[],n,null);A!=this.top?A.children.push(r):A.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function b2(t,e){let A=e,n=A.children.length,r=t.childCount,o=new Map,i=[];e:for(;r>0;){let a;for(;;)if(n){let u=A.children[n-1];if(u instanceof ds)A=u,n=u.children.length;else{a=u,n--;break}}else{if(A==e)break e;n=A.parent.children.indexOf(A),A=A.parent}let l=a.node;if(l){if(l!=t.child(r-1))break;--r,o.set(a,r),i.push(a)}}return{index:r,matched:o,matches:i.reverse()}}function v2(t,e){return t.type.side-e.type.side}function E2(t,e,A,n){let r=e.locals(t),o=0;if(r.length==0){for(let u=0;u<t.childCount;u++){let f=t.child(u);n(f,r,e.forChild(o,f),u),o+=f.nodeSize}return}let i=0,a=[],l=null;for(let u=0;;){let f,h;for(;i<r.length&&r[i].to==o;){let b=r[i++];b.widget&&(f?(h||(h=[f])).push(b):f=b)}if(f)if(h){h.sort(v2);for(let b=0;b<h.length;b++)A(h[b],u,!!l)}else A(f,u,!!l);let p,g;if(l)g=-1,p=l,l=null;else if(u<t.childCount)g=u,p=t.child(u++);else break;for(let b=0;b<a.length;b++)a[b].to<=o&&a.splice(b--,1);for(;i<r.length&&r[i].from<=o&&r[i].to>o;)a.push(r[i++]);let B=o+p.nodeSize;if(p.isText){let b=B;i<r.length&&r[i].from<b&&(b=r[i].from);for(let w=0;w<a.length;w++)a[w].to<b&&(b=a[w].to);b<B&&(l=p.cut(b-o),p=p.cut(0,b-o),B=b,g=-1)}else for(;i<r.length&&r[i].to<B;)i++;let y=p.isInline&&!p.isLeaf?a.filter(b=>!b.inline):a.slice();n(p,y,e.forChild(o,p),g),o=B}}function k2(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function S2(t,e,A,n){for(let r=0,o=0;r<t.childCount&&o<=n;){let i=t.child(r++),a=o;if(o+=i.nodeSize,!i.isText)continue;let l=i.text;for(;r<t.childCount;){let u=t.child(r++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=A){if(o>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let u=a<n?l.lastIndexOf(e,n-a-1):-1;if(u>=0&&u+e.length+a>=A)return a+u;if(A==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function Bm(t,e,A,n,r){let o=[];for(let i=0,a=0;i<t.length;i++){let l=t[i],u=a,f=a+=l.size;u>=A||f<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,n)),r&&(o.push(r),r=void 0),f>A&&o.push(l.slice(A-u,l.size,n)))}return o}function ym(t,e=null){let A=t.domSelectionRange(),n=t.state.doc;if(!A.focusNode)return null;let r=t.docView.nearestDesc(A.focusNode),o=r&&r.size==0,i=t.docView.posFromDOM(A.focusNode,A.focusOffset,1);if(i<0)return null;let a=n.resolve(i),l,u;if(Tu(A)){for(l=i;r&&!r.node;)r=r.parent;let h=r.node;if(r&&h.isAtom&&Pe.isSelectable(h)&&r.parent&&!(h.isInline&&qP(A.focusNode,A.focusOffset,r.dom))){let p=r.posBefore;u=new Pe(i==p?a:n.resolve(p))}}else{if(A instanceof t.dom.ownerDocument.defaultView.Selection&&A.rangeCount>1){let h=i,p=i;for(let g=0;g<A.rangeCount;g++){let B=A.getRangeAt(g);h=Math.min(h,t.docView.posFromDOM(B.startContainer,B.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(B.endContainer,B.endOffset,-1))}if(h<0)return null;[l,i]=p==t.state.selection.anchor?[p,h]:[h,p],a=n.resolve(i)}else l=t.docView.posFromDOM(A.anchorNode,A.anchorOffset,1);if(l<0)return null}let f=n.resolve(l);if(!u){let h=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;u=Cm(t,f,a,h)}return u}function Bv(t){return t.editable?t.hasFocus():kv(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Qo(t,e=!1){let A=t.state.selection;if(bv(t,A),!!Bv(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&jA){let n=t.domSelectionRange(),r=t.domObserver.currentSelection;if(n.anchorNode&&r.anchorNode&&ls(n.anchorNode,n.anchorOffset,r.anchorNode,r.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)F2(t);else{let{anchor:n,head:r}=A,o,i;yv&&!(A instanceof Ze)&&(A.$from.parent.inlineContent||(o=wv(t,A.from)),!A.empty&&!A.$from.parent.inlineContent&&(i=wv(t,A.to))),t.docView.setSelection(n,r,t,e),yv&&(o&&Cv(o),i&&Cv(i)),A.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Q2(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const yv=an||jA&&qb<63;function wv(t,e){let{node:A,offset:n}=t.docView.domFromPos(e,0),r=n<A.childNodes.length?A.childNodes[n]:null,o=n?A.childNodes[n-1]:null;if(an&&r&&r.contentEditable=="false")return wm(r);if((!r||r.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(r)return wm(r);if(o)return wm(o)}}function wm(t){return t.contentEditable="true",an&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Cv(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Q2(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let A=t.domSelectionRange(),n=A.anchorNode,r=A.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(A.anchorNode!=n||A.anchorOffset!=r)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Bv(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function F2(t){let e=t.domSelection(),A=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?A.setStart(n.parentNode,PA(n)+1):A.setStart(n,0),A.collapse(!0),e.removeAllRanges(),e.addRange(A),!r&&!t.state.selection.visible&&bn&&ci<=11&&(n.disabled=!0,n.disabled=!1)}function bv(t,e){if(e instanceof Pe){let A=t.docView.descAt(e.from);A!=t.lastSelectedViewDesc&&(vv(t),A&&A.selectNode(),t.lastSelectedViewDesc=A)}else vv(t)}function vv(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Cm(t,e,A,n){return t.someProp("createSelectionBetween",r=>r(t,e,A))||Ze.between(e,A,n)}function Ev(t){return t.editable&&!t.hasFocus()?!1:kv(t)}function kv(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function U2(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),A=t.domSelectionRange();return ls(e.node,e.offset,A.anchorNode,A.anchorOffset)}function bm(t,e){let{$anchor:A,$head:n}=t.selection,r=e>0?A.max(n):A.min(n),o=r.parent.inlineContent?r.depth?t.doc.resolve(e>0?r.after():r.before()):null:r;return o&&nt.findFrom(o,e)}function fi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Sv(t,e,A){let n=t.state.selection;if(n instanceof Ze)if(A.indexOf("s")>-1){let{$head:r}=n,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=t.state.doc.resolve(r.pos+o.nodeSize*(e<0?-1:1));return fi(t,new Ze(n.$anchor,i))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let r=bm(t.state,e);return r&&r instanceof Pe?fi(t,r):!1}else if(!(Zn&&A.indexOf("m")>-1)){let r=n.$head,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter,i;if(!o||o.isText)return!1;let a=e<0?r.pos-o.nodeSize:r.pos;return o.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Pe.isSelectable(o)?fi(t,new Pe(e<0?t.state.doc.resolve(r.pos-o.nodeSize):r)):Ll?fi(t,new Ze(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Pe&&n.node.isInline)return fi(t,new Ze(e>0?n.$to:n.$from));{let r=bm(t.state,e);return r?fi(t,r):!1}}}function Lu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Hl(t,e){let A=t.pmViewDesc;return A&&A.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ma(t,e){return e<0?I2(t):x2(t)}function I2(t){let e=t.domSelectionRange(),A=e.focusNode,n=e.focusOffset;if(!A)return;let r,o,i=!1;for(Sr&&A.nodeType==1&&n<Lu(A)&&Hl(A.childNodes[n],-1)&&(i=!0);;)if(n>0){if(A.nodeType!=1)break;{let a=A.childNodes[n-1];if(Hl(a,-1))r=A,o=--n;else if(a.nodeType==3)A=a,n=A.nodeValue.length;else break}}else{if(Qv(A))break;{let a=A.previousSibling;for(;a&&Hl(a,-1);)r=A.parentNode,o=PA(a),a=a.previousSibling;if(a)A=a,n=Lu(A);else{if(A=A.parentNode,A==t.dom)break;n=0}}}i?vm(t,A,n):r&&vm(t,r,o)}function x2(t){let e=t.domSelectionRange(),A=e.focusNode,n=e.focusOffset;if(!A)return;let r=Lu(A),o,i;for(;;)if(n<r){if(A.nodeType!=1)break;let a=A.childNodes[n];if(Hl(a,1))o=A,i=++n;else break}else{if(Qv(A))break;{let a=A.nextSibling;for(;a&&Hl(a,1);)o=a.parentNode,i=PA(a)+1,a=a.nextSibling;if(a)A=a,n=0,r=Lu(A);else{if(A=A.parentNode,A==t.dom)break;n=r=0}}}o&&vm(t,o,i)}function Qv(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function T2(t,e){for(;t&&e==t.childNodes.length&&!Dl(t);)e=PA(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let A=t.childNodes[e];if(A.nodeType==3)return A;if(A.nodeType==1&&A.contentEditable=="false")break;t=A,e=0}}function _2(t,e){for(;t&&!e&&!Dl(t);)e=PA(t),t=t.parentNode;for(;t&&e;){let A=t.childNodes[e-1];if(A.nodeType==3)return A;if(A.nodeType==1&&A.contentEditable=="false")break;t=A,e=t.childNodes.length}}function vm(t,e,A){if(e.nodeType!=3){let o,i;(i=T2(e,A))?(e=i,A=0):(o=_2(e,A))&&(e=o,A=o.nodeValue.length)}let n=t.domSelection();if(!n)return;if(Tu(n)){let o=document.createRange();o.setEnd(e,A),o.setStart(e,A),n.removeAllRanges(),n.addRange(o)}else n.extend&&n.extend(e,A);t.domObserver.setCurSelection();let{state:r}=t;setTimeout(()=>{t.state==r&&Qo(t)},50)}function Fv(t,e){let A=t.state.doc.resolve(e);if(!(jA||t2)&&A.parent.inlineContent){let r=t.coordsAtPos(e);if(e>A.start()){let o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<A.end()){let o=t.coordsAtPos(e+1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Uv(t,e,A){let n=t.state.selection;if(n instanceof Ze&&!n.empty||A.indexOf("s")>-1||Zn&&A.indexOf("m")>-1)return!1;let{$from:r,$to:o}=n;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=bm(t.state,e);if(i&&i instanceof Pe)return fi(t,i)}if(!r.parent.inlineContent){let i=e<0?r:o,a=n instanceof On?nt.near(i,e):nt.findFrom(i,e);return a?fi(t,a):!1}return!1}function Iv(t,e){if(!(t.state.selection instanceof Ze))return!0;let{$head:A,$anchor:n,empty:r}=t.state.selection;if(!A.sameParent(n))return!0;if(!r)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!A.textOffset&&(e<0?A.nodeBefore:A.nodeAfter);if(o&&!o.isText){let i=t.state.tr;return e<0?i.delete(A.pos-o.nodeSize,A.pos):i.delete(A.pos,A.pos+o.nodeSize),t.dispatch(i),!0}return!1}function xv(t,e,A){t.domObserver.stop(),e.contentEditable=A,t.domObserver.start()}function D2(t){if(!an||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:A}=t.domSelectionRange();if(e&&e.nodeType==1&&A==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;xv(t,n,"true"),setTimeout(()=>xv(t,n,"false"),20)}return!1}function L2(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function O2(t,e){let A=e.keyCode,n=L2(e);if(A==8||Zn&&A==72&&n=="c")return Iv(t,-1)||ma(t,-1);if(A==46&&!e.shiftKey||Zn&&A==68&&n=="c")return Iv(t,1)||ma(t,1);if(A==13||A==27)return!0;if(A==37||Zn&&A==66&&n=="c"){let r=A==37?Fv(t,t.state.selection.from)=="ltr"?-1:1:-1;return Sv(t,r,n)||ma(t,r)}else if(A==39||Zn&&A==70&&n=="c"){let r=A==39?Fv(t,t.state.selection.from)=="ltr"?1:-1:1;return Sv(t,r,n)||ma(t,r)}else{if(A==38||Zn&&A==80&&n=="c")return Uv(t,-1,n)||ma(t,-1);if(A==40||Zn&&A==78&&n=="c")return D2(t)||Uv(t,1,n)||ma(t,1);if(n==(Zn?"m":"c")&&(A==66||A==73||A==89||A==90))return!0}return!1}function Em(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let A=[],{content:n,openStart:r,openEnd:o}=e;for(;r>1&&o>1&&n.childCount==1&&n.firstChild.childCount==1;){r--,o--;let g=n.firstChild;A.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),n=g.content}let i=t.someProp("clipboardSerializer")||ss.fromSchema(t.state.schema),a=Hv(),l=a.createElement("div");l.appendChild(i.serializeFragment(n,{document:a}));let u=l.firstChild,f,h=0;for(;u&&u.nodeType==1&&(f=Mv[u.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let B=a.createElement(f[g]);for(;l.firstChild;)B.appendChild(l.firstChild);l.appendChild(B),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${o}${h?` -${h}`:""} ${JSON.stringify(A)}`);let p=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
31
31
 
32
32
  `);return{dom:l,text:p,slice:e}}function Tv(t,e,A,n,r){let o=r.parent.type.spec.code,i,a;if(!A&&!e)return null;let l=e&&(n||o||!A);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,o||n,t)}),o)return e?new De(we.from(t.state.schema.text(e.replace(/\r\n?/g,`
33
- `))),0,0):De.empty;let h=t.someProp("clipboardTextParser",p=>p(e,r,n,t));if(h)a=h;else{let p=r.marks(),{schema:g}=t.state,B=ss.fromSchema(g);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let b=i.appendChild(document.createElement("p"));y&&b.appendChild(B.serializeNode(g.text(y,p)))})}}else t.someProp("transformPastedHTML",h=>{A=h(A,t)}),i=R2(A),Ll&&P2(i);let u=i&&i.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let p=i.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;i=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||oi.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!M2.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)a=V2(Ov(a,+f[1],+f[2]),f[4]);else if(a=De.maxOpen(N2(a.content,r),!0),a.openStart||a.openEnd){let h=0,p=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;p<a.openEnd&&!g.type.spec.isolating;p++,g=g.lastChild);a=Ov(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const M2=/^(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 N2(t,e){if(t.childCount<2)return t;for(let A=e.depth;A>=0;A--){let r=e.node(A).contentMatchAt(e.index(A)),o,i=[];if(t.forEach(a=>{if(!i)return;let l=r.findWrapping(a.type),u;if(!l)return i=null;if(u=i.length&&o.length&&Dv(l,o,a,i[i.length-1],0))i[i.length-1]=u;else{i.length&&(i[i.length-1]=Lv(i[i.length-1],o.length));let f=_v(a,l);i.push(f),r=r.matchType(f.type),o=l}}),i)return we.from(i)}return t}function _v(t,e,A=0){for(let n=e.length-1;n>=A;n--)t=e[n].create(null,we.from(t));return t}function Dv(t,e,A,n,r){if(r<t.length&&r<e.length&&t[r]==e[r]){let o=Dv(t,e,A,n.lastChild,r+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(r==t.length-1?A.type:t[r+1]))return n.copy(n.content.append(we.from(_v(A,t,r+1))))}}function Lv(t,e){if(e==0)return t;let A=t.content.replaceChild(t.childCount-1,Lv(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(we.empty,!0);return t.copy(A.append(n))}function km(t,e,A,n,r,o){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(o=0),r<n-1&&(a=km(a,e,A,n,r+1,o)),r>=A&&(a=e<0?i.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(we.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function Ov(t,e,A){return e<t.openStart&&(t=new De(km(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),A<t.openEnd&&(t=new De(km(t.content,1,A,t.openEnd,0,0),t.openStart,A)),t}const Mv={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 Nv=null;function Hv(){return Nv||(Nv=document.implementation.createHTMLDocument("title"))}let Sm=null;function H2(t){let e=window.trustedTypes;return e?(Sm||(Sm=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:A=>A})),Sm.createHTML(t)):t}function R2(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let A=Hv().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),r;if((r=n&&Mv[n[1].toLowerCase()])&&(t=r.map(o=>"<"+o+">").join("")+t+r.map(o=>"</"+o+">").reverse().join("")),A.innerHTML=H2(t),r)for(let o=0;o<r.length;o++)A=A.querySelector(r[o])||A;return A}function P2(t){let e=t.querySelectorAll(jA?"span:not([class]):not([style])":"span.Apple-converted-space");for(let A=0;A<e.length;A++){let n=e[A];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function V2(t,e){if(!t.size)return t;let A=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:r,openStart:o,openEnd:i}=t;for(let a=n.length-2;a>=0;a-=2){let l=A.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;r=we.from(l.create(n[a+1],r)),o++,i++}return new De(r,o,i)}const ln={},cn={},$2={touchstart:!0,touchmove:!0};class K2{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function G2(t){for(let e in ln){let A=ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{z2(t,n)&&!Fm(t,n)&&(t.editable||!(n.type in cn))&&A(t,n)},$2[e]?{passive:!0}:void 0)}an&&t.dom.addEventListener("input",()=>null),Qm(t)}function hi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function W2(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Qm(t){t.someProp("handleDOMEvents",e=>{for(let A in e)t.input.eventHandlers[A]||t.dom.addEventListener(A,t.input.eventHandlers[A]=n=>Fm(t,n))})}function Fm(t,e){return t.someProp("handleDOMEvents",A=>{let n=A[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function z2(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let A=e.target;A!=t.dom;A=A.parentNode)if(!A||A.nodeType==11||A.pmViewDesc&&A.pmViewDesc.stopEvent(e))return!1;return!0}function Y2(t,e){!Fm(t,e)&&ln[e.type]&&(t.editable||!(e.type in cn))&&ln[e.type](t,e)}cn.keydown=(t,e)=>{let A=e;if(t.input.shiftKey=A.keyCode==16||A.shiftKey,!Pv(t,A)&&(t.input.lastKeyCode=A.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ko&&jA&&A.keyCode==13)))if(A.keyCode!=229&&t.domObserver.forceFlush(),ha&&A.keyCode==13&&!A.ctrlKey&&!A.altKey&&!A.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",r=>r(t,cs(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,A))||O2(t,A)?A.preventDefault():hi(t,"key")},cn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},cn.keypress=(t,e)=>{let A=e;if(Pv(t,A)||!A.charCode||A.ctrlKey&&!A.altKey||Zn&&A.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,A))){A.preventDefault();return}let n=t.state.selection;if(!(n instanceof Ze)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(A.charCode),o=()=>t.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!t.someProp("handleTextInput",i=>i(t,n.$from.pos,n.$to.pos,r,o))&&t.dispatch(o()),A.preventDefault()}};function Ou(t){return{left:t.clientX,top:t.clientY}}function J2(t,e){let A=e.x-t.clientX,n=e.y-t.clientY;return A*A+n*n<100}function Um(t,e,A,n,r){if(n==-1)return!1;let o=t.state.doc.resolve(n);for(let i=o.depth+1;i>0;i--)if(t.someProp(e,a=>i>o.depth?a(t,A,o.nodeAfter,o.before(i),r,!0):a(t,A,o.node(i),o.before(i),r,!1)))return!0;return!1}function ga(t,e,A){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function X2(t,e){if(e==-1)return!1;let A=t.state.doc.resolve(e),n=A.nodeAfter;return n&&n.isAtom&&Pe.isSelectable(n)?(ga(t,new Pe(A)),!0):!1}function j2(t,e){if(e==-1)return!1;let A=t.state.selection,n,r;A instanceof Pe&&(n=A.node);let o=t.state.doc.resolve(e);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i);if(Pe.isSelectable(a)){n&&A.$from.depth>0&&i>=A.$from.depth&&o.before(A.$from.depth+1)==A.$from.pos?r=o.before(A.$from.depth):r=o.before(i);break}}return r!=null?(ga(t,Pe.create(t.state.doc,r)),!0):!1}function q2(t,e,A,n,r){return Um(t,"handleClickOn",e,A,n)||t.someProp("handleClick",o=>o(t,e,n))||(r?j2(t,A):X2(t,A))}function Z2(t,e,A,n){return Um(t,"handleDoubleClickOn",e,A,n)||t.someProp("handleDoubleClick",r=>r(t,e,n))}function e4(t,e,A,n){return Um(t,"handleTripleClickOn",e,A,n)||t.someProp("handleTripleClick",r=>r(t,e,n))||t4(t,A,n)}function t4(t,e,A){if(A.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(ga(t,Ze.create(n,0,n.content.size)),!0):!1;let r=n.resolve(e);for(let o=r.depth+1;o>0;o--){let i=o>r.depth?r.nodeAfter:r.node(o),a=r.before(o);if(i.inlineContent)ga(t,Ze.create(n,a+1,a+1+i.content.size));else if(Pe.isSelectable(i))ga(t,Pe.create(n,a));else continue;return!0}}function Im(t){return Mu(t)}const Rv=Zn?"metaKey":"ctrlKey";ln.mousedown=(t,e)=>{let A=e;t.input.shiftKey=A.shiftKey;let n=Im(t),r=Date.now(),o="singleClick";r-t.input.lastClick.time<500&&J2(A,t.input.lastClick)&&!A[Rv]&&t.input.lastClick.button==A.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:r,x:A.clientX,y:A.clientY,type:o,button:A.button};let i=t.posAtCoords(Ou(A));i&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new A4(t,i,A,!!n)):(o=="doubleClick"?Z2:e4)(t,i.pos,i.inside,A)?A.preventDefault():hi(t,"pointer"))};class A4{constructor(e,A,n,r){this.view=e,this.pos=A,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Rv],this.allowDefault=n.shiftKey;let o,i;if(A.inside>-1)o=e.state.doc.nodeAt(A.inside),i=A.inside;else{let f=e.state.doc.resolve(A.pos);o=f.parent,i=f.depth?f.before():0}const a=r?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(n.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof Pe&&u.from<=i&&u.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Sr&&!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)),hi(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(()=>Qo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let A=this.pos;this.view.state.doc!=this.startDoc&&(A=this.view.posAtCoords(Ou(e))),this.updateAllowDefault(e),this.allowDefault||!A?hi(this.view,"pointer"):q2(this.view,A.pos,A.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||an&&this.mightDrag&&!this.mightDrag.node.isAtom||jA&&!this.view.state.selection.visible&&Math.min(Math.abs(A.pos-this.view.state.selection.from),Math.abs(A.pos-this.view.state.selection.to))<=2)?(ga(this.view,nt.near(this.view.state.doc.resolve(A.pos))),e.preventDefault()):hi(this.view,"pointer")}move(e){this.updateAllowDefault(e),hi(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)}}ln.touchstart=t=>{t.input.lastTouch=Date.now(),Im(t),hi(t,"pointer")},ln.touchmove=t=>{t.input.lastTouch=Date.now(),hi(t,"pointer")},ln.contextmenu=t=>Im(t);function Pv(t,e){return t.composing?!0:an&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const n4=ko?5e3:-1;cn.compositionstart=cn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,A=e.selection.$to;if(e.selection instanceof Ze&&(e.storedMarks||!A.textOffset&&A.parentOffset&&A.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||A.marks(),Mu(t,!0),t.markCursor=null;else if(Mu(t,!e.selection.empty),Sr&&e.selection.empty&&A.parentOffset&&!A.textOffset&&A.nodeBefore.marks.length){let n=t.domSelectionRange();for(let r=n.focusNode,o=n.focusOffset;r&&r.nodeType==1&&o!=0;){let i=o<0?r.lastChild:r.childNodes[o-1];if(!i)break;if(i.nodeType==3){let a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else r=i,o=-1}}t.input.composing=!0}Vv(t,n4)},cn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Vv(t,20))};function Vv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Mu(t),e))}function $v(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=o4());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function r4(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let A=XP(e.focusNode,e.focusOffset),n=jP(e.focusNode,e.focusOffset);if(A&&n&&A!=n){let r=n.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(A==o||n==o)return o;if(!r||!r.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let i=A.pmViewDesc;if(!(!i||!i.isText(A.nodeValue)))return n}}return A||n}function o4(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Mu(t,e=!1){if(!(ko&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$v(t),e||t.docView&&t.docView.dirty){let A=ym(t),n=t.state.selection;return A&&!A.eq(n)?t.dispatch(t.state.tr.setSelection(A)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function i4(t,e){if(!t.dom.parentNode)return;let A=t.dom.parentNode.appendChild(document.createElement("div"));A.appendChild(e),A.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(r),setTimeout(()=>{A.parentNode&&A.parentNode.removeChild(A),t.focus()},50)}const Rl=bn&&ci<15||ha&&A2<604;ln.copy=cn.cut=(t,e)=>{let A=e,n=t.state.selection,r=A.type=="cut";if(n.empty)return;let o=Rl?null:A.clipboardData,i=n.content(),{dom:a,text:l}=Em(t,i);o?(A.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):i4(t,a),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function s4(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function a4(t,e){if(!t.dom.parentNode)return;let A=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(A?"textarea":"div"));A||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let r=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),A?Pl(t,n.value,null,r,e):Pl(t,n.textContent,n.innerHTML,r,e)},50)}function Pl(t,e,A,n,r){let o=Tv(t,e,A,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,r,o||De.empty)))return!0;if(!o)return!1;let i=s4(o),a=i?t.state.tr.replaceSelectionWith(i,n):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Kv(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let A=t.getData("text/uri-list");return A?A.replace(/\r?\n/g," "):""}cn.paste=(t,e)=>{let A=e;if(t.composing&&!ko)return;let n=Rl?null:A.clipboardData,r=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Pl(t,Kv(n),n.getData("text/html"),r,A)?A.preventDefault():a4(t,A)};class Gv{constructor(e,A,n){this.slice=e,this.move=A,this.node=n}}const l4=Zn?"altKey":"ctrlKey";function Wv(t,e){let A=t.someProp("dragCopies",n=>!n(e));return A??!e[l4]}ln.dragstart=(t,e)=>{let A=e,n=t.input.mouseDown;if(n&&n.done(),!A.dataTransfer)return;let r=t.state.selection,o=r.empty?null:t.posAtCoords(Ou(A)),i;if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof Pe?r.to-1:r.to))){if(n&&n.mightDrag)i=Pe.create(t.state.doc,n.mightDrag.pos);else if(A.target&&A.target.nodeType==1){let h=t.docView.nearestDesc(A.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(i=Pe.create(t.state.doc,h.posBefore))}}let a=(i||t.state.selection).content(),{dom:l,text:u,slice:f}=Em(t,a);(!A.dataTransfer.files.length||!jA||qb>120)&&A.dataTransfer.clearData(),A.dataTransfer.setData(Rl?"Text":"text/html",l.innerHTML),A.dataTransfer.effectAllowed="copyMove",Rl||A.dataTransfer.setData("text/plain",u),t.dragging=new Gv(f,Wv(t,A),i)},ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},cn.dragover=cn.dragenter=(t,e)=>e.preventDefault(),cn.drop=(t,e)=>{let A=e,n=t.dragging;if(t.dragging=null,!A.dataTransfer)return;let r=t.posAtCoords(Ou(A));if(!r)return;let o=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",B=>{i=B(i,t)}):i=Tv(t,Kv(A.dataTransfer),Rl?null:A.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&Wv(t,A));if(t.someProp("handleDrop",B=>B(t,A,i||De.empty,a))){A.preventDefault();return}if(!i)return;A.preventDefault();let l=i?Lb(t.state.doc,o.pos,i):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:B}=n;B?B.replace(u):u.deleteSelection()}let f=u.mapping.map(l),h=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(f,f,i.content.firstChild):u.replaceRange(f,f,i),u.doc.eq(p))return;let g=u.doc.resolve(f);if(h&&Pe.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))u.setSelection(new Pe(g));else{let B=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((y,b,w,v)=>B=v),u.setSelection(Cm(t,g,u.doc.resolve(B)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},ln.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Qo(t)},20))},ln.blur=(t,e)=>{let A=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),A.relatedTarget&&t.dom.contains(A.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ln.beforeinput=(t,e)=>{if(jA&&ko&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,cs(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in cn)ln[t]=cn[t];function Vl(t,e){if(t==e)return!0;for(let A in t)if(t[A]!==e[A])return!1;for(let A in e)if(!(A in t))return!1;return!0}class Nu{constructor(e,A){this.toDOM=e,this.spec=A||hs,this.side=this.spec.side||0}map(e,A,n,r){let{pos:o,deleted:i}=e.mapResult(A.from+r,this.side<0?-1:1);return i?null:new un(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Nu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Vl(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class pi{constructor(e,A){this.attrs=e,this.spec=A||hs}map(e,A,n,r){let o=e.map(A.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(A.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new un(o,i,this)}valid(e,A){return A.from<A.to}eq(e){return this==e||e instanceof pi&&Vl(this.attrs,e.attrs)&&Vl(this.spec,e.spec)}static is(e){return e.type instanceof pi}destroy(){}}class xm{constructor(e,A){this.attrs=e,this.spec=A||hs}map(e,A,n,r){let o=e.mapResult(A.from+r,1);if(o.deleted)return null;let i=e.mapResult(A.to+r,-1);return i.deleted||i.pos<=o.pos?null:new un(o.pos-n,i.pos-n,this)}valid(e,A){let{index:n,offset:r}=e.content.findIndex(A.from),o;return r==A.from&&!(o=e.child(n)).isText&&r+o.nodeSize==A.to}eq(e){return this==e||e instanceof xm&&Vl(this.attrs,e.attrs)&&Vl(this.spec,e.spec)}destroy(){}}class un{constructor(e,A,n){this.from=e,this.to=A,this.type=n}copy(e,A){return new un(e,A,this.type)}eq(e,A=0){return this.type.eq(e.type)&&this.from+A==e.from&&this.to+A==e.to}map(e,A,n){return this.type.map(e,this,A,n)}static widget(e,A,n){return new un(e,e,new Nu(A,n))}static inline(e,A,n,r){return new un(e,A,new pi(n,r))}static node(e,A,n,r){return new un(e,A,new xm(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof pi}get widget(){return this.type instanceof Nu}}const Ba=[],hs={};class Xt{constructor(e,A){this.local=e.length?e:Ba,this.children=A.length?A:Ba}static create(e,A){return A.length?Hu(A,e,0,hs):qA}find(e,A,n){let r=[];return this.findInner(e??0,A??1e9,r,0,n),r}findInner(e,A,n,r,o){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=A&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<A&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,A-a,n,r+a,o)}}map(e,A,n){return this==qA||e.maps.length==0?this:this.mapInner(e,A,0,0,n||hs)}mapInner(e,A,n,r,o){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,r);l&&l.type.valid(A,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?c4(this.children,i||[],e,A,n,r,o):i?new Xt(i.sort(ps),Ba):qA}add(e,A){return A.length?this==qA?Xt.create(e,A):this.addInner(e,A,0):this}addInner(e,A,n){let r,o=0;e.forEach((a,l)=>{let u=l+n,f;if(f=Yv(A,a,u)){for(r||(r=this.children.slice());o<r.length&&r[o]<l;)o+=3;r[o]==l?r[o+2]=r[o+2].addInner(a,f,u+1):r.splice(o,0,l,l+a.nodeSize,Hu(f,a,u+1,hs)),o+=3}});let i=zv(o?Jv(A):A,-n);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new Xt(i.length?this.local.concat(i).sort(ps):this.local,r||this.children)}remove(e){return e.length==0||this==qA?this:this.removeInner(e,0)}removeInner(e,A){let n=this.children,r=this.local;for(let o=0;o<n.length;o+=3){let i,a=n[o]+A,l=n[o+1]+A;for(let f=0,h;f<e.length;f++)(h=e[f])&&h.from>a&&h.to<l&&(e[f]=null,(i||(i=[])).push(h));if(!i)continue;n==this.children&&(n=this.children.slice());let u=n[o+2].removeInner(i,a+1);u!=qA?n[o+2]=u:(n.splice(o,3),o-=3)}if(r.length){for(let o=0,i;o<e.length;o++)if(i=e[o])for(let a=0;a<r.length;a++)r[a].eq(i,A)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new Xt(r,n):qA}forChild(e,A){if(this==qA)return this;if(A.isLeaf)return Xt.empty;let n,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,i=o+A.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>o&&l.type instanceof pi){let u=Math.max(o,l.from)-o,f=Math.min(i,l.to)-o;u<f&&(r||(r=[])).push(l.copy(u,f))}}if(r){let a=new Xt(r.sort(ps),Ba);return n?new mi([a,n]):a}return n||qA}eq(e){if(this==e)return!0;if(!(e instanceof Xt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let A=0;A<this.local.length;A++)if(!this.local[A].eq(e.local[A]))return!1;for(let A=0;A<this.children.length;A+=3)if(this.children[A]!=e.children[A]||this.children[A+1]!=e.children[A+1]||!this.children[A+2].eq(e.children[A+2]))return!1;return!0}locals(e){return Tm(this.localsInner(e))}localsInner(e){if(this==qA)return Ba;if(e.inlineContent||!this.local.some(pi.is))return this.local;let A=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof pi||A.push(this.local[n]);return A}forEachSet(e){e(this)}}Xt.empty=new Xt([],[]),Xt.removeOverlap=Tm;const qA=Xt.empty;class mi{constructor(e){this.members=e}map(e,A){const n=this.members.map(r=>r.map(e,A,hs));return mi.from(n)}forChild(e,A){if(A.isLeaf)return Xt.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,A);o!=qA&&(o instanceof mi?n=n.concat(o.members):n.push(o))}return mi.from(n)}eq(e){if(!(e instanceof mi)||e.members.length!=this.members.length)return!1;for(let A=0;A<this.members.length;A++)if(!this.members[A].eq(e.members[A]))return!1;return!0}locals(e){let A,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(!A)A=o;else{n&&(A=A.slice(),n=!1);for(let i=0;i<o.length;i++)A.push(o[i])}}return A?Tm(n?A:A.sort(ps)):Ba}static from(e){switch(e.length){case 0:return qA;case 1:return e[0];default:return new mi(e.every(A=>A instanceof Xt)?e:e.reduce((A,n)=>A.concat(n instanceof Xt?n:n.members),[]))}}forEachSet(e){for(let A=0;A<this.members.length;A++)this.members[A].forEachSet(e)}}function c4(t,e,A,n,r,o,i){let a=t.slice();for(let u=0,f=o;u<A.maps.length;u++){let h=0;A.maps[u].forEach((p,g,B,y)=>{let b=y-B-(g-p);for(let w=0;w<a.length;w+=3){let v=a[w+1];if(v<0||p>v+f-h)continue;let S=a[w]+f-h;g>=S?a[w+1]=p<=S?-2:-1:p>=f&&b&&(a[w]+=b,a[w+1]+=b)}h+=b}),f=A.maps[u].map(f,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let f=A.map(t[u]+o),h=f-r;if(h<0||h>=n.content.size){l=!0;continue}let p=A.map(t[u+1]+o,-1),g=p-r,{index:B,offset:y}=n.content.findIndex(h),b=n.maybeChild(B);if(b&&y==h&&y+b.nodeSize==g){let w=a[u+2].mapInner(A,b,f+1,t[u]+o+1,i);w!=qA?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=u4(a,t,e,A,r,o,i),f=Hu(u,n,0,i);e=f.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<f.children.length;h+=3){let g=f.children[h];for(;p<a.length&&a[p]<g;)p+=3;a.splice(p,0,f.children[h],f.children[h+1],f.children[h+2])}}return new Xt(e.sort(ps),a)}function zv(t,e){if(!e||!t.length)return t;let A=[];for(let n=0;n<t.length;n++){let r=t[n];A.push(new un(r.from+e,r.to+e,r.type))}return A}function u4(t,e,A,n,r,o,i){function a(l,u){for(let f=0;f<l.local.length;f++){let h=l.local[f].map(n,r,u);h?A.push(h):i.onRemove&&i.onRemove(l.local[f].spec)}for(let f=0;f<l.children.length;f+=3)a(l.children[f+2],l.children[f]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return A}function Yv(t,e,A){if(e.isLeaf)return null;let n=A+e.nodeSize,r=null;for(let o=0,i;o<t.length;o++)(i=t[o])&&i.from>A&&i.to<n&&((r||(r=[])).push(i),t[o]=null);return r}function Jv(t){let e=[];for(let A=0;A<t.length;A++)t[A]!=null&&e.push(t[A]);return e}function Hu(t,e,A,n){let r=[],o=!1;e.forEach((a,l)=>{let u=Yv(t,a,l+A);if(u){o=!0;let f=Hu(u,a,A+l+1,n);f!=qA&&r.push(l,l+a.nodeSize,f)}});let i=zv(o?Jv(t):t,-A).sort(ps);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(n.onRemove&&n.onRemove(i[a].spec),i.splice(a--,1));return i.length||r.length?new Xt(i,r):qA}function ps(t,e){return t.from-e.from||t.to-e.to}function Tm(t){let e=t;for(let A=0;A<e.length-1;A++){let n=e[A];if(n.from!=n.to)for(let r=A+1;r<e.length;r++){let o=e[r];if(o.from==n.from){o.to!=n.to&&(e==t&&(e=t.slice()),e[r]=o.copy(o.from,n.to),Xv(e,r+1,o.copy(n.to,o.to)));continue}else{o.from<n.to&&(e==t&&(e=t.slice()),e[A]=n.copy(n.from,o.from),Xv(e,r,n.copy(o.from,n.to)));break}}}return e}function Xv(t,e,A){for(;e<t.length&&ps(A,t[e])>0;)e++;t.splice(e,0,A)}function _m(t){let e=[];return t.someProp("decorations",A=>{let n=A(t.state);n&&n!=qA&&e.push(n)}),t.cursorWrapper&&e.push(Xt.create(t.state.doc,[t.cursorWrapper.deco])),mi.from(e)}const d4={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},f4=bn&&ci<=11;class h4{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 p4{constructor(e,A){this.view=e,this.handleDOMChange=A,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new h4,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let r=0;r<n.length;r++)this.queue.push(n[r]);bn&&ci<=11&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),f4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,d4)),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 A=0;A<e.length;A++)this.queue.push(e[A]);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(Ev(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(bn&&ci<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ls(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 A=new Set,n;for(let o=e.focusNode;o;o=fa(o))A.add(o);for(let o=e.anchorNode;o;o=fa(o))if(A.has(o)){n=o;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))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 A=this.pendingRecords();A.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ev(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,a=!1,l=[];if(e.editable)for(let f=0;f<A.length;f++){let h=this.registerMutation(A[f],l);h&&(o=o<0?h.from:Math.min(h.from,o),i=i<0?h.to:Math.max(h.to,i),h.typeOver&&(a=!0))}if(Sr&&l.length){let f=l.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,p]=f;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of f){let g=p.parentNode;g&&g.nodeName=="LI"&&(!h||B4(e,h)!=g)&&p.remove()}}}let u=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tu(n)&&(u=ym(e))&&u.eq(nt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Qo(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),m4(e)),this.handleDOMChange(o,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Qo(e),this.currentSelection.set(n))}registerMutation(e,A){if(A.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let h=e.addedNodes[f];A.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(bn&&ci<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:h,nextSibling:p}=e.addedNodes[f];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(r=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let i=r&&r.parentNode==e.target?PA(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?PA(o):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let jv=new WeakMap,qv=!1;function m4(t){if(!jv.has(t)&&(jv.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Sr,qv)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."),qv=!0}}function Zv(t,e){let A=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return ls(i.node,i.offset,r,o)&&([A,n,r,o]=[r,o,A,n]),{anchorNode:A,anchorOffset:n,focusNode:r,focusOffset:o}}function g4(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Zv(t,r)}let A;function n(r){r.preventDefault(),r.stopImmediatePropagation(),A=r.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),A?Zv(t,A):null}function B4(t,e){for(let A=e.parentNode;A&&A!=t.dom;A=A.parentNode){let n=t.docView.nearestDesc(A,!0);if(n&&n.node.isBlock)return A}return null}function y4(t,e,A){let{node:n,fromOffset:r,toOffset:o,from:i,to:a}=t.docView.parseRange(e,A),l=t.domSelectionRange(),u,f=l.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(u=[{node:f,offset:l.anchorOffset}],Tu(l)||u.push({node:l.focusNode,offset:l.focusOffset})),jA&&t.input.lastKeyCode===8)for(let b=o;b>r;b--){let w=n.childNodes[b-1],v=w.pmViewDesc;if(w.nodeName=="BR"&&!v){o=b;break}if(!v||v.size)break}let h=t.state.doc,p=t.someProp("domParser")||oi.fromSchema(t.state.schema),g=h.resolve(i),B=null,y=p.parse(n,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:r,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:w4,context:g});if(u&&u[0].pos!=null){let b=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=b),B={anchor:b+i,head:w+i}}return{doc:y,sel:B,from:i,to:a}}function w4(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(an&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let A=document.createElement("div");return A.appendChild(document.createElement("li")),{skip:A}}else if(t.parentNode.lastChild==t||an&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const C4=/^(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 b4(t,e,A,n,r){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let M=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=ym(t,M);if(O&&!t.state.selection.eq(O)){if(jA&&ko&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ie=>ie(t,cs(13,"Enter"))))return;let P=t.state.tr.setSelection(O);M=="pointer"?P.setMeta("pointer",!0):M=="key"&&P.scrollIntoView(),o&&P.setMeta("composition",o),t.dispatch(P)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(A);e=i.before(a+1),A=t.state.doc.resolve(A).after(a+1);let l=t.state.selection,u=y4(t,e,A),f=t.state.doc,h=f.slice(u.from,u.to),p,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,g="end"):(p=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let B=k4(h.content,u.doc.content,u.from,p,g);if(B&&t.input.domChangeCount++,(ha&&t.input.lastIOSEnter>Date.now()-225||ko)&&r.some(M=>M.nodeType==1&&!C4.test(M.nodeName))&&(!B||B.endA>=B.endB)&&t.someProp("handleKeyDown",M=>M(t,cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!B)if(n&&l instanceof Ze&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))B={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let M=eE(t,t.state.doc,u.sel);if(M&&!M.eq(t.state.selection)){let O=t.state.tr.setSelection(M);o&&O.setMeta("composition",o),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&B.start==B.endB&&t.state.selection instanceof Ze&&(B.start>t.state.selection.from&&B.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?B.start=t.state.selection.from:B.endA<t.state.selection.to&&B.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(B.endB+=t.state.selection.to-B.endA,B.endA=t.state.selection.to)),bn&&ci<=11&&B.endB==B.start+1&&B.endA==B.start&&B.start>u.from&&u.doc.textBetween(B.start-u.from-1,B.start-u.from+1)=="  "&&(B.start--,B.endA--,B.endB--);let y=u.doc.resolveNoCache(B.start-u.from),b=u.doc.resolveNoCache(B.endB-u.from),w=f.resolve(B.start),v=y.sameParent(b)&&y.parent.inlineContent&&w.end()>=B.endA,S;if((ha&&t.input.lastIOSEnter>Date.now()-225&&(!v||r.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!v&&y.pos<u.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&!/\S/.test(u.doc.textBetween(y.pos,b.pos,"",""))&&(S=nt.findFrom(u.doc.resolve(y.pos+1),1,!0))&&S.head>y.pos)&&t.someProp("handleKeyDown",M=>M(t,cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>B.start&&E4(f,B.start,B.endA,y,b)&&t.someProp("handleKeyDown",M=>M(t,cs(8,"Backspace")))){ko&&jA&&t.domObserver.suppressSelectionUpdates();return}jA&&B.endB==B.start&&(t.input.lastChromeDelete=Date.now()),ko&&!v&&y.start()!=b.start()&&b.parentOffset==0&&y.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==B.endA&&(B.endB-=2,b=u.doc.resolveNoCache(B.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(M){return M(t,cs(13,"Enter"))})},20));let F=B.start,I=B.endA,Q=M=>{let O=M||t.state.tr.replace(F,I,u.doc.slice(B.start-u.from,B.endB-u.from));if(u.sel){let P=eE(t,O.doc,u.sel);P&&!(jA&&t.composing&&P.empty&&(B.start!=B.endB||t.input.lastChromeDelete<Date.now()-100)&&(P.head==F||P.head==O.mapping.map(I)-1)||bn&&P.empty&&P.head==F)&&O.setSelection(P)}return o&&O.setMeta("composition",o),O.scrollIntoView()},x;if(v){if(y.pos==b.pos){bn&&ci<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(t),20));let M=Q(t.state.tr.delete(F,I)),O=f.resolve(B.start).marksAcross(f.resolve(B.endA));O&&M.ensureMarks(O),t.dispatch(M)}else if(B.endA==B.endB&&(x=v4(y.parent.content.cut(y.parentOffset,b.parentOffset),w.parent.content.cut(w.parentOffset,B.endA-w.start())))){let M=Q(t.state.tr);x.type=="add"?M.addMark(F,I,x.mark):M.removeMark(F,I,x.mark),t.dispatch(M)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-(b.textOffset?0:1)){let M=y.parent.textBetween(y.parentOffset,b.parentOffset),O=()=>Q(t.state.tr.insertText(M,F,I));t.someProp("handleTextInput",P=>P(t,F,I,M,O))||t.dispatch(O())}}else t.dispatch(Q())}function eE(t,e,A){return Math.max(A.anchor,A.head)>e.content.size?null:Cm(t,e.resolve(A.anchor),e.resolve(A.head))}function v4(t,e){let A=t.firstChild.marks,n=e.firstChild.marks,r=A,o=n,i,a,l;for(let f=0;f<n.length;f++)r=n[f].removeFromSet(r);for(let f=0;f<A.length;f++)o=A[f].removeFromSet(o);if(r.length==1&&o.length==0)a=r[0],i="add",l=f=>f.mark(a.addToSet(f.marks));else if(r.length==0&&o.length==1)a=o[0],i="remove",l=f=>f.mark(a.removeFromSet(f.marks));else return null;let u=[];for(let f=0;f<e.childCount;f++)u.push(l(e.child(f)));if(we.from(u).eq(t))return{mark:a,type:i}}function E4(t,e,A,n,r){if(A-e<=r.pos-n.pos||Dm(n,!0,!1)<r.pos)return!1;let o=t.resolve(e);if(!n.parent.isTextblock){let a=o.nodeAfter;return a!=null&&A==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let i=t.resolve(Dm(o,!0,!0));return!i.parent.isTextblock||i.pos>A||Dm(i,!0,!1)<A?!1:n.parent.content.cut(n.parentOffset).eq(i.parent.content)}function Dm(t,e,A){let n=t.depth,r=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,r++,e=!1;if(A){let o=t.node(n).maybeChild(t.indexAfter(n));for(;o&&!o.isLeaf;)o=o.firstChild,r++}return r}function k4(t,e,A,n,r){let o=t.findDiffStart(e,A);if(o==null)return null;let{a:i,b:a}=t.findDiffEnd(e,A+t.size,A+e.size);if(r=="end"){let l=Math.max(0,o-Math.min(i,a));n-=i+l-o}if(i<o&&t.size<e.size){let l=n<=o&&n>=i?o-n:0;o-=l,o&&o<e.size&&tE(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-i),i=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,o&&o<t.size&&tE(t.textBetween(o-1,o+1))&&(o+=l?1:-1),i=o+(i-a),a=o}return{start:o,endA:i,endB:a}}function tE(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),A=t.charCodeAt(1);return e>=56320&&e<=57343&&A>=55296&&A<=56319}class AE{constructor(e,A){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 K2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=A,this.state=A.state,this.directPlugins=A.plugins||[],this.directPlugins.forEach(sE),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=oE(this),rE(this),this.nodeViews=iE(this),this.docView=dv(this.state.doc,nE(this),_m(this),this.dom,this),this.domObserver=new p4(this,(n,r,o,i)=>b4(this,n,r,o,i)),this.domObserver.start(),G2(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 A in e)this._props[A]=e[A];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Qm(this);let A=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sE),this.directPlugins=e.plugins),this.updateStateInner(e.state,A)}setProps(e){let A={};for(let n in this._props)A[n]=this._props[n];A.state=this.state;for(let n in e)A[n]=e[n];this.update(A)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,A){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&($v(this),i=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=A.plugins;if(a||this._props.plugins!=A.plugins||this._props.nodeViews!=A.nodeViews){let g=iE(this);Q4(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||A.handleDOMEvents!=this._props.handleDOMEvents)&&Qm(this),this.editable=oE(this),rE(this);let l=_m(this),u=nE(this),f=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(r.selection))&&(i=!0);let p=f=="preserve"&&i&&this.dom.style.overflowAnchor==null&&o2(this);if(i){this.domObserver.stop();let g=h&&(bn||jA)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&S4(r.selection,e.selection);if(h){let B=jA?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=r4(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=dv(e.doc,u,l,this.dom,this)),B&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&U2(this))?Qo(this,g):(bv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((n=this.dragging)===null||n===void 0)&&n.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():p&&i2(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",A=>A(this)))if(this.state.selection instanceof Pe){let A=this.docView.domAfterPos(this.state.selection.from);A.nodeType==1&&Zb(this,A.getBoundingClientRect(),e)}else Zb(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 A=0;A<this.directPlugins.length;A++){let n=this.directPlugins[A];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let A=0;A<this.state.plugins.length;A++){let n=this.state.plugins[A];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let A=0;A<this.pluginViews.length;A++){let n=this.pluginViews[A];n.update&&n.update(this,e)}}updateDraggedNode(e,A){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let o=n.from+(this.state.doc.content.size-A.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(r=o)}this.dragging=new Gv(e.slice,e.move,r<0?void 0:Pe.create(this.state.doc,r))}someProp(e,A){let n=this._props&&this._props[e],r;if(n!=null&&(r=A?A(n):n))return r;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(r=A?A(a):a))return r}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let a=o[i].props[e];if(a!=null&&(r=A?A(a):a))return r}}hasFocus(){if(bn){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&&s2(this.dom),Qo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let A=this.dom.parentNode;A;A=A.parentNode)if(A.nodeType==9||A.nodeType==11&&A.host)return A.getSelection||(Object.getPrototypeOf(A).getSelection=()=>A.ownerDocument.getSelection()),this._root=A}return e||document}updateRoot(){this._root=null}posAtCoords(e){return d2(this,e)}coordsAtPos(e,A=1){return ov(this,e,A)}domAtPos(e,A=0){return this.docView.domFromPos(e,A)}nodeDOM(e){let A=this.docView.descAt(e);return A?A.nodeDOM:null}posAtDOM(e,A,n=-1){let r=this.docView.posFromDOM(e,A,n);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,A){return g2(this,A||this.state,e)}pasteHTML(e,A){return Pl(this,"",e,!1,A||new ClipboardEvent("paste"))}pasteText(e,A){return Pl(this,e,null,!0,A||new ClipboardEvent("paste"))}serializeForClipboard(e){return Em(this,e)}destroy(){this.docView&&(W2(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],_m(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,YP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Y2(this,e)}domSelectionRange(){let e=this.domSelection();return e?an&&this.root.nodeType===11&&ZP(this.dom.ownerDocument)==this.dom&&g4(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}AE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function nE(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",A=>{if(typeof A=="function"&&(A=A(t.state)),A)for(let n in A)n=="class"?e.class+=" "+A[n]:n=="style"?e.style=(e.style?e.style+";":"")+A[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(A[n]))}),e.translate||(e.translate="no"),[un.node(0,t.state.doc.content.size,e)]}function rE(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:un.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function oE(t){return!t.someProp("editable",e=>e(t.state)===!1)}function S4(t,e){let A=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(A)!=e.$anchor.start(A)}function iE(t){let e=Object.create(null);function A(n){for(let r in n)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=n[r])}return t.someProp("nodeViews",A),t.someProp("markViews",A),e}function Q4(t,e){let A=0,n=0;for(let r in t){if(t[r]!=e[r])return!0;A++}for(let r in e)n++;return A!=n}function sE(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var gi={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:"'"},Ru={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},F4=typeof navigator<"u"&&/Mac/.test(navigator.platform),U4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),VA=0;VA<10;VA++)gi[48+VA]=gi[96+VA]=String(VA);for(var VA=1;VA<=24;VA++)gi[VA+111]="F"+VA;for(var VA=65;VA<=90;VA++)gi[VA]=String.fromCharCode(VA+32),Ru[VA]=String.fromCharCode(VA);for(var Lm in gi)Ru.hasOwnProperty(Lm)||(Ru[Lm]=gi[Lm]);function I4(t){var e=F4&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||U4&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",A=!e&&t.key||(t.shiftKey?Ru:gi)[t.keyCode]||t.key||"Unidentified";return A=="Esc"&&(A="Escape"),A=="Del"&&(A="Delete"),A=="Left"&&(A="ArrowLeft"),A=="Up"&&(A="ArrowUp"),A=="Right"&&(A="ArrowRight"),A=="Down"&&(A="ArrowDown"),A}const x4=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),T4=typeof navigator<"u"&&/Win/.test(navigator.platform);function _4(t){let e=t.split(/-(?!$)/),A=e[e.length-1];A=="Space"&&(A=" ");let n,r,o,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))x4?i=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(A="Alt-"+A),r&&(A="Ctrl-"+A),i&&(A="Meta-"+A),o&&(A="Shift-"+A),A}function D4(t){let e=Object.create(null);for(let A in t)e[_4(A)]=t[A];return e}function Om(t,e,A=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),A&&e.shiftKey&&(t="Shift-"+t),t}function L4(t){return new tA({props:{handleKeyDown:aE(t)}})}function aE(t){let e=D4(t);return function(A,n){let r=I4(n),o,i=e[Om(r,n)];if(i&&i(A.state,A.dispatch,A))return!0;if(r.length==1&&r!=" "){if(n.shiftKey){let a=e[Om(r,n,!1)];if(a&&a(A.state,A.dispatch,A))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(T4&&n.ctrlKey&&n.altKey)&&(o=gi[n.keyCode])&&o!=r){let a=e[Om(o,n)];if(a&&a(A.state,A.dispatch,A))return!0}}return!1}}const Mm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function lE(t,e){let{$cursor:A}=t.selection;return!A||(e?!e.endOfTextblock("backward",t):A.parentOffset>0)?null:A}const cE=(t,e,A)=>{let n=lE(t,A);if(!n)return!1;let r=Nm(n);if(!r){let i=n.blockRange(),a=i&&aa(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let o=r.nodeBefore;if(yE(t,r,e,-1))return!0;if(n.parent.content.size==0&&(ya(o,"end")||Pe.isSelectable(o)))for(let i=n.depth;;i--){let a=Uu(t.doc,n.before(i),n.after(i),De.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(ya(o,"end")?nt.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):Pe.create(l.doc,r.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(i==1||n.node(i-1).childCount>1)break}return o.isAtom&&r.depth==n.depth-1?(e&&e(t.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0):!1},O4=(t,e,A)=>{let n=lE(t,A);if(!n)return!1;let r=Nm(n);return r?uE(t,r,e):!1},M4=(t,e,A)=>{let n=fE(t,A);if(!n)return!1;let r=Hm(n);return r?uE(t,r,e):!1};function uE(t,e,A){let n=e.nodeBefore,r=n,o=e.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let i=e.nodeAfter,a=i,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let f=a.firstChild;if(!f)return!1;a=f}let u=Uu(t.doc,o,l,De.empty);if(!u||u.from!=o||u instanceof TA&&u.slice.size>=l-o)return!1;if(A){let f=t.tr.step(u);f.setSelection(Ze.create(f.doc,o)),A(f.scrollIntoView())}return!0}function ya(t,e,A=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(A&&n.childCount!=1)return!1}return!1}const dE=(t,e,A)=>{let{$head:n,empty:r}=t.selection,o=n;if(!r)return!1;if(n.parent.isTextblock){if(A?!A.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=Nm(n)}let i=o&&o.nodeBefore;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)};function Nm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function fE(t,e){let{$cursor:A}=t.selection;return!A||(e?!e.endOfTextblock("forward",t):A.parentOffset<A.parent.content.size)?null:A}const hE=(t,e,A)=>{let n=fE(t,A);if(!n)return!1;let r=Hm(n);if(!r)return!1;let o=r.nodeAfter;if(yE(t,r,e,1))return!0;if(n.parent.content.size==0&&(ya(o,"start")||Pe.isSelectable(o))){let i=Uu(t.doc,n.before(),n.after(),De.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(ya(o,"start")?nt.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):Pe.create(a.doc,a.mapping.map(r.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&r.depth==n.depth-1?(e&&e(t.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0):!1},pE=(t,e,A)=>{let{$head:n,empty:r}=t.selection,o=n;if(!r)return!1;if(n.parent.isTextblock){if(A?!A.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=Hm(n)}let i=o&&o.nodeAfter;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function Hm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let A=t.node(e);if(t.index(e)+1<A.childCount)return t.doc.resolve(t.after(e+1));if(A.type.spec.isolating)break}return null}const N4=(t,e)=>{let A=t.selection,n=A instanceof Pe,r;if(n){if(A.node.isTextblock||!ai(t.doc,A.from))return!1;r=A.from}else if(r=Fu(t.doc,A.from,-1),r==null)return!1;if(e){let o=t.tr.join(r);n&&o.setSelection(Pe.create(o.doc,r-t.doc.resolve(r).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},H4=(t,e)=>{let A=t.selection,n;if(A instanceof Pe){if(A.node.isTextblock||!ai(t.doc,A.to))return!1;n=A.to}else if(n=Fu(t.doc,A.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},R4=(t,e)=>{let{$from:A,$to:n}=t.selection,r=A.blockRange(n),o=r&&aa(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},mE=(t,e)=>{let{$head:A,$anchor:n}=t.selection;return!A.parent.type.spec.code||!A.sameParent(n)?!1:(e&&e(t.tr.insertText(`
34
- `).scrollIntoView()),!0)};function Rm(t){for(let e=0;e<t.edgeCount;e++){let{type:A}=t.edge(e);if(A.isTextblock&&!A.hasRequiredAttrs())return A}return null}const P4=(t,e)=>{let{$head:A,$anchor:n}=t.selection;if(!A.parent.type.spec.code||!A.sameParent(n))return!1;let r=A.node(-1),o=A.indexAfter(-1),i=Rm(r.contentMatchAt(o));if(!i||!r.canReplaceWith(o,o,i))return!1;if(e){let a=A.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(nt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},gE=(t,e)=>{let A=t.selection,{$from:n,$to:r}=A;if(A instanceof On||n.parent.inlineContent||r.parent.inlineContent)return!1;let o=Rm(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let i=(!n.parentOffset&&r.index()<r.parent.childCount?n:r).pos,a=t.tr.insert(i,o.createAndFill());a.setSelection(Ze.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},BE=(t,e)=>{let{$cursor:A}=t.selection;if(!A||A.parent.content.size)return!1;if(A.depth>1&&A.after()!=A.end(-1)){let o=A.before();if(vo(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=A.blockRange(),r=n&&aa(n);return r==null?!1:(e&&e(t.tr.lift(n,r).scrollIntoView()),!0)};function V4(t){return(e,A)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Pe&&e.selection.node.isBlock)return!n.parentOffset||!vo(e.doc,n.pos)?!1:(A&&A(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,a,l=!1,u=!1;for(let g=n.depth;;g--)if(n.node(g).isBlock){l=n.end(g)==n.pos+(n.depth-g),u=n.start(g)==n.pos-(n.depth-g),a=Rm(n.node(g-1).contentMatchAt(n.indexAfter(g-1))),o.unshift(l&&a?{type:a}:null),i=g;break}else{if(g==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof Ze||e.selection instanceof On)&&f.deleteSelection();let h=f.mapping.map(n.pos),p=vo(f.doc,h,o.length,o);if(p||(o[0]=a?{type:a}:null,p=vo(f.doc,h,o.length,o)),!p)return!1;if(f.split(h,o.length,o),!l&&u&&n.node(i).type!=a){let g=f.mapping.map(n.before(i)),B=f.doc.resolve(g);a&&n.node(i-1).canReplaceWith(B.index(),B.index()+1,a)&&f.setNodeMarkup(f.mapping.map(n.before(i)),a)}return A&&A(f.scrollIntoView()),!0}}const $4=V4(),K4=(t,e)=>{let{$from:A,to:n}=t.selection,r,o=A.sharedDepth(n);return o==0?!1:(r=A.before(o),e&&e(t.tr.setSelection(Pe.create(t.doc,r))),!0)};function G4(t,e,A){let n=e.nodeBefore,r=e.nodeAfter,o=e.index();return!n||!r||!n.type.compatibleContent(r.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(A&&A(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(r.isTextblock||ai(t.doc,e.pos))?!1:(A&&A(t.tr.join(e.pos).scrollIntoView()),!0)}function yE(t,e,A,n){let r=e.nodeBefore,o=e.nodeAfter,i,a,l=r.type.spec.isolating||o.type.spec.isolating;if(!l&&G4(t,e,A))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(a=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&a.matchType(i[0]||o.type).validEnd){if(A){let g=e.pos+o.nodeSize,B=we.empty;for(let w=i.length-1;w>=0;w--)B=we.from(i[w].create(null,B));B=we.from(r.copy(B));let y=t.tr.step(new _A(e.pos-1,g,e.pos,g,new De(B,1,0),i.length,!0)),b=y.doc.resolve(g+2*i.length);b.nodeAfter&&b.nodeAfter.type==r.type&&ai(y.doc,b.pos)&&y.join(b.pos),A(y.scrollIntoView())}return!0}let f=o.type.spec.isolating||n>0&&l?null:nt.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),p=h&&aa(h);if(p!=null&&p>=e.depth)return A&&A(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&ya(o,"start",!0)&&ya(r,"end")){let g=r,B=[];for(;B.push(g),!g.isTextblock;)g=g.lastChild;let y=o,b=1;for(;!y.isTextblock;y=y.firstChild)b++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(A){let w=we.empty;for(let S=B.length-1;S>=0;S--)w=we.from(B[S].copy(w));let v=t.tr.step(new _A(e.pos-B.length,e.pos+o.nodeSize,e.pos+b,e.pos+o.nodeSize-b,new De(w,B.length,0),0,!0));A(v.scrollIntoView())}return!0}}return!1}function wE(t){return function(e,A){let n=e.selection,r=t<0?n.$from:n.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return r.node(o).isTextblock?(A&&A(e.tr.setSelection(Ze.create(e.doc,t<0?r.start(o):r.end(o)))),!0):!1}}const W4=wE(-1),z4=wE(1);function Y4(t,e=null){return function(A,n){let{$from:r,$to:o}=A.selection,i=r.blockRange(o),a=i&&rm(i,t,e);return a?(n&&n(A.tr.wrap(i,a).scrollIntoView()),!0):!1}}function CE(t,e=null){return function(A,n){let r=!1;for(let o=0;o<A.selection.ranges.length&&!r;o++){let{$from:{pos:i},$to:{pos:a}}=A.selection.ranges[o];A.doc.nodesBetween(i,a,(l,u)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)r=!0;else{let f=A.doc.resolve(u),h=f.index();r=f.parent.canReplaceWith(h,h+1,t)}})}if(!r)return!1;if(n){let o=A.tr;for(let i=0;i<A.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=A.selection.ranges[i];o.setBlockType(a,l,t,e)}n(o.scrollIntoView())}return!0}}function Pm(...t){return function(e,A,n){for(let r=0;r<t.length;r++)if(t[r](e,A,n))return!0;return!1}}Pm(Mm,cE,dE),Pm(Mm,hE,pE),Pm(mE,gE,BE,$4),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function J4(t,e=null){return function(A,n){let{$from:r,$to:o}=A.selection,i=r.blockRange(o);if(!i)return!1;let a=n?A.tr:null;return X4(a,i,t,e)?(n&&n(a.scrollIntoView()),!0):!1}}function X4(t,e,A,n=null){let r=!1,o=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(A)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=i.resolve(e.start-2);o=new bu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new bu(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let a=rm(o,A,n,e);return a?(t&&j4(t,e,a,r,A),!0):!1}function j4(t,e,A,n,r){let o=we.empty;for(let f=A.length-1;f>=0;f--)o=we.from(A[f].type.create(A[f].attrs,o));t.step(new _A(e.start-(n?2:0),e.end,e.start,e.end,new De(o,0,0),A.length,!0));let i=0;for(let f=0;f<A.length;f++)A[f].type==r&&(i=f+1);let a=A.length-i,l=e.start+A.length-(n?2:0),u=e.parent;for(let f=e.startIndex,h=e.endIndex,p=!0;f<h;f++,p=!1)!p&&vo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(f).nodeSize;return t}function q4(t){return function(e,A){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,i=>i.childCount>0&&i.firstChild.type==t);return o?A?n.node(o.depth-1).type==t?Z4(e,A,t,o):eV(e,A,o):!0:!1}}function Z4(t,e,A,n){let r=t.tr,o=n.end,i=n.$to.end(n.depth);o<i&&(r.step(new _A(o-1,i,o,i,new De(we.from(A.create(null,n.parent.copy())),1,0),1,!0)),n=new bu(r.doc.resolve(n.$from.pos),r.doc.resolve(i),n.depth));const a=aa(n);if(a==null)return!1;r.lift(n,a);let l=r.doc.resolve(r.mapping.map(o,-1)-1);return ai(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),e(r.scrollIntoView()),!0}function eV(t,e,A){let n=t.tr,r=A.parent;for(let g=A.end,B=A.endIndex-1,y=A.startIndex;B>y;B--)g-=r.child(B).nodeSize,n.delete(g-1,g+1);let o=n.doc.resolve(A.start),i=o.nodeAfter;if(n.mapping.map(A.end)!=A.start+o.nodeAfter.nodeSize)return!1;let a=A.startIndex==0,l=A.endIndex==r.childCount,u=o.node(-1),f=o.index(-1);if(!u.canReplace(f+(a?0:1),f+1,i.content.append(l?we.empty:we.from(r))))return!1;let h=o.pos,p=h+i.nodeSize;return n.step(new _A(h-(a?1:0),p+(l?1:0),h+1,p-1,new De((a?we.empty:we.from(r.copy(we.empty))).append(l?we.empty:we.from(r.copy(we.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function tV(t){return function(e,A){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let i=o.startIndex;if(i==0)return!1;let a=o.parent,l=a.child(i-1);if(l.type!=t)return!1;if(A){let u=l.lastChild&&l.lastChild.type==a.type,f=we.from(u?t.create():null),h=new De(we.from(t.create(null,we.from(a.type.create(null,f)))),u?3:1,0),p=o.start,g=o.end;A(e.tr.step(new _A(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}var AV=Object.defineProperty,bE=(t,e)=>{for(var A in e)AV(t,A,{get:e[A],enumerable:!0})};function Pu(t){const{state:e,transaction:A}=t;let{selection:n}=A,{doc:r}=A,{storedMarks:o}=A;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 o},get selection(){return n},get doc(){return r},get tr(){return n=A.selection,r=A.doc,o=A.storedMarks,A}}}var Vu=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:A}=this,{view:n}=e,{tr:r}=A,o=this.buildProps(r);return Object.fromEntries(Object.entries(t).map(([i,a])=>[i,(...u)=>{const f=a(...u)(o);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(r),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:A,editor:n,state:r}=this,{view:o}=n,i=[],a=!!t,l=t||r.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),i.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(A).map(([h,p])=>[h,(...B)=>{const y=this.buildProps(l,e),b=p(...B)(y);return i.push(b),f}])),run:u};return f}createCan(t){const{rawCommands:e,state:A}=this,n=!1,r=t||A.tr,o=this.buildProps(r,n);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,n)}}buildProps(t,e=!0){const{rawCommands:A,editor:n,state:r}=this,{view:o}=n,i={tr:t,editor:n,view:o,state:Pu({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(A).map(([a,l])=>[a,(...u)=>l(...u)(i)]))}};return i}},nV=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const A=this.callbacks[t];return A&&A.forEach(n=>n.apply(this,e)),this}off(t,e){const A=this.callbacks[t];return A&&(e?this.callbacks[t]=A.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){const A=(...n)=>{this.off(t,A),e.apply(this,n)};return this.on(t,A)}removeAllListeners(){this.callbacks={}}};function vE(t,e){const A=new Rb(t);return e.forEach(n=>{n.steps.forEach(r=>{A.step(r)})}),A}var EE=t=>{const e=t.childNodes;for(let A=e.length-1;A>=0;A-=1){const n=e[A];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&EE(n)}return t};function $u(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,A=new window.DOMParser().parseFromString(e,"text/html").body;return EE(A)}function $l(t,e,A){if(t instanceof ri||t instanceof we)return t;A={slice:!0,parseOptions:{},...A};const n=typeof t=="object"&&t!==null,r=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return we.fromArray(t.map(a=>e.nodeFromJSON(a)));const i=e.nodeFromJSON(t);return A.errorOnInvalidContent&&i.check(),i}catch(o){if(A.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),$l("",e,A)}if(r){if(A.errorOnInvalidContent){let i=!1,a="";const l=new pb({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:u=>(i=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(A.slice?oi.fromSchema(l).parseSlice($u(t),A.parseOptions):oi.fromSchema(l).parse($u(t),A.parseOptions),A.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=oi.fromSchema(e);return A.slice?o.parseSlice($u(t),A.parseOptions).content:o.parse($u(t),A.parseOptions)}return $l("",e,A)}function Vm(t,e,A={},n={}){return $l(t,e,{slice:!1,parseOptions:A,errorOnInvalidContent:n.errorOnInvalidContent})}function rV(t){for(let e=0;e<t.edgeCount;e+=1){const{type:A}=t.edge(e);if(A.isTextblock&&!A.hasRequiredAttrs())return A}return null}function oV(t,e,A){const n=[];return t.nodesBetween(e.from,e.to,(r,o)=>{A(r)&&n.push({node:r,pos:o})}),n}function iV(t,e){for(let A=t.depth;A>0;A-=1){const n=t.node(A);if(e(n))return{pos:A>0?t.before(A):0,start:t.start(A),depth:A,node:n}}}function Ku(t){return e=>iV(e.$from,t)}function Re(t,e,A){return t.config[e]===void 0&&t.parent?Re(t.parent,e,A):typeof t.config[e]=="function"?t.config[e].bind({...A,parent:t.parent?Re(t.parent,e,A):null}):t.config[e]}function $m(t){return t.map(e=>{const A={name:e.name,options:e.options,storage:e.storage},n=Re(e,"addExtensions",A);return n?[e,...$m(n())]:e}).flat(10)}function Km(t,e){const A=ss.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(A),r.innerHTML}function kE(t){return typeof t=="function"}function Ut(t,e=void 0,...A){return kE(t)?e?t.bind(e)(...A):t(...A):t}function sV(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Kl(t){const e=t.filter(r=>r.type==="extension"),A=t.filter(r=>r.type==="node"),n=t.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:A,markExtensions:n}}function SE(t){const e=[],{nodeExtensions:A,markExtensions:n}=Kl(t),r=[...A,...n],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:r},l=Re(i,"addGlobalAttributes",a);if(!l)return;l().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([p,g])=>{e.push({type:h,name:p,attribute:{...o,...g}})})})})}),r.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Re(i,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([f,h])=>{const p={...o,...h};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:i.name,name:f,attribute:p})})}),e}function AA(...t){return t.filter(e=>!!e).reduce((e,A)=>{const n={...e};return Object.entries(A).forEach(([r,o])=>{if(!n[r]){n[r]=o;return}if(r==="class"){const a=o?String(o).split(" "):[],l=n[r]?n[r].split(" "):[],u=a.filter(f=>!l.includes(f));n[r]=[...l,...u].join(" ")}else if(r==="style"){const a=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],l=n[r]?n[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;l.forEach(f=>{const[h,p]=f.split(":").map(g=>g.trim());u.set(h,p)}),a.forEach(f=>{const[h,p]=f.split(":").map(g=>g.trim());u.set(h,p)}),n[r]=Array.from(u.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else n[r]=o}),n},{})}function Gu(t,e){return e.filter(A=>A.type===t.type.name).filter(A=>A.attribute.rendered).map(A=>A.attribute.renderHTML?A.attribute.renderHTML(t.attrs)||{}:{[A.name]:t.attrs[A.name]}).reduce((A,n)=>AA(A,n),{})}function aV(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function QE(t,e){return"style"in t?t:{...t,getAttrs:A=>{const n=t.getAttrs?t.getAttrs(A):t.attrs;if(n===!1)return!1;const r=e.reduce((o,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(A):aV(A.getAttribute(i.name));return a==null?o:{...o,[i.name]:a}},{});return{...n,...r}}}}function FE(t){return Object.fromEntries(Object.entries(t).filter(([e,A])=>e==="attrs"&&sV(A)?!1:A!=null))}function lV(t,e){var A;const n=SE(t),{nodeExtensions:r,markExtensions:o}=Kl(t),i=(A=r.find(u=>Re(u,"topNode")))==null?void 0:A.name,a=Object.fromEntries(r.map(u=>{const f=n.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,v)=>{const S=Re(v,"extendNodeSchema",h);return{...w,...S?S(u):{}}},{}),g=FE({...p,content:Ut(Re(u,"content",h)),marks:Ut(Re(u,"marks",h)),group:Ut(Re(u,"group",h)),inline:Ut(Re(u,"inline",h)),atom:Ut(Re(u,"atom",h)),selectable:Ut(Re(u,"selectable",h)),draggable:Ut(Re(u,"draggable",h)),code:Ut(Re(u,"code",h)),whitespace:Ut(Re(u,"whitespace",h)),linebreakReplacement:Ut(Re(u,"linebreakReplacement",h)),defining:Ut(Re(u,"defining",h)),isolating:Ut(Re(u,"isolating",h)),attrs:Object.fromEntries(f.map(w=>{var v,S;return[w.name,{default:(v=w?.attribute)==null?void 0:v.default,validate:(S=w?.attribute)==null?void 0:S.validate}]}))}),B=Ut(Re(u,"parseHTML",h));B&&(g.parseDOM=B.map(w=>QE(w,f)));const y=Re(u,"renderHTML",h);y&&(g.toDOM=w=>y({node:w,HTMLAttributes:Gu(w,f)}));const b=Re(u,"renderText",h);return b&&(g.toText=b),[u.name,g]})),l=Object.fromEntries(o.map(u=>{const f=n.filter(b=>b.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((b,w)=>{const v=Re(w,"extendMarkSchema",h);return{...b,...v?v(u):{}}},{}),g=FE({...p,inclusive:Ut(Re(u,"inclusive",h)),excludes:Ut(Re(u,"excludes",h)),group:Ut(Re(u,"group",h)),spanning:Ut(Re(u,"spanning",h)),code:Ut(Re(u,"code",h)),attrs:Object.fromEntries(f.map(b=>{var w,v;return[b.name,{default:(w=b?.attribute)==null?void 0:w.default,validate:(v=b?.attribute)==null?void 0:v.validate}]}))}),B=Ut(Re(u,"parseHTML",h));B&&(g.parseDOM=B.map(b=>QE(b,f)));const y=Re(u,"renderHTML",h);return y&&(g.toDOM=b=>y({mark:b,HTMLAttributes:Gu(b,f)})),[u.name,g]}));return new pb({topNode:i,nodes:a,marks:l})}function cV(t){const e=t.filter((A,n)=>t.indexOf(A)!==n);return Array.from(new Set(e))}function Gm(t){return t.sort((A,n)=>{const r=Re(A,"priority")||100,o=Re(n,"priority")||100;return r>o?-1:r<o?1:0})}function UE(t){const e=Gm($m(t)),A=cV(e.map(n=>n.name));return A.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${A.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function IE(t,e,A){const{from:n,to:r}=e,{blockSeparator:o=`
33
+ `))),0,0):De.empty;let h=t.someProp("clipboardTextParser",p=>p(e,r,n,t));if(h)a=h;else{let p=r.marks(),{schema:g}=t.state,B=ss.fromSchema(g);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let b=i.appendChild(document.createElement("p"));y&&b.appendChild(B.serializeNode(g.text(y,p)))})}}else t.someProp("transformPastedHTML",h=>{A=h(A,t)}),i=R2(A),Ll&&P2(i);let u=i&&i.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let p=i.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;i=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||oi.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!M2.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)a=V2(Ov(a,+f[1],+f[2]),f[4]);else if(a=De.maxOpen(N2(a.content,r),!0),a.openStart||a.openEnd){let h=0,p=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;p<a.openEnd&&!g.type.spec.isolating;p++,g=g.lastChild);a=Ov(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const M2=/^(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 N2(t,e){if(t.childCount<2)return t;for(let A=e.depth;A>=0;A--){let r=e.node(A).contentMatchAt(e.index(A)),o,i=[];if(t.forEach(a=>{if(!i)return;let l=r.findWrapping(a.type),u;if(!l)return i=null;if(u=i.length&&o.length&&Dv(l,o,a,i[i.length-1],0))i[i.length-1]=u;else{i.length&&(i[i.length-1]=Lv(i[i.length-1],o.length));let f=_v(a,l);i.push(f),r=r.matchType(f.type),o=l}}),i)return we.from(i)}return t}function _v(t,e,A=0){for(let n=e.length-1;n>=A;n--)t=e[n].create(null,we.from(t));return t}function Dv(t,e,A,n,r){if(r<t.length&&r<e.length&&t[r]==e[r]){let o=Dv(t,e,A,n.lastChild,r+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(r==t.length-1?A.type:t[r+1]))return n.copy(n.content.append(we.from(_v(A,t,r+1))))}}function Lv(t,e){if(e==0)return t;let A=t.content.replaceChild(t.childCount-1,Lv(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(we.empty,!0);return t.copy(A.append(n))}function km(t,e,A,n,r,o){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(o=0),r<n-1&&(a=km(a,e,A,n,r+1,o)),r>=A&&(a=e<0?i.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(we.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function Ov(t,e,A){return e<t.openStart&&(t=new De(km(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),A<t.openEnd&&(t=new De(km(t.content,1,A,t.openEnd,0,0),t.openStart,A)),t}const Mv={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 Nv=null;function Hv(){return Nv||(Nv=document.implementation.createHTMLDocument("title"))}let Sm=null;function H2(t){let e=window.trustedTypes;return e?(Sm||(Sm=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:A=>A})),Sm.createHTML(t)):t}function R2(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let A=Hv().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),r;if((r=n&&Mv[n[1].toLowerCase()])&&(t=r.map(o=>"<"+o+">").join("")+t+r.map(o=>"</"+o+">").reverse().join("")),A.innerHTML=H2(t),r)for(let o=0;o<r.length;o++)A=A.querySelector(r[o])||A;return A}function P2(t){let e=t.querySelectorAll(jA?"span:not([class]):not([style])":"span.Apple-converted-space");for(let A=0;A<e.length;A++){let n=e[A];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function V2(t,e){if(!t.size)return t;let A=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:r,openStart:o,openEnd:i}=t;for(let a=n.length-2;a>=0;a-=2){let l=A.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;r=we.from(l.create(n[a+1],r)),o++,i++}return new De(r,o,i)}const ln={},cn={},$2={touchstart:!0,touchmove:!0};class K2{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function G2(t){for(let e in ln){let A=ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{z2(t,n)&&!Fm(t,n)&&(t.editable||!(n.type in cn))&&A(t,n)},$2[e]?{passive:!0}:void 0)}an&&t.dom.addEventListener("input",()=>null),Qm(t)}function hi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function W2(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Qm(t){t.someProp("handleDOMEvents",e=>{for(let A in e)t.input.eventHandlers[A]||t.dom.addEventListener(A,t.input.eventHandlers[A]=n=>Fm(t,n))})}function Fm(t,e){return t.someProp("handleDOMEvents",A=>{let n=A[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function z2(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let A=e.target;A!=t.dom;A=A.parentNode)if(!A||A.nodeType==11||A.pmViewDesc&&A.pmViewDesc.stopEvent(e))return!1;return!0}function Y2(t,e){!Fm(t,e)&&ln[e.type]&&(t.editable||!(e.type in cn))&&ln[e.type](t,e)}cn.keydown=(t,e)=>{let A=e;if(t.input.shiftKey=A.keyCode==16||A.shiftKey,!Pv(t,A)&&(t.input.lastKeyCode=A.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ko&&jA&&A.keyCode==13)))if(A.keyCode!=229&&t.domObserver.forceFlush(),ha&&A.keyCode==13&&!A.ctrlKey&&!A.altKey&&!A.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",r=>r(t,cs(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,A))||O2(t,A)?A.preventDefault():hi(t,"key")},cn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},cn.keypress=(t,e)=>{let A=e;if(Pv(t,A)||!A.charCode||A.ctrlKey&&!A.altKey||Zn&&A.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,A))){A.preventDefault();return}let n=t.state.selection;if(!(n instanceof Ze)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(A.charCode),o=()=>t.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!t.someProp("handleTextInput",i=>i(t,n.$from.pos,n.$to.pos,r,o))&&t.dispatch(o()),A.preventDefault()}};function Ou(t){return{left:t.clientX,top:t.clientY}}function J2(t,e){let A=e.x-t.clientX,n=e.y-t.clientY;return A*A+n*n<100}function Um(t,e,A,n,r){if(n==-1)return!1;let o=t.state.doc.resolve(n);for(let i=o.depth+1;i>0;i--)if(t.someProp(e,a=>i>o.depth?a(t,A,o.nodeAfter,o.before(i),r,!0):a(t,A,o.node(i),o.before(i),r,!1)))return!0;return!1}function ga(t,e,A){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function X2(t,e){if(e==-1)return!1;let A=t.state.doc.resolve(e),n=A.nodeAfter;return n&&n.isAtom&&Pe.isSelectable(n)?(ga(t,new Pe(A)),!0):!1}function j2(t,e){if(e==-1)return!1;let A=t.state.selection,n,r;A instanceof Pe&&(n=A.node);let o=t.state.doc.resolve(e);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i);if(Pe.isSelectable(a)){n&&A.$from.depth>0&&i>=A.$from.depth&&o.before(A.$from.depth+1)==A.$from.pos?r=o.before(A.$from.depth):r=o.before(i);break}}return r!=null?(ga(t,Pe.create(t.state.doc,r)),!0):!1}function q2(t,e,A,n,r){return Um(t,"handleClickOn",e,A,n)||t.someProp("handleClick",o=>o(t,e,n))||(r?j2(t,A):X2(t,A))}function Z2(t,e,A,n){return Um(t,"handleDoubleClickOn",e,A,n)||t.someProp("handleDoubleClick",r=>r(t,e,n))}function e4(t,e,A,n){return Um(t,"handleTripleClickOn",e,A,n)||t.someProp("handleTripleClick",r=>r(t,e,n))||t4(t,A,n)}function t4(t,e,A){if(A.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(ga(t,Ze.create(n,0,n.content.size)),!0):!1;let r=n.resolve(e);for(let o=r.depth+1;o>0;o--){let i=o>r.depth?r.nodeAfter:r.node(o),a=r.before(o);if(i.inlineContent)ga(t,Ze.create(n,a+1,a+1+i.content.size));else if(Pe.isSelectable(i))ga(t,Pe.create(n,a));else continue;return!0}}function Im(t){return Mu(t)}const Rv=Zn?"metaKey":"ctrlKey";ln.mousedown=(t,e)=>{let A=e;t.input.shiftKey=A.shiftKey;let n=Im(t),r=Date.now(),o="singleClick";r-t.input.lastClick.time<500&&J2(A,t.input.lastClick)&&!A[Rv]&&t.input.lastClick.button==A.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:r,x:A.clientX,y:A.clientY,type:o,button:A.button};let i=t.posAtCoords(Ou(A));i&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new A4(t,i,A,!!n)):(o=="doubleClick"?Z2:e4)(t,i.pos,i.inside,A)?A.preventDefault():hi(t,"pointer"))};class A4{constructor(e,A,n,r){this.view=e,this.pos=A,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Rv],this.allowDefault=n.shiftKey;let o,i;if(A.inside>-1)o=e.state.doc.nodeAt(A.inside),i=A.inside;else{let f=e.state.doc.resolve(A.pos);o=f.parent,i=f.depth?f.before():0}const a=r?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(n.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof Pe&&u.from<=i&&u.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Sr&&!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)),hi(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(()=>Qo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let A=this.pos;this.view.state.doc!=this.startDoc&&(A=this.view.posAtCoords(Ou(e))),this.updateAllowDefault(e),this.allowDefault||!A?hi(this.view,"pointer"):q2(this.view,A.pos,A.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||an&&this.mightDrag&&!this.mightDrag.node.isAtom||jA&&!this.view.state.selection.visible&&Math.min(Math.abs(A.pos-this.view.state.selection.from),Math.abs(A.pos-this.view.state.selection.to))<=2)?(ga(this.view,nt.near(this.view.state.doc.resolve(A.pos))),e.preventDefault()):hi(this.view,"pointer")}move(e){this.updateAllowDefault(e),hi(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)}}ln.touchstart=t=>{t.input.lastTouch=Date.now(),Im(t),hi(t,"pointer")},ln.touchmove=t=>{t.input.lastTouch=Date.now(),hi(t,"pointer")},ln.contextmenu=t=>Im(t);function Pv(t,e){return t.composing?!0:an&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const n4=ko?5e3:-1;cn.compositionstart=cn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,A=e.selection.$to;if(e.selection instanceof Ze&&(e.storedMarks||!A.textOffset&&A.parentOffset&&A.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||A.marks(),Mu(t,!0),t.markCursor=null;else if(Mu(t,!e.selection.empty),Sr&&e.selection.empty&&A.parentOffset&&!A.textOffset&&A.nodeBefore.marks.length){let n=t.domSelectionRange();for(let r=n.focusNode,o=n.focusOffset;r&&r.nodeType==1&&o!=0;){let i=o<0?r.lastChild:r.childNodes[o-1];if(!i)break;if(i.nodeType==3){let a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else r=i,o=-1}}t.input.composing=!0}Vv(t,n4)},cn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Vv(t,20))};function Vv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Mu(t),e))}function $v(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=o4());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function r4(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let A=XP(e.focusNode,e.focusOffset),n=jP(e.focusNode,e.focusOffset);if(A&&n&&A!=n){let r=n.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(A==o||n==o)return o;if(!r||!r.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let i=A.pmViewDesc;if(!(!i||!i.isText(A.nodeValue)))return n}}return A||n}function o4(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Mu(t,e=!1){if(!(ko&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$v(t),e||t.docView&&t.docView.dirty){let A=ym(t),n=t.state.selection;return A&&!A.eq(n)?t.dispatch(t.state.tr.setSelection(A)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function i4(t,e){if(!t.dom.parentNode)return;let A=t.dom.parentNode.appendChild(document.createElement("div"));A.appendChild(e),A.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(r),setTimeout(()=>{A.parentNode&&A.parentNode.removeChild(A),t.focus()},50)}const Rl=bn&&ci<15||ha&&A2<604;ln.copy=cn.cut=(t,e)=>{let A=e,n=t.state.selection,r=A.type=="cut";if(n.empty)return;let o=Rl?null:A.clipboardData,i=n.content(),{dom:a,text:l}=Em(t,i);o?(A.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):i4(t,a),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function s4(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function a4(t,e){if(!t.dom.parentNode)return;let A=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(A?"textarea":"div"));A||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let r=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),A?Pl(t,n.value,null,r,e):Pl(t,n.textContent,n.innerHTML,r,e)},50)}function Pl(t,e,A,n,r){let o=Tv(t,e,A,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,r,o||De.empty)))return!0;if(!o)return!1;let i=s4(o),a=i?t.state.tr.replaceSelectionWith(i,n):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Kv(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let A=t.getData("text/uri-list");return A?A.replace(/\r?\n/g," "):""}cn.paste=(t,e)=>{let A=e;if(t.composing&&!ko)return;let n=Rl?null:A.clipboardData,r=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Pl(t,Kv(n),n.getData("text/html"),r,A)?A.preventDefault():a4(t,A)};class Gv{constructor(e,A,n){this.slice=e,this.move=A,this.node=n}}const l4=Zn?"altKey":"ctrlKey";function Wv(t,e){let A=t.someProp("dragCopies",n=>!n(e));return A??!e[l4]}ln.dragstart=(t,e)=>{let A=e,n=t.input.mouseDown;if(n&&n.done(),!A.dataTransfer)return;let r=t.state.selection,o=r.empty?null:t.posAtCoords(Ou(A)),i;if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof Pe?r.to-1:r.to))){if(n&&n.mightDrag)i=Pe.create(t.state.doc,n.mightDrag.pos);else if(A.target&&A.target.nodeType==1){let h=t.docView.nearestDesc(A.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(i=Pe.create(t.state.doc,h.posBefore))}}let a=(i||t.state.selection).content(),{dom:l,text:u,slice:f}=Em(t,a);(!A.dataTransfer.files.length||!jA||qb>120)&&A.dataTransfer.clearData(),A.dataTransfer.setData(Rl?"Text":"text/html",l.innerHTML),A.dataTransfer.effectAllowed="copyMove",Rl||A.dataTransfer.setData("text/plain",u),t.dragging=new Gv(f,Wv(t,A),i)},ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},cn.dragover=cn.dragenter=(t,e)=>e.preventDefault(),cn.drop=(t,e)=>{let A=e,n=t.dragging;if(t.dragging=null,!A.dataTransfer)return;let r=t.posAtCoords(Ou(A));if(!r)return;let o=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",B=>{i=B(i,t)}):i=Tv(t,Kv(A.dataTransfer),Rl?null:A.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&Wv(t,A));if(t.someProp("handleDrop",B=>B(t,A,i||De.empty,a))){A.preventDefault();return}if(!i)return;A.preventDefault();let l=i?Lb(t.state.doc,o.pos,i):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:B}=n;B?B.replace(u):u.deleteSelection()}let f=u.mapping.map(l),h=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(f,f,i.content.firstChild):u.replaceRange(f,f,i),u.doc.eq(p))return;let g=u.doc.resolve(f);if(h&&Pe.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))u.setSelection(new Pe(g));else{let B=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((y,b,w,v)=>B=v),u.setSelection(Cm(t,g,u.doc.resolve(B)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},ln.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Qo(t)},20))},ln.blur=(t,e)=>{let A=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),A.relatedTarget&&t.dom.contains(A.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ln.beforeinput=(t,e)=>{if(jA&&ko&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,cs(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in cn)ln[t]=cn[t];function Vl(t,e){if(t==e)return!0;for(let A in t)if(t[A]!==e[A])return!1;for(let A in e)if(!(A in t))return!1;return!0}class Nu{constructor(e,A){this.toDOM=e,this.spec=A||hs,this.side=this.spec.side||0}map(e,A,n,r){let{pos:o,deleted:i}=e.mapResult(A.from+r,this.side<0?-1:1);return i?null:new un(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Nu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Vl(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class pi{constructor(e,A){this.attrs=e,this.spec=A||hs}map(e,A,n,r){let o=e.map(A.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(A.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new un(o,i,this)}valid(e,A){return A.from<A.to}eq(e){return this==e||e instanceof pi&&Vl(this.attrs,e.attrs)&&Vl(this.spec,e.spec)}static is(e){return e.type instanceof pi}destroy(){}}class xm{constructor(e,A){this.attrs=e,this.spec=A||hs}map(e,A,n,r){let o=e.mapResult(A.from+r,1);if(o.deleted)return null;let i=e.mapResult(A.to+r,-1);return i.deleted||i.pos<=o.pos?null:new un(o.pos-n,i.pos-n,this)}valid(e,A){let{index:n,offset:r}=e.content.findIndex(A.from),o;return r==A.from&&!(o=e.child(n)).isText&&r+o.nodeSize==A.to}eq(e){return this==e||e instanceof xm&&Vl(this.attrs,e.attrs)&&Vl(this.spec,e.spec)}destroy(){}}class un{constructor(e,A,n){this.from=e,this.to=A,this.type=n}copy(e,A){return new un(e,A,this.type)}eq(e,A=0){return this.type.eq(e.type)&&this.from+A==e.from&&this.to+A==e.to}map(e,A,n){return this.type.map(e,this,A,n)}static widget(e,A,n){return new un(e,e,new Nu(A,n))}static inline(e,A,n,r){return new un(e,A,new pi(n,r))}static node(e,A,n,r){return new un(e,A,new xm(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof pi}get widget(){return this.type instanceof Nu}}const Ba=[],hs={};class jt{constructor(e,A){this.local=e.length?e:Ba,this.children=A.length?A:Ba}static create(e,A){return A.length?Hu(A,e,0,hs):qA}find(e,A,n){let r=[];return this.findInner(e??0,A??1e9,r,0,n),r}findInner(e,A,n,r,o){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=A&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<A&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,A-a,n,r+a,o)}}map(e,A,n){return this==qA||e.maps.length==0?this:this.mapInner(e,A,0,0,n||hs)}mapInner(e,A,n,r,o){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,r);l&&l.type.valid(A,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?c4(this.children,i||[],e,A,n,r,o):i?new jt(i.sort(ps),Ba):qA}add(e,A){return A.length?this==qA?jt.create(e,A):this.addInner(e,A,0):this}addInner(e,A,n){let r,o=0;e.forEach((a,l)=>{let u=l+n,f;if(f=Yv(A,a,u)){for(r||(r=this.children.slice());o<r.length&&r[o]<l;)o+=3;r[o]==l?r[o+2]=r[o+2].addInner(a,f,u+1):r.splice(o,0,l,l+a.nodeSize,Hu(f,a,u+1,hs)),o+=3}});let i=zv(o?Jv(A):A,-n);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new jt(i.length?this.local.concat(i).sort(ps):this.local,r||this.children)}remove(e){return e.length==0||this==qA?this:this.removeInner(e,0)}removeInner(e,A){let n=this.children,r=this.local;for(let o=0;o<n.length;o+=3){let i,a=n[o]+A,l=n[o+1]+A;for(let f=0,h;f<e.length;f++)(h=e[f])&&h.from>a&&h.to<l&&(e[f]=null,(i||(i=[])).push(h));if(!i)continue;n==this.children&&(n=this.children.slice());let u=n[o+2].removeInner(i,a+1);u!=qA?n[o+2]=u:(n.splice(o,3),o-=3)}if(r.length){for(let o=0,i;o<e.length;o++)if(i=e[o])for(let a=0;a<r.length;a++)r[a].eq(i,A)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new jt(r,n):qA}forChild(e,A){if(this==qA)return this;if(A.isLeaf)return jt.empty;let n,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,i=o+A.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>o&&l.type instanceof pi){let u=Math.max(o,l.from)-o,f=Math.min(i,l.to)-o;u<f&&(r||(r=[])).push(l.copy(u,f))}}if(r){let a=new jt(r.sort(ps),Ba);return n?new mi([a,n]):a}return n||qA}eq(e){if(this==e)return!0;if(!(e instanceof jt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let A=0;A<this.local.length;A++)if(!this.local[A].eq(e.local[A]))return!1;for(let A=0;A<this.children.length;A+=3)if(this.children[A]!=e.children[A]||this.children[A+1]!=e.children[A+1]||!this.children[A+2].eq(e.children[A+2]))return!1;return!0}locals(e){return Tm(this.localsInner(e))}localsInner(e){if(this==qA)return Ba;if(e.inlineContent||!this.local.some(pi.is))return this.local;let A=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof pi||A.push(this.local[n]);return A}forEachSet(e){e(this)}}jt.empty=new jt([],[]),jt.removeOverlap=Tm;const qA=jt.empty;class mi{constructor(e){this.members=e}map(e,A){const n=this.members.map(r=>r.map(e,A,hs));return mi.from(n)}forChild(e,A){if(A.isLeaf)return jt.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,A);o!=qA&&(o instanceof mi?n=n.concat(o.members):n.push(o))}return mi.from(n)}eq(e){if(!(e instanceof mi)||e.members.length!=this.members.length)return!1;for(let A=0;A<this.members.length;A++)if(!this.members[A].eq(e.members[A]))return!1;return!0}locals(e){let A,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(!A)A=o;else{n&&(A=A.slice(),n=!1);for(let i=0;i<o.length;i++)A.push(o[i])}}return A?Tm(n?A:A.sort(ps)):Ba}static from(e){switch(e.length){case 0:return qA;case 1:return e[0];default:return new mi(e.every(A=>A instanceof jt)?e:e.reduce((A,n)=>A.concat(n instanceof jt?n:n.members),[]))}}forEachSet(e){for(let A=0;A<this.members.length;A++)this.members[A].forEachSet(e)}}function c4(t,e,A,n,r,o,i){let a=t.slice();for(let u=0,f=o;u<A.maps.length;u++){let h=0;A.maps[u].forEach((p,g,B,y)=>{let b=y-B-(g-p);for(let w=0;w<a.length;w+=3){let v=a[w+1];if(v<0||p>v+f-h)continue;let S=a[w]+f-h;g>=S?a[w+1]=p<=S?-2:-1:p>=f&&b&&(a[w]+=b,a[w+1]+=b)}h+=b}),f=A.maps[u].map(f,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let f=A.map(t[u]+o),h=f-r;if(h<0||h>=n.content.size){l=!0;continue}let p=A.map(t[u+1]+o,-1),g=p-r,{index:B,offset:y}=n.content.findIndex(h),b=n.maybeChild(B);if(b&&y==h&&y+b.nodeSize==g){let w=a[u+2].mapInner(A,b,f+1,t[u]+o+1,i);w!=qA?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=u4(a,t,e,A,r,o,i),f=Hu(u,n,0,i);e=f.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<f.children.length;h+=3){let g=f.children[h];for(;p<a.length&&a[p]<g;)p+=3;a.splice(p,0,f.children[h],f.children[h+1],f.children[h+2])}}return new jt(e.sort(ps),a)}function zv(t,e){if(!e||!t.length)return t;let A=[];for(let n=0;n<t.length;n++){let r=t[n];A.push(new un(r.from+e,r.to+e,r.type))}return A}function u4(t,e,A,n,r,o,i){function a(l,u){for(let f=0;f<l.local.length;f++){let h=l.local[f].map(n,r,u);h?A.push(h):i.onRemove&&i.onRemove(l.local[f].spec)}for(let f=0;f<l.children.length;f+=3)a(l.children[f+2],l.children[f]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return A}function Yv(t,e,A){if(e.isLeaf)return null;let n=A+e.nodeSize,r=null;for(let o=0,i;o<t.length;o++)(i=t[o])&&i.from>A&&i.to<n&&((r||(r=[])).push(i),t[o]=null);return r}function Jv(t){let e=[];for(let A=0;A<t.length;A++)t[A]!=null&&e.push(t[A]);return e}function Hu(t,e,A,n){let r=[],o=!1;e.forEach((a,l)=>{let u=Yv(t,a,l+A);if(u){o=!0;let f=Hu(u,a,A+l+1,n);f!=qA&&r.push(l,l+a.nodeSize,f)}});let i=zv(o?Jv(t):t,-A).sort(ps);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(n.onRemove&&n.onRemove(i[a].spec),i.splice(a--,1));return i.length||r.length?new jt(i,r):qA}function ps(t,e){return t.from-e.from||t.to-e.to}function Tm(t){let e=t;for(let A=0;A<e.length-1;A++){let n=e[A];if(n.from!=n.to)for(let r=A+1;r<e.length;r++){let o=e[r];if(o.from==n.from){o.to!=n.to&&(e==t&&(e=t.slice()),e[r]=o.copy(o.from,n.to),Xv(e,r+1,o.copy(n.to,o.to)));continue}else{o.from<n.to&&(e==t&&(e=t.slice()),e[A]=n.copy(n.from,o.from),Xv(e,r,n.copy(o.from,n.to)));break}}}return e}function Xv(t,e,A){for(;e<t.length&&ps(A,t[e])>0;)e++;t.splice(e,0,A)}function _m(t){let e=[];return t.someProp("decorations",A=>{let n=A(t.state);n&&n!=qA&&e.push(n)}),t.cursorWrapper&&e.push(jt.create(t.state.doc,[t.cursorWrapper.deco])),mi.from(e)}const d4={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},f4=bn&&ci<=11;class h4{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 p4{constructor(e,A){this.view=e,this.handleDOMChange=A,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new h4,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let r=0;r<n.length;r++)this.queue.push(n[r]);bn&&ci<=11&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),f4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,d4)),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 A=0;A<e.length;A++)this.queue.push(e[A]);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(Ev(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(bn&&ci<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ls(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 A=new Set,n;for(let o=e.focusNode;o;o=fa(o))A.add(o);for(let o=e.anchorNode;o;o=fa(o))if(A.has(o)){n=o;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))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 A=this.pendingRecords();A.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ev(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,a=!1,l=[];if(e.editable)for(let f=0;f<A.length;f++){let h=this.registerMutation(A[f],l);h&&(o=o<0?h.from:Math.min(h.from,o),i=i<0?h.to:Math.max(h.to,i),h.typeOver&&(a=!0))}if(Sr&&l.length){let f=l.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,p]=f;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of f){let g=p.parentNode;g&&g.nodeName=="LI"&&(!h||B4(e,h)!=g)&&p.remove()}}}let u=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tu(n)&&(u=ym(e))&&u.eq(nt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Qo(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),m4(e)),this.handleDOMChange(o,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Qo(e),this.currentSelection.set(n))}registerMutation(e,A){if(A.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let h=e.addedNodes[f];A.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(bn&&ci<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:h,nextSibling:p}=e.addedNodes[f];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(r=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let i=r&&r.parentNode==e.target?PA(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?PA(o):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let jv=new WeakMap,qv=!1;function m4(t){if(!jv.has(t)&&(jv.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Sr,qv)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."),qv=!0}}function Zv(t,e){let A=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return ls(i.node,i.offset,r,o)&&([A,n,r,o]=[r,o,A,n]),{anchorNode:A,anchorOffset:n,focusNode:r,focusOffset:o}}function g4(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Zv(t,r)}let A;function n(r){r.preventDefault(),r.stopImmediatePropagation(),A=r.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),A?Zv(t,A):null}function B4(t,e){for(let A=e.parentNode;A&&A!=t.dom;A=A.parentNode){let n=t.docView.nearestDesc(A,!0);if(n&&n.node.isBlock)return A}return null}function y4(t,e,A){let{node:n,fromOffset:r,toOffset:o,from:i,to:a}=t.docView.parseRange(e,A),l=t.domSelectionRange(),u,f=l.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(u=[{node:f,offset:l.anchorOffset}],Tu(l)||u.push({node:l.focusNode,offset:l.focusOffset})),jA&&t.input.lastKeyCode===8)for(let b=o;b>r;b--){let w=n.childNodes[b-1],v=w.pmViewDesc;if(w.nodeName=="BR"&&!v){o=b;break}if(!v||v.size)break}let h=t.state.doc,p=t.someProp("domParser")||oi.fromSchema(t.state.schema),g=h.resolve(i),B=null,y=p.parse(n,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:r,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:w4,context:g});if(u&&u[0].pos!=null){let b=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=b),B={anchor:b+i,head:w+i}}return{doc:y,sel:B,from:i,to:a}}function w4(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(an&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let A=document.createElement("div");return A.appendChild(document.createElement("li")),{skip:A}}else if(t.parentNode.lastChild==t||an&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const C4=/^(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 b4(t,e,A,n,r){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let M=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=ym(t,M);if(O&&!t.state.selection.eq(O)){if(jA&&ko&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ie=>ie(t,cs(13,"Enter"))))return;let P=t.state.tr.setSelection(O);M=="pointer"?P.setMeta("pointer",!0):M=="key"&&P.scrollIntoView(),o&&P.setMeta("composition",o),t.dispatch(P)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(A);e=i.before(a+1),A=t.state.doc.resolve(A).after(a+1);let l=t.state.selection,u=y4(t,e,A),f=t.state.doc,h=f.slice(u.from,u.to),p,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,g="end"):(p=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let B=k4(h.content,u.doc.content,u.from,p,g);if(B&&t.input.domChangeCount++,(ha&&t.input.lastIOSEnter>Date.now()-225||ko)&&r.some(M=>M.nodeType==1&&!C4.test(M.nodeName))&&(!B||B.endA>=B.endB)&&t.someProp("handleKeyDown",M=>M(t,cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!B)if(n&&l instanceof Ze&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))B={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let M=eE(t,t.state.doc,u.sel);if(M&&!M.eq(t.state.selection)){let O=t.state.tr.setSelection(M);o&&O.setMeta("composition",o),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&B.start==B.endB&&t.state.selection instanceof Ze&&(B.start>t.state.selection.from&&B.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?B.start=t.state.selection.from:B.endA<t.state.selection.to&&B.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(B.endB+=t.state.selection.to-B.endA,B.endA=t.state.selection.to)),bn&&ci<=11&&B.endB==B.start+1&&B.endA==B.start&&B.start>u.from&&u.doc.textBetween(B.start-u.from-1,B.start-u.from+1)=="  "&&(B.start--,B.endA--,B.endB--);let y=u.doc.resolveNoCache(B.start-u.from),b=u.doc.resolveNoCache(B.endB-u.from),w=f.resolve(B.start),v=y.sameParent(b)&&y.parent.inlineContent&&w.end()>=B.endA,S;if((ha&&t.input.lastIOSEnter>Date.now()-225&&(!v||r.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!v&&y.pos<u.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&!/\S/.test(u.doc.textBetween(y.pos,b.pos,"",""))&&(S=nt.findFrom(u.doc.resolve(y.pos+1),1,!0))&&S.head>y.pos)&&t.someProp("handleKeyDown",M=>M(t,cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>B.start&&E4(f,B.start,B.endA,y,b)&&t.someProp("handleKeyDown",M=>M(t,cs(8,"Backspace")))){ko&&jA&&t.domObserver.suppressSelectionUpdates();return}jA&&B.endB==B.start&&(t.input.lastChromeDelete=Date.now()),ko&&!v&&y.start()!=b.start()&&b.parentOffset==0&&y.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==B.endA&&(B.endB-=2,b=u.doc.resolveNoCache(B.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(M){return M(t,cs(13,"Enter"))})},20));let F=B.start,I=B.endA,Q=M=>{let O=M||t.state.tr.replace(F,I,u.doc.slice(B.start-u.from,B.endB-u.from));if(u.sel){let P=eE(t,O.doc,u.sel);P&&!(jA&&t.composing&&P.empty&&(B.start!=B.endB||t.input.lastChromeDelete<Date.now()-100)&&(P.head==F||P.head==O.mapping.map(I)-1)||bn&&P.empty&&P.head==F)&&O.setSelection(P)}return o&&O.setMeta("composition",o),O.scrollIntoView()},x;if(v){if(y.pos==b.pos){bn&&ci<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(t),20));let M=Q(t.state.tr.delete(F,I)),O=f.resolve(B.start).marksAcross(f.resolve(B.endA));O&&M.ensureMarks(O),t.dispatch(M)}else if(B.endA==B.endB&&(x=v4(y.parent.content.cut(y.parentOffset,b.parentOffset),w.parent.content.cut(w.parentOffset,B.endA-w.start())))){let M=Q(t.state.tr);x.type=="add"?M.addMark(F,I,x.mark):M.removeMark(F,I,x.mark),t.dispatch(M)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-(b.textOffset?0:1)){let M=y.parent.textBetween(y.parentOffset,b.parentOffset),O=()=>Q(t.state.tr.insertText(M,F,I));t.someProp("handleTextInput",P=>P(t,F,I,M,O))||t.dispatch(O())}}else t.dispatch(Q())}function eE(t,e,A){return Math.max(A.anchor,A.head)>e.content.size?null:Cm(t,e.resolve(A.anchor),e.resolve(A.head))}function v4(t,e){let A=t.firstChild.marks,n=e.firstChild.marks,r=A,o=n,i,a,l;for(let f=0;f<n.length;f++)r=n[f].removeFromSet(r);for(let f=0;f<A.length;f++)o=A[f].removeFromSet(o);if(r.length==1&&o.length==0)a=r[0],i="add",l=f=>f.mark(a.addToSet(f.marks));else if(r.length==0&&o.length==1)a=o[0],i="remove",l=f=>f.mark(a.removeFromSet(f.marks));else return null;let u=[];for(let f=0;f<e.childCount;f++)u.push(l(e.child(f)));if(we.from(u).eq(t))return{mark:a,type:i}}function E4(t,e,A,n,r){if(A-e<=r.pos-n.pos||Dm(n,!0,!1)<r.pos)return!1;let o=t.resolve(e);if(!n.parent.isTextblock){let a=o.nodeAfter;return a!=null&&A==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let i=t.resolve(Dm(o,!0,!0));return!i.parent.isTextblock||i.pos>A||Dm(i,!0,!1)<A?!1:n.parent.content.cut(n.parentOffset).eq(i.parent.content)}function Dm(t,e,A){let n=t.depth,r=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,r++,e=!1;if(A){let o=t.node(n).maybeChild(t.indexAfter(n));for(;o&&!o.isLeaf;)o=o.firstChild,r++}return r}function k4(t,e,A,n,r){let o=t.findDiffStart(e,A);if(o==null)return null;let{a:i,b:a}=t.findDiffEnd(e,A+t.size,A+e.size);if(r=="end"){let l=Math.max(0,o-Math.min(i,a));n-=i+l-o}if(i<o&&t.size<e.size){let l=n<=o&&n>=i?o-n:0;o-=l,o&&o<e.size&&tE(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-i),i=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,o&&o<t.size&&tE(t.textBetween(o-1,o+1))&&(o+=l?1:-1),i=o+(i-a),a=o}return{start:o,endA:i,endB:a}}function tE(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),A=t.charCodeAt(1);return e>=56320&&e<=57343&&A>=55296&&A<=56319}class AE{constructor(e,A){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 K2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=A,this.state=A.state,this.directPlugins=A.plugins||[],this.directPlugins.forEach(sE),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=oE(this),rE(this),this.nodeViews=iE(this),this.docView=dv(this.state.doc,nE(this),_m(this),this.dom,this),this.domObserver=new p4(this,(n,r,o,i)=>b4(this,n,r,o,i)),this.domObserver.start(),G2(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 A in e)this._props[A]=e[A];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Qm(this);let A=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sE),this.directPlugins=e.plugins),this.updateStateInner(e.state,A)}setProps(e){let A={};for(let n in this._props)A[n]=this._props[n];A.state=this.state;for(let n in e)A[n]=e[n];this.update(A)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,A){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&($v(this),i=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=A.plugins;if(a||this._props.plugins!=A.plugins||this._props.nodeViews!=A.nodeViews){let g=iE(this);Q4(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||A.handleDOMEvents!=this._props.handleDOMEvents)&&Qm(this),this.editable=oE(this),rE(this);let l=_m(this),u=nE(this),f=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(r.selection))&&(i=!0);let p=f=="preserve"&&i&&this.dom.style.overflowAnchor==null&&o2(this);if(i){this.domObserver.stop();let g=h&&(bn||jA)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&S4(r.selection,e.selection);if(h){let B=jA?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=r4(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=dv(e.doc,u,l,this.dom,this)),B&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&U2(this))?Qo(this,g):(bv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((n=this.dragging)===null||n===void 0)&&n.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():p&&i2(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",A=>A(this)))if(this.state.selection instanceof Pe){let A=this.docView.domAfterPos(this.state.selection.from);A.nodeType==1&&Zb(this,A.getBoundingClientRect(),e)}else Zb(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 A=0;A<this.directPlugins.length;A++){let n=this.directPlugins[A];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let A=0;A<this.state.plugins.length;A++){let n=this.state.plugins[A];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let A=0;A<this.pluginViews.length;A++){let n=this.pluginViews[A];n.update&&n.update(this,e)}}updateDraggedNode(e,A){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let o=n.from+(this.state.doc.content.size-A.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(r=o)}this.dragging=new Gv(e.slice,e.move,r<0?void 0:Pe.create(this.state.doc,r))}someProp(e,A){let n=this._props&&this._props[e],r;if(n!=null&&(r=A?A(n):n))return r;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(r=A?A(a):a))return r}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let a=o[i].props[e];if(a!=null&&(r=A?A(a):a))return r}}hasFocus(){if(bn){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&&s2(this.dom),Qo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let A=this.dom.parentNode;A;A=A.parentNode)if(A.nodeType==9||A.nodeType==11&&A.host)return A.getSelection||(Object.getPrototypeOf(A).getSelection=()=>A.ownerDocument.getSelection()),this._root=A}return e||document}updateRoot(){this._root=null}posAtCoords(e){return d2(this,e)}coordsAtPos(e,A=1){return ov(this,e,A)}domAtPos(e,A=0){return this.docView.domFromPos(e,A)}nodeDOM(e){let A=this.docView.descAt(e);return A?A.nodeDOM:null}posAtDOM(e,A,n=-1){let r=this.docView.posFromDOM(e,A,n);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,A){return g2(this,A||this.state,e)}pasteHTML(e,A){return Pl(this,"",e,!1,A||new ClipboardEvent("paste"))}pasteText(e,A){return Pl(this,e,null,!0,A||new ClipboardEvent("paste"))}serializeForClipboard(e){return Em(this,e)}destroy(){this.docView&&(W2(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],_m(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,YP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Y2(this,e)}domSelectionRange(){let e=this.domSelection();return e?an&&this.root.nodeType===11&&ZP(this.dom.ownerDocument)==this.dom&&g4(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}AE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function nE(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",A=>{if(typeof A=="function"&&(A=A(t.state)),A)for(let n in A)n=="class"?e.class+=" "+A[n]:n=="style"?e.style=(e.style?e.style+";":"")+A[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(A[n]))}),e.translate||(e.translate="no"),[un.node(0,t.state.doc.content.size,e)]}function rE(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:un.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function oE(t){return!t.someProp("editable",e=>e(t.state)===!1)}function S4(t,e){let A=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(A)!=e.$anchor.start(A)}function iE(t){let e=Object.create(null);function A(n){for(let r in n)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=n[r])}return t.someProp("nodeViews",A),t.someProp("markViews",A),e}function Q4(t,e){let A=0,n=0;for(let r in t){if(t[r]!=e[r])return!0;A++}for(let r in e)n++;return A!=n}function sE(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var gi={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:"'"},Ru={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},F4=typeof navigator<"u"&&/Mac/.test(navigator.platform),U4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),VA=0;VA<10;VA++)gi[48+VA]=gi[96+VA]=String(VA);for(var VA=1;VA<=24;VA++)gi[VA+111]="F"+VA;for(var VA=65;VA<=90;VA++)gi[VA]=String.fromCharCode(VA+32),Ru[VA]=String.fromCharCode(VA);for(var Lm in gi)Ru.hasOwnProperty(Lm)||(Ru[Lm]=gi[Lm]);function I4(t){var e=F4&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||U4&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",A=!e&&t.key||(t.shiftKey?Ru:gi)[t.keyCode]||t.key||"Unidentified";return A=="Esc"&&(A="Escape"),A=="Del"&&(A="Delete"),A=="Left"&&(A="ArrowLeft"),A=="Up"&&(A="ArrowUp"),A=="Right"&&(A="ArrowRight"),A=="Down"&&(A="ArrowDown"),A}const x4=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),T4=typeof navigator<"u"&&/Win/.test(navigator.platform);function _4(t){let e=t.split(/-(?!$)/),A=e[e.length-1];A=="Space"&&(A=" ");let n,r,o,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))x4?i=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(A="Alt-"+A),r&&(A="Ctrl-"+A),i&&(A="Meta-"+A),o&&(A="Shift-"+A),A}function D4(t){let e=Object.create(null);for(let A in t)e[_4(A)]=t[A];return e}function Om(t,e,A=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),A&&e.shiftKey&&(t="Shift-"+t),t}function L4(t){return new AA({props:{handleKeyDown:aE(t)}})}function aE(t){let e=D4(t);return function(A,n){let r=I4(n),o,i=e[Om(r,n)];if(i&&i(A.state,A.dispatch,A))return!0;if(r.length==1&&r!=" "){if(n.shiftKey){let a=e[Om(r,n,!1)];if(a&&a(A.state,A.dispatch,A))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(T4&&n.ctrlKey&&n.altKey)&&(o=gi[n.keyCode])&&o!=r){let a=e[Om(o,n)];if(a&&a(A.state,A.dispatch,A))return!0}}return!1}}const Mm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function lE(t,e){let{$cursor:A}=t.selection;return!A||(e?!e.endOfTextblock("backward",t):A.parentOffset>0)?null:A}const cE=(t,e,A)=>{let n=lE(t,A);if(!n)return!1;let r=Nm(n);if(!r){let i=n.blockRange(),a=i&&aa(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let o=r.nodeBefore;if(yE(t,r,e,-1))return!0;if(n.parent.content.size==0&&(ya(o,"end")||Pe.isSelectable(o)))for(let i=n.depth;;i--){let a=Uu(t.doc,n.before(i),n.after(i),De.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(ya(o,"end")?nt.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):Pe.create(l.doc,r.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(i==1||n.node(i-1).childCount>1)break}return o.isAtom&&r.depth==n.depth-1?(e&&e(t.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0):!1},O4=(t,e,A)=>{let n=lE(t,A);if(!n)return!1;let r=Nm(n);return r?uE(t,r,e):!1},M4=(t,e,A)=>{let n=fE(t,A);if(!n)return!1;let r=Hm(n);return r?uE(t,r,e):!1};function uE(t,e,A){let n=e.nodeBefore,r=n,o=e.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let i=e.nodeAfter,a=i,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let f=a.firstChild;if(!f)return!1;a=f}let u=Uu(t.doc,o,l,De.empty);if(!u||u.from!=o||u instanceof TA&&u.slice.size>=l-o)return!1;if(A){let f=t.tr.step(u);f.setSelection(Ze.create(f.doc,o)),A(f.scrollIntoView())}return!0}function ya(t,e,A=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(A&&n.childCount!=1)return!1}return!1}const dE=(t,e,A)=>{let{$head:n,empty:r}=t.selection,o=n;if(!r)return!1;if(n.parent.isTextblock){if(A?!A.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=Nm(n)}let i=o&&o.nodeBefore;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)};function Nm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function fE(t,e){let{$cursor:A}=t.selection;return!A||(e?!e.endOfTextblock("forward",t):A.parentOffset<A.parent.content.size)?null:A}const hE=(t,e,A)=>{let n=fE(t,A);if(!n)return!1;let r=Hm(n);if(!r)return!1;let o=r.nodeAfter;if(yE(t,r,e,1))return!0;if(n.parent.content.size==0&&(ya(o,"start")||Pe.isSelectable(o))){let i=Uu(t.doc,n.before(),n.after(),De.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(ya(o,"start")?nt.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):Pe.create(a.doc,a.mapping.map(r.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&r.depth==n.depth-1?(e&&e(t.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0):!1},pE=(t,e,A)=>{let{$head:n,empty:r}=t.selection,o=n;if(!r)return!1;if(n.parent.isTextblock){if(A?!A.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=Hm(n)}let i=o&&o.nodeAfter;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function Hm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let A=t.node(e);if(t.index(e)+1<A.childCount)return t.doc.resolve(t.after(e+1));if(A.type.spec.isolating)break}return null}const N4=(t,e)=>{let A=t.selection,n=A instanceof Pe,r;if(n){if(A.node.isTextblock||!ai(t.doc,A.from))return!1;r=A.from}else if(r=Fu(t.doc,A.from,-1),r==null)return!1;if(e){let o=t.tr.join(r);n&&o.setSelection(Pe.create(o.doc,r-t.doc.resolve(r).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},H4=(t,e)=>{let A=t.selection,n;if(A instanceof Pe){if(A.node.isTextblock||!ai(t.doc,A.to))return!1;n=A.to}else if(n=Fu(t.doc,A.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},R4=(t,e)=>{let{$from:A,$to:n}=t.selection,r=A.blockRange(n),o=r&&aa(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},mE=(t,e)=>{let{$head:A,$anchor:n}=t.selection;return!A.parent.type.spec.code||!A.sameParent(n)?!1:(e&&e(t.tr.insertText(`
34
+ `).scrollIntoView()),!0)};function Rm(t){for(let e=0;e<t.edgeCount;e++){let{type:A}=t.edge(e);if(A.isTextblock&&!A.hasRequiredAttrs())return A}return null}const P4=(t,e)=>{let{$head:A,$anchor:n}=t.selection;if(!A.parent.type.spec.code||!A.sameParent(n))return!1;let r=A.node(-1),o=A.indexAfter(-1),i=Rm(r.contentMatchAt(o));if(!i||!r.canReplaceWith(o,o,i))return!1;if(e){let a=A.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(nt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},gE=(t,e)=>{let A=t.selection,{$from:n,$to:r}=A;if(A instanceof On||n.parent.inlineContent||r.parent.inlineContent)return!1;let o=Rm(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let i=(!n.parentOffset&&r.index()<r.parent.childCount?n:r).pos,a=t.tr.insert(i,o.createAndFill());a.setSelection(Ze.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},BE=(t,e)=>{let{$cursor:A}=t.selection;if(!A||A.parent.content.size)return!1;if(A.depth>1&&A.after()!=A.end(-1)){let o=A.before();if(vo(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=A.blockRange(),r=n&&aa(n);return r==null?!1:(e&&e(t.tr.lift(n,r).scrollIntoView()),!0)};function V4(t){return(e,A)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Pe&&e.selection.node.isBlock)return!n.parentOffset||!vo(e.doc,n.pos)?!1:(A&&A(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,a,l=!1,u=!1;for(let g=n.depth;;g--)if(n.node(g).isBlock){l=n.end(g)==n.pos+(n.depth-g),u=n.start(g)==n.pos-(n.depth-g),a=Rm(n.node(g-1).contentMatchAt(n.indexAfter(g-1))),o.unshift(l&&a?{type:a}:null),i=g;break}else{if(g==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof Ze||e.selection instanceof On)&&f.deleteSelection();let h=f.mapping.map(n.pos),p=vo(f.doc,h,o.length,o);if(p||(o[0]=a?{type:a}:null,p=vo(f.doc,h,o.length,o)),!p)return!1;if(f.split(h,o.length,o),!l&&u&&n.node(i).type!=a){let g=f.mapping.map(n.before(i)),B=f.doc.resolve(g);a&&n.node(i-1).canReplaceWith(B.index(),B.index()+1,a)&&f.setNodeMarkup(f.mapping.map(n.before(i)),a)}return A&&A(f.scrollIntoView()),!0}}const $4=V4(),K4=(t,e)=>{let{$from:A,to:n}=t.selection,r,o=A.sharedDepth(n);return o==0?!1:(r=A.before(o),e&&e(t.tr.setSelection(Pe.create(t.doc,r))),!0)};function G4(t,e,A){let n=e.nodeBefore,r=e.nodeAfter,o=e.index();return!n||!r||!n.type.compatibleContent(r.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(A&&A(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(r.isTextblock||ai(t.doc,e.pos))?!1:(A&&A(t.tr.join(e.pos).scrollIntoView()),!0)}function yE(t,e,A,n){let r=e.nodeBefore,o=e.nodeAfter,i,a,l=r.type.spec.isolating||o.type.spec.isolating;if(!l&&G4(t,e,A))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(a=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&a.matchType(i[0]||o.type).validEnd){if(A){let g=e.pos+o.nodeSize,B=we.empty;for(let w=i.length-1;w>=0;w--)B=we.from(i[w].create(null,B));B=we.from(r.copy(B));let y=t.tr.step(new _A(e.pos-1,g,e.pos,g,new De(B,1,0),i.length,!0)),b=y.doc.resolve(g+2*i.length);b.nodeAfter&&b.nodeAfter.type==r.type&&ai(y.doc,b.pos)&&y.join(b.pos),A(y.scrollIntoView())}return!0}let f=o.type.spec.isolating||n>0&&l?null:nt.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),p=h&&aa(h);if(p!=null&&p>=e.depth)return A&&A(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&ya(o,"start",!0)&&ya(r,"end")){let g=r,B=[];for(;B.push(g),!g.isTextblock;)g=g.lastChild;let y=o,b=1;for(;!y.isTextblock;y=y.firstChild)b++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(A){let w=we.empty;for(let S=B.length-1;S>=0;S--)w=we.from(B[S].copy(w));let v=t.tr.step(new _A(e.pos-B.length,e.pos+o.nodeSize,e.pos+b,e.pos+o.nodeSize-b,new De(w,B.length,0),0,!0));A(v.scrollIntoView())}return!0}}return!1}function wE(t){return function(e,A){let n=e.selection,r=t<0?n.$from:n.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return r.node(o).isTextblock?(A&&A(e.tr.setSelection(Ze.create(e.doc,t<0?r.start(o):r.end(o)))),!0):!1}}const W4=wE(-1),z4=wE(1);function Y4(t,e=null){return function(A,n){let{$from:r,$to:o}=A.selection,i=r.blockRange(o),a=i&&rm(i,t,e);return a?(n&&n(A.tr.wrap(i,a).scrollIntoView()),!0):!1}}function CE(t,e=null){return function(A,n){let r=!1;for(let o=0;o<A.selection.ranges.length&&!r;o++){let{$from:{pos:i},$to:{pos:a}}=A.selection.ranges[o];A.doc.nodesBetween(i,a,(l,u)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)r=!0;else{let f=A.doc.resolve(u),h=f.index();r=f.parent.canReplaceWith(h,h+1,t)}})}if(!r)return!1;if(n){let o=A.tr;for(let i=0;i<A.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=A.selection.ranges[i];o.setBlockType(a,l,t,e)}n(o.scrollIntoView())}return!0}}function Pm(...t){return function(e,A,n){for(let r=0;r<t.length;r++)if(t[r](e,A,n))return!0;return!1}}Pm(Mm,cE,dE),Pm(Mm,hE,pE),Pm(mE,gE,BE,$4),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function J4(t,e=null){return function(A,n){let{$from:r,$to:o}=A.selection,i=r.blockRange(o);if(!i)return!1;let a=n?A.tr:null;return X4(a,i,t,e)?(n&&n(a.scrollIntoView()),!0):!1}}function X4(t,e,A,n=null){let r=!1,o=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(A)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=i.resolve(e.start-2);o=new bu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new bu(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let a=rm(o,A,n,e);return a?(t&&j4(t,e,a,r,A),!0):!1}function j4(t,e,A,n,r){let o=we.empty;for(let f=A.length-1;f>=0;f--)o=we.from(A[f].type.create(A[f].attrs,o));t.step(new _A(e.start-(n?2:0),e.end,e.start,e.end,new De(o,0,0),A.length,!0));let i=0;for(let f=0;f<A.length;f++)A[f].type==r&&(i=f+1);let a=A.length-i,l=e.start+A.length-(n?2:0),u=e.parent;for(let f=e.startIndex,h=e.endIndex,p=!0;f<h;f++,p=!1)!p&&vo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(f).nodeSize;return t}function q4(t){return function(e,A){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,i=>i.childCount>0&&i.firstChild.type==t);return o?A?n.node(o.depth-1).type==t?Z4(e,A,t,o):eV(e,A,o):!0:!1}}function Z4(t,e,A,n){let r=t.tr,o=n.end,i=n.$to.end(n.depth);o<i&&(r.step(new _A(o-1,i,o,i,new De(we.from(A.create(null,n.parent.copy())),1,0),1,!0)),n=new bu(r.doc.resolve(n.$from.pos),r.doc.resolve(i),n.depth));const a=aa(n);if(a==null)return!1;r.lift(n,a);let l=r.doc.resolve(r.mapping.map(o,-1)-1);return ai(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),e(r.scrollIntoView()),!0}function eV(t,e,A){let n=t.tr,r=A.parent;for(let g=A.end,B=A.endIndex-1,y=A.startIndex;B>y;B--)g-=r.child(B).nodeSize,n.delete(g-1,g+1);let o=n.doc.resolve(A.start),i=o.nodeAfter;if(n.mapping.map(A.end)!=A.start+o.nodeAfter.nodeSize)return!1;let a=A.startIndex==0,l=A.endIndex==r.childCount,u=o.node(-1),f=o.index(-1);if(!u.canReplace(f+(a?0:1),f+1,i.content.append(l?we.empty:we.from(r))))return!1;let h=o.pos,p=h+i.nodeSize;return n.step(new _A(h-(a?1:0),p+(l?1:0),h+1,p-1,new De((a?we.empty:we.from(r.copy(we.empty))).append(l?we.empty:we.from(r.copy(we.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function tV(t){return function(e,A){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let i=o.startIndex;if(i==0)return!1;let a=o.parent,l=a.child(i-1);if(l.type!=t)return!1;if(A){let u=l.lastChild&&l.lastChild.type==a.type,f=we.from(u?t.create():null),h=new De(we.from(t.create(null,we.from(a.type.create(null,f)))),u?3:1,0),p=o.start,g=o.end;A(e.tr.step(new _A(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}var AV=Object.defineProperty,bE=(t,e)=>{for(var A in e)AV(t,A,{get:e[A],enumerable:!0})};function Pu(t){const{state:e,transaction:A}=t;let{selection:n}=A,{doc:r}=A,{storedMarks:o}=A;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 o},get selection(){return n},get doc(){return r},get tr(){return n=A.selection,r=A.doc,o=A.storedMarks,A}}}var Vu=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:A}=this,{view:n}=e,{tr:r}=A,o=this.buildProps(r);return Object.fromEntries(Object.entries(t).map(([i,a])=>[i,(...u)=>{const f=a(...u)(o);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(r),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:A,editor:n,state:r}=this,{view:o}=n,i=[],a=!!t,l=t||r.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),i.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(A).map(([h,p])=>[h,(...B)=>{const y=this.buildProps(l,e),b=p(...B)(y);return i.push(b),f}])),run:u};return f}createCan(t){const{rawCommands:e,state:A}=this,n=!1,r=t||A.tr,o=this.buildProps(r,n);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,n)}}buildProps(t,e=!0){const{rawCommands:A,editor:n,state:r}=this,{view:o}=n,i={tr:t,editor:n,view:o,state:Pu({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(A).map(([a,l])=>[a,(...u)=>l(...u)(i)]))}};return i}},nV=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const A=this.callbacks[t];return A&&A.forEach(n=>n.apply(this,e)),this}off(t,e){const A=this.callbacks[t];return A&&(e?this.callbacks[t]=A.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){const A=(...n)=>{this.off(t,A),e.apply(this,n)};return this.on(t,A)}removeAllListeners(){this.callbacks={}}};function vE(t,e){const A=new Rb(t);return e.forEach(n=>{n.steps.forEach(r=>{A.step(r)})}),A}var EE=t=>{const e=t.childNodes;for(let A=e.length-1;A>=0;A-=1){const n=e[A];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&EE(n)}return t};function $u(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,A=new window.DOMParser().parseFromString(e,"text/html").body;return EE(A)}function $l(t,e,A){if(t instanceof ri||t instanceof we)return t;A={slice:!0,parseOptions:{},...A};const n=typeof t=="object"&&t!==null,r=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return we.fromArray(t.map(a=>e.nodeFromJSON(a)));const i=e.nodeFromJSON(t);return A.errorOnInvalidContent&&i.check(),i}catch(o){if(A.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),$l("",e,A)}if(r){if(A.errorOnInvalidContent){let i=!1,a="";const l=new pb({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:u=>(i=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(A.slice?oi.fromSchema(l).parseSlice($u(t),A.parseOptions):oi.fromSchema(l).parse($u(t),A.parseOptions),A.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=oi.fromSchema(e);return A.slice?o.parseSlice($u(t),A.parseOptions).content:o.parse($u(t),A.parseOptions)}return $l("",e,A)}function Vm(t,e,A={},n={}){return $l(t,e,{slice:!1,parseOptions:A,errorOnInvalidContent:n.errorOnInvalidContent})}function rV(t){for(let e=0;e<t.edgeCount;e+=1){const{type:A}=t.edge(e);if(A.isTextblock&&!A.hasRequiredAttrs())return A}return null}function oV(t,e,A){const n=[];return t.nodesBetween(e.from,e.to,(r,o)=>{A(r)&&n.push({node:r,pos:o})}),n}function iV(t,e){for(let A=t.depth;A>0;A-=1){const n=t.node(A);if(e(n))return{pos:A>0?t.before(A):0,start:t.start(A),depth:A,node:n}}}function Ku(t){return e=>iV(e.$from,t)}function Re(t,e,A){return t.config[e]===void 0&&t.parent?Re(t.parent,e,A):typeof t.config[e]=="function"?t.config[e].bind({...A,parent:t.parent?Re(t.parent,e,A):null}):t.config[e]}function $m(t){return t.map(e=>{const A={name:e.name,options:e.options,storage:e.storage},n=Re(e,"addExtensions",A);return n?[e,...$m(n())]:e}).flat(10)}function Km(t,e){const A=ss.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(A),r.innerHTML}function kE(t){return typeof t=="function"}function Ut(t,e=void 0,...A){return kE(t)?e?t.bind(e)(...A):t(...A):t}function sV(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Kl(t){const e=t.filter(r=>r.type==="extension"),A=t.filter(r=>r.type==="node"),n=t.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:A,markExtensions:n}}function SE(t){const e=[],{nodeExtensions:A,markExtensions:n}=Kl(t),r=[...A,...n],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:r},l=Re(i,"addGlobalAttributes",a);if(!l)return;l().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([p,g])=>{e.push({type:h,name:p,attribute:{...o,...g}})})})})}),r.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Re(i,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([f,h])=>{const p={...o,...h};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:i.name,name:f,attribute:p})})}),e}function zt(...t){return t.filter(e=>!!e).reduce((e,A)=>{const n={...e};return Object.entries(A).forEach(([r,o])=>{if(!n[r]){n[r]=o;return}if(r==="class"){const a=o?String(o).split(" "):[],l=n[r]?n[r].split(" "):[],u=a.filter(f=>!l.includes(f));n[r]=[...l,...u].join(" ")}else if(r==="style"){const a=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],l=n[r]?n[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;l.forEach(f=>{const[h,p]=f.split(":").map(g=>g.trim());u.set(h,p)}),a.forEach(f=>{const[h,p]=f.split(":").map(g=>g.trim());u.set(h,p)}),n[r]=Array.from(u.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else n[r]=o}),n},{})}function Gu(t,e){return e.filter(A=>A.type===t.type.name).filter(A=>A.attribute.rendered).map(A=>A.attribute.renderHTML?A.attribute.renderHTML(t.attrs)||{}:{[A.name]:t.attrs[A.name]}).reduce((A,n)=>zt(A,n),{})}function aV(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function QE(t,e){return"style"in t?t:{...t,getAttrs:A=>{const n=t.getAttrs?t.getAttrs(A):t.attrs;if(n===!1)return!1;const r=e.reduce((o,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(A):aV(A.getAttribute(i.name));return a==null?o:{...o,[i.name]:a}},{});return{...n,...r}}}}function FE(t){return Object.fromEntries(Object.entries(t).filter(([e,A])=>e==="attrs"&&sV(A)?!1:A!=null))}function lV(t,e){var A;const n=SE(t),{nodeExtensions:r,markExtensions:o}=Kl(t),i=(A=r.find(u=>Re(u,"topNode")))==null?void 0:A.name,a=Object.fromEntries(r.map(u=>{const f=n.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,v)=>{const S=Re(v,"extendNodeSchema",h);return{...w,...S?S(u):{}}},{}),g=FE({...p,content:Ut(Re(u,"content",h)),marks:Ut(Re(u,"marks",h)),group:Ut(Re(u,"group",h)),inline:Ut(Re(u,"inline",h)),atom:Ut(Re(u,"atom",h)),selectable:Ut(Re(u,"selectable",h)),draggable:Ut(Re(u,"draggable",h)),code:Ut(Re(u,"code",h)),whitespace:Ut(Re(u,"whitespace",h)),linebreakReplacement:Ut(Re(u,"linebreakReplacement",h)),defining:Ut(Re(u,"defining",h)),isolating:Ut(Re(u,"isolating",h)),attrs:Object.fromEntries(f.map(w=>{var v,S;return[w.name,{default:(v=w?.attribute)==null?void 0:v.default,validate:(S=w?.attribute)==null?void 0:S.validate}]}))}),B=Ut(Re(u,"parseHTML",h));B&&(g.parseDOM=B.map(w=>QE(w,f)));const y=Re(u,"renderHTML",h);y&&(g.toDOM=w=>y({node:w,HTMLAttributes:Gu(w,f)}));const b=Re(u,"renderText",h);return b&&(g.toText=b),[u.name,g]})),l=Object.fromEntries(o.map(u=>{const f=n.filter(b=>b.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((b,w)=>{const v=Re(w,"extendMarkSchema",h);return{...b,...v?v(u):{}}},{}),g=FE({...p,inclusive:Ut(Re(u,"inclusive",h)),excludes:Ut(Re(u,"excludes",h)),group:Ut(Re(u,"group",h)),spanning:Ut(Re(u,"spanning",h)),code:Ut(Re(u,"code",h)),attrs:Object.fromEntries(f.map(b=>{var w,v;return[b.name,{default:(w=b?.attribute)==null?void 0:w.default,validate:(v=b?.attribute)==null?void 0:v.validate}]}))}),B=Ut(Re(u,"parseHTML",h));B&&(g.parseDOM=B.map(b=>QE(b,f)));const y=Re(u,"renderHTML",h);return y&&(g.toDOM=b=>y({mark:b,HTMLAttributes:Gu(b,f)})),[u.name,g]}));return new pb({topNode:i,nodes:a,marks:l})}function cV(t){const e=t.filter((A,n)=>t.indexOf(A)!==n);return Array.from(new Set(e))}function Gm(t){return t.sort((A,n)=>{const r=Re(A,"priority")||100,o=Re(n,"priority")||100;return r>o?-1:r<o?1:0})}function UE(t){const e=Gm($m(t)),A=cV(e.map(n=>n.name));return A.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${A.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function IE(t,e,A){const{from:n,to:r}=e,{blockSeparator:o=`
35
35
 
36
- `,textSerializers:i={}}=A||{};let a="";return t.nodesBetween(n,r,(l,u,f,h)=>{var p;l.isBlock&&u>n&&(a+=o);const g=i?.[l.type.name];if(g)return f&&(a+=g({node:l,pos:u,parent:f,index:h,range:e})),!1;l.isText&&(a+=(p=l?.text)==null?void 0:p.slice(Math.max(n,u)-u,r-u))}),a}function uV(t,e){const A={from:0,to:t.content.size};return IE(t,A,e)}function xE(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,A])=>[e,A.spec.toText]))}function Fo(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function TE(t,e){const A=Fo(e,t.schema),{from:n,to:r,empty:o}=t.selection,i=[];o?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,r,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===A.name);return a?{...a.attrs}:{}}function wA(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function dV(t,e){const A=wA(e,t.schema),{from:n,to:r}=t.selection,o=[];t.doc.nodesBetween(n,r,a=>{o.push(a)});const i=o.reverse().find(a=>a.type.name===A.name);return i?{...i.attrs}:{}}function Wu(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _E(t,e){const A=Wu(typeof e=="string"?e:e.name,t.schema);return A==="node"?dV(t,e):A==="mark"?TE(t,e):{}}function fV(t,e=JSON.stringify){const A={};return t.filter(n=>{const r=e(n);return Object.prototype.hasOwnProperty.call(A,r)?!1:A[r]=!0})}function hV(t){const e=fV(t);return e.length===1?e:e.filter((A,n)=>!e.filter((o,i)=>i!==n).some(o=>A.oldRange.from>=o.oldRange.from&&A.oldRange.to<=o.oldRange.to&&A.newRange.from>=o.newRange.from&&A.newRange.to<=o.newRange.to))}function DE(t){const{mapping:e,steps:A}=t,n=[];return e.maps.forEach((r,o)=>{const i=[];if(r.ranges.length)r.forEach((a,l)=>{i.push({from:a,to:l})});else{const{from:a,to:l}=A[o];if(a===void 0||l===void 0)return;i.push({from:a,to:l})}i.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),f=e.slice(o).map(l),h=e.invert().map(u,-1),p=e.invert().map(f);n.push({oldRange:{from:h,to:p},newRange:{from:u,to:f}})})}),hV(n)}function Wm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function zu(t,e,A={strict:!0}){const n=Object.keys(e);return n.length?n.every(r=>A.strict?e[r]===t[r]:Wm(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function LE(t,e,A={}){return t.find(n=>n.type===e&&zu(Object.fromEntries(Object.keys(A).map(r=>[r,n.attrs[r]])),A))}function OE(t,e,A={}){return!!LE(t,e,A)}function zm(t,e,A){var n;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===e)||(A=A||((n=r.node.marks[0])==null?void 0:n.attrs),!LE([...r.node.marks],e,A)))return;let i=r.index,a=t.start()+r.offset,l=i+1,u=a+r.node.nodeSize;for(;i>0&&OE([...t.parent.child(i-1).marks],e,A);)i-=1,a-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&OE([...t.parent.child(l).marks],e,A);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function Ym(t,e,A){const n=[];return t===e?A.resolve(t).marks().forEach(r=>{const o=A.resolve(t),i=zm(o,r.type);i&&n.push({mark:r,...i})}):A.nodesBetween(t,e,(r,o)=>{!r||r?.nodeSize===void 0||n.push(...r.marks.map(i=>({from:o,to:o+r.nodeSize,mark:i})))}),n}var pV=(t,e,A,n=20)=>{const r=t.doc.resolve(A);let o=n,i=null;for(;o>0&&i===null;){const a=r.node(o);a?.type.name===e?i=a:o-=1}return[i,o]};function Jm(t,e){return e.nodes[t]||e.marks[t]||null}function Yu(t,e,A){return Object.fromEntries(Object.entries(A).filter(([n])=>{const r=t.find(o=>o.type===e&&o.name===n);return r?r.attribute.keepOnSplit:!1}))}var mV=(t,e=500)=>{let A="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(r,o,i,a)=>{var l,u;const f=((u=(l=r.type.spec).toText)==null?void 0:u.call(l,{node:r,pos:o,parent:i,index:a}))||r.textContent||"%leaf%";A+=r.isAtom&&!r.isText?f:f.slice(0,Math.max(0,n-o))}),A};function Xm(t,e,A={}){const{empty:n,ranges:r}=t.selection,o=e?Fo(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>zu(h.attrs,A,{strict:!1}));let i=0;const a=[];if(r.forEach(({$from:h,$to:p})=>{const g=h.pos,B=p.pos;t.doc.nodesBetween(g,B,(y,b)=>{if(!y.isText&&!y.marks.length)return;const w=Math.max(g,b),v=Math.min(B,b+y.nodeSize),S=v-w;i+=S,a.push(...y.marks.map(F=>({mark:F,from:w,to:v})))})}),i===0)return!1;const l=a.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>zu(h.mark.attrs,A,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,p)=>h+p.to-p.from,0);return(l>0?l+u:l)>=i}function Bi(t,e,A={}){const{from:n,to:r,empty:o}=t.selection,i=e?wA(e,t.schema):null,a=[];t.doc.nodesBetween(n,r,(h,p)=>{if(h.isText)return;const g=Math.max(n,p),B=Math.min(r,p+h.nodeSize);a.push({node:h,from:g,to:B})});const l=r-n,u=a.filter(h=>i?i.name===h.node.type.name:!0).filter(h=>zu(h.node.attrs,A,{strict:!1}));return o?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}function gV(t,e,A={}){if(!e)return Bi(t,null,A)||Xm(t,null,A);const n=Wu(e,t.schema);return n==="node"?Bi(t,e,A):n==="mark"?Xm(t,e,A):!1}var BV=(t,e)=>{const{$from:A,$to:n,$anchor:r}=t.selection;if(e){const o=Ku(a=>a.type.name===e)(t.selection);if(!o)return!1;const i=t.doc.resolve(o.pos+1);return r.pos+1===i.end()}return!(n.parentOffset<n.parent.nodeSize-2||A.pos!==n.pos)},yV=t=>{const{$from:e,$to:A}=t.selection;return!(e.parentOffset>0||e.pos!==A.pos)};function ME(t,e){return Array.isArray(e)?e.some(A=>(typeof A=="string"?A:A.name)===t.name):e}function NE(t,e){const{nodeExtensions:A}=Kl(e),n=A.find(i=>i.name===t);if(!n)return!1;const r={name:n.name,options:n.options,storage:n.storage},o=Ut(Re(n,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")}function Ju(t,{checkChildren:e=!0,ignoreWhitespace:A=!1}={}){var n;if(A){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!=null?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(o=>{r!==!1&&(Ju(o,{ignoreWhitespace:A,checkChildren:e})||(r=!1))}),r}return!1}function HE(t){return t instanceof Pe}function RE(t){return t instanceof Ze}function ms(t=0,e=0,A=0){return Math.min(Math.max(t,e),A)}function PE(t,e=null){if(!e)return null;const A=nt.atStart(t),n=nt.atEnd(t);if(e==="start"||e===!0)return A;if(e==="end")return n;const r=A.from,o=n.to;return e==="all"?Ze.create(t,ms(0,r,o),ms(t.content.size,r,o)):Ze.create(t,ms(e,r,o),ms(e,r,o))}function wV(t,e,A){const n=t.steps.length-1;if(n<e)return;const r=t.steps[n];if(!(r instanceof TA||r instanceof _A))return;const o=t.mapping.maps[n];let i=0;o.forEach((a,l,u,f)=>{i===0&&(i=f)}),t.setSelection(nt.near(t.doc.resolve(i),A))}var Xu=class{constructor(t){this.find=t.find,this.handler=t.handler}},CV=(t,e)=>{if(Wm(e))return e.exec(t);const A=e(t);if(!A)return null;const n=[A.text];return n.index=A.index,n.input=t,n.data=A.data,A.replaceWith&&(A.text.includes(A.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(A.replaceWith)),n};function ju(t){var e;const{editor:A,from:n,to:r,text:o,rules:i,plugin:a}=t,{view:l}=A;if(l.composing)return!1;const u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let f=!1;const h=mV(u)+o;return i.forEach(p=>{if(f)return;const g=CV(h,p.find);if(!g)return;const B=l.state.tr,y=Pu({state:l.state,transaction:B}),b={from:n-(g[0].length-o.length),to:r},{commands:w,chain:v,can:S}=new Vu({editor:A,state:y});p.handler({state:y,range:b,match:g,commands:w,chain:v,can:S})===null||!B.steps.length||(B.setMeta(a,{transform:B,from:n,to:r,text:o}),l.dispatch(B),f=!0)}),f}function bV(t){const{editor:e,rules:A}=t,n=new tA({state:{init(){return null},apply(r,o,i){const a=r.getMeta(n);if(a)return a;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:f}=l;typeof f=="string"?f=f:f=Km(we.from(f),i.schema);const{from:h}=l,p=h+f.length;ju({editor:e,from:h,to:p,text:f,rules:A,plugin:n})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,i,a){return ju({editor:e,from:o,to:i,text:a,rules:A,plugin:n})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:o}=r.state.selection;o&&ju({editor:e,from:o.pos,to:o.pos,text:"",rules:A,plugin:n})}),!1)},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?ju({editor:e,from:i.pos,to:i.pos,text:`
37
- `,rules:A,plugin:n}):!1}},isInputRules:!0});return n}function vV(t){return Object.prototype.toString.call(t).slice(8,-1)}function qu(t){return vV(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function VE(t,e){const A={...t};return qu(t)&&qu(e)&&Object.keys(e).forEach(n=>{qu(e[n])&&qu(t[n])?A[n]=VE(t[n],e[n]):A[n]=e[n]}),A}var jm=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Ut(Re(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Ut(Re(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>VE(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},yi=class h_ extends jm{constructor(){super(...arguments),this.type="mark"}static create(e={}){const A=typeof e=="function"?e():e;return new h_(A)}static handleExit({editor:e,mark:A}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find(u=>u?.type.name===A.name))return!1;const l=i.find(u=>u?.type.name===A.name);return l&&n.removeStoredMark(l),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}};function EV(t){return typeof t=="number"}var kV=class{constructor(t){this.find=t.find,this.handler=t.handler}},SV=(t,e,A)=>{if(Wm(e))return[...t.matchAll(e)];const n=e(t,A);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function QV(t){const{editor:e,state:A,from:n,to:r,rule:o,pasteEvent:i,dropEvent:a}=t,{commands:l,chain:u,can:f}=new Vu({editor:e,state:A}),h=[];return A.doc.nodesBetween(n,r,(g,B)=>{if(!g.isTextblock||g.type.spec.code)return;const y=Math.max(n,B),b=Math.min(r,B+g.content.size),w=g.textBetween(y-B,b-B,void 0,"");SV(w,o.find,i).forEach(S=>{if(S.index===void 0)return;const F=y+S.index+1,I=F+S[0].length,Q={from:A.tr.mapping.map(F),to:A.tr.mapping.map(I)},x=o.handler({state:A,range:Q,match:S,commands:l,chain:u,can:f,pasteEvent:i,dropEvent:a});h.push(x)})}),h.every(g=>g!==null)}var Zu=null,FV=t=>{var e;const A=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=A.clipboardData)==null||e.setData("text/html",t),A};function UV(t){const{editor:e,rules:A}=t;let n=null,r=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:f,from:h,to:p,rule:g,pasteEvt:B})=>{const y=f.tr,b=Pu({state:f,transaction:y});if(!(!QV({editor:e,state:b,from:Math.max(h-1,0),to:p.b-1,rule:g,pasteEvent:B,dropEvent:a})||!y.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return A.map(f=>new tA({view(h){const p=B=>{var y;n=(y=h.dom.parentElement)!=null&&y.contains(B.target)?h.dom.parentElement:null,n&&(Zu=e)},g=()=>{Zu&&(Zu=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(o=n===h.dom.parentElement,a=p,!o){const g=Zu;g?.isEditable&&setTimeout(()=>{const B=g.state.selection;B&&g.commands.deleteRange({from:B.from,to:B.to})},10)}return!1},paste:(h,p)=>{var g;const B=(g=p.clipboardData)==null?void 0:g.getData("text/html");return i=p,r=!!B?.includes("data-pm-slice"),!1}}},appendTransaction:(h,p,g)=>{const B=h[0],y=B.getMeta("uiEvent")==="paste"&&!r,b=B.getMeta("uiEvent")==="drop"&&!o,w=B.getMeta("applyPasteRules"),v=!!w;if(!y&&!b&&!v)return;if(v){let{text:I}=w;typeof I=="string"?I=I:I=Km(we.from(I),g.schema);const{from:Q}=w,x=Q+I.length,M=FV(I);return l({rule:f,state:g,from:Q,to:{b:x},pasteEvt:M})}const S=p.doc.content.findDiffStart(g.doc.content),F=p.doc.content.findDiffEnd(g.doc.content);if(!(!EV(S)||!F||S===F.b))return l({rule:f,state:g,from:S,to:F,pasteEvt:i})}}))}var ed=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=UE(t),this.schema=lV(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const A={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Jm(e.name,this.schema)},n=Re(e,"addCommands",A);return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=Gm([...this.extensions].reverse()),A=[],n=[],r=e.map(o=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Jm(o.name,this.schema)},a=[],l=Re(o,"addKeyboardShortcuts",i);let u={};if(o.type==="mark"&&Re(o,"exitable",i)&&(u.ArrowRight=()=>yi.handleExit({editor:t,mark:o})),l){const B=Object.fromEntries(Object.entries(l()).map(([y,b])=>[y,()=>b({editor:t})]));u={...u,...B}}const f=L4(u);a.push(f);const h=Re(o,"addInputRules",i);ME(o,t.options.enableInputRules)&&h&&A.push(...h());const p=Re(o,"addPasteRules",i);ME(o,t.options.enablePasteRules)&&p&&n.push(...p());const g=Re(o,"addProseMirrorPlugins",i);if(g){const B=g();a.push(...B)}return a}).flat();return[bV({editor:t,rules:A}),...UV({editor:t,rules:n}),...r]}get attributes(){return SE(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Kl(this.extensions);return Object.fromEntries(e.filter(A=>!!Re(A,"addNodeView")).map(A=>{const n=this.attributes.filter(a=>a.type===A.name),r={name:A.name,options:A.options,storage:this.editor.extensionStorage[A.name],editor:t,type:wA(A.name,this.schema)},o=Re(A,"addNodeView",r);if(!o)return[];const i=(a,l,u,f,h)=>{const p=Gu(a,n);return o()({node:a,view:l,getPos:u,decorations:f,innerDecorations:h,editor:t,extension:A,HTMLAttributes:p})};return[A.name,i]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Kl(this.extensions);return Object.fromEntries(e.filter(A=>!!Re(A,"addMarkView")).map(A=>{const n=this.attributes.filter(a=>a.type===A.name),r={name:A.name,options:A.options,storage:this.editor.extensionStorage[A.name],editor:t,type:Fo(A.name,this.schema)},o=Re(A,"addMarkView",r);if(!o)return[];const i=(a,l,u)=>{const f=Gu(a,n);return o()({mark:a,view:l,inline:u,editor:t,extension:A,HTMLAttributes:f,updateAttributes:h=>{G$(a,t,h)}})};return[A.name,i]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var A;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Jm(e.name,this.schema)};e.type==="mark"&&((A=Ut(Re(e,"keepOnSplit",n)))==null||A)&&this.splittableMarks.push(e.name);const r=Re(e,"onBeforeCreate",n),o=Re(e,"onCreate",n),i=Re(e,"onUpdate",n),a=Re(e,"onSelectionUpdate",n),l=Re(e,"onTransaction",n),u=Re(e,"onFocus",n),f=Re(e,"onBlur",n),h=Re(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};ed.resolve=UE,ed.sort=Gm,ed.flatten=$m;var IV={};bE(IV,{ClipboardTextSerializer:()=>$E,Commands:()=>YE,Delete:()=>JE,Drop:()=>XE,Editable:()=>jE,FocusEvents:()=>ZE,Keymap:()=>e1,Paste:()=>t1,Tabindex:()=>A1,focusEventsPluginKey:()=>qE});var dA=class p_ extends jm{constructor(){super(...arguments),this.type="extension"}static create(e={}){const A=typeof e=="function"?e():e;return new p_(A)}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}},$E=dA.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new tA({key:new DA("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:A}=t,{doc:n,selection:r}=e,{ranges:o}=r,i=Math.min(...o.map(f=>f.$from.pos)),a=Math.max(...o.map(f=>f.$to.pos)),l=xE(A);return IE(n,{from:i,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),KE={};bE(KE,{blur:()=>xV,clearContent:()=>TV,clearNodes:()=>_V,command:()=>DV,createParagraphNear:()=>LV,cut:()=>OV,deleteCurrentNode:()=>MV,deleteNode:()=>NV,deleteRange:()=>HV,deleteSelection:()=>RV,enter:()=>PV,exitCode:()=>VV,extendMarkRange:()=>$V,first:()=>KV,focus:()=>WV,forEach:()=>zV,insertContent:()=>YV,insertContentAt:()=>XV,joinBackward:()=>ZV,joinDown:()=>qV,joinForward:()=>e$,joinItemBackward:()=>t$,joinItemForward:()=>A$,joinTextblockBackward:()=>n$,joinTextblockForward:()=>r$,joinUp:()=>jV,keyboardShortcut:()=>i$,lift:()=>s$,liftEmptyBlock:()=>a$,liftListItem:()=>l$,newlineInCode:()=>c$,resetAttributes:()=>u$,scrollIntoView:()=>d$,selectAll:()=>f$,selectNodeBackward:()=>h$,selectNodeForward:()=>p$,selectParentNode:()=>m$,selectTextblockEnd:()=>g$,selectTextblockStart:()=>B$,setContent:()=>y$,setMark:()=>C$,setMeta:()=>b$,setNode:()=>v$,setNodeSelection:()=>E$,setTextSelection:()=>k$,sinkListItem:()=>S$,splitBlock:()=>Q$,splitListItem:()=>F$,toggleList:()=>U$,toggleMark:()=>I$,toggleNode:()=>x$,toggleWrap:()=>T$,undoInputRule:()=>_$,unsetAllMarks:()=>D$,unsetMark:()=>L$,updateAttributes:()=>O$,wrapIn:()=>M$,wrapInList:()=>N$});var xV=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var A;t.isDestroyed||(e.dom.blur(),(A=window?.getSelection())==null||A.removeAllRanges())}),!0),TV=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),_V=()=>({state:t,tr:e,dispatch:A})=>{const{selection:n}=e,{ranges:r}=n;return A&&r.forEach(({$from:o,$to:i})=>{t.doc.nodesBetween(o.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:f}=e,h=u.resolve(f.map(l)),p=u.resolve(f.map(l+a.nodeSize)),g=h.blockRange(p);if(!g)return;const B=aa(g);if(a.type.isTextblock){const{defaultType:y}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,y)}(B||B===0)&&e.lift(g,B)})}),!0},DV=t=>e=>t(e),LV=()=>({state:t,dispatch:e})=>gE(t,e),OV=(t,e)=>({editor:A,tr:n})=>{const{state:r}=A,o=r.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const i=n.mapping.map(e);return n.insert(i,o.content),n.setSelection(new Ze(n.doc.resolve(Math.max(i-1,0)))),!0},MV=()=>({tr:t,dispatch:e})=>{const{selection:A}=t,n=A.$anchor.node();if(n.content.size>0)return!1;const r=t.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===n.type){if(e){const a=r.before(o),l=r.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},NV=t=>({tr:e,state:A,dispatch:n})=>{const r=wA(t,A.schema),o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r){if(n){const l=o.before(i),u=o.after(i);e.delete(l,u).scrollIntoView()}return!0}return!1},HV=t=>({tr:e,dispatch:A})=>{const{from:n,to:r}=t;return A&&e.delete(n,r),!0},RV=()=>({state:t,dispatch:e})=>Mm(t,e),PV=()=>({commands:t})=>t.keyboardShortcut("Enter"),VV=()=>({state:t,dispatch:e})=>P4(t,e),$V=(t,e={})=>({tr:A,state:n,dispatch:r})=>{const o=Fo(t,n.schema),{doc:i,selection:a}=A,{$from:l,from:u,to:f}=a;if(r){const h=zm(l,o,e);if(h&&h.from<=u&&h.to>=f){const p=Ze.create(i,h.from,h.to);A.setSelection(p)}}return!0},KV=t=>e=>{const A=typeof t=="function"?t(e):t;for(let n=0;n<A.length;n+=1)if(A[n](e))return!0;return!1};function GV(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function qm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var WV=(t=null,e={})=>({editor:A,view:n,tr:r,dispatch:o})=>{e={scrollIntoView:!0,...e};const i=()=>{(qm()||GV())&&n.dom.focus(),requestAnimationFrame(()=>{A.isDestroyed||(n.focus(),e?.scrollIntoView&&A.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!RE(A.state.selection))return i(),!0;const a=PE(r.doc,t)||A.state.selection,l=A.state.selection.eq(a);return o&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},zV=(t,e)=>A=>t.every((n,r)=>e(n,{...A,index:r})),YV=(t,e)=>({tr:A,commands:n})=>n.insertContentAt({from:A.selection.from,to:A.selection.to},t,e),JV=t=>!("type"in t),XV=(t,e,A)=>({tr:n,dispatch:r,editor:o})=>{var i;if(r){A={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...A};let a;const{selection:l}=o.state,u=w=>{o.emit("contentError",{editor:o,error:w,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},f={preserveWhitespace:"full",...A.parseOptions};if(!A.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{$l(e,o.schema,{parseOptions:f,errorOnInvalidContent:!0})}catch(w){u(w)}try{a=$l(e,o.schema,{parseOptions:f,errorOnInvalidContent:(i=A.errorOnInvalidContent)!=null?i:o.options.enableContentCheck})}catch(w){return u(w),!1}let{from:h,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,B=!0;if((JV(a)?a:[a]).forEach(w=>{w.check(),g=g?w.isText&&w.marks.length===0:!1,B=B?w.isBlock:!1}),h===p&&B){const{parent:w}=n.doc.resolve(h);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(h-=1,p+=1)}let b;if(g){if(Array.isArray(e))b=e.map(w=>w.text||"").join("");else if(e instanceof we){let w="";e.forEach(v=>{v.text&&(w+=v.text)}),b=w}else typeof e=="object"&&e&&e.text?b=e.text:b=e;n.insertText(b,h,p)}else{b=a;const w=l.$from.parentOffset===0,v=l.$from.node().isText||l.$from.node().isTextblock,S=l.$from.node().content.size>0;w&&v&&S&&(h=Math.max(0,h-1)),n.replaceWith(h,p,b)}A.updateSelection&&wV(n,n.steps.length-1,-1),A.applyInputRules&&n.setMeta("applyInputRules",{from:h,text:b}),A.applyPasteRules&&n.setMeta("applyPasteRules",{from:h,text:b})}return!0},jV=()=>({state:t,dispatch:e})=>N4(t,e),qV=()=>({state:t,dispatch:e})=>H4(t,e),ZV=()=>({state:t,dispatch:e})=>cE(t,e),e$=()=>({state:t,dispatch:e})=>hE(t,e),t$=()=>({state:t,dispatch:e,tr:A})=>{try{const n=Fu(t.doc,t.selection.$from.pos,-1);return n==null?!1:(A.join(n,2),e&&e(A),!0)}catch{return!1}},A$=()=>({state:t,dispatch:e,tr:A})=>{try{const n=Fu(t.doc,t.selection.$from.pos,1);return n==null?!1:(A.join(n,2),e&&e(A),!0)}catch{return!1}},n$=()=>({state:t,dispatch:e})=>O4(t,e),r$=()=>({state:t,dispatch:e})=>M4(t,e);function GE(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function o$(t){const e=t.split(/-(?!$)/);let A=e[e.length-1];A==="Space"&&(A=" ");let n,r,o,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))qm()||GE()?i=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(A=`Alt-${A}`),r&&(A=`Ctrl-${A}`),i&&(A=`Meta-${A}`),o&&(A=`Shift-${A}`),A}var i$=t=>({editor:e,view:A,tr:n,dispatch:r})=>{const o=o$(t).split(/-(?!$)/),i=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{A.someProp("handleKeyDown",u=>u(A,a))});return l?.steps.forEach(u=>{const f=u.map(n.mapping);f&&r&&n.maybeStep(f)}),!0},s$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return Bi(A,r,e)?R4(A,n):!1},a$=()=>({state:t,dispatch:e})=>BE(t,e),l$=t=>({state:e,dispatch:A})=>{const n=wA(t,e.schema);return q4(n)(e,A)},c$=()=>({state:t,dispatch:e})=>mE(t,e);function WE(t,e){const A=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,r)=>(A.includes(r)||(n[r]=t[r]),n),{})}var u$=(t,e)=>({tr:A,state:n,dispatch:r})=>{let o=null,i=null;const a=Wu(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wA(t,n.schema)),a==="mark"&&(i=Fo(t,n.schema)),r&&A.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,f)=>{o&&o===u.type&&A.setNodeMarkup(f,void 0,WE(u.attrs,e)),i&&u.marks.length&&u.marks.forEach(h=>{i===h.type&&A.addMark(f,f+u.nodeSize,i.create(WE(h.attrs,e)))})})}),!0):!1},d$=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),f$=()=>({tr:t,dispatch:e})=>{if(e){const A=new On(t.doc);t.setSelection(A)}return!0},h$=()=>({state:t,dispatch:e})=>dE(t,e),p$=()=>({state:t,dispatch:e})=>pE(t,e),m$=()=>({state:t,dispatch:e})=>K4(t,e),g$=()=>({state:t,dispatch:e})=>z4(t,e),B$=()=>({state:t,dispatch:e})=>W4(t,e),y$=(t,{errorOnInvalidContent:e,emitUpdate:A=!0,parseOptions:n={}}={})=>({editor:r,tr:o,dispatch:i,commands:a})=>{const{doc:l}=o;if(n.preserveWhitespace!=="full"){const u=Vm(t,r.schema,n,{errorOnInvalidContent:e??r.options.enableContentCheck});return i&&o.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!A),!0}return i&&o.setMeta("preventUpdate",!A),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??r.options.enableContentCheck})};function w$(t,e,A){var n;const{selection:r}=e;let o=null;if(RE(r)&&(o=r.$cursor),o){const a=(n=t.storedMarks)!=null?n:o.marks();return!!A.isInSet(a)||!a.some(l=>l.type.excludes(A))}const{ranges:i}=r;return i.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(A):!1;return t.doc.nodesBetween(a.pos,l.pos,(f,h,p)=>{if(u)return!1;if(f.isInline){const g=!p||p.type.allowsMarkType(A),B=!!A.isInSet(f.marks)||!f.marks.some(y=>y.type.excludes(A));u=g&&B}return!u}),u})}var C$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{const{selection:o}=A,{empty:i,ranges:a}=o,l=Fo(t,n.schema);if(r)if(i){const u=TE(n,l);A.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const f=u.$from.pos,h=u.$to.pos;n.doc.nodesBetween(f,h,(p,g)=>{const B=Math.max(g,f),y=Math.min(g+p.nodeSize,h);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&A.addMark(B,y,l.create({...w.attrs,...e}))}):A.addMark(B,y,l.create(e))})});return w$(n,A,l)},b$=(t,e)=>({tr:A})=>(A.setMeta(t,e),!0),v$=(t,e={})=>({state:A,dispatch:n,chain:r})=>{const o=wA(t,A.schema);let i;return A.selection.$anchor.sameParent(A.selection.$head)&&(i=A.selection.$anchor.parent.attrs),o.isTextblock?r().command(({commands:a})=>CE(o,{...i,...e})(A)?!0:a.clearNodes()).command(({state:a})=>CE(o,{...i,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},E$=t=>({tr:e,dispatch:A})=>{if(A){const{doc:n}=e,r=ms(t,0,n.content.size),o=Pe.create(n,r);e.setSelection(o)}return!0},k$=t=>({tr:e,dispatch:A})=>{if(A){const{doc:n}=e,{from:r,to:o}=typeof t=="number"?{from:t,to:t}:t,i=Ze.atStart(n).from,a=Ze.atEnd(n).to,l=ms(r,i,a),u=ms(o,i,a),f=Ze.create(n,l,u);e.setSelection(f)}return!0},S$=t=>({state:e,dispatch:A})=>{const n=wA(t,e.schema);return tV(n)(e,A)};function zE(t,e){const A=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(A){const n=A.filter(r=>e?.includes(r.type.name));t.tr.ensureMarks(n)}}var Q$=({keepMarks:t=!0}={})=>({tr:e,state:A,dispatch:n,editor:r})=>{const{selection:o,doc:i}=e,{$from:a,$to:l}=o,u=r.extensionManager.attributes,f=Yu(u,a.node().type.name,a.node().attrs);if(o instanceof Pe&&o.node.isBlock)return!a.parentOffset||!vo(i,a.pos)?!1:(n&&(t&&zE(A,r.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:rV(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:f}]:void 0,B=vo(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!B&&vo(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(B=!0,g=p?[{type:p,attrs:f}]:void 0),n){if(B&&(o instanceof Ze&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const y=e.mapping.map(a.before()),b=e.doc.resolve(y);a.node(-1).canReplaceWith(b.index(),b.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&zE(A,r.extensionManager.splittableMarks),e.scrollIntoView()}return B},F$=(t,e={})=>({tr:A,state:n,dispatch:r,editor:o})=>{var i;const a=wA(t,n.schema),{$from:l,$to:u}=n.selection,f=n.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let w=we.empty;const v=l.index(-1)?1:l.index(-2)?2:3;for(let M=l.depth-v;M>=l.depth-3;M-=1)w=we.from(l.node(M).copy(w));const S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,F={...Yu(p,l.node().type.name,l.node().attrs),...e},I=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(F))||void 0;w=w.append(we.from(a.createAndFill(null,I)||void 0));const Q=l.before(l.depth-(v-1));A.replace(Q,l.after(-S),new De(w,4-v,0));let x=-1;A.doc.nodesBetween(Q,A.doc.content.size,(M,O)=>{if(x>-1)return!1;M.isTextblock&&M.content.size===0&&(x=O+1)}),x>-1&&A.setSelection(Ze.near(A.doc.resolve(x))),A.scrollIntoView()}return!0}const g=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,B={...Yu(p,h.type.name,h.attrs),...e},y={...Yu(p,l.node().type.name,l.node().attrs),...e};A.delete(l.pos,u.pos);const b=g?[{type:a,attrs:B},{type:g,attrs:y}]:[{type:a,attrs:B}];if(!vo(A.doc,l.pos,2))return!1;if(r){const{selection:w,storedMarks:v}=n,{splittableMarks:S}=o.extensionManager,F=v||w.$to.parentOffset&&w.$from.marks();if(A.split(l.pos,2,b).scrollIntoView(),!F||!r)return!0;const I=F.filter(Q=>S.includes(Q.type.name));A.ensureMarks(I)}return!0},Zm=(t,e)=>{const A=Ku(i=>i.type===e)(t.selection);if(!A)return!0;const n=t.doc.resolve(Math.max(0,A.pos-1)).before(A.depth);if(n===void 0)return!0;const r=t.doc.nodeAt(n);return A.node.type===r?.type&&ai(t.doc,A.pos)&&t.join(A.pos),!0},eg=(t,e)=>{const A=Ku(i=>i.type===e)(t.selection);if(!A)return!0;const n=t.doc.resolve(A.start).after(A.depth);if(n===void 0)return!0;const r=t.doc.nodeAt(n);return A.node.type===r?.type&&ai(t.doc,n)&&t.join(n),!0},U$=(t,e,A,n={})=>({editor:r,tr:o,state:i,dispatch:a,chain:l,commands:u,can:f})=>{const{extensions:h,splittableMarks:p}=r.extensionManager,g=wA(t,i.schema),B=wA(e,i.schema),{selection:y,storedMarks:b}=i,{$from:w,$to:v}=y,S=w.blockRange(v),F=b||y.$to.parentOffset&&y.$from.marks();if(!S)return!1;const I=Ku(Q=>NE(Q.type.name,h))(y);if(S.depth>=1&&I&&S.depth-I.depth<=1){if(I.node.type===g)return u.liftListItem(B);if(NE(I.node.type.name,h)&&g.validContent(I.node.content)&&a)return l().command(()=>(o.setNodeMarkup(I.pos,g),!0)).command(()=>Zm(o,g)).command(()=>eg(o,g)).run()}return!A||!F||!a?l().command(()=>f().wrapInList(g,n)?!0:u.clearNodes()).wrapInList(g,n).command(()=>Zm(o,g)).command(()=>eg(o,g)).run():l().command(()=>{const Q=f().wrapInList(g,n),x=F.filter(M=>p.includes(M.type.name));return o.ensureMarks(x),Q?!0:u.clearNodes()}).wrapInList(g,n).command(()=>Zm(o,g)).command(()=>eg(o,g)).run()},I$=(t,e={},A={})=>({state:n,commands:r})=>{const{extendEmptyMarkRange:o=!1}=A,i=Fo(t,n.schema);return Xm(n,i,e)?r.unsetMark(i,{extendEmptyMarkRange:o}):r.setMark(i,e)},x$=(t,e,A={})=>({state:n,commands:r})=>{const o=wA(t,n.schema),i=wA(e,n.schema),a=Bi(n,o,A);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?r.setNode(i,l):r.setNode(o,{...l,...A})},T$=(t,e={})=>({state:A,commands:n})=>{const r=wA(t,A.schema);return Bi(A,r,e)?n.lift(r):n.wrapIn(r,e)},_$=()=>({state:t,dispatch:e})=>{const A=t.plugins;for(let n=0;n<A.length;n+=1){const r=A[n];let o;if(r.spec.isInputRules&&(o=r.getState(t))){if(e){const i=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else i.delete(o.from,o.to)}return!0}}return!1},D$=()=>({tr:t,dispatch:e})=>{const{selection:A}=t,{empty:n,ranges:r}=A;return n||e&&r.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},L$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{var o;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=A,l=Fo(t,n.schema),{$from:u,empty:f,ranges:h}=a;if(!r)return!0;if(f&&i){let{from:p,to:g}=a;const B=(o=u.marks().find(b=>b.type===l))==null?void 0:o.attrs,y=zm(u,l,B);y&&(p=y.from,g=y.to),A.removeMark(p,g,l)}else h.forEach(p=>{A.removeMark(p.$from.pos,p.$to.pos,l)});return A.removeStoredMark(l),!0},O$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{let o=null,i=null;const a=Wu(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wA(t,n.schema)),a==="mark"&&(i=Fo(t,n.schema)),r&&A.selection.ranges.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;let h,p,g,B;A.selection.empty?n.doc.nodesBetween(u,f,(y,b)=>{o&&o===y.type&&(g=Math.max(b,u),B=Math.min(b+y.nodeSize,f),h=b,p=y)}):n.doc.nodesBetween(u,f,(y,b)=>{b<u&&o&&o===y.type&&(g=Math.max(b,u),B=Math.min(b+y.nodeSize,f),h=b,p=y),b>=u&&b<=f&&(o&&o===y.type&&A.setNodeMarkup(b,void 0,{...y.attrs,...e}),i&&y.marks.length&&y.marks.forEach(w=>{if(i===w.type){const v=Math.max(b,u),S=Math.min(b+y.nodeSize,f);A.addMark(v,S,i.create({...w.attrs,...e}))}}))}),p&&(h!==void 0&&A.setNodeMarkup(h,void 0,{...p.attrs,...e}),i&&p.marks.length&&p.marks.forEach(y=>{i===y.type&&A.addMark(g,B,i.create({...y.attrs,...e}))}))}),!0):!1},M$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return Y4(r,e)(A,n)},N$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return J4(r,e)(A,n)},YE=dA.create({name:"commands",addCommands(){return{...KE}}}),JE=dA.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var A,n,r;const o=()=>{var i,a,l,u;if((u=(l=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const f=vE(t.before,[t,...e]);DE(f).forEach(g=>{f.mapping.mapResult(g.oldRange.from).deletedAfter&&f.mapping.mapResult(g.oldRange.to).deletedBefore&&f.before.nodesBetween(g.oldRange.from,g.oldRange.to,(B,y)=>{const b=y+B.nodeSize-2,w=g.oldRange.from<=y&&b<=g.oldRange.to;this.editor.emit("delete",{type:"node",node:B,from:y,to:b,newFrom:f.mapping.map(y),newTo:f.mapping.map(b),deletedRange:g.oldRange,newRange:g.newRange,partial:!w,editor:this.editor,transaction:t,combinedTransform:f})})});const p=f.mapping;f.steps.forEach((g,B)=>{var y,b;if(g instanceof kr){const w=p.slice(B).map(g.from,-1),v=p.slice(B).map(g.to),S=p.invert().map(w,-1),F=p.invert().map(v),I=(y=f.doc.nodeAt(w-1))==null?void 0:y.marks.some(x=>x.eq(g.mark)),Q=(b=f.doc.nodeAt(v))==null?void 0:b.marks.some(x=>x.eq(g.mark));this.editor.emit("delete",{type:"mark",mark:g.mark,from:g.from,to:g.to,deletedRange:{from:S,to:F},newRange:{from:w,to:v},partial:!!(Q||I),editor:this.editor,transaction:t,combinedTransform:f})}})};(r=(n=(A=this.editor.options.coreExtensionOptions)==null?void 0:A.delete)==null?void 0:n.async)==null||r?setTimeout(o,0):o()}}),XE=dA.create({name:"drop",addProseMirrorPlugins(){return[new tA({key:new DA("tiptapDrop"),props:{handleDrop:(t,e,A,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:A,moved:n})}}})]}}),jE=dA.create({name:"editable",addProseMirrorPlugins(){return[new tA({key:new DA("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qE=new DA("focusEvents"),ZE=dA.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new tA({key:qE,props:{handleDOMEvents:{focus:(e,A)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:A}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,A)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:A}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),e1=dA.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:f,$anchor:h}=l,{pos:p,parent:g}=h,B=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,y=B.parent.type.spec.isolating,b=h.pos-h.parentOffset,w=y&&B.parent.childCount===1?b===h.pos:nt.atStart(u).from===p;return!f||!g.type.isTextblock||g.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"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 qm()||GE()?o:r},addProseMirrorPlugins(){return[new tA({key:new DA("clearDocument"),appendTransaction:(t,e,A)=>{if(t.some(y=>y.getMeta("composition")))return;const n=t.some(y=>y.docChanged)&&!e.doc.eq(A.doc),r=t.some(y=>y.getMeta("preventClearDocument"));if(!n||r)return;const{empty:o,from:i,to:a}=e.selection,l=nt.atStart(e.doc).from,u=nt.atEnd(e.doc).to;if(o||!(i===l&&a===u)||!Ju(A.doc))return;const p=A.tr,g=Pu({state:A,transaction:p}),{commands:B}=new Vu({editor:this.editor,state:g});if(B.clearNodes(),!!p.steps.length)return p}})]}}),t1=dA.create({name:"paste",addProseMirrorPlugins(){return[new tA({key:new DA("tiptapPaste"),props:{handlePaste:(t,e,A)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:A})}}})]}}),A1=dA.create({name:"tabindex",addProseMirrorPlugins(){return[new tA({key:new DA("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),H$=class il{constructor(e,A,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=A,this.currentNode=r}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 A=this.from,n=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}A=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:A,to:n},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),A=this.resolvedPos.doc.resolve(e);return new il(A,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 il(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 il(e,this.editor)}get children(){const e=[];return this.node.content.forEach((A,n)=>{const r=A.isBlock&&!A.isTextblock,o=A.isAtom&&!A.isText,i=this.pos+n+(o?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(i);if(!r&&a.depth<=this.depth)return;const l=new il(a,this.editor,r,r?A:null);r&&(l.actualDepth=this.depth+1),e.push(new il(a,this.editor,r,r?A:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,A={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(A).length>0){const o=r.node.attrs,i=Object.keys(A);for(let a=0;a<i.length;a+=1){const l=i[a];if(o[l]!==A[l])break}}else n=r;r=r.parent}return n}querySelector(e,A={}){return this.querySelectorAll(e,A,!0)[0]||null}querySelectorAll(e,A={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;const o=Object.keys(A);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===e&&o.every(l=>A[l]===i.node.attrs[l])&&r.push(i),!(n&&r.length>0)&&(r=r.concat(i.querySelectorAll(e,A,n))))}),r}setAttribute(e){const{tr:A}=this.editor.state;A.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(A)}},R$=`.ProseMirror {
36
+ `,textSerializers:i={}}=A||{};let a="";return t.nodesBetween(n,r,(l,u,f,h)=>{var p;l.isBlock&&u>n&&(a+=o);const g=i?.[l.type.name];if(g)return f&&(a+=g({node:l,pos:u,parent:f,index:h,range:e})),!1;l.isText&&(a+=(p=l?.text)==null?void 0:p.slice(Math.max(n,u)-u,r-u))}),a}function uV(t,e){const A={from:0,to:t.content.size};return IE(t,A,e)}function xE(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,A])=>[e,A.spec.toText]))}function Fo(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function TE(t,e){const A=Fo(e,t.schema),{from:n,to:r,empty:o}=t.selection,i=[];o?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,r,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===A.name);return a?{...a.attrs}:{}}function wA(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function dV(t,e){const A=wA(e,t.schema),{from:n,to:r}=t.selection,o=[];t.doc.nodesBetween(n,r,a=>{o.push(a)});const i=o.reverse().find(a=>a.type.name===A.name);return i?{...i.attrs}:{}}function Wu(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _E(t,e){const A=Wu(typeof e=="string"?e:e.name,t.schema);return A==="node"?dV(t,e):A==="mark"?TE(t,e):{}}function fV(t,e=JSON.stringify){const A={};return t.filter(n=>{const r=e(n);return Object.prototype.hasOwnProperty.call(A,r)?!1:A[r]=!0})}function hV(t){const e=fV(t);return e.length===1?e:e.filter((A,n)=>!e.filter((o,i)=>i!==n).some(o=>A.oldRange.from>=o.oldRange.from&&A.oldRange.to<=o.oldRange.to&&A.newRange.from>=o.newRange.from&&A.newRange.to<=o.newRange.to))}function DE(t){const{mapping:e,steps:A}=t,n=[];return e.maps.forEach((r,o)=>{const i=[];if(r.ranges.length)r.forEach((a,l)=>{i.push({from:a,to:l})});else{const{from:a,to:l}=A[o];if(a===void 0||l===void 0)return;i.push({from:a,to:l})}i.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),f=e.slice(o).map(l),h=e.invert().map(u,-1),p=e.invert().map(f);n.push({oldRange:{from:h,to:p},newRange:{from:u,to:f}})})}),hV(n)}function Wm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function zu(t,e,A={strict:!0}){const n=Object.keys(e);return n.length?n.every(r=>A.strict?e[r]===t[r]:Wm(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function LE(t,e,A={}){return t.find(n=>n.type===e&&zu(Object.fromEntries(Object.keys(A).map(r=>[r,n.attrs[r]])),A))}function OE(t,e,A={}){return!!LE(t,e,A)}function zm(t,e,A){var n;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===e)||(A=A||((n=r.node.marks[0])==null?void 0:n.attrs),!LE([...r.node.marks],e,A)))return;let i=r.index,a=t.start()+r.offset,l=i+1,u=a+r.node.nodeSize;for(;i>0&&OE([...t.parent.child(i-1).marks],e,A);)i-=1,a-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&OE([...t.parent.child(l).marks],e,A);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function Ym(t,e,A){const n=[];return t===e?A.resolve(t).marks().forEach(r=>{const o=A.resolve(t),i=zm(o,r.type);i&&n.push({mark:r,...i})}):A.nodesBetween(t,e,(r,o)=>{!r||r?.nodeSize===void 0||n.push(...r.marks.map(i=>({from:o,to:o+r.nodeSize,mark:i})))}),n}var pV=(t,e,A,n=20)=>{const r=t.doc.resolve(A);let o=n,i=null;for(;o>0&&i===null;){const a=r.node(o);a?.type.name===e?i=a:o-=1}return[i,o]};function Jm(t,e){return e.nodes[t]||e.marks[t]||null}function Yu(t,e,A){return Object.fromEntries(Object.entries(A).filter(([n])=>{const r=t.find(o=>o.type===e&&o.name===n);return r?r.attribute.keepOnSplit:!1}))}var mV=(t,e=500)=>{let A="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(r,o,i,a)=>{var l,u;const f=((u=(l=r.type.spec).toText)==null?void 0:u.call(l,{node:r,pos:o,parent:i,index:a}))||r.textContent||"%leaf%";A+=r.isAtom&&!r.isText?f:f.slice(0,Math.max(0,n-o))}),A};function Xm(t,e,A={}){const{empty:n,ranges:r}=t.selection,o=e?Fo(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>zu(h.attrs,A,{strict:!1}));let i=0;const a=[];if(r.forEach(({$from:h,$to:p})=>{const g=h.pos,B=p.pos;t.doc.nodesBetween(g,B,(y,b)=>{if(!y.isText&&!y.marks.length)return;const w=Math.max(g,b),v=Math.min(B,b+y.nodeSize),S=v-w;i+=S,a.push(...y.marks.map(F=>({mark:F,from:w,to:v})))})}),i===0)return!1;const l=a.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>zu(h.mark.attrs,A,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,p)=>h+p.to-p.from,0);return(l>0?l+u:l)>=i}function Bi(t,e,A={}){const{from:n,to:r,empty:o}=t.selection,i=e?wA(e,t.schema):null,a=[];t.doc.nodesBetween(n,r,(h,p)=>{if(h.isText)return;const g=Math.max(n,p),B=Math.min(r,p+h.nodeSize);a.push({node:h,from:g,to:B})});const l=r-n,u=a.filter(h=>i?i.name===h.node.type.name:!0).filter(h=>zu(h.node.attrs,A,{strict:!1}));return o?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}function gV(t,e,A={}){if(!e)return Bi(t,null,A)||Xm(t,null,A);const n=Wu(e,t.schema);return n==="node"?Bi(t,e,A):n==="mark"?Xm(t,e,A):!1}var BV=(t,e)=>{const{$from:A,$to:n,$anchor:r}=t.selection;if(e){const o=Ku(a=>a.type.name===e)(t.selection);if(!o)return!1;const i=t.doc.resolve(o.pos+1);return r.pos+1===i.end()}return!(n.parentOffset<n.parent.nodeSize-2||A.pos!==n.pos)},yV=t=>{const{$from:e,$to:A}=t.selection;return!(e.parentOffset>0||e.pos!==A.pos)};function ME(t,e){return Array.isArray(e)?e.some(A=>(typeof A=="string"?A:A.name)===t.name):e}function NE(t,e){const{nodeExtensions:A}=Kl(e),n=A.find(i=>i.name===t);if(!n)return!1;const r={name:n.name,options:n.options,storage:n.storage},o=Ut(Re(n,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")}function Ju(t,{checkChildren:e=!0,ignoreWhitespace:A=!1}={}){var n;if(A){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!=null?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(o=>{r!==!1&&(Ju(o,{ignoreWhitespace:A,checkChildren:e})||(r=!1))}),r}return!1}function HE(t){return t instanceof Pe}function RE(t){return t instanceof Ze}function ms(t=0,e=0,A=0){return Math.min(Math.max(t,e),A)}function PE(t,e=null){if(!e)return null;const A=nt.atStart(t),n=nt.atEnd(t);if(e==="start"||e===!0)return A;if(e==="end")return n;const r=A.from,o=n.to;return e==="all"?Ze.create(t,ms(0,r,o),ms(t.content.size,r,o)):Ze.create(t,ms(e,r,o),ms(e,r,o))}function wV(t,e,A){const n=t.steps.length-1;if(n<e)return;const r=t.steps[n];if(!(r instanceof TA||r instanceof _A))return;const o=t.mapping.maps[n];let i=0;o.forEach((a,l,u,f)=>{i===0&&(i=f)}),t.setSelection(nt.near(t.doc.resolve(i),A))}var Xu=class{constructor(t){this.find=t.find,this.handler=t.handler}},CV=(t,e)=>{if(Wm(e))return e.exec(t);const A=e(t);if(!A)return null;const n=[A.text];return n.index=A.index,n.input=t,n.data=A.data,A.replaceWith&&(A.text.includes(A.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(A.replaceWith)),n};function ju(t){var e;const{editor:A,from:n,to:r,text:o,rules:i,plugin:a}=t,{view:l}=A;if(l.composing)return!1;const u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let f=!1;const h=mV(u)+o;return i.forEach(p=>{if(f)return;const g=CV(h,p.find);if(!g)return;const B=l.state.tr,y=Pu({state:l.state,transaction:B}),b={from:n-(g[0].length-o.length),to:r},{commands:w,chain:v,can:S}=new Vu({editor:A,state:y});p.handler({state:y,range:b,match:g,commands:w,chain:v,can:S})===null||!B.steps.length||(B.setMeta(a,{transform:B,from:n,to:r,text:o}),l.dispatch(B),f=!0)}),f}function bV(t){const{editor:e,rules:A}=t,n=new AA({state:{init(){return null},apply(r,o,i){const a=r.getMeta(n);if(a)return a;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:f}=l;typeof f=="string"?f=f:f=Km(we.from(f),i.schema);const{from:h}=l,p=h+f.length;ju({editor:e,from:h,to:p,text:f,rules:A,plugin:n})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,i,a){return ju({editor:e,from:o,to:i,text:a,rules:A,plugin:n})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:o}=r.state.selection;o&&ju({editor:e,from:o.pos,to:o.pos,text:"",rules:A,plugin:n})}),!1)},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?ju({editor:e,from:i.pos,to:i.pos,text:`
37
+ `,rules:A,plugin:n}):!1}},isInputRules:!0});return n}function vV(t){return Object.prototype.toString.call(t).slice(8,-1)}function qu(t){return vV(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function VE(t,e){const A={...t};return qu(t)&&qu(e)&&Object.keys(e).forEach(n=>{qu(e[n])&&qu(t[n])?A[n]=VE(t[n],e[n]):A[n]=e[n]}),A}var jm=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Ut(Re(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Ut(Re(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>VE(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},yi=class h_ extends jm{constructor(){super(...arguments),this.type="mark"}static create(e={}){const A=typeof e=="function"?e():e;return new h_(A)}static handleExit({editor:e,mark:A}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find(u=>u?.type.name===A.name))return!1;const l=i.find(u=>u?.type.name===A.name);return l&&n.removeStoredMark(l),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}};function EV(t){return typeof t=="number"}var kV=class{constructor(t){this.find=t.find,this.handler=t.handler}},SV=(t,e,A)=>{if(Wm(e))return[...t.matchAll(e)];const n=e(t,A);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function QV(t){const{editor:e,state:A,from:n,to:r,rule:o,pasteEvent:i,dropEvent:a}=t,{commands:l,chain:u,can:f}=new Vu({editor:e,state:A}),h=[];return A.doc.nodesBetween(n,r,(g,B)=>{if(!g.isTextblock||g.type.spec.code)return;const y=Math.max(n,B),b=Math.min(r,B+g.content.size),w=g.textBetween(y-B,b-B,void 0,"");SV(w,o.find,i).forEach(S=>{if(S.index===void 0)return;const F=y+S.index+1,I=F+S[0].length,Q={from:A.tr.mapping.map(F),to:A.tr.mapping.map(I)},x=o.handler({state:A,range:Q,match:S,commands:l,chain:u,can:f,pasteEvent:i,dropEvent:a});h.push(x)})}),h.every(g=>g!==null)}var Zu=null,FV=t=>{var e;const A=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=A.clipboardData)==null||e.setData("text/html",t),A};function UV(t){const{editor:e,rules:A}=t;let n=null,r=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:f,from:h,to:p,rule:g,pasteEvt:B})=>{const y=f.tr,b=Pu({state:f,transaction:y});if(!(!QV({editor:e,state:b,from:Math.max(h-1,0),to:p.b-1,rule:g,pasteEvent:B,dropEvent:a})||!y.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return A.map(f=>new AA({view(h){const p=B=>{var y;n=(y=h.dom.parentElement)!=null&&y.contains(B.target)?h.dom.parentElement:null,n&&(Zu=e)},g=()=>{Zu&&(Zu=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(o=n===h.dom.parentElement,a=p,!o){const g=Zu;g?.isEditable&&setTimeout(()=>{const B=g.state.selection;B&&g.commands.deleteRange({from:B.from,to:B.to})},10)}return!1},paste:(h,p)=>{var g;const B=(g=p.clipboardData)==null?void 0:g.getData("text/html");return i=p,r=!!B?.includes("data-pm-slice"),!1}}},appendTransaction:(h,p,g)=>{const B=h[0],y=B.getMeta("uiEvent")==="paste"&&!r,b=B.getMeta("uiEvent")==="drop"&&!o,w=B.getMeta("applyPasteRules"),v=!!w;if(!y&&!b&&!v)return;if(v){let{text:I}=w;typeof I=="string"?I=I:I=Km(we.from(I),g.schema);const{from:Q}=w,x=Q+I.length,M=FV(I);return l({rule:f,state:g,from:Q,to:{b:x},pasteEvt:M})}const S=p.doc.content.findDiffStart(g.doc.content),F=p.doc.content.findDiffEnd(g.doc.content);if(!(!EV(S)||!F||S===F.b))return l({rule:f,state:g,from:S,to:F,pasteEvt:i})}}))}var ed=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=UE(t),this.schema=lV(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const A={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Jm(e.name,this.schema)},n=Re(e,"addCommands",A);return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=Gm([...this.extensions].reverse()),A=[],n=[],r=e.map(o=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Jm(o.name,this.schema)},a=[],l=Re(o,"addKeyboardShortcuts",i);let u={};if(o.type==="mark"&&Re(o,"exitable",i)&&(u.ArrowRight=()=>yi.handleExit({editor:t,mark:o})),l){const B=Object.fromEntries(Object.entries(l()).map(([y,b])=>[y,()=>b({editor:t})]));u={...u,...B}}const f=L4(u);a.push(f);const h=Re(o,"addInputRules",i);ME(o,t.options.enableInputRules)&&h&&A.push(...h());const p=Re(o,"addPasteRules",i);ME(o,t.options.enablePasteRules)&&p&&n.push(...p());const g=Re(o,"addProseMirrorPlugins",i);if(g){const B=g();a.push(...B)}return a}).flat();return[bV({editor:t,rules:A}),...UV({editor:t,rules:n}),...r]}get attributes(){return SE(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Kl(this.extensions);return Object.fromEntries(e.filter(A=>!!Re(A,"addNodeView")).map(A=>{const n=this.attributes.filter(a=>a.type===A.name),r={name:A.name,options:A.options,storage:this.editor.extensionStorage[A.name],editor:t,type:wA(A.name,this.schema)},o=Re(A,"addNodeView",r);if(!o)return[];const i=(a,l,u,f,h)=>{const p=Gu(a,n);return o()({node:a,view:l,getPos:u,decorations:f,innerDecorations:h,editor:t,extension:A,HTMLAttributes:p})};return[A.name,i]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Kl(this.extensions);return Object.fromEntries(e.filter(A=>!!Re(A,"addMarkView")).map(A=>{const n=this.attributes.filter(a=>a.type===A.name),r={name:A.name,options:A.options,storage:this.editor.extensionStorage[A.name],editor:t,type:Fo(A.name,this.schema)},o=Re(A,"addMarkView",r);if(!o)return[];const i=(a,l,u)=>{const f=Gu(a,n);return o()({mark:a,view:l,inline:u,editor:t,extension:A,HTMLAttributes:f,updateAttributes:h=>{G$(a,t,h)}})};return[A.name,i]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var A;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Jm(e.name,this.schema)};e.type==="mark"&&((A=Ut(Re(e,"keepOnSplit",n)))==null||A)&&this.splittableMarks.push(e.name);const r=Re(e,"onBeforeCreate",n),o=Re(e,"onCreate",n),i=Re(e,"onUpdate",n),a=Re(e,"onSelectionUpdate",n),l=Re(e,"onTransaction",n),u=Re(e,"onFocus",n),f=Re(e,"onBlur",n),h=Re(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};ed.resolve=UE,ed.sort=Gm,ed.flatten=$m;var IV={};bE(IV,{ClipboardTextSerializer:()=>$E,Commands:()=>YE,Delete:()=>JE,Drop:()=>XE,Editable:()=>jE,FocusEvents:()=>ZE,Keymap:()=>e1,Paste:()=>t1,Tabindex:()=>A1,focusEventsPluginKey:()=>qE});var dA=class p_ extends jm{constructor(){super(...arguments),this.type="extension"}static create(e={}){const A=typeof e=="function"?e():e;return new p_(A)}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}},$E=dA.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new AA({key:new DA("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:A}=t,{doc:n,selection:r}=e,{ranges:o}=r,i=Math.min(...o.map(f=>f.$from.pos)),a=Math.max(...o.map(f=>f.$to.pos)),l=xE(A);return IE(n,{from:i,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),KE={};bE(KE,{blur:()=>xV,clearContent:()=>TV,clearNodes:()=>_V,command:()=>DV,createParagraphNear:()=>LV,cut:()=>OV,deleteCurrentNode:()=>MV,deleteNode:()=>NV,deleteRange:()=>HV,deleteSelection:()=>RV,enter:()=>PV,exitCode:()=>VV,extendMarkRange:()=>$V,first:()=>KV,focus:()=>WV,forEach:()=>zV,insertContent:()=>YV,insertContentAt:()=>XV,joinBackward:()=>ZV,joinDown:()=>qV,joinForward:()=>e$,joinItemBackward:()=>t$,joinItemForward:()=>A$,joinTextblockBackward:()=>n$,joinTextblockForward:()=>r$,joinUp:()=>jV,keyboardShortcut:()=>i$,lift:()=>s$,liftEmptyBlock:()=>a$,liftListItem:()=>l$,newlineInCode:()=>c$,resetAttributes:()=>u$,scrollIntoView:()=>d$,selectAll:()=>f$,selectNodeBackward:()=>h$,selectNodeForward:()=>p$,selectParentNode:()=>m$,selectTextblockEnd:()=>g$,selectTextblockStart:()=>B$,setContent:()=>y$,setMark:()=>C$,setMeta:()=>b$,setNode:()=>v$,setNodeSelection:()=>E$,setTextSelection:()=>k$,sinkListItem:()=>S$,splitBlock:()=>Q$,splitListItem:()=>F$,toggleList:()=>U$,toggleMark:()=>I$,toggleNode:()=>x$,toggleWrap:()=>T$,undoInputRule:()=>_$,unsetAllMarks:()=>D$,unsetMark:()=>L$,updateAttributes:()=>O$,wrapIn:()=>M$,wrapInList:()=>N$});var xV=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var A;t.isDestroyed||(e.dom.blur(),(A=window?.getSelection())==null||A.removeAllRanges())}),!0),TV=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),_V=()=>({state:t,tr:e,dispatch:A})=>{const{selection:n}=e,{ranges:r}=n;return A&&r.forEach(({$from:o,$to:i})=>{t.doc.nodesBetween(o.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:f}=e,h=u.resolve(f.map(l)),p=u.resolve(f.map(l+a.nodeSize)),g=h.blockRange(p);if(!g)return;const B=aa(g);if(a.type.isTextblock){const{defaultType:y}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,y)}(B||B===0)&&e.lift(g,B)})}),!0},DV=t=>e=>t(e),LV=()=>({state:t,dispatch:e})=>gE(t,e),OV=(t,e)=>({editor:A,tr:n})=>{const{state:r}=A,o=r.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const i=n.mapping.map(e);return n.insert(i,o.content),n.setSelection(new Ze(n.doc.resolve(Math.max(i-1,0)))),!0},MV=()=>({tr:t,dispatch:e})=>{const{selection:A}=t,n=A.$anchor.node();if(n.content.size>0)return!1;const r=t.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===n.type){if(e){const a=r.before(o),l=r.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},NV=t=>({tr:e,state:A,dispatch:n})=>{const r=wA(t,A.schema),o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r){if(n){const l=o.before(i),u=o.after(i);e.delete(l,u).scrollIntoView()}return!0}return!1},HV=t=>({tr:e,dispatch:A})=>{const{from:n,to:r}=t;return A&&e.delete(n,r),!0},RV=()=>({state:t,dispatch:e})=>Mm(t,e),PV=()=>({commands:t})=>t.keyboardShortcut("Enter"),VV=()=>({state:t,dispatch:e})=>P4(t,e),$V=(t,e={})=>({tr:A,state:n,dispatch:r})=>{const o=Fo(t,n.schema),{doc:i,selection:a}=A,{$from:l,from:u,to:f}=a;if(r){const h=zm(l,o,e);if(h&&h.from<=u&&h.to>=f){const p=Ze.create(i,h.from,h.to);A.setSelection(p)}}return!0},KV=t=>e=>{const A=typeof t=="function"?t(e):t;for(let n=0;n<A.length;n+=1)if(A[n](e))return!0;return!1};function GV(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function qm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var WV=(t=null,e={})=>({editor:A,view:n,tr:r,dispatch:o})=>{e={scrollIntoView:!0,...e};const i=()=>{(qm()||GV())&&n.dom.focus(),requestAnimationFrame(()=>{A.isDestroyed||(n.focus(),e?.scrollIntoView&&A.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!RE(A.state.selection))return i(),!0;const a=PE(r.doc,t)||A.state.selection,l=A.state.selection.eq(a);return o&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},zV=(t,e)=>A=>t.every((n,r)=>e(n,{...A,index:r})),YV=(t,e)=>({tr:A,commands:n})=>n.insertContentAt({from:A.selection.from,to:A.selection.to},t,e),JV=t=>!("type"in t),XV=(t,e,A)=>({tr:n,dispatch:r,editor:o})=>{var i;if(r){A={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...A};let a;const{selection:l}=o.state,u=w=>{o.emit("contentError",{editor:o,error:w,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},f={preserveWhitespace:"full",...A.parseOptions};if(!A.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{$l(e,o.schema,{parseOptions:f,errorOnInvalidContent:!0})}catch(w){u(w)}try{a=$l(e,o.schema,{parseOptions:f,errorOnInvalidContent:(i=A.errorOnInvalidContent)!=null?i:o.options.enableContentCheck})}catch(w){return u(w),!1}let{from:h,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,B=!0;if((JV(a)?a:[a]).forEach(w=>{w.check(),g=g?w.isText&&w.marks.length===0:!1,B=B?w.isBlock:!1}),h===p&&B){const{parent:w}=n.doc.resolve(h);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(h-=1,p+=1)}let b;if(g){if(Array.isArray(e))b=e.map(w=>w.text||"").join("");else if(e instanceof we){let w="";e.forEach(v=>{v.text&&(w+=v.text)}),b=w}else typeof e=="object"&&e&&e.text?b=e.text:b=e;n.insertText(b,h,p)}else{b=a;const w=l.$from.parentOffset===0,v=l.$from.node().isText||l.$from.node().isTextblock,S=l.$from.node().content.size>0;w&&v&&S&&(h=Math.max(0,h-1)),n.replaceWith(h,p,b)}A.updateSelection&&wV(n,n.steps.length-1,-1),A.applyInputRules&&n.setMeta("applyInputRules",{from:h,text:b}),A.applyPasteRules&&n.setMeta("applyPasteRules",{from:h,text:b})}return!0},jV=()=>({state:t,dispatch:e})=>N4(t,e),qV=()=>({state:t,dispatch:e})=>H4(t,e),ZV=()=>({state:t,dispatch:e})=>cE(t,e),e$=()=>({state:t,dispatch:e})=>hE(t,e),t$=()=>({state:t,dispatch:e,tr:A})=>{try{const n=Fu(t.doc,t.selection.$from.pos,-1);return n==null?!1:(A.join(n,2),e&&e(A),!0)}catch{return!1}},A$=()=>({state:t,dispatch:e,tr:A})=>{try{const n=Fu(t.doc,t.selection.$from.pos,1);return n==null?!1:(A.join(n,2),e&&e(A),!0)}catch{return!1}},n$=()=>({state:t,dispatch:e})=>O4(t,e),r$=()=>({state:t,dispatch:e})=>M4(t,e);function GE(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function o$(t){const e=t.split(/-(?!$)/);let A=e[e.length-1];A==="Space"&&(A=" ");let n,r,o,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))qm()||GE()?i=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(A=`Alt-${A}`),r&&(A=`Ctrl-${A}`),i&&(A=`Meta-${A}`),o&&(A=`Shift-${A}`),A}var i$=t=>({editor:e,view:A,tr:n,dispatch:r})=>{const o=o$(t).split(/-(?!$)/),i=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{A.someProp("handleKeyDown",u=>u(A,a))});return l?.steps.forEach(u=>{const f=u.map(n.mapping);f&&r&&n.maybeStep(f)}),!0},s$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return Bi(A,r,e)?R4(A,n):!1},a$=()=>({state:t,dispatch:e})=>BE(t,e),l$=t=>({state:e,dispatch:A})=>{const n=wA(t,e.schema);return q4(n)(e,A)},c$=()=>({state:t,dispatch:e})=>mE(t,e);function WE(t,e){const A=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,r)=>(A.includes(r)||(n[r]=t[r]),n),{})}var u$=(t,e)=>({tr:A,state:n,dispatch:r})=>{let o=null,i=null;const a=Wu(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wA(t,n.schema)),a==="mark"&&(i=Fo(t,n.schema)),r&&A.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,f)=>{o&&o===u.type&&A.setNodeMarkup(f,void 0,WE(u.attrs,e)),i&&u.marks.length&&u.marks.forEach(h=>{i===h.type&&A.addMark(f,f+u.nodeSize,i.create(WE(h.attrs,e)))})})}),!0):!1},d$=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),f$=()=>({tr:t,dispatch:e})=>{if(e){const A=new On(t.doc);t.setSelection(A)}return!0},h$=()=>({state:t,dispatch:e})=>dE(t,e),p$=()=>({state:t,dispatch:e})=>pE(t,e),m$=()=>({state:t,dispatch:e})=>K4(t,e),g$=()=>({state:t,dispatch:e})=>z4(t,e),B$=()=>({state:t,dispatch:e})=>W4(t,e),y$=(t,{errorOnInvalidContent:e,emitUpdate:A=!0,parseOptions:n={}}={})=>({editor:r,tr:o,dispatch:i,commands:a})=>{const{doc:l}=o;if(n.preserveWhitespace!=="full"){const u=Vm(t,r.schema,n,{errorOnInvalidContent:e??r.options.enableContentCheck});return i&&o.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!A),!0}return i&&o.setMeta("preventUpdate",!A),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??r.options.enableContentCheck})};function w$(t,e,A){var n;const{selection:r}=e;let o=null;if(RE(r)&&(o=r.$cursor),o){const a=(n=t.storedMarks)!=null?n:o.marks();return!!A.isInSet(a)||!a.some(l=>l.type.excludes(A))}const{ranges:i}=r;return i.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(A):!1;return t.doc.nodesBetween(a.pos,l.pos,(f,h,p)=>{if(u)return!1;if(f.isInline){const g=!p||p.type.allowsMarkType(A),B=!!A.isInSet(f.marks)||!f.marks.some(y=>y.type.excludes(A));u=g&&B}return!u}),u})}var C$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{const{selection:o}=A,{empty:i,ranges:a}=o,l=Fo(t,n.schema);if(r)if(i){const u=TE(n,l);A.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const f=u.$from.pos,h=u.$to.pos;n.doc.nodesBetween(f,h,(p,g)=>{const B=Math.max(g,f),y=Math.min(g+p.nodeSize,h);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&A.addMark(B,y,l.create({...w.attrs,...e}))}):A.addMark(B,y,l.create(e))})});return w$(n,A,l)},b$=(t,e)=>({tr:A})=>(A.setMeta(t,e),!0),v$=(t,e={})=>({state:A,dispatch:n,chain:r})=>{const o=wA(t,A.schema);let i;return A.selection.$anchor.sameParent(A.selection.$head)&&(i=A.selection.$anchor.parent.attrs),o.isTextblock?r().command(({commands:a})=>CE(o,{...i,...e})(A)?!0:a.clearNodes()).command(({state:a})=>CE(o,{...i,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},E$=t=>({tr:e,dispatch:A})=>{if(A){const{doc:n}=e,r=ms(t,0,n.content.size),o=Pe.create(n,r);e.setSelection(o)}return!0},k$=t=>({tr:e,dispatch:A})=>{if(A){const{doc:n}=e,{from:r,to:o}=typeof t=="number"?{from:t,to:t}:t,i=Ze.atStart(n).from,a=Ze.atEnd(n).to,l=ms(r,i,a),u=ms(o,i,a),f=Ze.create(n,l,u);e.setSelection(f)}return!0},S$=t=>({state:e,dispatch:A})=>{const n=wA(t,e.schema);return tV(n)(e,A)};function zE(t,e){const A=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(A){const n=A.filter(r=>e?.includes(r.type.name));t.tr.ensureMarks(n)}}var Q$=({keepMarks:t=!0}={})=>({tr:e,state:A,dispatch:n,editor:r})=>{const{selection:o,doc:i}=e,{$from:a,$to:l}=o,u=r.extensionManager.attributes,f=Yu(u,a.node().type.name,a.node().attrs);if(o instanceof Pe&&o.node.isBlock)return!a.parentOffset||!vo(i,a.pos)?!1:(n&&(t&&zE(A,r.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:rV(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:f}]:void 0,B=vo(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!B&&vo(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(B=!0,g=p?[{type:p,attrs:f}]:void 0),n){if(B&&(o instanceof Ze&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const y=e.mapping.map(a.before()),b=e.doc.resolve(y);a.node(-1).canReplaceWith(b.index(),b.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&zE(A,r.extensionManager.splittableMarks),e.scrollIntoView()}return B},F$=(t,e={})=>({tr:A,state:n,dispatch:r,editor:o})=>{var i;const a=wA(t,n.schema),{$from:l,$to:u}=n.selection,f=n.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let w=we.empty;const v=l.index(-1)?1:l.index(-2)?2:3;for(let M=l.depth-v;M>=l.depth-3;M-=1)w=we.from(l.node(M).copy(w));const S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,F={...Yu(p,l.node().type.name,l.node().attrs),...e},I=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(F))||void 0;w=w.append(we.from(a.createAndFill(null,I)||void 0));const Q=l.before(l.depth-(v-1));A.replace(Q,l.after(-S),new De(w,4-v,0));let x=-1;A.doc.nodesBetween(Q,A.doc.content.size,(M,O)=>{if(x>-1)return!1;M.isTextblock&&M.content.size===0&&(x=O+1)}),x>-1&&A.setSelection(Ze.near(A.doc.resolve(x))),A.scrollIntoView()}return!0}const g=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,B={...Yu(p,h.type.name,h.attrs),...e},y={...Yu(p,l.node().type.name,l.node().attrs),...e};A.delete(l.pos,u.pos);const b=g?[{type:a,attrs:B},{type:g,attrs:y}]:[{type:a,attrs:B}];if(!vo(A.doc,l.pos,2))return!1;if(r){const{selection:w,storedMarks:v}=n,{splittableMarks:S}=o.extensionManager,F=v||w.$to.parentOffset&&w.$from.marks();if(A.split(l.pos,2,b).scrollIntoView(),!F||!r)return!0;const I=F.filter(Q=>S.includes(Q.type.name));A.ensureMarks(I)}return!0},Zm=(t,e)=>{const A=Ku(i=>i.type===e)(t.selection);if(!A)return!0;const n=t.doc.resolve(Math.max(0,A.pos-1)).before(A.depth);if(n===void 0)return!0;const r=t.doc.nodeAt(n);return A.node.type===r?.type&&ai(t.doc,A.pos)&&t.join(A.pos),!0},eg=(t,e)=>{const A=Ku(i=>i.type===e)(t.selection);if(!A)return!0;const n=t.doc.resolve(A.start).after(A.depth);if(n===void 0)return!0;const r=t.doc.nodeAt(n);return A.node.type===r?.type&&ai(t.doc,n)&&t.join(n),!0},U$=(t,e,A,n={})=>({editor:r,tr:o,state:i,dispatch:a,chain:l,commands:u,can:f})=>{const{extensions:h,splittableMarks:p}=r.extensionManager,g=wA(t,i.schema),B=wA(e,i.schema),{selection:y,storedMarks:b}=i,{$from:w,$to:v}=y,S=w.blockRange(v),F=b||y.$to.parentOffset&&y.$from.marks();if(!S)return!1;const I=Ku(Q=>NE(Q.type.name,h))(y);if(S.depth>=1&&I&&S.depth-I.depth<=1){if(I.node.type===g)return u.liftListItem(B);if(NE(I.node.type.name,h)&&g.validContent(I.node.content)&&a)return l().command(()=>(o.setNodeMarkup(I.pos,g),!0)).command(()=>Zm(o,g)).command(()=>eg(o,g)).run()}return!A||!F||!a?l().command(()=>f().wrapInList(g,n)?!0:u.clearNodes()).wrapInList(g,n).command(()=>Zm(o,g)).command(()=>eg(o,g)).run():l().command(()=>{const Q=f().wrapInList(g,n),x=F.filter(M=>p.includes(M.type.name));return o.ensureMarks(x),Q?!0:u.clearNodes()}).wrapInList(g,n).command(()=>Zm(o,g)).command(()=>eg(o,g)).run()},I$=(t,e={},A={})=>({state:n,commands:r})=>{const{extendEmptyMarkRange:o=!1}=A,i=Fo(t,n.schema);return Xm(n,i,e)?r.unsetMark(i,{extendEmptyMarkRange:o}):r.setMark(i,e)},x$=(t,e,A={})=>({state:n,commands:r})=>{const o=wA(t,n.schema),i=wA(e,n.schema),a=Bi(n,o,A);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?r.setNode(i,l):r.setNode(o,{...l,...A})},T$=(t,e={})=>({state:A,commands:n})=>{const r=wA(t,A.schema);return Bi(A,r,e)?n.lift(r):n.wrapIn(r,e)},_$=()=>({state:t,dispatch:e})=>{const A=t.plugins;for(let n=0;n<A.length;n+=1){const r=A[n];let o;if(r.spec.isInputRules&&(o=r.getState(t))){if(e){const i=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else i.delete(o.from,o.to)}return!0}}return!1},D$=()=>({tr:t,dispatch:e})=>{const{selection:A}=t,{empty:n,ranges:r}=A;return n||e&&r.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},L$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{var o;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=A,l=Fo(t,n.schema),{$from:u,empty:f,ranges:h}=a;if(!r)return!0;if(f&&i){let{from:p,to:g}=a;const B=(o=u.marks().find(b=>b.type===l))==null?void 0:o.attrs,y=zm(u,l,B);y&&(p=y.from,g=y.to),A.removeMark(p,g,l)}else h.forEach(p=>{A.removeMark(p.$from.pos,p.$to.pos,l)});return A.removeStoredMark(l),!0},O$=(t,e={})=>({tr:A,state:n,dispatch:r})=>{let o=null,i=null;const a=Wu(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=wA(t,n.schema)),a==="mark"&&(i=Fo(t,n.schema)),r&&A.selection.ranges.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;let h,p,g,B;A.selection.empty?n.doc.nodesBetween(u,f,(y,b)=>{o&&o===y.type&&(g=Math.max(b,u),B=Math.min(b+y.nodeSize,f),h=b,p=y)}):n.doc.nodesBetween(u,f,(y,b)=>{b<u&&o&&o===y.type&&(g=Math.max(b,u),B=Math.min(b+y.nodeSize,f),h=b,p=y),b>=u&&b<=f&&(o&&o===y.type&&A.setNodeMarkup(b,void 0,{...y.attrs,...e}),i&&y.marks.length&&y.marks.forEach(w=>{if(i===w.type){const v=Math.max(b,u),S=Math.min(b+y.nodeSize,f);A.addMark(v,S,i.create({...w.attrs,...e}))}}))}),p&&(h!==void 0&&A.setNodeMarkup(h,void 0,{...p.attrs,...e}),i&&p.marks.length&&p.marks.forEach(y=>{i===y.type&&A.addMark(g,B,i.create({...y.attrs,...e}))}))}),!0):!1},M$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return Y4(r,e)(A,n)},N$=(t,e={})=>({state:A,dispatch:n})=>{const r=wA(t,A.schema);return J4(r,e)(A,n)},YE=dA.create({name:"commands",addCommands(){return{...KE}}}),JE=dA.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var A,n,r;const o=()=>{var i,a,l,u;if((u=(l=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const f=vE(t.before,[t,...e]);DE(f).forEach(g=>{f.mapping.mapResult(g.oldRange.from).deletedAfter&&f.mapping.mapResult(g.oldRange.to).deletedBefore&&f.before.nodesBetween(g.oldRange.from,g.oldRange.to,(B,y)=>{const b=y+B.nodeSize-2,w=g.oldRange.from<=y&&b<=g.oldRange.to;this.editor.emit("delete",{type:"node",node:B,from:y,to:b,newFrom:f.mapping.map(y),newTo:f.mapping.map(b),deletedRange:g.oldRange,newRange:g.newRange,partial:!w,editor:this.editor,transaction:t,combinedTransform:f})})});const p=f.mapping;f.steps.forEach((g,B)=>{var y,b;if(g instanceof kr){const w=p.slice(B).map(g.from,-1),v=p.slice(B).map(g.to),S=p.invert().map(w,-1),F=p.invert().map(v),I=(y=f.doc.nodeAt(w-1))==null?void 0:y.marks.some(x=>x.eq(g.mark)),Q=(b=f.doc.nodeAt(v))==null?void 0:b.marks.some(x=>x.eq(g.mark));this.editor.emit("delete",{type:"mark",mark:g.mark,from:g.from,to:g.to,deletedRange:{from:S,to:F},newRange:{from:w,to:v},partial:!!(Q||I),editor:this.editor,transaction:t,combinedTransform:f})}})};(r=(n=(A=this.editor.options.coreExtensionOptions)==null?void 0:A.delete)==null?void 0:n.async)==null||r?setTimeout(o,0):o()}}),XE=dA.create({name:"drop",addProseMirrorPlugins(){return[new AA({key:new DA("tiptapDrop"),props:{handleDrop:(t,e,A,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:A,moved:n})}}})]}}),jE=dA.create({name:"editable",addProseMirrorPlugins(){return[new AA({key:new DA("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qE=new DA("focusEvents"),ZE=dA.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new AA({key:qE,props:{handleDOMEvents:{focus:(e,A)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:A}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,A)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:A}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),e1=dA.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:f,$anchor:h}=l,{pos:p,parent:g}=h,B=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,y=B.parent.type.spec.isolating,b=h.pos-h.parentOffset,w=y&&B.parent.childCount===1?b===h.pos:nt.atStart(u).from===p;return!f||!g.type.isTextblock||g.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"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 qm()||GE()?o:r},addProseMirrorPlugins(){return[new AA({key:new DA("clearDocument"),appendTransaction:(t,e,A)=>{if(t.some(y=>y.getMeta("composition")))return;const n=t.some(y=>y.docChanged)&&!e.doc.eq(A.doc),r=t.some(y=>y.getMeta("preventClearDocument"));if(!n||r)return;const{empty:o,from:i,to:a}=e.selection,l=nt.atStart(e.doc).from,u=nt.atEnd(e.doc).to;if(o||!(i===l&&a===u)||!Ju(A.doc))return;const p=A.tr,g=Pu({state:A,transaction:p}),{commands:B}=new Vu({editor:this.editor,state:g});if(B.clearNodes(),!!p.steps.length)return p}})]}}),t1=dA.create({name:"paste",addProseMirrorPlugins(){return[new AA({key:new DA("tiptapPaste"),props:{handlePaste:(t,e,A)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:A})}}})]}}),A1=dA.create({name:"tabindex",addProseMirrorPlugins(){return[new AA({key:new DA("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),H$=class il{constructor(e,A,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=A,this.currentNode=r}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 A=this.from,n=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}A=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:A,to:n},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),A=this.resolvedPos.doc.resolve(e);return new il(A,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 il(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 il(e,this.editor)}get children(){const e=[];return this.node.content.forEach((A,n)=>{const r=A.isBlock&&!A.isTextblock,o=A.isAtom&&!A.isText,i=this.pos+n+(o?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(i);if(!r&&a.depth<=this.depth)return;const l=new il(a,this.editor,r,r?A:null);r&&(l.actualDepth=this.depth+1),e.push(new il(a,this.editor,r,r?A:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,A={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(A).length>0){const o=r.node.attrs,i=Object.keys(A);for(let a=0;a<i.length;a+=1){const l=i[a];if(o[l]!==A[l])break}}else n=r;r=r.parent}return n}querySelector(e,A={}){return this.querySelectorAll(e,A,!0)[0]||null}querySelectorAll(e,A={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;const o=Object.keys(A);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===e&&o.every(l=>A[l]===i.node.attrs[l])&&r.push(i),!(n&&r.length>0)&&(r=r.concat(i.querySelectorAll(e,A,n))))}),r}setAttribute(e){const{tr:A}=this.editor.state;A.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(A)}},R$=`.ProseMirror {
38
38
  position: relative;
39
39
  }
40
40
 
@@ -106,24 +106,24 @@ img.ProseMirror-separator {
106
106
  display: block;
107
107
  }`;function P$(t,e,A){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}var V$=class extends nV{constructor(e={}){super(),this.css=null,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,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),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 A=this.createDoc(),n=PE(A,this.options.autofocus);this.editorState=da.create({doc:A,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){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(e),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null}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=P$(R$,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,A=!0){this.setOptions({editable:e}),A&&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:e=>{this.editorState=e},dispatch:e=>{this.editorState=this.state.apply(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,A)=>{if(A==="state")return this.editorState;if(A in e)return Reflect.get(e,A);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${A}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,A){const n=kE(A)?A(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const A=this.state.plugins;let n=A;if([].concat(e).forEach(o=>{const i=typeof o=="string"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(i))}),A.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,A;const r=[...this.options.enableCoreExtensions?[jE,$E.configure({blockSeparator:(A=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:A.blockSeparator}),YE,ZE,e1,A1,XE,t1,JE].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 ed(r,this)}createCommandManager(){this.commandManager=new Vu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Vm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(A){if(!(A instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(A.message))throw A;this.emit("contentError",{editor:this,error:A,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(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=Vm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var A;this.editorView=new AE(e,{...this.options.editorProps,attributes:{role:"textbox",...(A=this.options.editorProps)==null?void 0:A.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const A=this.capturedTransaction;return this.capturedTransaction=null,A}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(f=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(f)});return}const{state:A,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(A.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:A}),!o)return;this.view.updateState(A),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=n.findLast(f=>f.getMeta("focus")||f.getMeta("blur")),l=a?.getMeta("focus"),u=a?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),u&&this.emit("blur",{editor:this,event:u.event,transaction:a}),!(e.getMeta("preventUpdate")||!n.some(f=>f.docChanged)||i.doc.eq(A.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return _E(this.state,e)}isActive(e,A){const n=typeof e=="string"?e:null,r=typeof e=="string"?A:e;return gV(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Km(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:A=`
108
108
 
109
- `,textSerializers:n={}}=e||{};return uV(this.state.doc,{blockSeparator:A,textSerializers:{...xE(this.schema),...n}})}get isEmpty(){return Ju(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,A;return(A=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?A:!0}$node(e,A){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,A))||null}$nodes(e,A){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,A))||null}$pos(e){const A=this.state.doc.resolve(e);return new H$(A,this)}get $doc(){return this.$pos(0)}};function gs(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=Ut(t.getAttributes,void 0,n);if(r===!1||r===null)return null;const{tr:o}=e,i=n[n.length-1],a=n[0];if(i){const l=a.search(/\S/),u=A.from+a.indexOf(i),f=u+i.length;if(Ym(A.from,A.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>u).length)return null;f<A.to&&o.delete(f,A.to),u>A.from&&o.delete(A.from+l,u);const p=A.from+l+i.length;o.addMark(A.from+l,p,t.type.create(r||{})),o.removeStoredMark(t.type)}}})}function $$(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=Ut(t.getAttributes,void 0,n)||{},{tr:o}=e,i=A.from;let a=A.to;const l=t.type.create(r);if(n[1]){const u=n[0].lastIndexOf(n[1]);let f=i+u;f>a?f=a:a=f+n[1].length;const h=n[0][n[0].length-1];o.insertText(h,i+n[0].length-1),o.replaceWith(f,a,l)}else if(n[0]){const u=t.type.isInline?i:i-1;o.insert(u,t.type.create(r)).delete(o.mapping.map(i),o.mapping.map(a))}o.scrollIntoView()}})}function tg(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=e.doc.resolve(A.from),o=Ut(t.getAttributes,void 0,n)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(A.from,A.to).setBlockType(A.from,A.from,t.type,o)}})}function wa(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n,chain:r})=>{const o=Ut(t.getAttributes,void 0,n)||{},i=e.tr.delete(A.from,A.to),l=i.doc.resolve(A.from).blockRange(),u=l&&rm(l,t.type,o);if(!u)return null;if(i.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:g}=t.editor.extensionManager,B=p||h.$to.parentOffset&&h.$from.marks();if(B){const y=B.filter(b=>g.includes(b.type.name));i.ensureMarks(y)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(h,o).run()}const f=i.doc.resolve(A.from-1).nodeBefore;f&&f.type===t.type&&ai(i.doc,A.from-1)&&(!t.joinPredicate||t.joinPredicate(n,f))&&i.join(A.from-1)}})}function K$(t,e){const{selection:A}=t,{$from:n}=A;if(A instanceof Pe){const o=n.index();return n.parent.canReplaceWith(o,o+1,e)}let r=n.depth;for(;r>=0;){const o=n.index(r);if(n.node(r).contentMatchAt(o).matchType(e))return!0;r-=1}return!1}function G$(t,e,A={}){const{state:n}=e,{doc:r,tr:o}=n,i=t;r.descendants((a,l)=>{const u=o.mapping.map(l),f=o.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(g=>{if(g!==i)return!1;h=g}),!h)return;let p=!1;if(Object.keys(A).forEach(g=>{A[g]!==h.attrs[g]&&(p=!0)}),p){const g=t.type.create({...t.attrs,...A});o.removeMark(u,f,t.type),o.addMark(u,f,g)}}),o.docChanged&&e.view.dispatch(o)}var Mn=class m_ extends jm{constructor(){super(...arguments),this.type="node"}static create(e={}){const A=typeof e=="function"?e():e;return new m_(A)}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}};function wi(t){return new kV({find:t.find,handler:({state:e,range:A,match:n,pasteEvent:r})=>{const o=Ut(t.getAttributes,void 0,n,r);if(o===!1||o===null)return null;const{tr:i}=e,a=n[n.length-1],l=n[0];let u=A.to;if(a){const f=l.search(/\S/),h=A.from+l.indexOf(a),p=h+a.length;if(Ym(A.from,A.to,e.doc).filter(B=>B.mark.type.excluded.find(b=>b===t.type&&b!==B.mark.type)).filter(B=>B.to>h).length)return null;p<A.to&&i.delete(p,A.to),h>A.from&&i.delete(A.from+f,h),u=A.from+f+a.length,i.addMark(A.from+f,u,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}var W$=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,z$=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Y$=yi.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[gs({find:W$,type:this.type})]},addPasteRules(){return[wi({find:z$,type:this.type})]}}),J$=Y$,X$=dA.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(A=>e.updateAttributes(A,{textAlign:t})).every(A=>A):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:A})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?A.unsetTextAlign():A.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),j$=X$;const q$="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Z$="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ag="numeric",ng="ascii",rg="alpha",Gl="asciinumeric",Wl="alphanumeric",og="domain",n1="emoji",eK="scheme",tK="slashscheme",ig="whitespace";function AK(t,e){return t in e||(e[t]=[]),e[t]}function Bs(t,e,A){e[Ag]&&(e[Gl]=!0,e[Wl]=!0),e[ng]&&(e[Gl]=!0,e[rg]=!0),e[Gl]&&(e[Wl]=!0),e[rg]&&(e[Wl]=!0),e[Wl]&&(e[og]=!0),e[n1]&&(e[og]=!0);for(const n in e){const r=AK(n,A);r.indexOf(t)<0&&r.push(t)}}function nK(t,e){const A={};for(const n in e)e[n].indexOf(t)>=0&&(A[n]=!0);return A}function vn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}vn.groups={},vn.prototype={accepts(){return!!this.t},go(t){const e=this,A=e.j[t];if(A)return A;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,A,n){for(let r=0;r<t.length;r++)this.tt(t[r],e,A,n)},tr(t,e,A,n){n=n||vn.groups;let r;return e&&e.j?r=e:(r=new vn(e),A&&n&&Bs(e,A,n)),this.jr.push([t,r]),r},ts(t,e,A,n){let r=this;const o=t.length;if(!o)return r;for(let i=0;i<o-1;i++)r=r.tt(t[i]);return r.tt(t[o-1],e,A,n)},tt(t,e,A,n){n=n||vn.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const o=e;let i,a=r.go(t);if(a?(i=new vn,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new vn,o){if(n)if(i.t&&typeof i.t=="string"){const l=Object.assign(nK(i.t,n),A);Bs(o,l,n)}else A&&Bs(o,A,n);i.t=o}return r.j[t]=i,i}};const it=(t,e,A,n,r)=>t.ta(e,A,n,r),nA=(t,e,A,n,r)=>t.tr(e,A,n,r),r1=(t,e,A,n,r)=>t.ts(e,A,n,r),Ee=(t,e,A,n,r)=>t.tt(e,A,n,r),Uo="WORD",sg="UWORD",o1="ASCIINUMERICAL",i1="ALPHANUMERICAL",zl="LOCALHOST",ag="TLD",lg="UTLD",td="SCHEME",Ca="SLASH_SCHEME",cg="NUM",ug="WS",dg="NL",Yl="OPENBRACE",Jl="CLOSEBRACE",Ad="OPENBRACKET",nd="CLOSEBRACKET",rd="OPENPAREN",od="CLOSEPAREN",id="OPENANGLEBRACKET",sd="CLOSEANGLEBRACKET",ad="FULLWIDTHLEFTPAREN",ld="FULLWIDTHRIGHTPAREN",cd="LEFTCORNERBRACKET",ud="RIGHTCORNERBRACKET",dd="LEFTWHITECORNERBRACKET",fd="RIGHTWHITECORNERBRACKET",hd="FULLWIDTHLESSTHAN",pd="FULLWIDTHGREATERTHAN",md="AMPERSAND",gd="APOSTROPHE",Bd="ASTERISK",Ci="AT",yd="BACKSLASH",wd="BACKTICK",Cd="CARET",bi="COLON",fg="COMMA",bd="DOLLAR",Xr="DOT",vd="EQUALS",hg="EXCLAMATION",tr="HYPHEN",Xl="PERCENT",Ed="PIPE",kd="PLUS",Sd="POUND",jl="QUERY",pg="QUOTE",s1="FULLWIDTHMIDDLEDOT",mg="SEMI",jr="SLASH",ql="TILDE",Qd="UNDERSCORE",a1="EMOJI",Fd="SYM";var l1=Object.freeze({__proto__:null,ALPHANUMERICAL:i1,AMPERSAND:md,APOSTROPHE:gd,ASCIINUMERICAL:o1,ASTERISK:Bd,AT:Ci,BACKSLASH:yd,BACKTICK:wd,CARET:Cd,CLOSEANGLEBRACKET:sd,CLOSEBRACE:Jl,CLOSEBRACKET:nd,CLOSEPAREN:od,COLON:bi,COMMA:fg,DOLLAR:bd,DOT:Xr,EMOJI:a1,EQUALS:vd,EXCLAMATION:hg,FULLWIDTHGREATERTHAN:pd,FULLWIDTHLEFTPAREN:ad,FULLWIDTHLESSTHAN:hd,FULLWIDTHMIDDLEDOT:s1,FULLWIDTHRIGHTPAREN:ld,HYPHEN:tr,LEFTCORNERBRACKET:cd,LEFTWHITECORNERBRACKET:dd,LOCALHOST:zl,NL:dg,NUM:cg,OPENANGLEBRACKET:id,OPENBRACE:Yl,OPENBRACKET:Ad,OPENPAREN:rd,PERCENT:Xl,PIPE:Ed,PLUS:kd,POUND:Sd,QUERY:jl,QUOTE:pg,RIGHTCORNERBRACKET:ud,RIGHTWHITECORNERBRACKET:fd,SCHEME:td,SEMI:mg,SLASH:jr,SLASH_SCHEME:Ca,SYM:Fd,TILDE:ql,TLD:ag,UNDERSCORE:Qd,UTLD:lg,UWORD:sg,WORD:Uo,WS:ug});const Io=/[a-z]/,Zl=new RegExp("\\p{L}","u"),gg=new RegExp("\\p{Emoji}","u"),xo=/\d/,Bg=/\s/,c1="\r",yg=`
109
+ `,textSerializers:n={}}=e||{};return uV(this.state.doc,{blockSeparator:A,textSerializers:{...xE(this.schema),...n}})}get isEmpty(){return Ju(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,A;return(A=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?A:!0}$node(e,A){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,A))||null}$nodes(e,A){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,A))||null}$pos(e){const A=this.state.doc.resolve(e);return new H$(A,this)}get $doc(){return this.$pos(0)}};function gs(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=Ut(t.getAttributes,void 0,n);if(r===!1||r===null)return null;const{tr:o}=e,i=n[n.length-1],a=n[0];if(i){const l=a.search(/\S/),u=A.from+a.indexOf(i),f=u+i.length;if(Ym(A.from,A.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>u).length)return null;f<A.to&&o.delete(f,A.to),u>A.from&&o.delete(A.from+l,u);const p=A.from+l+i.length;o.addMark(A.from+l,p,t.type.create(r||{})),o.removeStoredMark(t.type)}}})}function $$(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=Ut(t.getAttributes,void 0,n)||{},{tr:o}=e,i=A.from;let a=A.to;const l=t.type.create(r);if(n[1]){const u=n[0].lastIndexOf(n[1]);let f=i+u;f>a?f=a:a=f+n[1].length;const h=n[0][n[0].length-1];o.insertText(h,i+n[0].length-1),o.replaceWith(f,a,l)}else if(n[0]){const u=t.type.isInline?i:i-1;o.insert(u,t.type.create(r)).delete(o.mapping.map(i),o.mapping.map(a))}o.scrollIntoView()}})}function tg(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n})=>{const r=e.doc.resolve(A.from),o=Ut(t.getAttributes,void 0,n)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(A.from,A.to).setBlockType(A.from,A.from,t.type,o)}})}function wa(t){return new Xu({find:t.find,handler:({state:e,range:A,match:n,chain:r})=>{const o=Ut(t.getAttributes,void 0,n)||{},i=e.tr.delete(A.from,A.to),l=i.doc.resolve(A.from).blockRange(),u=l&&rm(l,t.type,o);if(!u)return null;if(i.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:g}=t.editor.extensionManager,B=p||h.$to.parentOffset&&h.$from.marks();if(B){const y=B.filter(b=>g.includes(b.type.name));i.ensureMarks(y)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(h,o).run()}const f=i.doc.resolve(A.from-1).nodeBefore;f&&f.type===t.type&&ai(i.doc,A.from-1)&&(!t.joinPredicate||t.joinPredicate(n,f))&&i.join(A.from-1)}})}function K$(t,e){const{selection:A}=t,{$from:n}=A;if(A instanceof Pe){const o=n.index();return n.parent.canReplaceWith(o,o+1,e)}let r=n.depth;for(;r>=0;){const o=n.index(r);if(n.node(r).contentMatchAt(o).matchType(e))return!0;r-=1}return!1}function G$(t,e,A={}){const{state:n}=e,{doc:r,tr:o}=n,i=t;r.descendants((a,l)=>{const u=o.mapping.map(l),f=o.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(g=>{if(g!==i)return!1;h=g}),!h)return;let p=!1;if(Object.keys(A).forEach(g=>{A[g]!==h.attrs[g]&&(p=!0)}),p){const g=t.type.create({...t.attrs,...A});o.removeMark(u,f,t.type),o.addMark(u,f,g)}}),o.docChanged&&e.view.dispatch(o)}var Mn=class m_ extends jm{constructor(){super(...arguments),this.type="node"}static create(e={}){const A=typeof e=="function"?e():e;return new m_(A)}configure(e){return super.configure(e)}extend(e){const A=typeof e=="function"?e():e;return super.extend(A)}};function wi(t){return new kV({find:t.find,handler:({state:e,range:A,match:n,pasteEvent:r})=>{const o=Ut(t.getAttributes,void 0,n,r);if(o===!1||o===null)return null;const{tr:i}=e,a=n[n.length-1],l=n[0];let u=A.to;if(a){const f=l.search(/\S/),h=A.from+l.indexOf(a),p=h+a.length;if(Ym(A.from,A.to,e.doc).filter(B=>B.mark.type.excluded.find(b=>b===t.type&&b!==B.mark.type)).filter(B=>B.to>h).length)return null;p<A.to&&i.delete(p,A.to),h>A.from&&i.delete(A.from+f,h),u=A.from+f+a.length,i.addMark(A.from+f,u,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}var W$=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,z$=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Y$=yi.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[gs({find:W$,type:this.type})]},addPasteRules(){return[wi({find:z$,type:this.type})]}}),J$=Y$,X$=dA.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(A=>e.updateAttributes(A,{textAlign:t})).every(A=>A):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:A})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?A.unsetTextAlign():A.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),j$=X$;const q$="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Z$="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ag="numeric",ng="ascii",rg="alpha",Gl="asciinumeric",Wl="alphanumeric",og="domain",n1="emoji",eK="scheme",tK="slashscheme",ig="whitespace";function AK(t,e){return t in e||(e[t]=[]),e[t]}function Bs(t,e,A){e[Ag]&&(e[Gl]=!0,e[Wl]=!0),e[ng]&&(e[Gl]=!0,e[rg]=!0),e[Gl]&&(e[Wl]=!0),e[rg]&&(e[Wl]=!0),e[Wl]&&(e[og]=!0),e[n1]&&(e[og]=!0);for(const n in e){const r=AK(n,A);r.indexOf(t)<0&&r.push(t)}}function nK(t,e){const A={};for(const n in e)e[n].indexOf(t)>=0&&(A[n]=!0);return A}function vn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}vn.groups={},vn.prototype={accepts(){return!!this.t},go(t){const e=this,A=e.j[t];if(A)return A;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,A,n){for(let r=0;r<t.length;r++)this.tt(t[r],e,A,n)},tr(t,e,A,n){n=n||vn.groups;let r;return e&&e.j?r=e:(r=new vn(e),A&&n&&Bs(e,A,n)),this.jr.push([t,r]),r},ts(t,e,A,n){let r=this;const o=t.length;if(!o)return r;for(let i=0;i<o-1;i++)r=r.tt(t[i]);return r.tt(t[o-1],e,A,n)},tt(t,e,A,n){n=n||vn.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const o=e;let i,a=r.go(t);if(a?(i=new vn,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new vn,o){if(n)if(i.t&&typeof i.t=="string"){const l=Object.assign(nK(i.t,n),A);Bs(o,l,n)}else A&&Bs(o,A,n);i.t=o}return r.j[t]=i,i}};const it=(t,e,A,n,r)=>t.ta(e,A,n,r),nA=(t,e,A,n,r)=>t.tr(e,A,n,r),r1=(t,e,A,n,r)=>t.ts(e,A,n,r),Ee=(t,e,A,n,r)=>t.tt(e,A,n,r),Uo="WORD",sg="UWORD",o1="ASCIINUMERICAL",i1="ALPHANUMERICAL",zl="LOCALHOST",ag="TLD",lg="UTLD",td="SCHEME",Ca="SLASH_SCHEME",cg="NUM",ug="WS",dg="NL",Yl="OPENBRACE",Jl="CLOSEBRACE",Ad="OPENBRACKET",nd="CLOSEBRACKET",rd="OPENPAREN",od="CLOSEPAREN",id="OPENANGLEBRACKET",sd="CLOSEANGLEBRACKET",ad="FULLWIDTHLEFTPAREN",ld="FULLWIDTHRIGHTPAREN",cd="LEFTCORNERBRACKET",ud="RIGHTCORNERBRACKET",dd="LEFTWHITECORNERBRACKET",fd="RIGHTWHITECORNERBRACKET",hd="FULLWIDTHLESSTHAN",pd="FULLWIDTHGREATERTHAN",md="AMPERSAND",gd="APOSTROPHE",Bd="ASTERISK",Ci="AT",yd="BACKSLASH",wd="BACKTICK",Cd="CARET",bi="COLON",fg="COMMA",bd="DOLLAR",Xr="DOT",vd="EQUALS",hg="EXCLAMATION",tr="HYPHEN",Xl="PERCENT",Ed="PIPE",kd="PLUS",Sd="POUND",jl="QUERY",pg="QUOTE",s1="FULLWIDTHMIDDLEDOT",mg="SEMI",jr="SLASH",ql="TILDE",Qd="UNDERSCORE",a1="EMOJI",Fd="SYM";var l1=Object.freeze({__proto__:null,ALPHANUMERICAL:i1,AMPERSAND:md,APOSTROPHE:gd,ASCIINUMERICAL:o1,ASTERISK:Bd,AT:Ci,BACKSLASH:yd,BACKTICK:wd,CARET:Cd,CLOSEANGLEBRACKET:sd,CLOSEBRACE:Jl,CLOSEBRACKET:nd,CLOSEPAREN:od,COLON:bi,COMMA:fg,DOLLAR:bd,DOT:Xr,EMOJI:a1,EQUALS:vd,EXCLAMATION:hg,FULLWIDTHGREATERTHAN:pd,FULLWIDTHLEFTPAREN:ad,FULLWIDTHLESSTHAN:hd,FULLWIDTHMIDDLEDOT:s1,FULLWIDTHRIGHTPAREN:ld,HYPHEN:tr,LEFTCORNERBRACKET:cd,LEFTWHITECORNERBRACKET:dd,LOCALHOST:zl,NL:dg,NUM:cg,OPENANGLEBRACKET:id,OPENBRACE:Yl,OPENBRACKET:Ad,OPENPAREN:rd,PERCENT:Xl,PIPE:Ed,PLUS:kd,POUND:Sd,QUERY:jl,QUOTE:pg,RIGHTCORNERBRACKET:ud,RIGHTWHITECORNERBRACKET:fd,SCHEME:td,SEMI:mg,SLASH:jr,SLASH_SCHEME:Ca,SYM:Fd,TILDE:ql,TLD:ag,UNDERSCORE:Qd,UTLD:lg,UWORD:sg,WORD:Uo,WS:ug});const Io=/[a-z]/,Zl=new RegExp("\\p{L}","u"),gg=new RegExp("\\p{Emoji}","u"),xo=/\d/,Bg=/\s/,c1="\r",yg=`
110
110
  `,rK="️",oK="‍",wg="";let Ud=null,Id=null;function iK(t=[]){const e={};vn.groups=e;const A=new vn;Ud==null&&(Ud=d1(q$)),Id==null&&(Id=d1(Z$)),Ee(A,"'",gd),Ee(A,"{",Yl),Ee(A,"}",Jl),Ee(A,"[",Ad),Ee(A,"]",nd),Ee(A,"(",rd),Ee(A,")",od),Ee(A,"<",id),Ee(A,">",sd),Ee(A,"(",ad),Ee(A,")",ld),Ee(A,"「",cd),Ee(A,"」",ud),Ee(A,"『",dd),Ee(A,"』",fd),Ee(A,"<",hd),Ee(A,">",pd),Ee(A,"&",md),Ee(A,"*",Bd),Ee(A,"@",Ci),Ee(A,"`",wd),Ee(A,"^",Cd),Ee(A,":",bi),Ee(A,",",fg),Ee(A,"$",bd),Ee(A,".",Xr),Ee(A,"=",vd),Ee(A,"!",hg),Ee(A,"-",tr),Ee(A,"%",Xl),Ee(A,"|",Ed),Ee(A,"+",kd),Ee(A,"#",Sd),Ee(A,"?",jl),Ee(A,'"',pg),Ee(A,"/",jr),Ee(A,";",mg),Ee(A,"~",ql),Ee(A,"_",Qd),Ee(A,"\\",yd),Ee(A,"・",s1);const n=nA(A,xo,cg,{[Ag]:!0});nA(n,xo,n);const r=nA(n,Io,o1,{[Gl]:!0}),o=nA(n,Zl,i1,{[Wl]:!0}),i=nA(A,Io,Uo,{[ng]:!0});nA(i,xo,r),nA(i,Io,i),nA(r,xo,r),nA(r,Io,r);const a=nA(A,Zl,sg,{[rg]:!0});nA(a,Io),nA(a,xo,o),nA(a,Zl,a),nA(o,xo,o),nA(o,Io),nA(o,Zl,o);const l=Ee(A,yg,dg,{[ig]:!0}),u=Ee(A,c1,ug,{[ig]:!0}),f=nA(A,Bg,ug,{[ig]:!0});Ee(A,wg,f),Ee(u,yg,l),Ee(u,wg,f),nA(u,Bg,f),Ee(f,c1),Ee(f,yg),nA(f,Bg,f),Ee(f,wg,f);const h=nA(A,gg,a1,{[n1]:!0});Ee(h,"#"),nA(h,gg,h),Ee(h,rK,h);const p=Ee(h,oK);Ee(p,"#"),nA(p,gg,h);const g=[[Io,i],[xo,r]],B=[[Io,null],[Zl,a],[xo,o]];for(let y=0;y<Ud.length;y++)vi(A,Ud[y],ag,Uo,g);for(let y=0;y<Id.length;y++)vi(A,Id[y],lg,sg,B);Bs(ag,{tld:!0,ascii:!0},e),Bs(lg,{utld:!0,alpha:!0},e),vi(A,"file",td,Uo,g),vi(A,"mailto",td,Uo,g),vi(A,"http",Ca,Uo,g),vi(A,"https",Ca,Uo,g),vi(A,"ftp",Ca,Uo,g),vi(A,"ftps",Ca,Uo,g),Bs(td,{scheme:!0,ascii:!0},e),Bs(Ca,{slashscheme:!0,ascii:!0},e),t=t.sort((y,b)=>y[0]>b[0]?1:-1);for(let y=0;y<t.length;y++){const b=t[y][0],v=t[y][1]?{[eK]:!0}:{[tK]:!0};b.indexOf("-")>=0?v[og]=!0:Io.test(b)?xo.test(b)?v[Gl]=!0:v[ng]=!0:v[Ag]=!0,r1(A,b,b,v)}return r1(A,"localhost",zl,{ascii:!0}),A.jd=new vn(Fd),{start:A,tokens:Object.assign({groups:e},l1)}}function u1(t,e){const A=sK(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=A.length,r=[];let o=0,i=0;for(;i<n;){let a=t,l=null,u=0,f=null,h=-1,p=-1;for(;i<n&&(l=a.go(A[i]));)a=l,a.accepts()?(h=0,p=0,f=a):h>=0&&(h+=A[i].length,p++),u+=A[i].length,o+=A[i].length,i++;o-=h,i-=p,u-=h,r.push({t:f.t,v:e.slice(o-u,o),s:o-u,e:o})}return r}function sK(t){const e=[],A=t.length;let n=0;for(;n<A;){let r=t.charCodeAt(n),o,i=r<55296||r>56319||n+1===A||(o=t.charCodeAt(n+1))<56320||o>57343?t[n]:t.slice(n,n+2);e.push(i),n+=i.length}return e}function vi(t,e,A,n,r){let o;const i=e.length;for(let a=0;a<i-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new vn(n),o.jr=r.slice(),t.j[l]=o),t=o}return o=new vn(A),o.jr=r.slice(),t.j[e[i-1]]=o,o}function d1(t){const e=[],A=[];let n=0,r="0123456789";for(;n<t.length;){let o=0;for(;r.indexOf(t[n+o])>=0;)o++;if(o>0){e.push(A.join(""));for(let i=parseInt(t.substring(n,n+o),10);i>0;i--)A.pop();n+=o}else A.push(t[n]),n++}return e}const ec={defaultProtocol:"http",events:null,format:f1,formatHref:f1,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Cg(t,e=null){let A=Object.assign({},ec);t&&(A=Object.assign(A,t instanceof Cg?t.o:t));const n=A.ignoreTags,r=[];for(let o=0;o<n.length;o++)r.push(n[o].toUpperCase());this.o=A,e&&(this.defaultRender=e),this.ignoreTags=r}Cg.prototype={o:ec,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,A){const n=e!=null;let r=this.o[t];return r&&(typeof r=="object"?(r=A.t in r?r[A.t]:ec[t],typeof r=="function"&&n&&(r=r(e,A))):typeof r=="function"&&n&&(r=r(e,A.t,A)),r)},getObj(t,e,A){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,A.t,A)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function f1(t){return t}function h1(t,e){this.t="token",this.v=t,this.tk=e}h1.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),A=t.get("truncate",e,this),n=t.get("format",e,this);return A&&n.length>A?n.substring(0,A)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=ec.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,A=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",A,this),r=t.get("tagName",A,e),o=this.toFormattedString(t),i={},a=t.get("className",A,e),l=t.get("target",A,e),u=t.get("rel",A,e),f=t.getObj("attributes",A,e),h=t.getObj("events",A,e);return i.href=n,a&&(i.class=a),l&&(i.target=l),u&&(i.rel=u),f&&Object.assign(i,f),{tagName:r,attributes:i,content:o,eventListeners:h}}};function xd(t,e){class A extends h1{constructor(r,o){super(r,o),this.t=t}}for(const n in e)A.prototype[n]=e[n];return A.t=t,A}const p1=xd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),m1=xd("text"),aK=xd("nl"),Td=xd("url",{isLink:!0,toHref(t=ec.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==zl&&t[1].t===bi}}),Ar=t=>new vn(t);function lK({groups:t}){const e=t.domain.concat([md,Bd,Ci,yd,wd,Cd,bd,vd,tr,cg,Xl,Ed,kd,Sd,jr,Fd,ql,Qd]),A=[gd,bi,fg,Xr,hg,Xl,jl,pg,mg,id,sd,Yl,Jl,nd,Ad,rd,od,ad,ld,cd,ud,dd,fd,hd,pd],n=[md,gd,Bd,yd,wd,Cd,bd,vd,tr,Yl,Jl,Xl,Ed,kd,Sd,jl,jr,Fd,ql,Qd],r=Ar(),o=Ee(r,ql);it(o,n,o),it(o,t.domain,o);const i=Ar(),a=Ar(),l=Ar();it(r,t.domain,i),it(r,t.scheme,a),it(r,t.slashscheme,l),it(i,n,o),it(i,t.domain,i);const u=Ee(i,Ci);Ee(o,Ci,u),Ee(a,Ci,u),Ee(l,Ci,u);const f=Ee(o,Xr);it(f,n,o),it(f,t.domain,o);const h=Ar();it(u,t.domain,h),it(h,t.domain,h);const p=Ee(h,Xr);it(p,t.domain,h);const g=Ar(p1);it(p,t.tld,g),it(p,t.utld,g),Ee(u,zl,g);const B=Ee(h,tr);Ee(B,tr,B),it(B,t.domain,h),it(g,t.domain,h),Ee(g,Xr,p),Ee(g,tr,B);const y=Ee(g,bi);it(y,t.numeric,p1);const b=Ee(i,tr),w=Ee(i,Xr);Ee(b,tr,b),it(b,t.domain,i),it(w,n,o),it(w,t.domain,i);const v=Ar(Td);it(w,t.tld,v),it(w,t.utld,v),it(v,t.domain,i),it(v,n,o),Ee(v,Xr,w),Ee(v,tr,b),Ee(v,Ci,u);const S=Ee(v,bi),F=Ar(Td);it(S,t.numeric,F);const I=Ar(Td),Q=Ar();it(I,e,I),it(I,A,Q),it(Q,e,I),it(Q,A,Q),Ee(v,jr,I),Ee(F,jr,I);const x=Ee(a,bi),M=Ee(l,bi),O=Ee(M,jr),P=Ee(O,jr);it(a,t.domain,i),Ee(a,Xr,w),Ee(a,tr,b),it(l,t.domain,i),Ee(l,Xr,w),Ee(l,tr,b),it(x,t.domain,I),Ee(x,jr,I),Ee(x,jl,I),it(P,t.domain,I),it(P,e,I),Ee(P,jr,I);const ie=[[Yl,Jl],[Ad,nd],[rd,od],[id,sd],[ad,ld],[cd,ud],[dd,fd],[hd,pd]];for(let ae=0;ae<ie.length;ae++){const[ue,H]=ie[ae],G=Ee(I,ue);Ee(Q,ue,G),Ee(G,H,I);const $=Ar(Td);it(G,e,$);const te=Ar();it(G,A),it($,e,$),it($,A,te),it(te,e,$),it(te,A,te),Ee($,H,I),Ee(te,H,I)}return Ee(r,zl,v),Ee(r,dg,aK),{start:r,tokens:l1}}function cK(t,e,A){let n=A.length,r=0,o=[],i=[];for(;r<n;){let a=t,l=null,u=null,f=0,h=null,p=-1;for(;r<n&&!(l=a.go(A[r].t));)i.push(A[r++]);for(;r<n&&(u=l||a.go(A[r].t));)l=null,a=u,a.accepts()?(p=0,h=a):p>=0&&p++,r++,f++;if(p<0)r-=f,r<n&&(i.push(A[r]),r++);else{i.length>0&&(o.push(bg(m1,e,i)),i=[]),r-=p,f-=p;const g=h.t,B=A.slice(r-f,r);o.push(bg(g,e,B))}}return i.length>0&&o.push(bg(m1,e,i)),o}function bg(t,e,A){const n=A[0].s,r=A[A.length-1].e,o=e.slice(n,r);return new t(o,A)}const uK=typeof console<"u"&&console&&console.warn||(()=>{}),dK="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Pt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function fK(){return vn.groups={},Pt.scanner=null,Pt.parser=null,Pt.tokenQueue=[],Pt.pluginQueue=[],Pt.customSchemes=[],Pt.initialized=!1,Pt}function g1(t,e=!1){if(Pt.initialized&&uK(`linkifyjs: already initialized - will not register custom scheme "${t}" ${dK}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
111
111
  1. Must only contain digits, lowercase ASCII letters or "-"
112
112
  2. Cannot start or end with "-"
113
- 3. "-" cannot repeat`);Pt.customSchemes.push([t,e])}function hK(){Pt.scanner=iK(Pt.customSchemes);for(let t=0;t<Pt.tokenQueue.length;t++)Pt.tokenQueue[t][1]({scanner:Pt.scanner});Pt.parser=lK(Pt.scanner.tokens);for(let t=0;t<Pt.pluginQueue.length;t++)Pt.pluginQueue[t][1]({scanner:Pt.scanner,parser:Pt.parser});return Pt.initialized=!0,Pt}function vg(t){return Pt.initialized||hK(),cK(Pt.parser.start,t,u1(Pt.scanner.start,t))}vg.scan=u1;function B1(t,e=null,A=null){if(e&&typeof e=="object"){if(A)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);A=e,e=null}const n=new Cg(A),r=vg(t),o=[];for(let i=0;i<r.length;i++){const a=r[i];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}var Eg="[\0-   ᠎ -\u2029  ]",pK=new RegExp(Eg),mK=new RegExp(`${Eg}$`),gK=new RegExp(Eg,"g");function BK(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yK(t){return new tA({key:new DA("autolink"),appendTransaction:(e,A,n)=>{const r=e.some(u=>u.docChanged)&&!A.doc.eq(n.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!r||o)return;const{tr:i}=n,a=vE(A.doc,[...e]);if(DE(a).forEach(({newRange:u})=>{const f=oV(n.doc,u,g=>g.isTextblock);let h,p;if(f.length>1)h=f[0],p=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(f.length){const g=n.doc.textBetween(u.from,u.to," "," ");if(!mK.test(g))return;h=f[0],p=n.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&p){const g=p.split(pK).filter(Boolean);if(g.length<=0)return!1;const B=g[g.length-1],y=h.pos+p.lastIndexOf(B);if(!B)return!1;const b=vg(B).map(w=>w.toObject(t.defaultProtocol));if(!BK(b))return!1;b.filter(w=>w.isLink).map(w=>({...w,from:y+w.start+1,to:y+w.end+1})).filter(w=>n.schema.marks.code?!n.doc.rangeHasMark(w.from,w.to,n.schema.marks.code):!0).filter(w=>t.validate(w.value)).filter(w=>t.shouldAutoLink(w.value)).forEach(w=>{Ym(w.from,w.to,n.doc).some(v=>v.mark.type===t.type)||i.addMark(w.from,w.to,t.type.create({href:w.href}))})}}),!!i.steps.length)return i}})}function wK(t){return new tA({key:new DA("handleClickLink"),props:{handleClick:(e,A,n)=>{var r,o;if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{let f=n.target;const h=[];for(;f.nodeName!=="DIV";)h.push(f),f=f.parentNode;i=h.find(p=>p.nodeName==="A")}if(!i)return!1;const a=_E(e.state,t.type.name),l=(r=i?.href)!=null?r:a.href,u=(o=i?.target)!=null?o:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),i&&l?(window.open(l,u),!0):!1}}})}function CK(t){return new tA({key:new DA("handlePasteLink"),props:{handlePaste:(e,A,n)=>{const{state:r}=e,{selection:o}=r,{empty:i}=o;if(i)return!1;let a="";n.content.forEach(u=>{a+=u.textContent});const l=B1(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function ys(t,e){const A=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const r=typeof n=="string"?n:n.scheme;r&&A.push(r)}),!t||t.replace(gK,"").match(new RegExp(`^(?:(?:${A.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var y1=yi.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){g1(t);return}g1(t.scheme,t.optionalSlashes)})},onDestroy(){fK()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ys(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:A=>!!ys(A,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ys(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",AA(this.options.HTMLAttributes,t),0]:["a",AA(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:A}=t;return this.options.isAllowedUri(A,{defaultValidate:n=>!!ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:A}=t||{};return A&&!this.options.isAllowedUri(A,{defaultValidate:n=>!!ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[wi({find:t=>{const e=[];if(t){const{protocols:A,defaultProtocol:n}=this.options,r=B1(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!ys(i,A),protocols:A,defaultProtocol:n}));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:A}=this.options;return this.options.autolink&&t.push(yK({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:r=>!!ys(r,e),protocols:e,defaultProtocol:A}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(wK({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(CK({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),bK=y1,_d=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:A,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,n,A]},vK=/^\s*>\s$/,EK=Mn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return _d("blockquote",{...AA(this.options.HTMLAttributes,t),children:_d("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wa({find:vK,type:this.type})]}}),kK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,SK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,QK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,FK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,w1=yi.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return _d("strong",{...AA(this.options.HTMLAttributes,t),children:_d("slot",{})})},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[gs({find:kK,type:this.type}),gs({find:QK,type:this.type})]},addPasteRules(){return[wi({find:SK,type:this.type}),wi({find:FK,type:this.type})]}}),UK=w1,IK=/(^|[^`])`([^`]+)`(?!`)/,xK=/(^|[^`])`([^`]+)`(?!`)/g,TK=yi.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[gs({find:IK,type:this.type})]},addPasteRules(){return[wi({find:xK,type:this.type})]}}),_K=/^```([a-z]+)?[\s\n]$/,DK=/^~~~([a-z]+)?[\s\n]$/,LK=Mn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:A}=this.options,o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(A)).map(i=>i.replace(A,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",AA(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,A=e.pos===1;return!t||e.parent.type.name!==this.name?!1:A||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:A}=e,{$from:n,empty:r}=A;if(!r||n.parent.type!==this.type)return!1;const o=n.parentOffset===n.parent.nodeSize-2,i=n.parent.textContent.endsWith(`
113
+ 3. "-" cannot repeat`);Pt.customSchemes.push([t,e])}function hK(){Pt.scanner=iK(Pt.customSchemes);for(let t=0;t<Pt.tokenQueue.length;t++)Pt.tokenQueue[t][1]({scanner:Pt.scanner});Pt.parser=lK(Pt.scanner.tokens);for(let t=0;t<Pt.pluginQueue.length;t++)Pt.pluginQueue[t][1]({scanner:Pt.scanner,parser:Pt.parser});return Pt.initialized=!0,Pt}function vg(t){return Pt.initialized||hK(),cK(Pt.parser.start,t,u1(Pt.scanner.start,t))}vg.scan=u1;function B1(t,e=null,A=null){if(e&&typeof e=="object"){if(A)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);A=e,e=null}const n=new Cg(A),r=vg(t),o=[];for(let i=0;i<r.length;i++){const a=r[i];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}var Eg="[\0-   ᠎ -\u2029  ]",pK=new RegExp(Eg),mK=new RegExp(`${Eg}$`),gK=new RegExp(Eg,"g");function BK(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yK(t){return new AA({key:new DA("autolink"),appendTransaction:(e,A,n)=>{const r=e.some(u=>u.docChanged)&&!A.doc.eq(n.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!r||o)return;const{tr:i}=n,a=vE(A.doc,[...e]);if(DE(a).forEach(({newRange:u})=>{const f=oV(n.doc,u,g=>g.isTextblock);let h,p;if(f.length>1)h=f[0],p=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(f.length){const g=n.doc.textBetween(u.from,u.to," "," ");if(!mK.test(g))return;h=f[0],p=n.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&p){const g=p.split(pK).filter(Boolean);if(g.length<=0)return!1;const B=g[g.length-1],y=h.pos+p.lastIndexOf(B);if(!B)return!1;const b=vg(B).map(w=>w.toObject(t.defaultProtocol));if(!BK(b))return!1;b.filter(w=>w.isLink).map(w=>({...w,from:y+w.start+1,to:y+w.end+1})).filter(w=>n.schema.marks.code?!n.doc.rangeHasMark(w.from,w.to,n.schema.marks.code):!0).filter(w=>t.validate(w.value)).filter(w=>t.shouldAutoLink(w.value)).forEach(w=>{Ym(w.from,w.to,n.doc).some(v=>v.mark.type===t.type)||i.addMark(w.from,w.to,t.type.create({href:w.href}))})}}),!!i.steps.length)return i}})}function wK(t){return new AA({key:new DA("handleClickLink"),props:{handleClick:(e,A,n)=>{var r,o;if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{let f=n.target;const h=[];for(;f.nodeName!=="DIV";)h.push(f),f=f.parentNode;i=h.find(p=>p.nodeName==="A")}if(!i)return!1;const a=_E(e.state,t.type.name),l=(r=i?.href)!=null?r:a.href,u=(o=i?.target)!=null?o:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),i&&l?(window.open(l,u),!0):!1}}})}function CK(t){return new AA({key:new DA("handlePasteLink"),props:{handlePaste:(e,A,n)=>{const{state:r}=e,{selection:o}=r,{empty:i}=o;if(i)return!1;let a="";n.content.forEach(u=>{a+=u.textContent});const l=B1(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function ys(t,e){const A=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const r=typeof n=="string"?n:n.scheme;r&&A.push(r)}),!t||t.replace(gK,"").match(new RegExp(`^(?:(?:${A.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var y1=yi.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){g1(t);return}g1(t.scheme,t.optionalSlashes)})},onDestroy(){fK()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ys(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:A=>!!ys(A,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ys(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",zt(this.options.HTMLAttributes,t),0]:["a",zt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:A}=t;return this.options.isAllowedUri(A,{defaultValidate:n=>!!ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:A}=t||{};return A&&!this.options.isAllowedUri(A,{defaultValidate:n=>!!ys(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[wi({find:t=>{const e=[];if(t){const{protocols:A,defaultProtocol:n}=this.options,r=B1(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!ys(i,A),protocols:A,defaultProtocol:n}));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:A}=this.options;return this.options.autolink&&t.push(yK({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:r=>!!ys(r,e),protocols:e,defaultProtocol:A}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(wK({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(CK({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),bK=y1,_d=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:A,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,n,A]},vK=/^\s*>\s$/,EK=Mn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return _d("blockquote",{...zt(this.options.HTMLAttributes,t),children:_d("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wa({find:vK,type:this.type})]}}),kK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,SK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,QK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,FK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,w1=yi.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return _d("strong",{...zt(this.options.HTMLAttributes,t),children:_d("slot",{})})},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[gs({find:kK,type:this.type}),gs({find:QK,type:this.type})]},addPasteRules(){return[wi({find:SK,type:this.type}),wi({find:FK,type:this.type})]}}),UK=w1,IK=/(^|[^`])`([^`]+)`(?!`)/,xK=/(^|[^`])`([^`]+)`(?!`)/g,TK=yi.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[gs({find:IK,type:this.type})]},addPasteRules(){return[wi({find:xK,type:this.type})]}}),_K=/^```([a-z]+)?[\s\n]$/,DK=/^~~~([a-z]+)?[\s\n]$/,LK=Mn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:A}=this.options,o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(A)).map(i=>i.replace(A,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",zt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,A=e.pos===1;return!t||e.parent.type.name!==this.name?!1:A||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:A}=e,{$from:n,empty:r}=A;if(!r||n.parent.type!==this.type)return!1;const o=n.parentOffset===n.parent.nodeSize-2,i=n.parent.textContent.endsWith(`
114
114
 
115
- `);return!o||!i?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:A,doc:n}=e,{$from:r,empty:o}=A;if(!o||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const a=r.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(nt.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[tg({find:_K,type:this.type,getAttributes:t=>({language:t[1]})}),tg({find:DK,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new tA({key:new DA("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const A=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),r=n?JSON.parse(n):void 0,o=r?.mode;if(!A||!o)return!1;const{tr:i,schema:a}=t.state,l=a.text(A.replace(/\r\n?/g,`
116
- `));return i.replaceSelectionWith(this.type.create({language:o},l)),i.selection.$from.parent.type!==this.type&&i.setSelection(Ze.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),OK=Mn.create({name:"doc",topNode:!0,content:"block+"}),MK=Mn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",AA(this.options.HTMLAttributes,t)]},renderText(){return`
117
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:A,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:o}=A;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=n.extensionManager,l=o||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:f})=>{if(f&&l&&i){const h=l.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),NK=Mn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,AA(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),HK=Mn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",AA(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!K$(e,e.schema.nodes[this.name]))return!1;const{selection:A}=e,{$to:n}=A,r=t();return HE(A)?r.insertContentAt(n.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:o,dispatch:i})=>{var a;if(i){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Ze.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Pe.create(o.doc,l.pos)):o.setSelection(Ze.create(o.doc,l.pos));else{const f=(a=l.parent.type.contentMatch.defaultType)==null?void 0:a.create();f&&(o.insert(u,f),o.setSelection(Ze.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$$({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),RK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,VK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$K=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,KK=yi.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[gs({find:RK,type:this.type}),gs({find:VK,type:this.type})]},addPasteRules(){return[wi({find:PK,type:this.type}),wi({find:$K,type:this.type})]}}),GK=Object.defineProperty,WK=(t,e)=>{for(var A in e)GK(t,A,{get:e[A],enumerable:!0})},zK="listItem",C1="textStyle",b1=/^\s*([-+*])\s$/,v1=Mn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zK,this.editor.getAttributes(C1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=wa({find:b1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wa({find:b1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(C1),editor:this.editor})),[t]}}),E1=Mn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",AA(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YK={};WK(YK,{findListItemPos:()=>tc,getNextListDepth:()=>kg,handleBackspace:()=>Sg,handleDelete:()=>Qg,hasListBefore:()=>k1,hasListItemAfter:()=>JK,hasListItemBefore:()=>S1,listItemHasSubList:()=>Q1,nextListIsDeeper:()=>F1,nextListIsHigher:()=>U1});var tc=(t,e)=>{const{$from:A}=e.selection,n=wA(t,e.schema);let r=null,o=A.depth,i=A.pos,a=null;for(;o>0&&a===null;)r=A.node(o),r.type===n?a=o:(o-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},kg=(t,e)=>{const A=tc(t,e);if(!A)return!1;const[,n]=pV(e,t,A.$pos.pos+4);return n},k1=(t,e,A)=>{const{$anchor:n}=t.selection,r=Math.max(0,n.pos-2),o=t.doc.resolve(r).node();return!(!o||!A.includes(o.type.name))},S1=(t,e)=>{var A;const{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-2);return!(r.index()===0||((A=r.nodeBefore)==null?void 0:A.type.name)!==t)},Q1=(t,e,A)=>{if(!A)return!1;const n=wA(t,e.schema);let r=!1;return A.descendants(o=>{o.type===n&&(r=!0)}),r},Sg=(t,e,A)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Bi(t.state,e)&&k1(t.state,e,A)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),u=[];l.node().descendants((p,g)=>{p.type.name===e&&u.push({node:p,pos:g})});const f=u.at(-1);if(!f)return!1;const h=t.state.doc.resolve(l.start()+f.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Bi(t.state,e)||!yV(t.state))return!1;const n=tc(e,t.state);if(!n)return!1;const o=t.state.doc.resolve(n.$pos.pos-2).node(n.depth),i=Q1(e,t.state,o);return S1(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},F1=(t,e)=>{const A=kg(t,e),n=tc(t,e);return!n||!A?!1:A>n.depth},U1=(t,e)=>{const A=kg(t,e),n=tc(t,e);return!n||!A?!1:A<n.depth},Qg=(t,e)=>{if(!Bi(t.state,e)||!BV(t.state,e))return!1;const{selection:A}=t.state,{$from:n,$to:r}=A;return!A.empty&&n.sameParent(r)?!1:F1(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():U1(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},JK=(t,e)=>{var A;const{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||((A=r.nodeAfter)==null?void 0:A.type.name)!==t)},I1=dA.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A})=>{t.state.schema.nodes[A]!==void 0&&Qg(t,A)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A})=>{t.state.schema.nodes[A]!==void 0&&Qg(t,A)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A,wrapperNames:n})=>{t.state.schema.nodes[A]!==void 0&&Sg(t,A,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A,wrapperNames:n})=>{t.state.schema.nodes[A]!==void 0&&Sg(t,A,n)&&(e=!0)}),e}}}}),XK="listItem",x1="textStyle",T1=/^(\d+)\.\s$/,_1=Mn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...A}=t;return e===1?["ol",AA(this.options.HTMLAttributes,A),0]:["ol",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(XK,this.editor.getAttributes(x1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=wa({find:T1,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,A)=>A.childCount+A.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wa({find:T1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(x1)}),joinPredicate:(e,A)=>A.childCount+A.attrs.start===+e[1],editor:this.editor})),[t]}}),jK=/^\s*(\[([( |x])?\])\s$/,qK=Mn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",AA(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:A,editor:n})=>{const r=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=f=>{var h,p;a.ariaLabel=((p=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:p.call(h,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};return u(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=f.target;n.isEditable&&typeof A=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=A();if(typeof g!="number")return!1;const B=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...B?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,h])=>{r.setAttribute(f,h)}),r.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,i),r.append(o,l),Object.entries(e).forEach(([f,h])=>{r.setAttribute(f,h)}),{dom:r,contentDOM:l,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(f),!0)}}},addInputRules(){return[wa({find:jK,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ZK=Mn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",AA(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});dA.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(v1.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(E1.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(I1.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(_1.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(qK.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ZK.configure(this.options.taskList)),t}});var e3=Mn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),t3=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,A3=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,n3=yi.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[gs({find:t3,type:this.type})]},addPasteRules(){return[wi({find:A3,type:this.type})]}}),r3=Mn.create({name:"text",group:"inline"}),o3=yi.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",AA(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function i3(t={}){return new tA({view(e){return new s3(e,t)}})}class s3{constructor(e,A){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=A.width)!==null&&n!==void 0?n:1,this.color=A.color===!1?void 0:A.color||"black",this.class=A.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let o=i=>{this[r](i)};return e.dom.addEventListener(r,o),{name:r,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:A})=>this.editorView.dom.removeEventListener(e,A))}update(e,A){this.cursorPos!=null&&A.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),A=!e.parent.inlineContent,n,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,a=o.height/r.offsetHeight;if(A){let h=e.nodeBefore,p=e.nodeAfter;if(h||p){let g=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(g){let B=g.getBoundingClientRect(),y=h?B.bottom:B.top;h&&p&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*a;n={left:B.left,right:B.right,top:y-b,bottom:y+b}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*i;n={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",A),this.element.classList.toggle("prosemirror-dropcursor-inline",!A);let u,f;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,f=-pageYOffset;else{let h=l.getBoundingClientRect(),p=h.width/l.offsetWidth,g=h.height/l.offsetHeight;u=h.left-l.scrollLeft*p,f=h.top-l.scrollTop*g}this.element.style.left=(n.left-u)/i+"px",this.element.style.top=(n.top-f)/a+"px",this.element.style.width=(n.right-n.left)/i+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let A=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=A&&A.inside>=0&&this.editorView.state.doc.nodeAt(A.inside),r=n&&n.type.spec.disableDropCursor,o=typeof r=="function"?r(this.editorView,A,e):r;if(A&&!o){let i=A.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Lb(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class rA extends nt{constructor(e){super(e,e)}map(e,A){let n=e.resolve(A.map(this.head));return rA.valid(n)?new rA(n):nt.near(n)}content(){return De.empty}eq(e){return e instanceof rA&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new rA(e.resolve(A.pos))}getBookmark(){return new Fg(this.anchor)}static valid(e){let A=e.parent;if(A.isTextblock||!a3(e)||!l3(e))return!1;let n=A.type.spec.allowGapCursor;if(n!=null)return n;let r=A.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,A,n=!1){e:for(;;){if(!n&&rA.valid(e))return e;let r=e.pos,o=null;for(let i=e.depth;;i--){let a=e.node(i);if(A>0?e.indexAfter(i)<a.childCount:e.index(i)>0){o=a.child(A>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=A;let l=e.doc.resolve(r);if(rA.valid(l))return l}for(;;){let i=A>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Pe.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*A),n=!1;continue e}break}o=i,r+=A;let a=e.doc.resolve(r);if(rA.valid(a))return a}return null}}}rA.prototype.visible=!1,rA.findFrom=rA.findGapCursorFrom,nt.jsonID("gapcursor",rA);class Fg{constructor(e){this.pos=e}map(e){return new Fg(e.map(this.pos))}resolve(e){let A=e.resolve(this.pos);return rA.valid(A)?new rA(A):nt.near(A)}}function a3(t){for(let e=t.depth;e>=0;e--){let A=t.index(e),n=t.node(e);if(A==0){if(n.type.spec.isolating)return!0;continue}for(let r=n.child(A-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function l3(t){for(let e=t.depth;e>=0;e--){let A=t.indexAfter(e),n=t.node(e);if(A==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let r=n.child(A);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function c3(){return new tA({props:{decorations:h3,createSelectionBetween(t,e,A){return e.pos==A.pos&&rA.valid(A)?new rA(A):null},handleClick:d3,handleKeyDown:u3,handleDOMEvents:{beforeinput:f3}}})}const u3=aE({ArrowLeft:Dd("horiz",-1),ArrowRight:Dd("horiz",1),ArrowUp:Dd("vert",-1),ArrowDown:Dd("vert",1)});function Dd(t,e){const A=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,r,o){let i=n.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof Ze){if(!o.endOfTextblock(A)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let u=rA.findGapCursorFrom(a,e,l);return u?(r&&r(n.tr.setSelection(new rA(u))),!0):!1}}function d3(t,e,A){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!rA.valid(n))return!1;let r=t.posAtCoords({left:A.clientX,top:A.clientY});return r&&r.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rA(n))),!0)}function f3(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof rA))return!1;let{$from:A}=t.state.selection,n=A.parent.contentMatchAt(A.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let r=we.empty;for(let i=n.length-1;i>=0;i--)r=we.from(n[i].createAndFill(null,r));let o=t.state.tr.replace(A.pos,A.pos,new De(r,0,0));return o.setSelection(Ze.near(o.doc.resolve(A.pos+1))),t.dispatch(o),!1}function h3(t){if(!(t.selection instanceof rA))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Xt.create(t.doc,[un.widget(t.selection.head,e,{key:"gapcursor"})])}var Ld=200,LA=function(){};LA.prototype.append=function(e){return e.length?(e=LA.from(e),!this.length&&e||e.length<Ld&&this.leafAppend(e)||this.length<Ld&&e.leafPrepend(this)||this.appendInner(e)):this},LA.prototype.prepend=function(e){return e.length?LA.from(e).append(this):this},LA.prototype.appendInner=function(e){return new p3(this,e)},LA.prototype.slice=function(e,A){return e===void 0&&(e=0),A===void 0&&(A=this.length),e>=A?LA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,A))},LA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},LA.prototype.forEach=function(e,A,n){A===void 0&&(A=0),n===void 0&&(n=this.length),A<=n?this.forEachInner(e,A,n,0):this.forEachInvertedInner(e,A,n,0)},LA.prototype.map=function(e,A,n){A===void 0&&(A=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,i){return r.push(e(o,i))},A,n),r},LA.from=function(e){return e instanceof LA?e:e&&e.length?new D1(e):LA.empty};var D1=(function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var A={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,a){for(var l=o;l<i;l++)if(r(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,a){for(var l=o-1;l>=i;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Ld)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Ld)return new e(r.flatten().concat(this.values))},A.length.get=function(){return this.values.length},A.depth.get=function(){return 0},Object.defineProperties(e.prototype,A),e})(LA);LA.empty=new D1([]);var p3=(function(t){function e(A,n){t.call(this),this.left=A,this.right=n,this.length=A.length+n.length,this.depth=Math.max(A.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,i){var a=this.left.length;if(r<a&&this.left.forEachInner(n,r,Math.min(o,a),i)===!1||o>a&&this.right.forEachInner(n,Math.max(r-a,0),Math.min(this.length,o)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,i){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(n,r-a,Math.max(o,a)-a,i+a)===!1||o<a&&this.left.forEachInvertedInner(n,Math.min(r,a),o,i)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(LA);const m3=500;class Qr{constructor(e,A){this.items=e,this.eventCount=A}popEvent(e,A){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let r,o;A&&(r=this.remapping(n,this.items.length),o=r.maps.length);let i=e.tr,a,l,u=[],f=[];return this.items.forEach((h,p)=>{if(!h.step){r||(r=this.remapping(n,p+1),o=r.maps.length),o--,f.push(h);return}if(r){f.push(new qr(h.map));let g=h.step.map(r.slice(o)),B;g&&i.maybeStep(g).doc&&(B=i.mapping.maps[i.mapping.maps.length-1],u.push(new qr(B,void 0,void 0,u.length+f.length))),o--,B&&r.appendMap(B,o)}else i.maybeStep(h.step);if(h.selection)return a=r?h.selection.map(r.slice(o)):h.selection,l=new Qr(this.items.slice(0,n).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,A,n,r){let o=[],i=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),p=new qr(e.mapping.maps[f],h,A),g;(g=l&&l.merge(p))&&(p=g,f?o.pop():a=a.slice(0,a.length-1)),o.push(p),A&&(i++,A=void 0),r||(l=p)}let u=i-n.depth;return u>B3&&(a=g3(a,u),i-=u),new Qr(a.append(o),i)}remapping(e,A){let n=new Ul;return this.items.forEach((r,o)=>{let i=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?n.maps.length-r.mirrorOffset:void 0;n.appendMap(r.map,i)},e,A),n}addMaps(e){return this.eventCount==0?this:new Qr(this.items.append(e.map(A=>new qr(A))),this.eventCount)}rebased(e,A){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-A),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},r);let l=A;this.items.forEach(p=>{let g=o.getMirror(--l);if(g==null)return;i=Math.min(i,g);let B=o.maps[g];if(p.step){let y=e.steps[g].invert(e.docs[g]),b=p.selection&&p.selection.map(o.slice(l+1,g));b&&a++,n.push(new qr(B,y,b))}else n.push(new qr(B))},r);let u=[];for(let p=A;p<i;p++)u.push(new qr(o.maps[p]));let f=this.items.slice(0,r).append(u).append(n),h=new Qr(f,a);return h.emptyItemCount()>m3&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(A=>{A.step||e++}),e}compress(e=this.items.length){let A=this.remapping(0,e),n=A.maps.length,r=[],o=0;return this.items.forEach((i,a)=>{if(a>=e)r.push(i),i.selection&&o++;else if(i.step){let l=i.step.map(A.slice(n)),u=l&&l.getMap();if(n--,u&&A.appendMap(u,n),l){let f=i.selection&&i.selection.map(A.slice(n));f&&o++;let h=new qr(u.invert(),l,f),p,g=r.length-1;(p=r.length&&r[g].merge(h))?r[g]=p:r.push(h)}}else i.map&&n--},this.items.length,0),new Qr(LA.from(r.reverse()),o)}}Qr.empty=new Qr(LA.empty,0);function g3(t,e){let A;return t.forEach((n,r)=>{if(n.selection&&e--==0)return A=r,!1}),t.slice(A)}class qr{constructor(e,A,n,r){this.map=e,this.step=A,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let A=e.step.merge(this.step);if(A)return new qr(A.getMap().invert(),A,this.selection)}}}class Ei{constructor(e,A,n,r,o){this.done=e,this.undone=A,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const B3=20;function y3(t,e,A,n){let r=A.getMeta(ws),o;if(r)return r.historyState;A.getMeta(b3)&&(t=new Ei(t.done,t.undone,null,0,-1));let i=A.getMeta("appendedTransaction");if(A.steps.length==0)return t;if(i&&i.getMeta(ws))return i.getMeta(ws).redo?new Ei(t.done.addTransform(A,void 0,n,Od(e)),t.undone,L1(A.mapping.maps),t.prevTime,t.prevComposition):new Ei(t.done,t.undone.addTransform(A,void 0,n,Od(e)),null,t.prevTime,t.prevComposition);if(A.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=A.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(A.time||0)-n.newGroupDelay||!w3(A,t.prevRanges)),u=i?Ug(t.prevRanges,A.mapping):L1(A.mapping.maps);return new Ei(t.done.addTransform(A,l?e.selection.getBookmark():void 0,n,Od(e)),Qr.empty,u,A.time,a??t.prevComposition)}else return(o=A.getMeta("rebased"))?new Ei(t.done.rebased(A,o),t.undone.rebased(A,o),Ug(t.prevRanges,A.mapping),t.prevTime,t.prevComposition):new Ei(t.done.addMaps(A.mapping.maps),t.undone.addMaps(A.mapping.maps),Ug(t.prevRanges,A.mapping),t.prevTime,t.prevComposition)}function w3(t,e){if(!e)return!1;if(!t.docChanged)return!0;let A=!1;return t.mapping.maps[0].forEach((n,r)=>{for(let o=0;o<e.length;o+=2)n<=e[o+1]&&r>=e[o]&&(A=!0)}),A}function L1(t){let e=[];for(let A=t.length-1;A>=0&&e.length==0;A--)t[A].forEach((n,r,o,i)=>e.push(o,i));return e}function Ug(t,e){if(!t)return null;let A=[];for(let n=0;n<t.length;n+=2){let r=e.map(t[n],1),o=e.map(t[n+1],-1);r<=o&&A.push(r,o)}return A}function C3(t,e,A){let n=Od(e),r=ws.get(e).spec.config,o=(A?t.undone:t.done).popEvent(e,n);if(!o)return null;let i=o.selection.resolve(o.transform.doc),a=(A?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,n),l=new Ei(A?a:o.remaining,A?o.remaining:a,null,0,-1);return o.transform.setSelection(i).setMeta(ws,{redo:A,historyState:l})}let Ig=!1,O1=null;function Od(t){let e=t.plugins;if(O1!=e){Ig=!1,O1=e;for(let A=0;A<e.length;A++)if(e[A].spec.historyPreserveItems){Ig=!0;break}}return Ig}const ws=new DA("history"),b3=new DA("closeHistory");function v3(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new tA({key:ws,state:{init(){return new Ei(Qr.empty,Qr.empty,null,0,-1)},apply(e,A,n){return y3(A,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,A){let n=A.inputType,r=n=="historyUndo"?N1:n=="historyRedo"?H1:null;return r?(A.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function M1(t,e){return(A,n)=>{let r=ws.getState(A);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(n){let o=C3(r,A,t);o&&n(e?o.scrollIntoView():o)}return!0}}const N1=M1(!1,!0),H1=M1(!0,!0);dA.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,A=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(A)}},addProseMirrorPlugins(){let t=!1;return[new tA({key:new DA("characterCount"),appendTransaction:(e,A,n)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const o=this.storage.characters({node:n.doc});if(o>r){const i=o-r,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(a,l);return t=!0,u}t=!0},filterTransaction:(e,A)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const r=this.storage.characters({node:A.doc}),o=this.storage.characters({node:e.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-n,u=a-l,f=a;return e.deleteRange(u,f),!(this.storage.characters({node:e.doc})>n)}})]}});var E3=dA.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[i3(this.options)]}});dA.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new tA({key:new DA("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:A,isFocused:n}=this.editor,{anchor:r}=e,o=[];if(!A||!n)return Xt.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(r>=u&&r<=u+l.nodeSize-1))return!1;i+=1});let a=0;return t.descendants((l,u)=>{if(l.isText||!(r>=u&&r<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(un.node(u,u+l.nodeSize,{class:this.options.className}))}),Xt.create(t,o)}}})]}});var k3=dA.create({name:"gapCursor",addProseMirrorPlugins(){return[c3()]},extendNodeSchema(t){var e;const A={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ut(Re(t,"allowGapCursor",A)))!=null?e:null}}});dA.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new tA({key:new DA("placeholder"),props:{decorations:({doc:t,selection:e})=>{const A=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,r=[];if(!A)return null;const o=this.editor.isEmpty;return t.descendants((i,a)=>{const l=n>=a&&n<=a+i.nodeSize,u=!i.isLeaf&&Ju(i);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);const h=un.node(a,a+i.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});r.push(h)}return this.options.includeChildren}),Xt.create(t,r)}}})]}}),dA.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new tA({key:new DA("selection"),props:{decorations(A){return A.selection.empty||t.isFocused||!t.isEditable||HE(A.selection)||t.view.dragging?null:Xt.create(A.doc,[un.inline(A.selection.from,A.selection.to,{class:e.className})])}}})]}});function R1({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var S3=dA.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const t=new DA(this.name),e=Object.entries(this.editor.schema.nodes).map(([,A])=>A).filter(A=>(this.options.notAfter||[]).concat(this.options.node).includes(A.name));return[new tA({key:t,appendTransaction:(A,n,r)=>{const{doc:o,tr:i,schema:a}=r,l=t.getState(r),u=o.content.size,f=a.nodes[this.options.node];if(l)return i.insert(u,f.create())},state:{init:(A,n)=>{const r=n.tr.doc.lastChild;return!R1({node:r,types:e})},apply:(A,n)=>{if(!A.docChanged)return n;const r=A.doc.lastChild;return!R1({node:r,types:e})}}})]}}),Q3=dA.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>N1(t,e),redo:()=>({state:t,dispatch:e})=>H1(t,e)}},addProseMirrorPlugins(){return[v3(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),F3=dA.create({name:"starterKit",addExtensions(){var t,e,A,n;const r=[];return this.options.bold!==!1&&r.push(w1.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(EK.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(v1.configure(this.options.bulletList)),this.options.code!==!1&&r.push(TK.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(LK.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(OK.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(E3.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(k3.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(MK.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(NK.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(Q3.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(HK.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(KK.configure(this.options.italic)),this.options.listItem!==!1&&r.push(E1.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(I1.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&r.push(y1.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&r.push(_1.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(e3.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(n3.configure(this.options.strike)),this.options.text!==!1&&r.push(r3.configure(this.options.text)),this.options.underline!==!1&&r.push(o3.configure((A=this.options)==null?void 0:A.underline)),this.options.trailingNode!==!1&&r.push(S3.configure((n=this.options)==null?void 0:n.trailingNode)),r}}),U3=F3;function P1(t){return s.customRef((e,A)=>({get(){return e(),t},set(n){t=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{A()})})}}))}var I3=class extends V${constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=P1(this.view.state),this.reactiveExtensionStorage=P1(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),s.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const A=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=A),A}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},x3=s.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=s.ref(),A=s.getCurrentInstance();return s.watchEffect(()=>{const n=t.editor;n&&n.options.element&&e.value&&s.nextTick(()=>{var r;if(!e.value||!((r=n.options.element)!=null&&r.firstChild))return;const o=s.unref(e.value);e.value.append(...n.options.element.childNodes),n.contentComponent=A.ctx._,A&&(n.appContext={...A.appContext,provides:A.provides}),n.setOptions({element:o}),n.createNodeViews()})}),s.onBeforeUnmount(()=>{const n=t.editor;n&&(n.contentComponent=null,n.appContext=null)}),{rootEl:e}},render(){return s.h("div",{ref:t=>{this.rootEl=t}})}});s.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return s.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),s.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return s.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}});var T3=(t={})=>{const e=s.shallowRef();return s.onMounted(()=>{e.value=new I3(t)}),s.onBeforeUnmount(()=>{var A,n,r;const o=(A=e.value)==null?void 0:A.options.element,i=o?.cloneNode(!0);(n=o?.parentNode)==null||n.replaceChild(i,o),(r=e.value)==null||r.destroy()}),e};s.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return s.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});const _3={class:"rte-editor"},D3={key:0,class:"rte-editor__controls mb-2"},L3=["disabled"],O3=["disabled"],M3={class:"btn-group"},N3=["disabled"],H3=["disabled"],R3={class:"btn-group"},P3={class:"dropdown"},V3={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},$3={class:"dropdown-menu"},K3={class:"dropdown"},G3={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},W3={class:"dropdown-menu"},z3={class:"btn-group"},Y3=["disabled"],J3=["disabled"],X3=s.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:e}){const A=t,n=e,r=s.ref(!1),o=T3({content:A.modelValue,onUpdate:()=>{n("update:modelValue",o.value?.getHTML())},extensions:[U3.configure({bold:!1}),UK.extend({addAttributes(){return{class:{default:null}}},parseHTML(){return[{tag:"strong"},{tag:"b"}]},renderHTML({HTMLAttributes:u}){return["strong",AA(this.options.HTMLAttributes,u),0]}}),j$.configure({types:["heading","paragraph"]}),J$,bK.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}})]});s.watch(()=>A.modelValue,(u,f)=>{if(o.value){if(o.value.getHTML()===u)return;o.value.commands.setContent(u)}});function i(){const u=o.value?.getAttributes("link").href,f=window.prompt("URL",u);if(f!==null){if(f===""){o.value?.chain().focus().extendMarkRange("link").unsetLink().run();return}try{o.value?.chain().focus().extendMarkRange("link").setLink({href:f}).run()}catch(h){alert(h.message)}}}const a=()=>{o.value?.commands.setContent(`<textarea>${o.value.getHTML()}</textarea>`),r.value=!0},l=()=>{o.value?.commands.setContent(o.value.getText()),r.value=!1};return(u,f)=>{const h=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("div",_3,[s.unref(o)?(s.openBlock(),s.createElementBlock("div",D3,[r.value?(s.openBlock(),s.createElementBlock("button",{key:1,class:"btn btn-sm btn-light is-active",onClick:l,disabled:!s.unref(o).can().chain().focus().toggleCode().run(),title:"Toggle Source"},[s.createVNode(h,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],8,O3)):(s.openBlock(),s.createElementBlock("button",{key:0,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("code")}]),onClick:a,disabled:!s.unref(o).can().chain().focus().toggleCode().run(),title:"Toggle Source"},[s.createVNode(h,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],10,L3)),s.createElementVNode("div",M3,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("bold")}]),onClick:f[0]||(f[0]=p=>s.unref(o)?.chain().focus().toggleBold().run()),disabled:!s.unref(o).can().chain().focus().toggleBold().run(),title:"Toggle Bold"},[s.createVNode(h,{symbol:"bold","base-path":t.iconBasePath},null,8,["base-path"])],10,N3),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("italic")}]),onClick:f[1]||(f[1]=p=>s.unref(o)?.chain().focus().toggleItalic().run()),disabled:!s.unref(o).can().chain().focus().toggleItalic().run(),title:"Toggle Italic"},[s.createVNode(h,{symbol:"italic","base-path":t.iconBasePath},null,8,["base-path"])],10,H3)]),s.createElementVNode("div",R3,[s.createElementVNode("div",P3,[s.createElementVNode("button",V3,[s.unref(o).isActive("heading",{level:1})?(s.openBlock(),s.createBlock(h,{key:0,symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:2})?(s.openBlock(),s.createBlock(h,{key:1,symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:3})?(s.openBlock(),s.createBlock(h,{key:2,symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:4})?(s.openBlock(),s.createBlock(h,{key:3,symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])):(s.openBlock(),s.createBlock(h,{key:4,symbol:"headline","base-path":t.iconBasePath},null,8,["base-path"]))]),s.createElementVNode("ul",$3,[s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:1})}]),onClick:f[2]||(f[2]=p=>s.unref(o)?.chain().focus().setHeading({level:1}).run()),title:"Set Heading 1"},[s.createVNode(h,{symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:2})}]),onClick:f[3]||(f[3]=p=>s.unref(o)?.chain().focus().setHeading({level:2}).run()),title:"Set Heading 2"},[s.createVNode(h,{symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:3})}]),onClick:f[4]||(f[4]=p=>s.unref(o)?.chain().focus().setHeading({level:3}).run()),title:"Set Heading 3"},[s.createVNode(h,{symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:4})}]),onClick:f[5]||(f[5]=p=>s.unref(o)?.chain().focus().setHeading({level:4}).run()),title:"Set Heading 4"},[s.createVNode(h,{symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("paragraph")}]),onClick:f[6]||(f[6]=p=>s.unref(o)?.chain().focus().setParagraph().run()),title:"Set Paragraph"},[s.createVNode(h,{symbol:"paragraph","base-path":t.iconBasePath},null,8,["base-path"])],2),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("bulletList")}]),onClick:f[7]||(f[7]=p=>s.unref(o)?.chain().focus().toggleBulletList().run()),title:"Toggle Bullet List"},[s.createVNode(h,{symbol:"list","base-path":t.iconBasePath},null,8,["base-path"])],2),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("orderedList")}]),onClick:f[8]||(f[8]=p=>s.unref(o)?.chain().focus().toggleOrderedList().run()),title:"Toggle Ordered List"},[s.createVNode(h,{symbol:"ordered-list","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("div",K3,[s.createElementVNode("button",G3,[s.unref(o).isActive({textAlign:"center"})?(s.openBlock(),s.createBlock(h,{key:0,symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive({textAlign:"left"})?(s.openBlock(),s.createBlock(h,{key:1,symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive({textAlign:"right"})?(s.openBlock(),s.createBlock(h,{key:2,symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])):(s.openBlock(),s.createBlock(h,{key:3,symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"]))]),s.createElementVNode("ul",W3,[s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"left"})}]),onClick:f[9]||(f[9]=p=>s.unref(o)?.chain().focus().setTextAlign("left").run())},[s.createVNode(h,{symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"center"})}]),onClick:f[10]||(f[10]=p=>s.unref(o)?.chain().focus().setTextAlign("center").run())},[s.createVNode(h,{symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"right"})}]),onClick:f[11]||(f[11]=p=>s.unref(o)?.chain().focus().setTextAlign("right").run())},[s.createVNode(h,{symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"pretty"})}]),onClick:f[12]||(f[12]=p=>s.unref(o)?.chain().focus().setTextAlign("right").run())},[s.createVNode(h,{symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),s.unref(o).isActive("link")?(s.openBlock(),s.createElementBlock("button",{key:3,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("link")}]),onClick:f[13]||(f[13]=p=>s.unref(o).chain().focus().unsetLink().run()),title:"Unset Link"},[s.createVNode(h,{symbol:"unlink","base-path":t.iconBasePath},null,8,["base-path"])],2)):(s.openBlock(),s.createElementBlock("button",{key:2,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("link")}]),onClick:i,title:"Set Link"},[s.createVNode(h,{symbol:"link","base-path":t.iconBasePath},null,8,["base-path"])],2)),s.createElementVNode("div",z3,[s.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[14]||(f[14]=p=>s.unref(o)?.chain().focus().undo().run()),disabled:!s.unref(o).can().chain().focus().undo().run(),title:"Undo"},[s.createVNode(h,{symbol:"undo","base-path":t.iconBasePath},null,8,["base-path"])],8,Y3),s.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[15]||(f[15]=p=>s.unref(o)?.chain().focus().redo().run()),disabled:!s.unref(o).can().chain().focus().redo().run(),title:"Redo"},[s.createVNode(h,{symbol:"redo","base-path":t.iconBasePath},null,8,["base-path"])],8,J3)])])):s.createCommentVNode("",!0),s.createVNode(s.unref(x3),{class:"rte-editor__content",editor:s.unref(o)},null,8,["editor"])])}}}),j3={class:"input-color"},q3={class:"base-input__color-swatch"},Z3=["name","id","disabled","read-only","required","aria-label"],eG=s.defineComponent({__name:"input-color",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>{const a=s.resolveComponent("base-input");return s.openBlock(),s.createElementBlock("div",j3,[s.createVNode(a,{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),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":s.withCtx(l=>[s.createElementVNode("span",q3,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=u=>r.value=u),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,Z3),[[s.vModelText,r.value]])])]),_:1},8,["modelValue","type","id","name","placeholder","pattern","label","disabled","read-only","required","maxlength"])])}}}),tG={class:"color-palette"},AG=["for"],nG=s.defineComponent({__name:"color-palette",props:{modelValue:{type:[String],default:""},colors:{type:Array,default:["#000000","#FFFFFF"]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",tG,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),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":s.withCtx(a=>[s.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block rounded-circle",style:s.normalizeStyle({backgroundColor:a.option})},null,12,AG)]),_:1},8,["modelValue","options","name","id","label","disabled","required"])]))}}),rG={class:"input input-dropdown"},oG={class:"dropdown"},iG={class:"caption"},sG=["innerHTML"],aG={class:"caption__text"},lG={class:"d-block text-truncate"},cG={class:"dropdown-menu"},uG={class:"form-check"},dG=["value","id","name","label","required","disabled"],fG=["value","id","name","label","required","disabled"],hG=["for"],pG=s.defineComponent({__name:"input-dropdown",props:{id:{type:String},name:{type:String,default:()=>`dropdown-${Bt()}`},label:{type:String,default:()=>`dropdown-${Bt()}`},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:e}){const{t:A}=El(),n=t,r=e,o=s.computed({get(){return n.multiple&&!n.modelValue?[]:n.modelValue},set(l){r("update:modelValue",l)}}),i=s.computed(()=>n.options&&n.options.map(l=>(l=typeof l=="string"?{text:l,value:l}:l,{...l,active:n.modelValue&&l.value&&(n.exactMatch?n.modelValue===l.value:n.multiple?n.modelValue.includes(l.value):n.modelValue===l.value)}))),a=s.computed(()=>{if(!n.modelValue)return n.placeholder||`${A("common.select")}`;if(n.multiple&&Array.isArray(n.modelValue)&&n.modelValue.length)return i.value.reduce((l,u)=>n.modelValue.includes(u.value)?`${l}${l?", ":""}${u.text}`:l,"");if(!n.multiple){const l=i.value.find(u=>u.value===n.modelValue);return l?l.text:n.placeholder||`${A("common.select")}`}return n.placeholder||`${A("common.select")}`});return(l,u)=>{const f=s.resolveComponent("base-button");return s.openBlock(),s.createElementBlock("div",rG,[s.createElementVNode("div",oG,[s.createVNode(f,{"data-bs-toggle":"dropdown",role:"button",type:"button",title:a.value,class:"btn dropdown-toggle",color:t.color,outlined:t.outlined,disabled:t.disabled},{default:s.withCtx(()=>[s.createElementVNode("span",iG,[s.createVNode(s.Transition,{name:"bounce"},{default:s.withCtx(()=>[t.showSelectionCount&&t.modelValue.length?(s.openBlock(),s.createElementBlock("i",{key:0,class:"caption__count",innerHTML:t.modelValue.length},null,8,sG)):s.createCommentVNode("",!0)]),_:1}),s.createElementVNode("span",aG,[s.createElementVNode("span",lG,s.toDisplayString(t.toggleCaption||a.value),1)])])]),_:1},8,["title","color","outlined","disabled"]),s.createElementVNode("ul",cG,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,(h,p)=>(s.openBlock(),s.createElementBlock("li",{key:`${h.value}-${p}`},[s.createElementVNode("div",{class:s.normalizeClass(["dropdown-item",h.active&&"active"])},[s.createElementVNode("div",uG,[t.multiple?s.withDirectives((s.openBlock(),s.createElementBlock("input",{type:"checkbox","onUpdate:modelValue":u[0]||(u[0]=g=>o.value=g),value:h.value,key:`${t.name}-${h.value}-${p}__if`,id:`${t.name}-${h.value}-${p}`,name:t.name,label:h.text,required:t.required,disabled:h.selectable===!1,class:"form-check-input"},null,8,dG)),[[s.vModelCheckbox,o.value]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{type:"radio","onUpdate:modelValue":u[1]||(u[1]=g=>o.value=g),value:h.value,key:`${t.name}-${h.value}-${p}__else`,id:`${t.name}-${h.value}-${p}`,name:t.name,label:h.text,required:t.required,disabled:h.selectable===!1,class:"form-check-input visually-hidden"},null,8,fG)),[[s.vModelRadio,o.value]]),s.createElementVNode("label",{class:"form-check-label flex-grow-1",onclick:"event.stopPropagation",for:`${t.name}-${h.value}-${p}`},s.toDisplayString(h.text),9,hG)])],2)]))),128))])])])}}}),mG={key:0,class:"auto-suggest__suggestions position-relative"},gG={class:"suggestions dropdown-menu show w-100 mt-2"},BG=["onClick"],yG=["innerHTML"],wG=s.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:[]},color:{type:String,default:""},outlined:{type:Boolean,default:!1},selection:{type:String}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.ref(!1),i=s.computed({get(){return A.modelValue},set(g){n("update:modelValue",g)}}),a=s.computed(()=>{const g=new RegExp(`(${i.value})`,"i");return i.value?A.options.filter(B=>g.test(B)):A.options}),l=s.computed(()=>{const g=new RegExp(`(${i.value})`,"i");return a.value.map(B=>B.replace(g,"<strong>$1</strong>"))});s.watch(()=>A.options,(g,B)=>{g.length&&(o.value=!0)},{deep:!0});function u(){A.options.length&&(o.value=!0)}function f(g){o.value=!1;const B=a.value[g];n("update:modelValue",B),n("update:selection",B)}const h=s.ref();function p(g){const B=g.target;o.value&&B&&!r.value.contains(B)&&(o.value=!1)}return s.onBeforeMount(()=>{h.value=document.addEventListener("click",p)}),s.onBeforeUnmount(()=>{document.removeEventListener("click",h.value)}),(g,B)=>{const y=s.resolveComponent("base-input");return s.openBlock(),s.createElementBlock("div",{class:"auto-suggest",ref_key:"container",ref:r},[s.createElementVNode("div",{class:"auto-suggest__input",onFocusCapture:u},[s.renderSlot(g.$slots,"default",{},()=>[s.createVNode(y,s.mergeProps({modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=b=>i.value=b)},g.$props),null,16,["modelValue"])])],32),o.value&&a.value.length?(s.openBlock(),s.createElementBlock("div",mG,[s.createElementVNode("ul",gG,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:b,class:"suggestions__item dropdown-item",onClick:s.withModifiers(v=>f(w),["prevent"])},[s.createElementVNode("p",{class:"text-truncate my-2",innerHTML:b},null,8,yG)],8,BG))),128))])])):s.createCommentVNode("",!0)],512)}}});var Md=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ac={exports:{}};/**
115
+ `);return!o||!i?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:A,doc:n}=e,{$from:r,empty:o}=A;if(!o||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const a=r.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(nt.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[tg({find:_K,type:this.type,getAttributes:t=>({language:t[1]})}),tg({find:DK,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new AA({key:new DA("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const A=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),r=n?JSON.parse(n):void 0,o=r?.mode;if(!A||!o)return!1;const{tr:i,schema:a}=t.state,l=a.text(A.replace(/\r\n?/g,`
116
+ `));return i.replaceSelectionWith(this.type.create({language:o},l)),i.selection.$from.parent.type!==this.type&&i.setSelection(Ze.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),OK=Mn.create({name:"doc",topNode:!0,content:"block+"}),MK=Mn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",zt(this.options.HTMLAttributes,t)]},renderText(){return`
117
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:A,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:o}=A;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=n.extensionManager,l=o||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:f})=>{if(f&&l&&i){const h=l.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),NK=Mn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,zt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),HK=Mn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",zt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!K$(e,e.schema.nodes[this.name]))return!1;const{selection:A}=e,{$to:n}=A,r=t();return HE(A)?r.insertContentAt(n.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:o,dispatch:i})=>{var a;if(i){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Ze.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Pe.create(o.doc,l.pos)):o.setSelection(Ze.create(o.doc,l.pos));else{const f=(a=l.parent.type.contentMatch.defaultType)==null?void 0:a.create();f&&(o.insert(u,f),o.setSelection(Ze.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$$({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),RK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,VK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$K=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,KK=yi.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[gs({find:RK,type:this.type}),gs({find:VK,type:this.type})]},addPasteRules(){return[wi({find:PK,type:this.type}),wi({find:$K,type:this.type})]}}),GK=Object.defineProperty,WK=(t,e)=>{for(var A in e)GK(t,A,{get:e[A],enumerable:!0})},zK="listItem",C1="textStyle",b1=/^\s*([-+*])\s$/,v1=Mn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zK,this.editor.getAttributes(C1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=wa({find:b1,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wa({find:b1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(C1),editor:this.editor})),[t]}}),E1=Mn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YK={};WK(YK,{findListItemPos:()=>tc,getNextListDepth:()=>kg,handleBackspace:()=>Sg,handleDelete:()=>Qg,hasListBefore:()=>k1,hasListItemAfter:()=>JK,hasListItemBefore:()=>S1,listItemHasSubList:()=>Q1,nextListIsDeeper:()=>F1,nextListIsHigher:()=>U1});var tc=(t,e)=>{const{$from:A}=e.selection,n=wA(t,e.schema);let r=null,o=A.depth,i=A.pos,a=null;for(;o>0&&a===null;)r=A.node(o),r.type===n?a=o:(o-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},kg=(t,e)=>{const A=tc(t,e);if(!A)return!1;const[,n]=pV(e,t,A.$pos.pos+4);return n},k1=(t,e,A)=>{const{$anchor:n}=t.selection,r=Math.max(0,n.pos-2),o=t.doc.resolve(r).node();return!(!o||!A.includes(o.type.name))},S1=(t,e)=>{var A;const{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-2);return!(r.index()===0||((A=r.nodeBefore)==null?void 0:A.type.name)!==t)},Q1=(t,e,A)=>{if(!A)return!1;const n=wA(t,e.schema);let r=!1;return A.descendants(o=>{o.type===n&&(r=!0)}),r},Sg=(t,e,A)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Bi(t.state,e)&&k1(t.state,e,A)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),u=[];l.node().descendants((p,g)=>{p.type.name===e&&u.push({node:p,pos:g})});const f=u.at(-1);if(!f)return!1;const h=t.state.doc.resolve(l.start()+f.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Bi(t.state,e)||!yV(t.state))return!1;const n=tc(e,t.state);if(!n)return!1;const o=t.state.doc.resolve(n.$pos.pos-2).node(n.depth),i=Q1(e,t.state,o);return S1(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},F1=(t,e)=>{const A=kg(t,e),n=tc(t,e);return!n||!A?!1:A>n.depth},U1=(t,e)=>{const A=kg(t,e),n=tc(t,e);return!n||!A?!1:A<n.depth},Qg=(t,e)=>{if(!Bi(t.state,e)||!BV(t.state,e))return!1;const{selection:A}=t.state,{$from:n,$to:r}=A;return!A.empty&&n.sameParent(r)?!1:F1(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():U1(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},JK=(t,e)=>{var A;const{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||((A=r.nodeAfter)==null?void 0:A.type.name)!==t)},I1=dA.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A})=>{t.state.schema.nodes[A]!==void 0&&Qg(t,A)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A})=>{t.state.schema.nodes[A]!==void 0&&Qg(t,A)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A,wrapperNames:n})=>{t.state.schema.nodes[A]!==void 0&&Sg(t,A,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:A,wrapperNames:n})=>{t.state.schema.nodes[A]!==void 0&&Sg(t,A,n)&&(e=!0)}),e}}}}),XK="listItem",x1="textStyle",T1=/^(\d+)\.\s$/,_1=Mn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...A}=t;return e===1?["ol",zt(this.options.HTMLAttributes,A),0]:["ol",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(XK,this.editor.getAttributes(x1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=wa({find:T1,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,A)=>A.childCount+A.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wa({find:T1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(x1)}),joinPredicate:(e,A)=>A.childCount+A.attrs.start===+e[1],editor:this.editor})),[t]}}),jK=/^\s*(\[([( |x])?\])\s$/,qK=Mn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",zt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:A,editor:n})=>{const r=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=f=>{var h,p;a.ariaLabel=((p=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:p.call(h,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};return u(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=f.target;n.isEditable&&typeof A=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=A();if(typeof g!="number")return!1;const B=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...B?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,h])=>{r.setAttribute(f,h)}),r.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,i),r.append(o,l),Object.entries(e).forEach(([f,h])=>{r.setAttribute(f,h)}),{dom:r,contentDOM:l,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(f),!0)}}},addInputRules(){return[wa({find:jK,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ZK=Mn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",zt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});dA.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(v1.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(E1.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(I1.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(_1.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(qK.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ZK.configure(this.options.taskList)),t}});var e3=Mn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),t3=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,A3=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,n3=yi.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[gs({find:t3,type:this.type})]},addPasteRules(){return[wi({find:A3,type:this.type})]}}),r3=Mn.create({name:"text",group:"inline"}),o3=yi.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function i3(t={}){return new AA({view(e){return new s3(e,t)}})}class s3{constructor(e,A){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=A.width)!==null&&n!==void 0?n:1,this.color=A.color===!1?void 0:A.color||"black",this.class=A.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let o=i=>{this[r](i)};return e.dom.addEventListener(r,o),{name:r,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:A})=>this.editorView.dom.removeEventListener(e,A))}update(e,A){this.cursorPos!=null&&A.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),A=!e.parent.inlineContent,n,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,a=o.height/r.offsetHeight;if(A){let h=e.nodeBefore,p=e.nodeAfter;if(h||p){let g=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(g){let B=g.getBoundingClientRect(),y=h?B.bottom:B.top;h&&p&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*a;n={left:B.left,right:B.right,top:y-b,bottom:y+b}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*i;n={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",A),this.element.classList.toggle("prosemirror-dropcursor-inline",!A);let u,f;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,f=-pageYOffset;else{let h=l.getBoundingClientRect(),p=h.width/l.offsetWidth,g=h.height/l.offsetHeight;u=h.left-l.scrollLeft*p,f=h.top-l.scrollTop*g}this.element.style.left=(n.left-u)/i+"px",this.element.style.top=(n.top-f)/a+"px",this.element.style.width=(n.right-n.left)/i+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let A=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=A&&A.inside>=0&&this.editorView.state.doc.nodeAt(A.inside),r=n&&n.type.spec.disableDropCursor,o=typeof r=="function"?r(this.editorView,A,e):r;if(A&&!o){let i=A.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Lb(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class rA extends nt{constructor(e){super(e,e)}map(e,A){let n=e.resolve(A.map(this.head));return rA.valid(n)?new rA(n):nt.near(n)}content(){return De.empty}eq(e){return e instanceof rA&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,A){if(typeof A.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new rA(e.resolve(A.pos))}getBookmark(){return new Fg(this.anchor)}static valid(e){let A=e.parent;if(A.isTextblock||!a3(e)||!l3(e))return!1;let n=A.type.spec.allowGapCursor;if(n!=null)return n;let r=A.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,A,n=!1){e:for(;;){if(!n&&rA.valid(e))return e;let r=e.pos,o=null;for(let i=e.depth;;i--){let a=e.node(i);if(A>0?e.indexAfter(i)<a.childCount:e.index(i)>0){o=a.child(A>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=A;let l=e.doc.resolve(r);if(rA.valid(l))return l}for(;;){let i=A>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Pe.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*A),n=!1;continue e}break}o=i,r+=A;let a=e.doc.resolve(r);if(rA.valid(a))return a}return null}}}rA.prototype.visible=!1,rA.findFrom=rA.findGapCursorFrom,nt.jsonID("gapcursor",rA);class Fg{constructor(e){this.pos=e}map(e){return new Fg(e.map(this.pos))}resolve(e){let A=e.resolve(this.pos);return rA.valid(A)?new rA(A):nt.near(A)}}function a3(t){for(let e=t.depth;e>=0;e--){let A=t.index(e),n=t.node(e);if(A==0){if(n.type.spec.isolating)return!0;continue}for(let r=n.child(A-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function l3(t){for(let e=t.depth;e>=0;e--){let A=t.indexAfter(e),n=t.node(e);if(A==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let r=n.child(A);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function c3(){return new AA({props:{decorations:h3,createSelectionBetween(t,e,A){return e.pos==A.pos&&rA.valid(A)?new rA(A):null},handleClick:d3,handleKeyDown:u3,handleDOMEvents:{beforeinput:f3}}})}const u3=aE({ArrowLeft:Dd("horiz",-1),ArrowRight:Dd("horiz",1),ArrowUp:Dd("vert",-1),ArrowDown:Dd("vert",1)});function Dd(t,e){const A=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,r,o){let i=n.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof Ze){if(!o.endOfTextblock(A)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let u=rA.findGapCursorFrom(a,e,l);return u?(r&&r(n.tr.setSelection(new rA(u))),!0):!1}}function d3(t,e,A){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!rA.valid(n))return!1;let r=t.posAtCoords({left:A.clientX,top:A.clientY});return r&&r.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rA(n))),!0)}function f3(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof rA))return!1;let{$from:A}=t.state.selection,n=A.parent.contentMatchAt(A.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let r=we.empty;for(let i=n.length-1;i>=0;i--)r=we.from(n[i].createAndFill(null,r));let o=t.state.tr.replace(A.pos,A.pos,new De(r,0,0));return o.setSelection(Ze.near(o.doc.resolve(A.pos+1))),t.dispatch(o),!1}function h3(t){if(!(t.selection instanceof rA))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",jt.create(t.doc,[un.widget(t.selection.head,e,{key:"gapcursor"})])}var Ld=200,LA=function(){};LA.prototype.append=function(e){return e.length?(e=LA.from(e),!this.length&&e||e.length<Ld&&this.leafAppend(e)||this.length<Ld&&e.leafPrepend(this)||this.appendInner(e)):this},LA.prototype.prepend=function(e){return e.length?LA.from(e).append(this):this},LA.prototype.appendInner=function(e){return new p3(this,e)},LA.prototype.slice=function(e,A){return e===void 0&&(e=0),A===void 0&&(A=this.length),e>=A?LA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,A))},LA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},LA.prototype.forEach=function(e,A,n){A===void 0&&(A=0),n===void 0&&(n=this.length),A<=n?this.forEachInner(e,A,n,0):this.forEachInvertedInner(e,A,n,0)},LA.prototype.map=function(e,A,n){A===void 0&&(A=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,i){return r.push(e(o,i))},A,n),r},LA.from=function(e){return e instanceof LA?e:e&&e.length?new D1(e):LA.empty};var D1=(function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var A={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,a){for(var l=o;l<i;l++)if(r(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,a){for(var l=o-1;l>=i;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Ld)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Ld)return new e(r.flatten().concat(this.values))},A.length.get=function(){return this.values.length},A.depth.get=function(){return 0},Object.defineProperties(e.prototype,A),e})(LA);LA.empty=new D1([]);var p3=(function(t){function e(A,n){t.call(this),this.left=A,this.right=n,this.length=A.length+n.length,this.depth=Math.max(A.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,i){var a=this.left.length;if(r<a&&this.left.forEachInner(n,r,Math.min(o,a),i)===!1||o>a&&this.right.forEachInner(n,Math.max(r-a,0),Math.min(this.length,o)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,i){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(n,r-a,Math.max(o,a)-a,i+a)===!1||o<a&&this.left.forEachInvertedInner(n,Math.min(r,a),o,i)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(LA);const m3=500;class Qr{constructor(e,A){this.items=e,this.eventCount=A}popEvent(e,A){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let r,o;A&&(r=this.remapping(n,this.items.length),o=r.maps.length);let i=e.tr,a,l,u=[],f=[];return this.items.forEach((h,p)=>{if(!h.step){r||(r=this.remapping(n,p+1),o=r.maps.length),o--,f.push(h);return}if(r){f.push(new qr(h.map));let g=h.step.map(r.slice(o)),B;g&&i.maybeStep(g).doc&&(B=i.mapping.maps[i.mapping.maps.length-1],u.push(new qr(B,void 0,void 0,u.length+f.length))),o--,B&&r.appendMap(B,o)}else i.maybeStep(h.step);if(h.selection)return a=r?h.selection.map(r.slice(o)):h.selection,l=new Qr(this.items.slice(0,n).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,A,n,r){let o=[],i=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),p=new qr(e.mapping.maps[f],h,A),g;(g=l&&l.merge(p))&&(p=g,f?o.pop():a=a.slice(0,a.length-1)),o.push(p),A&&(i++,A=void 0),r||(l=p)}let u=i-n.depth;return u>B3&&(a=g3(a,u),i-=u),new Qr(a.append(o),i)}remapping(e,A){let n=new Ul;return this.items.forEach((r,o)=>{let i=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?n.maps.length-r.mirrorOffset:void 0;n.appendMap(r.map,i)},e,A),n}addMaps(e){return this.eventCount==0?this:new Qr(this.items.append(e.map(A=>new qr(A))),this.eventCount)}rebased(e,A){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-A),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},r);let l=A;this.items.forEach(p=>{let g=o.getMirror(--l);if(g==null)return;i=Math.min(i,g);let B=o.maps[g];if(p.step){let y=e.steps[g].invert(e.docs[g]),b=p.selection&&p.selection.map(o.slice(l+1,g));b&&a++,n.push(new qr(B,y,b))}else n.push(new qr(B))},r);let u=[];for(let p=A;p<i;p++)u.push(new qr(o.maps[p]));let f=this.items.slice(0,r).append(u).append(n),h=new Qr(f,a);return h.emptyItemCount()>m3&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(A=>{A.step||e++}),e}compress(e=this.items.length){let A=this.remapping(0,e),n=A.maps.length,r=[],o=0;return this.items.forEach((i,a)=>{if(a>=e)r.push(i),i.selection&&o++;else if(i.step){let l=i.step.map(A.slice(n)),u=l&&l.getMap();if(n--,u&&A.appendMap(u,n),l){let f=i.selection&&i.selection.map(A.slice(n));f&&o++;let h=new qr(u.invert(),l,f),p,g=r.length-1;(p=r.length&&r[g].merge(h))?r[g]=p:r.push(h)}}else i.map&&n--},this.items.length,0),new Qr(LA.from(r.reverse()),o)}}Qr.empty=new Qr(LA.empty,0);function g3(t,e){let A;return t.forEach((n,r)=>{if(n.selection&&e--==0)return A=r,!1}),t.slice(A)}class qr{constructor(e,A,n,r){this.map=e,this.step=A,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let A=e.step.merge(this.step);if(A)return new qr(A.getMap().invert(),A,this.selection)}}}class Ei{constructor(e,A,n,r,o){this.done=e,this.undone=A,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const B3=20;function y3(t,e,A,n){let r=A.getMeta(ws),o;if(r)return r.historyState;A.getMeta(b3)&&(t=new Ei(t.done,t.undone,null,0,-1));let i=A.getMeta("appendedTransaction");if(A.steps.length==0)return t;if(i&&i.getMeta(ws))return i.getMeta(ws).redo?new Ei(t.done.addTransform(A,void 0,n,Od(e)),t.undone,L1(A.mapping.maps),t.prevTime,t.prevComposition):new Ei(t.done,t.undone.addTransform(A,void 0,n,Od(e)),null,t.prevTime,t.prevComposition);if(A.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=A.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(A.time||0)-n.newGroupDelay||!w3(A,t.prevRanges)),u=i?Ug(t.prevRanges,A.mapping):L1(A.mapping.maps);return new Ei(t.done.addTransform(A,l?e.selection.getBookmark():void 0,n,Od(e)),Qr.empty,u,A.time,a??t.prevComposition)}else return(o=A.getMeta("rebased"))?new Ei(t.done.rebased(A,o),t.undone.rebased(A,o),Ug(t.prevRanges,A.mapping),t.prevTime,t.prevComposition):new Ei(t.done.addMaps(A.mapping.maps),t.undone.addMaps(A.mapping.maps),Ug(t.prevRanges,A.mapping),t.prevTime,t.prevComposition)}function w3(t,e){if(!e)return!1;if(!t.docChanged)return!0;let A=!1;return t.mapping.maps[0].forEach((n,r)=>{for(let o=0;o<e.length;o+=2)n<=e[o+1]&&r>=e[o]&&(A=!0)}),A}function L1(t){let e=[];for(let A=t.length-1;A>=0&&e.length==0;A--)t[A].forEach((n,r,o,i)=>e.push(o,i));return e}function Ug(t,e){if(!t)return null;let A=[];for(let n=0;n<t.length;n+=2){let r=e.map(t[n],1),o=e.map(t[n+1],-1);r<=o&&A.push(r,o)}return A}function C3(t,e,A){let n=Od(e),r=ws.get(e).spec.config,o=(A?t.undone:t.done).popEvent(e,n);if(!o)return null;let i=o.selection.resolve(o.transform.doc),a=(A?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,n),l=new Ei(A?a:o.remaining,A?o.remaining:a,null,0,-1);return o.transform.setSelection(i).setMeta(ws,{redo:A,historyState:l})}let Ig=!1,O1=null;function Od(t){let e=t.plugins;if(O1!=e){Ig=!1,O1=e;for(let A=0;A<e.length;A++)if(e[A].spec.historyPreserveItems){Ig=!0;break}}return Ig}const ws=new DA("history"),b3=new DA("closeHistory");function v3(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new AA({key:ws,state:{init(){return new Ei(Qr.empty,Qr.empty,null,0,-1)},apply(e,A,n){return y3(A,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,A){let n=A.inputType,r=n=="historyUndo"?N1:n=="historyRedo"?H1:null;return r?(A.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function M1(t,e){return(A,n)=>{let r=ws.getState(A);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(n){let o=C3(r,A,t);o&&n(e?o.scrollIntoView():o)}return!0}}const N1=M1(!1,!0),H1=M1(!0,!0);dA.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,A=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(A)}},addProseMirrorPlugins(){let t=!1;return[new AA({key:new DA("characterCount"),appendTransaction:(e,A,n)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const o=this.storage.characters({node:n.doc});if(o>r){const i=o-r,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(a,l);return t=!0,u}t=!0},filterTransaction:(e,A)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const r=this.storage.characters({node:A.doc}),o=this.storage.characters({node:e.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-n,u=a-l,f=a;return e.deleteRange(u,f),!(this.storage.characters({node:e.doc})>n)}})]}});var E3=dA.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[i3(this.options)]}});dA.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new AA({key:new DA("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:A,isFocused:n}=this.editor,{anchor:r}=e,o=[];if(!A||!n)return jt.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(r>=u&&r<=u+l.nodeSize-1))return!1;i+=1});let a=0;return t.descendants((l,u)=>{if(l.isText||!(r>=u&&r<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(un.node(u,u+l.nodeSize,{class:this.options.className}))}),jt.create(t,o)}}})]}});var k3=dA.create({name:"gapCursor",addProseMirrorPlugins(){return[c3()]},extendNodeSchema(t){var e;const A={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ut(Re(t,"allowGapCursor",A)))!=null?e:null}}});dA.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new AA({key:new DA("placeholder"),props:{decorations:({doc:t,selection:e})=>{const A=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,r=[];if(!A)return null;const o=this.editor.isEmpty;return t.descendants((i,a)=>{const l=n>=a&&n<=a+i.nodeSize,u=!i.isLeaf&&Ju(i);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);const h=un.node(a,a+i.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});r.push(h)}return this.options.includeChildren}),jt.create(t,r)}}})]}}),dA.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new AA({key:new DA("selection"),props:{decorations(A){return A.selection.empty||t.isFocused||!t.isEditable||HE(A.selection)||t.view.dragging?null:jt.create(A.doc,[un.inline(A.selection.from,A.selection.to,{class:e.className})])}}})]}});function R1({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var S3=dA.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const t=new DA(this.name),e=Object.entries(this.editor.schema.nodes).map(([,A])=>A).filter(A=>(this.options.notAfter||[]).concat(this.options.node).includes(A.name));return[new AA({key:t,appendTransaction:(A,n,r)=>{const{doc:o,tr:i,schema:a}=r,l=t.getState(r),u=o.content.size,f=a.nodes[this.options.node];if(l)return i.insert(u,f.create())},state:{init:(A,n)=>{const r=n.tr.doc.lastChild;return!R1({node:r,types:e})},apply:(A,n)=>{if(!A.docChanged)return n;const r=A.doc.lastChild;return!R1({node:r,types:e})}}})]}}),Q3=dA.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>N1(t,e),redo:()=>({state:t,dispatch:e})=>H1(t,e)}},addProseMirrorPlugins(){return[v3(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),F3=dA.create({name:"starterKit",addExtensions(){var t,e,A,n;const r=[];return this.options.bold!==!1&&r.push(w1.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(EK.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(v1.configure(this.options.bulletList)),this.options.code!==!1&&r.push(TK.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(LK.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(OK.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(E3.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(k3.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(MK.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(NK.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(Q3.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(HK.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(KK.configure(this.options.italic)),this.options.listItem!==!1&&r.push(E1.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(I1.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&r.push(y1.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&r.push(_1.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(e3.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(n3.configure(this.options.strike)),this.options.text!==!1&&r.push(r3.configure(this.options.text)),this.options.underline!==!1&&r.push(o3.configure((A=this.options)==null?void 0:A.underline)),this.options.trailingNode!==!1&&r.push(S3.configure((n=this.options)==null?void 0:n.trailingNode)),r}}),U3=F3;function P1(t){return s.customRef((e,A)=>({get(){return e(),t},set(n){t=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{A()})})}}))}var I3=class extends V${constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=P1(this.view.state),this.reactiveExtensionStorage=P1(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),s.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const A=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=A),A}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},x3=s.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=s.ref(),A=s.getCurrentInstance();return s.watchEffect(()=>{const n=t.editor;n&&n.options.element&&e.value&&s.nextTick(()=>{var r;if(!e.value||!((r=n.options.element)!=null&&r.firstChild))return;const o=s.unref(e.value);e.value.append(...n.options.element.childNodes),n.contentComponent=A.ctx._,A&&(n.appContext={...A.appContext,provides:A.provides}),n.setOptions({element:o}),n.createNodeViews()})}),s.onBeforeUnmount(()=>{const n=t.editor;n&&(n.contentComponent=null,n.appContext=null)}),{rootEl:e}},render(){return s.h("div",{ref:t=>{this.rootEl=t}})}});s.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return s.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),s.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return s.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}});var T3=(t={})=>{const e=s.shallowRef();return s.onMounted(()=>{e.value=new I3(t)}),s.onBeforeUnmount(()=>{var A,n,r;const o=(A=e.value)==null?void 0:A.options.element,i=o?.cloneNode(!0);(n=o?.parentNode)==null||n.replaceChild(i,o),(r=e.value)==null||r.destroy()}),e};s.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return s.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});const _3={class:"rte-editor"},D3={key:0,class:"rte-editor__controls mb-2"},L3=["disabled"],O3=["disabled"],M3={class:"btn-group"},N3=["disabled"],H3=["disabled"],R3={class:"btn-group"},P3={class:"dropdown"},V3={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},$3={class:"dropdown-menu"},K3={class:"dropdown"},G3={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},W3={class:"dropdown-menu"},z3={class:"btn-group"},Y3=["disabled"],J3=["disabled"],X3=s.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:e}){const A=t,n=e,r=s.ref(!1),o=T3({content:A.modelValue,onUpdate:()=>{n("update:modelValue",o.value?.getHTML())},extensions:[U3.configure({bold:!1}),UK.extend({addAttributes(){return{class:{default:null}}},parseHTML(){return[{tag:"strong"},{tag:"b"}]},renderHTML({HTMLAttributes:u}){return["strong",zt(this.options.HTMLAttributes,u),0]}}),j$.configure({types:["heading","paragraph"]}),J$,bK.extend({addAttributes(){return{...this.parent?.(),class:{default:null},id:{default:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:u=>({href:u.getAttribute("href"),target:u.getAttribute("target"),rel:u.getAttribute("rel"),class:u.getAttribute("class"),id:u.getAttribute("id"),title:u.getAttribute("title")})},{tag:"a:not([href])",getAttrs:u=>({href:null,target:u.getAttribute("target"),rel:u.getAttribute("rel"),class:u.getAttribute("class"),id:u.getAttribute("id"),title:u.getAttribute("title")})}]},renderHTML({HTMLAttributes:u}){if(!u.href){const{href:f,target:h,rel:p,...g}=u;return["a",zt(g),0]}return["a",zt(this.options.HTMLAttributes,u),0]}}).configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}})]});s.watch(()=>A.modelValue,(u,f)=>{if(o.value){if(o.value.getHTML()===u)return;o.value.commands.setContent(u)}});function i(){const u=o.value?.getAttributes("link").href,f=window.prompt("URL",u);if(f!==null){if(f===""){o.value?.chain().focus().extendMarkRange("link").unsetLink().run();return}try{o.value?.chain().focus().extendMarkRange("link").setLink({href:f}).run()}catch(h){alert(h.message)}}}const a=()=>{o.value?.commands.setContent(`<textarea>${o.value.getHTML()}</textarea>`),r.value=!0},l=()=>{o.value?.commands.setContent(o.value.getText()),r.value=!1};return(u,f)=>{const h=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("div",_3,[s.unref(o)?(s.openBlock(),s.createElementBlock("div",D3,[r.value?(s.openBlock(),s.createElementBlock("button",{key:1,class:"btn btn-sm btn-light is-active",onClick:l,disabled:!s.unref(o).can().chain().focus().toggleCode().run(),title:"Toggle Source"},[s.createVNode(h,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],8,O3)):(s.openBlock(),s.createElementBlock("button",{key:0,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("code")}]),onClick:a,disabled:!s.unref(o).can().chain().focus().toggleCode().run(),title:"Toggle Source"},[s.createVNode(h,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],10,L3)),s.createElementVNode("div",M3,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("bold")}]),onClick:f[0]||(f[0]=p=>s.unref(o)?.chain().focus().toggleBold().run()),disabled:!s.unref(o).can().chain().focus().toggleBold().run(),title:"Toggle Bold"},[s.createVNode(h,{symbol:"bold","base-path":t.iconBasePath},null,8,["base-path"])],10,N3),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("italic")}]),onClick:f[1]||(f[1]=p=>s.unref(o)?.chain().focus().toggleItalic().run()),disabled:!s.unref(o).can().chain().focus().toggleItalic().run(),title:"Toggle Italic"},[s.createVNode(h,{symbol:"italic","base-path":t.iconBasePath},null,8,["base-path"])],10,H3)]),s.createElementVNode("div",R3,[s.createElementVNode("div",P3,[s.createElementVNode("button",V3,[s.unref(o).isActive("heading",{level:1})?(s.openBlock(),s.createBlock(h,{key:0,symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:2})?(s.openBlock(),s.createBlock(h,{key:1,symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:3})?(s.openBlock(),s.createBlock(h,{key:2,symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive("heading",{level:4})?(s.openBlock(),s.createBlock(h,{key:3,symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])):(s.openBlock(),s.createBlock(h,{key:4,symbol:"headline","base-path":t.iconBasePath},null,8,["base-path"]))]),s.createElementVNode("ul",$3,[s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:1})}]),onClick:f[2]||(f[2]=p=>s.unref(o)?.chain().focus().setHeading({level:1}).run()),title:"Set Heading 1"},[s.createVNode(h,{symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:2})}]),onClick:f[3]||(f[3]=p=>s.unref(o)?.chain().focus().setHeading({level:2}).run()),title:"Set Heading 2"},[s.createVNode(h,{symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:3})}]),onClick:f[4]||(f[4]=p=>s.unref(o)?.chain().focus().setHeading({level:3}).run()),title:"Set Heading 3"},[s.createVNode(h,{symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("heading",{level:4})}]),onClick:f[5]||(f[5]=p=>s.unref(o)?.chain().focus().setHeading({level:4}).run()),title:"Set Heading 4"},[s.createVNode(h,{symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("paragraph")}]),onClick:f[6]||(f[6]=p=>s.unref(o)?.chain().focus().setParagraph().run()),title:"Set Paragraph"},[s.createVNode(h,{symbol:"paragraph","base-path":t.iconBasePath},null,8,["base-path"])],2),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("bulletList")}]),onClick:f[7]||(f[7]=p=>s.unref(o)?.chain().focus().toggleBulletList().run()),title:"Toggle Bullet List"},[s.createVNode(h,{symbol:"list","base-path":t.iconBasePath},null,8,["base-path"])],2),s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("orderedList")}]),onClick:f[8]||(f[8]=p=>s.unref(o)?.chain().focus().toggleOrderedList().run()),title:"Toggle Ordered List"},[s.createVNode(h,{symbol:"ordered-list","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("div",K3,[s.createElementVNode("button",G3,[s.unref(o).isActive({textAlign:"center"})?(s.openBlock(),s.createBlock(h,{key:0,symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive({textAlign:"left"})?(s.openBlock(),s.createBlock(h,{key:1,symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])):s.unref(o).isActive({textAlign:"right"})?(s.openBlock(),s.createBlock(h,{key:2,symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])):(s.openBlock(),s.createBlock(h,{key:3,symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"]))]),s.createElementVNode("ul",W3,[s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"left"})}]),onClick:f[9]||(f[9]=p=>s.unref(o)?.chain().focus().setTextAlign("left").run())},[s.createVNode(h,{symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"center"})}]),onClick:f[10]||(f[10]=p=>s.unref(o)?.chain().focus().setTextAlign("center").run())},[s.createVNode(h,{symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"right"})}]),onClick:f[11]||(f[11]=p=>s.unref(o)?.chain().focus().setTextAlign("right").run())},[s.createVNode(h,{symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])],2)]),s.createElementVNode("li",null,[s.createElementVNode("button",{class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive({textAlign:"pretty"})}]),onClick:f[12]||(f[12]=p=>s.unref(o)?.chain().focus().setTextAlign("right").run())},[s.createVNode(h,{symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),s.unref(o).isActive("link")?(s.openBlock(),s.createElementBlock("button",{key:3,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("link")}]),onClick:f[13]||(f[13]=p=>s.unref(o).chain().focus().unsetLink().run()),title:"Unset Link"},[s.createVNode(h,{symbol:"unlink","base-path":t.iconBasePath},null,8,["base-path"])],2)):(s.openBlock(),s.createElementBlock("button",{key:2,class:s.normalizeClass(["btn btn-sm btn-light",{"is-active":s.unref(o).isActive("link")}]),onClick:i,title:"Set Link"},[s.createVNode(h,{symbol:"link","base-path":t.iconBasePath},null,8,["base-path"])],2)),s.createElementVNode("div",z3,[s.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[14]||(f[14]=p=>s.unref(o)?.chain().focus().undo().run()),disabled:!s.unref(o).can().chain().focus().undo().run(),title:"Undo"},[s.createVNode(h,{symbol:"undo","base-path":t.iconBasePath},null,8,["base-path"])],8,Y3),s.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[15]||(f[15]=p=>s.unref(o)?.chain().focus().redo().run()),disabled:!s.unref(o).can().chain().focus().redo().run(),title:"Redo"},[s.createVNode(h,{symbol:"redo","base-path":t.iconBasePath},null,8,["base-path"])],8,J3)])])):s.createCommentVNode("",!0),s.createVNode(s.unref(x3),{class:"rte-editor__content",editor:s.unref(o)},null,8,["editor"])])}}}),j3={class:"input-color"},q3={class:"base-input__color-swatch"},Z3=["name","id","disabled","read-only","required","aria-label"],eG=s.defineComponent({__name:"input-color",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>{const a=s.resolveComponent("base-input");return s.openBlock(),s.createElementBlock("div",j3,[s.createVNode(a,{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),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":s.withCtx(l=>[s.createElementVNode("span",q3,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=u=>r.value=u),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,Z3),[[s.vModelText,r.value]])])]),_:1},8,["modelValue","type","id","name","placeholder","pattern","label","disabled","read-only","required","maxlength"])])}}}),tG={class:"color-palette"},AG=["for"],nG=s.defineComponent({__name:"color-palette",props:{modelValue:{type:[String],default:""},colors:{type:Array,default:["#000000","#FFFFFF"]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue},set(o){n("update:modelValue",o)}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",tG,[s.createVNode(gu,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),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":s.withCtx(a=>[s.createElementVNode("label",{for:`${t.id}-${a.index}`,class:"d-block rounded-circle",style:s.normalizeStyle({backgroundColor:a.option})},null,12,AG)]),_:1},8,["modelValue","options","name","id","label","disabled","required"])]))}}),rG={class:"input input-dropdown"},oG={class:"dropdown"},iG={class:"caption"},sG=["innerHTML"],aG={class:"caption__text"},lG={class:"d-block text-truncate"},cG={class:"dropdown-menu"},uG={class:"form-check"},dG=["value","id","name","label","required","disabled"],fG=["value","id","name","label","required","disabled"],hG=["for"],pG=s.defineComponent({__name:"input-dropdown",props:{id:{type:String},name:{type:String,default:()=>`dropdown-${Bt()}`},label:{type:String,default:()=>`dropdown-${Bt()}`},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:e}){const{t:A}=El(),n=t,r=e,o=s.computed({get(){return n.multiple&&!n.modelValue?[]:n.modelValue},set(l){r("update:modelValue",l)}}),i=s.computed(()=>n.options&&n.options.map(l=>(l=typeof l=="string"?{text:l,value:l}:l,{...l,active:n.modelValue&&l.value&&(n.exactMatch?n.modelValue===l.value:n.multiple?n.modelValue.includes(l.value):n.modelValue===l.value)}))),a=s.computed(()=>{if(!n.modelValue)return n.placeholder||`${A("common.select")}`;if(n.multiple&&Array.isArray(n.modelValue)&&n.modelValue.length)return i.value.reduce((l,u)=>n.modelValue.includes(u.value)?`${l}${l?", ":""}${u.text}`:l,"");if(!n.multiple){const l=i.value.find(u=>u.value===n.modelValue);return l?l.text:n.placeholder||`${A("common.select")}`}return n.placeholder||`${A("common.select")}`});return(l,u)=>{const f=s.resolveComponent("base-button");return s.openBlock(),s.createElementBlock("div",rG,[s.createElementVNode("div",oG,[s.createVNode(f,{"data-bs-toggle":"dropdown",role:"button",type:"button",title:a.value,class:"btn dropdown-toggle",color:t.color,outlined:t.outlined,disabled:t.disabled},{default:s.withCtx(()=>[s.createElementVNode("span",iG,[s.createVNode(s.Transition,{name:"bounce"},{default:s.withCtx(()=>[t.showSelectionCount&&t.modelValue.length?(s.openBlock(),s.createElementBlock("i",{key:0,class:"caption__count",innerHTML:t.modelValue.length},null,8,sG)):s.createCommentVNode("",!0)]),_:1}),s.createElementVNode("span",aG,[s.createElementVNode("span",lG,s.toDisplayString(t.toggleCaption||a.value),1)])])]),_:1},8,["title","color","outlined","disabled"]),s.createElementVNode("ul",cG,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,(h,p)=>(s.openBlock(),s.createElementBlock("li",{key:`${h.value}-${p}`},[s.createElementVNode("div",{class:s.normalizeClass(["dropdown-item",h.active&&"active"])},[s.createElementVNode("div",uG,[t.multiple?s.withDirectives((s.openBlock(),s.createElementBlock("input",{type:"checkbox","onUpdate:modelValue":u[0]||(u[0]=g=>o.value=g),value:h.value,key:`${t.name}-${h.value}-${p}__if`,id:`${t.name}-${h.value}-${p}`,name:t.name,label:h.text,required:t.required,disabled:h.selectable===!1,class:"form-check-input"},null,8,dG)),[[s.vModelCheckbox,o.value]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{type:"radio","onUpdate:modelValue":u[1]||(u[1]=g=>o.value=g),value:h.value,key:`${t.name}-${h.value}-${p}__else`,id:`${t.name}-${h.value}-${p}`,name:t.name,label:h.text,required:t.required,disabled:h.selectable===!1,class:"form-check-input visually-hidden"},null,8,fG)),[[s.vModelRadio,o.value]]),s.createElementVNode("label",{class:"form-check-label flex-grow-1",onclick:"event.stopPropagation",for:`${t.name}-${h.value}-${p}`},s.toDisplayString(h.text),9,hG)])],2)]))),128))])])])}}}),mG={key:0,class:"auto-suggest__suggestions position-relative"},gG={class:"suggestions dropdown-menu show w-100 mt-2"},BG=["onClick"],yG=["innerHTML"],wG=s.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:[]},color:{type:String,default:""},outlined:{type:Boolean,default:!1},selection:{type:String}},emits:["update:modelValue","update:selection"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.ref(!1),i=s.computed({get(){return A.modelValue},set(g){n("update:modelValue",g)}}),a=s.computed(()=>{const g=new RegExp(`(${i.value})`,"i");return i.value?A.options.filter(B=>g.test(B)):A.options}),l=s.computed(()=>{const g=new RegExp(`(${i.value})`,"i");return a.value.map(B=>B.replace(g,"<strong>$1</strong>"))});s.watch(()=>A.options,(g,B)=>{g.length&&(o.value=!0)},{deep:!0});function u(){A.options.length&&(o.value=!0)}function f(g){o.value=!1;const B=a.value[g];n("update:modelValue",B),n("update:selection",B)}const h=s.ref();function p(g){const B=g.target;o.value&&B&&!r.value.contains(B)&&(o.value=!1)}return s.onBeforeMount(()=>{h.value=document.addEventListener("click",p)}),s.onBeforeUnmount(()=>{document.removeEventListener("click",h.value)}),(g,B)=>{const y=s.resolveComponent("base-input");return s.openBlock(),s.createElementBlock("div",{class:"auto-suggest",ref_key:"container",ref:r},[s.createElementVNode("div",{class:"auto-suggest__input",onFocusCapture:u},[s.renderSlot(g.$slots,"default",{},()=>[s.createVNode(y,s.mergeProps({modelValue:i.value,"onUpdate:modelValue":B[0]||(B[0]=b=>i.value=b)},g.$props),null,16,["modelValue"])])],32),o.value&&a.value.length?(s.openBlock(),s.createElementBlock("div",mG,[s.createElementVNode("ul",gG,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:b,class:"suggestions__item dropdown-item",onClick:s.withModifiers(v=>f(w),["prevent"])},[s.createElementVNode("p",{class:"text-truncate my-2",innerHTML:b},null,8,yG)],8,BG))),128))])])):s.createCommentVNode("",!0)],512)}}});var Md=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ac={exports:{}};/**
118
118
  * @license
119
119
  * Lodash <https://lodash.com/>
120
120
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
121
121
  * Released under MIT license <https://lodash.com/license>
122
122
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
123
123
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
124
- */var CG=Ac.exports,V1;function bG(){return V1||(V1=1,(function(t,e){(function(){var A,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,p=2,g=4,B=1,y=2,b=1,w=2,v=4,S=8,F=16,I=32,Q=64,x=128,M=256,O=512,P=30,ie="...",ae=800,ue=16,H=1,G=2,$=3,te=1/0,ee=9007199254740991,K=17976931348623157e292,ce=NaN,j=4294967295,Qe=j-1,R=j>>>1,J=[["ary",x],["bind",b],["bindKey",w],["curry",S],["curryRight",F],["flip",O],["partial",I],["partialRight",Q],["rearg",M]],Ae="[object Arguments]",oe="[object Array]",k="[object AsyncFunction]",X="[object Boolean]",Se="[object Date]",ht="[object DOMException]",se="[object Error]",Ye="[object Function]",ge="[object GeneratorFunction]",Ce="[object Map]",D="[object Number]",ke="[object Null]",be="[object Object]",_="[object Promise]",N="[object Proxy]",ne="[object RegExp]",ve="[object Set]",ze="[object String]",W="[object Symbol]",fe="[object Undefined]",q="[object WeakMap]",me="[object WeakSet]",Je="[object ArrayBuffer]",Ue="[object DataView]",kt="[object Float32Array]",kA="[object Float64Array]",Fn="[object Int8Array]",tn="[object Int16Array]",Mo="[object Int32Array]",lo="[object Uint8Array]",Ds="[object Uint8ClampedArray]",Ls="[object Uint16Array]",Os="[object Uint32Array]",Z=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,At=/&(?:amp|lt|gt|quot|#39);/g,he=/[&<>"']/g,xe=RegExp(At.source),He=RegExp(he.source),Or=/<%-([\s\S]+?)%>/g,ar=/<%([\s\S]+?)%>/g,co=/<%=([\s\S]+?)%>/g,uo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dc=/^\w*$/,by=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/[\\^$.*+?()[\]{}|]/g,kAe=RegExp(vy.source),Ey=/^\s+/,SAe=/\s/,QAe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,FAe=/\{\n\/\* \[wrapped with (.+)\] \*/,UAe=/,? & /,IAe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xAe=/[()=,{}\[\]\/\s]/,TAe=/\\(\\)?/g,_Ae=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,PI=/\w*$/,DAe=/^[-+]0x[0-9a-f]+$/i,LAe=/^0b[01]+$/i,OAe=/^\[object .+?Constructor\]$/,MAe=/^0o[0-7]+$/i,NAe=/^(?:0|[1-9]\d*)$/,HAe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nh=/($^)/,RAe=/['\n\r\u2028\u2029\\]/g,rh="\\ud800-\\udfff",PAe="\\u0300-\\u036f",VAe="\\ufe20-\\ufe2f",$Ae="\\u20d0-\\u20ff",VI=PAe+VAe+$Ae,$I="\\u2700-\\u27bf",KI="a-z\\xdf-\\xf6\\xf8-\\xff",KAe="\\xac\\xb1\\xd7\\xf7",GAe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",WAe="\\u2000-\\u206f",zAe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",GI="A-Z\\xc0-\\xd6\\xd8-\\xde",WI="\\ufe0e\\ufe0f",zI=KAe+GAe+WAe+zAe,ky="['’]",YAe="["+rh+"]",YI="["+zI+"]",oh="["+VI+"]",JI="\\d+",JAe="["+$I+"]",XI="["+KI+"]",jI="[^"+rh+zI+JI+$I+KI+GI+"]",Sy="\\ud83c[\\udffb-\\udfff]",XAe="(?:"+oh+"|"+Sy+")",qI="[^"+rh+"]",Qy="(?:\\ud83c[\\udde6-\\uddff]){2}",Fy="[\\ud800-\\udbff][\\udc00-\\udfff]",Wa="["+GI+"]",ZI="\\u200d",ex="(?:"+XI+"|"+jI+")",jAe="(?:"+Wa+"|"+jI+")",tx="(?:"+ky+"(?:d|ll|m|re|s|t|ve))?",Ax="(?:"+ky+"(?:D|LL|M|RE|S|T|VE))?",nx=XAe+"?",rx="["+WI+"]?",qAe="(?:"+ZI+"(?:"+[qI,Qy,Fy].join("|")+")"+rx+nx+")*",ZAe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ene="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ox=rx+nx+qAe,tne="(?:"+[JAe,Qy,Fy].join("|")+")"+ox,Ane="(?:"+[qI+oh+"?",oh,Qy,Fy,YAe].join("|")+")",nne=RegExp(ky,"g"),rne=RegExp(oh,"g"),Uy=RegExp(Sy+"(?="+Sy+")|"+Ane+ox,"g"),one=RegExp([Wa+"?"+XI+"+"+tx+"(?="+[YI,Wa,"$"].join("|")+")",jAe+"+"+Ax+"(?="+[YI,Wa+ex,"$"].join("|")+")",Wa+"?"+ex+"+"+tx,Wa+"+"+Ax,ene,ZAe,JI,tne].join("|"),"g"),ine=RegExp("["+ZI+rh+VI+WI+"]"),sne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ane=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],lne=-1,Kt={};Kt[kt]=Kt[kA]=Kt[Fn]=Kt[tn]=Kt[Mo]=Kt[lo]=Kt[Ds]=Kt[Ls]=Kt[Os]=!0,Kt[Ae]=Kt[oe]=Kt[Je]=Kt[X]=Kt[Ue]=Kt[Se]=Kt[se]=Kt[Ye]=Kt[Ce]=Kt[D]=Kt[be]=Kt[ne]=Kt[ve]=Kt[ze]=Kt[q]=!1;var Nt={};Nt[Ae]=Nt[oe]=Nt[Je]=Nt[Ue]=Nt[X]=Nt[Se]=Nt[kt]=Nt[kA]=Nt[Fn]=Nt[tn]=Nt[Mo]=Nt[Ce]=Nt[D]=Nt[be]=Nt[ne]=Nt[ve]=Nt[ze]=Nt[W]=Nt[lo]=Nt[Ds]=Nt[Ls]=Nt[Os]=!0,Nt[se]=Nt[Ye]=Nt[q]=!1;var cne={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},une={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},fne={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hne=parseFloat,pne=parseInt,ix=typeof Md=="object"&&Md&&Md.Object===Object&&Md,mne=typeof self=="object"&&self&&self.Object===Object&&self,GA=ix||mne||Function("return this")(),Iy=e&&!e.nodeType&&e,Ms=Iy&&!0&&t&&!t.nodeType&&t,sx=Ms&&Ms.exports===Iy,xy=sx&&ix.process,lr=(function(){try{var z=Ms&&Ms.require&&Ms.require("util").types;return z||xy&&xy.binding&&xy.binding("util")}catch{}})(),ax=lr&&lr.isArrayBuffer,lx=lr&&lr.isDate,cx=lr&&lr.isMap,ux=lr&&lr.isRegExp,dx=lr&&lr.isSet,fx=lr&&lr.isTypedArray;function Kn(z,le,re){switch(re.length){case 0:return z.call(le);case 1:return z.call(le,re[0]);case 2:return z.call(le,re[0],re[1]);case 3:return z.call(le,re[0],re[1],re[2])}return z.apply(le,re)}function gne(z,le,re,Oe){for(var et=-1,vt=z==null?0:z.length;++et<vt;){var SA=z[et];le(Oe,SA,re(SA),z)}return Oe}function cr(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe&&le(z[re],re,z)!==!1;);return z}function Bne(z,le){for(var re=z==null?0:z.length;re--&&le(z[re],re,z)!==!1;);return z}function hx(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe;)if(!le(z[re],re,z))return!1;return!0}function Hi(z,le){for(var re=-1,Oe=z==null?0:z.length,et=0,vt=[];++re<Oe;){var SA=z[re];le(SA,re,z)&&(vt[et++]=SA)}return vt}function ih(z,le){var re=z==null?0:z.length;return!!re&&za(z,le,0)>-1}function Ty(z,le,re){for(var Oe=-1,et=z==null?0:z.length;++Oe<et;)if(re(le,z[Oe]))return!0;return!1}function Yt(z,le){for(var re=-1,Oe=z==null?0:z.length,et=Array(Oe);++re<Oe;)et[re]=le(z[re],re,z);return et}function Ri(z,le){for(var re=-1,Oe=le.length,et=z.length;++re<Oe;)z[et+re]=le[re];return z}function _y(z,le,re,Oe){var et=-1,vt=z==null?0:z.length;for(Oe&&vt&&(re=z[++et]);++et<vt;)re=le(re,z[et],et,z);return re}function yne(z,le,re,Oe){var et=z==null?0:z.length;for(Oe&&et&&(re=z[--et]);et--;)re=le(re,z[et],et,z);return re}function Dy(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe;)if(le(z[re],re,z))return!0;return!1}var wne=Ly("length");function Cne(z){return z.split("")}function bne(z){return z.match(IAe)||[]}function px(z,le,re){var Oe;return re(z,function(et,vt,SA){if(le(et,vt,SA))return Oe=vt,!1}),Oe}function sh(z,le,re,Oe){for(var et=z.length,vt=re+(Oe?1:-1);Oe?vt--:++vt<et;)if(le(z[vt],vt,z))return vt;return-1}function za(z,le,re){return le===le?Dne(z,le,re):sh(z,mx,re)}function vne(z,le,re,Oe){for(var et=re-1,vt=z.length;++et<vt;)if(Oe(z[et],le))return et;return-1}function mx(z){return z!==z}function gx(z,le){var re=z==null?0:z.length;return re?My(z,le)/re:ce}function Ly(z){return function(le){return le==null?A:le[z]}}function Oy(z){return function(le){return z==null?A:z[le]}}function Bx(z,le,re,Oe,et){return et(z,function(vt,SA,Ot){re=Oe?(Oe=!1,vt):le(re,vt,SA,Ot)}),re}function Ene(z,le){var re=z.length;for(z.sort(le);re--;)z[re]=z[re].value;return z}function My(z,le){for(var re,Oe=-1,et=z.length;++Oe<et;){var vt=le(z[Oe]);vt!==A&&(re=re===A?vt:re+vt)}return re}function Ny(z,le){for(var re=-1,Oe=Array(z);++re<z;)Oe[re]=le(re);return Oe}function kne(z,le){return Yt(le,function(re){return[re,z[re]]})}function yx(z){return z&&z.slice(0,vx(z)+1).replace(Ey,"")}function Gn(z){return function(le){return z(le)}}function Hy(z,le){return Yt(le,function(re){return z[re]})}function Lc(z,le){return z.has(le)}function wx(z,le){for(var re=-1,Oe=z.length;++re<Oe&&za(le,z[re],0)>-1;);return re}function Cx(z,le){for(var re=z.length;re--&&za(le,z[re],0)>-1;);return re}function Sne(z,le){for(var re=z.length,Oe=0;re--;)z[re]===le&&++Oe;return Oe}var Qne=Oy(cne),Fne=Oy(une);function Une(z){return"\\"+fne[z]}function Ine(z,le){return z==null?A:z[le]}function Ya(z){return ine.test(z)}function xne(z){return sne.test(z)}function Tne(z){for(var le,re=[];!(le=z.next()).done;)re.push(le.value);return re}function Ry(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe,et){re[++le]=[et,Oe]}),re}function bx(z,le){return function(re){return z(le(re))}}function Pi(z,le){for(var re=-1,Oe=z.length,et=0,vt=[];++re<Oe;){var SA=z[re];(SA===le||SA===f)&&(z[re]=f,vt[et++]=re)}return vt}function ah(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe){re[++le]=Oe}),re}function _ne(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe){re[++le]=[Oe,Oe]}),re}function Dne(z,le,re){for(var Oe=re-1,et=z.length;++Oe<et;)if(z[Oe]===le)return Oe;return-1}function Lne(z,le,re){for(var Oe=re+1;Oe--;)if(z[Oe]===le)return Oe;return Oe}function Ja(z){return Ya(z)?Mne(z):wne(z)}function Mr(z){return Ya(z)?Nne(z):Cne(z)}function vx(z){for(var le=z.length;le--&&SAe.test(z.charAt(le)););return le}var One=Oy(dne);function Mne(z){for(var le=Uy.lastIndex=0;Uy.test(z);)++le;return le}function Nne(z){return z.match(Uy)||[]}function Hne(z){return z.match(one)||[]}var Rne=(function z(le){le=le==null?GA:Xa.defaults(GA.Object(),le,Xa.pick(GA,ane));var re=le.Array,Oe=le.Date,et=le.Error,vt=le.Function,SA=le.Math,Ot=le.Object,Py=le.RegExp,Pne=le.String,ur=le.TypeError,lh=re.prototype,Vne=vt.prototype,ja=Ot.prototype,ch=le["__core-js_shared__"],uh=Vne.toString,xt=ja.hasOwnProperty,$ne=0,Ex=(function(){var c=/[^.]+$/.exec(ch&&ch.keys&&ch.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),dh=ja.toString,Kne=uh.call(Ot),Gne=GA._,Wne=Py("^"+uh.call(xt).replace(vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fh=sx?le.Buffer:A,Vi=le.Symbol,hh=le.Uint8Array,kx=fh?fh.allocUnsafe:A,ph=bx(Ot.getPrototypeOf,Ot),Sx=Ot.create,Qx=ja.propertyIsEnumerable,mh=lh.splice,Fx=Vi?Vi.isConcatSpreadable:A,Oc=Vi?Vi.iterator:A,Ns=Vi?Vi.toStringTag:A,gh=(function(){try{var c=$s(Ot,"defineProperty");return c({},"",{}),c}catch{}})(),zne=le.clearTimeout!==GA.clearTimeout&&le.clearTimeout,Yne=Oe&&Oe.now!==GA.Date.now&&Oe.now,Jne=le.setTimeout!==GA.setTimeout&&le.setTimeout,Bh=SA.ceil,yh=SA.floor,Vy=Ot.getOwnPropertySymbols,Xne=fh?fh.isBuffer:A,Ux=le.isFinite,jne=lh.join,qne=bx(Ot.keys,Ot),QA=SA.max,An=SA.min,Zne=Oe.now,ere=le.parseInt,Ix=SA.random,tre=lh.reverse,$y=$s(le,"DataView"),Mc=$s(le,"Map"),Ky=$s(le,"Promise"),qa=$s(le,"Set"),Nc=$s(le,"WeakMap"),Hc=$s(Ot,"create"),wh=Nc&&new Nc,Za={},Are=Ks($y),nre=Ks(Mc),rre=Ks(Ky),ore=Ks(qa),ire=Ks(Nc),Ch=Vi?Vi.prototype:A,Rc=Ch?Ch.valueOf:A,xx=Ch?Ch.toString:A;function U(c){if(oA(c)&&!tt(c)&&!(c instanceof pt)){if(c instanceof dr)return c;if(xt.call(c,"__wrapped__"))return TT(c)}return new dr(c)}var el=(function(){function c(){}return function(d){if(!qt(d))return{};if(Sx)return Sx(d);c.prototype=d;var m=new c;return c.prototype=A,m}})();function bh(){}function dr(c,d){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=A}U.templateSettings={escape:Or,evaluate:ar,interpolate:co,variable:"",imports:{_:U}},U.prototype=bh.prototype,U.prototype.constructor=U,dr.prototype=el(bh.prototype),dr.prototype.constructor=dr;function pt(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function sre(){var c=new pt(this.__wrapped__);return c.__actions__=Un(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Un(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Un(this.__views__),c}function are(){if(this.__filtered__){var c=new pt(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function lre(){var c=this.__wrapped__.value(),d=this.__dir__,m=tt(c),C=d<0,E=m?c.length:0,T=Coe(0,E,this.__views__),L=T.start,V=T.end,Y=V-L,de=C?V:L-1,pe=this.__iteratees__,Be=pe.length,Ie=0,Ne=An(Y,this.__takeCount__);if(!m||!C&&E==Y&&Ne==Y)return tT(c,this.__actions__);var Ge=[];e:for(;Y--&&Ie<Ne;){de+=d;for(var st=-1,We=c[de];++st<Be;){var ct=pe[st],gt=ct.iteratee,Yn=ct.type,yn=gt(We);if(Yn==G)We=yn;else if(!yn){if(Yn==H)continue e;break e}}Ge[Ie++]=We}return Ge}pt.prototype=el(bh.prototype),pt.prototype.constructor=pt;function Hs(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function cre(){this.__data__=Hc?Hc(null):{},this.size=0}function ure(c){var d=this.has(c)&&delete this.__data__[c];return this.size-=d?1:0,d}function dre(c){var d=this.__data__;if(Hc){var m=d[c];return m===l?A:m}return xt.call(d,c)?d[c]:A}function fre(c){var d=this.__data__;return Hc?d[c]!==A:xt.call(d,c)}function hre(c,d){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=Hc&&d===A?l:d,this}Hs.prototype.clear=cre,Hs.prototype.delete=ure,Hs.prototype.get=dre,Hs.prototype.has=fre,Hs.prototype.set=hre;function No(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function pre(){this.__data__=[],this.size=0}function mre(c){var d=this.__data__,m=vh(d,c);if(m<0)return!1;var C=d.length-1;return m==C?d.pop():mh.call(d,m,1),--this.size,!0}function gre(c){var d=this.__data__,m=vh(d,c);return m<0?A:d[m][1]}function Bre(c){return vh(this.__data__,c)>-1}function yre(c,d){var m=this.__data__,C=vh(m,c);return C<0?(++this.size,m.push([c,d])):m[C][1]=d,this}No.prototype.clear=pre,No.prototype.delete=mre,No.prototype.get=gre,No.prototype.has=Bre,No.prototype.set=yre;function Ho(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function wre(){this.size=0,this.__data__={hash:new Hs,map:new(Mc||No),string:new Hs}}function Cre(c){var d=Lh(this,c).delete(c);return this.size-=d?1:0,d}function bre(c){return Lh(this,c).get(c)}function vre(c){return Lh(this,c).has(c)}function Ere(c,d){var m=Lh(this,c),C=m.size;return m.set(c,d),this.size+=m.size==C?0:1,this}Ho.prototype.clear=wre,Ho.prototype.delete=Cre,Ho.prototype.get=bre,Ho.prototype.has=vre,Ho.prototype.set=Ere;function Rs(c){var d=-1,m=c==null?0:c.length;for(this.__data__=new Ho;++d<m;)this.add(c[d])}function kre(c){return this.__data__.set(c,l),this}function Sre(c){return this.__data__.has(c)}Rs.prototype.add=Rs.prototype.push=kre,Rs.prototype.has=Sre;function Nr(c){var d=this.__data__=new No(c);this.size=d.size}function Qre(){this.__data__=new No,this.size=0}function Fre(c){var d=this.__data__,m=d.delete(c);return this.size=d.size,m}function Ure(c){return this.__data__.get(c)}function Ire(c){return this.__data__.has(c)}function xre(c,d){var m=this.__data__;if(m instanceof No){var C=m.__data__;if(!Mc||C.length<r-1)return C.push([c,d]),this.size=++m.size,this;m=this.__data__=new Ho(C)}return m.set(c,d),this.size=m.size,this}Nr.prototype.clear=Qre,Nr.prototype.delete=Fre,Nr.prototype.get=Ure,Nr.prototype.has=Ire,Nr.prototype.set=xre;function Tx(c,d){var m=tt(c),C=!m&&Gs(c),E=!m&&!C&&zi(c),T=!m&&!C&&!E&&rl(c),L=m||C||E||T,V=L?Ny(c.length,Pne):[],Y=V.length;for(var de in c)(d||xt.call(c,de))&&!(L&&(de=="length"||E&&(de=="offset"||de=="parent")||T&&(de=="buffer"||de=="byteLength"||de=="byteOffset")||$o(de,Y)))&&V.push(de);return V}function _x(c){var d=c.length;return d?c[tw(0,d-1)]:A}function Tre(c,d){return Oh(Un(c),Ps(d,0,c.length))}function _re(c){return Oh(Un(c))}function Gy(c,d,m){(m!==A&&!Hr(c[d],m)||m===A&&!(d in c))&&Ro(c,d,m)}function Pc(c,d,m){var C=c[d];(!(xt.call(c,d)&&Hr(C,m))||m===A&&!(d in c))&&Ro(c,d,m)}function vh(c,d){for(var m=c.length;m--;)if(Hr(c[m][0],d))return m;return-1}function Dre(c,d,m,C){return $i(c,function(E,T,L){d(C,E,m(E),L)}),C}function Dx(c,d){return c&&ho(d,NA(d),c)}function Lre(c,d){return c&&ho(d,xn(d),c)}function Ro(c,d,m){d=="__proto__"&&gh?gh(c,d,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[d]=m}function Wy(c,d){for(var m=-1,C=d.length,E=re(C),T=c==null;++m<C;)E[m]=T?A:Sw(c,d[m]);return E}function Ps(c,d,m){return c===c&&(m!==A&&(c=c<=m?c:m),d!==A&&(c=c>=d?c:d)),c}function fr(c,d,m,C,E,T){var L,V=d&h,Y=d&p,de=d&g;if(m&&(L=E?m(c,C,E,T):m(c)),L!==A)return L;if(!qt(c))return c;var pe=tt(c);if(pe){if(L=voe(c),!V)return Un(c,L)}else{var Be=nn(c),Ie=Be==Ye||Be==ge;if(zi(c))return rT(c,V);if(Be==be||Be==Ae||Ie&&!E){if(L=Y||Ie?{}:vT(c),!V)return Y?doe(c,Lre(L,c)):uoe(c,Dx(L,c))}else{if(!Nt[Be])return E?c:{};L=Eoe(c,Be,V)}}T||(T=new Nr);var Ne=T.get(c);if(Ne)return Ne;T.set(c,L),qT(c)?c.forEach(function(We){L.add(fr(We,d,m,We,c,T))}):XT(c)&&c.forEach(function(We,ct){L.set(ct,fr(We,d,m,ct,c,T))});var Ge=de?Y?dw:uw:Y?xn:NA,st=pe?A:Ge(c);return cr(st||c,function(We,ct){st&&(ct=We,We=c[ct]),Pc(L,ct,fr(We,d,m,ct,c,T))}),L}function Ore(c){var d=NA(c);return function(m){return Lx(m,c,d)}}function Lx(c,d,m){var C=m.length;if(c==null)return!C;for(c=Ot(c);C--;){var E=m[C],T=d[E],L=c[E];if(L===A&&!(E in c)||!T(L))return!1}return!0}function Ox(c,d,m){if(typeof c!="function")throw new ur(i);return Yc(function(){c.apply(A,m)},d)}function Vc(c,d,m,C){var E=-1,T=ih,L=!0,V=c.length,Y=[],de=d.length;if(!V)return Y;m&&(d=Yt(d,Gn(m))),C?(T=Ty,L=!1):d.length>=r&&(T=Lc,L=!1,d=new Rs(d));e:for(;++E<V;){var pe=c[E],Be=m==null?pe:m(pe);if(pe=C||pe!==0?pe:0,L&&Be===Be){for(var Ie=de;Ie--;)if(d[Ie]===Be)continue e;Y.push(pe)}else T(d,Be,C)||Y.push(pe)}return Y}var $i=lT(fo),Mx=lT(Yy,!0);function Mre(c,d){var m=!0;return $i(c,function(C,E,T){return m=!!d(C,E,T),m}),m}function Eh(c,d,m){for(var C=-1,E=c.length;++C<E;){var T=c[C],L=d(T);if(L!=null&&(V===A?L===L&&!zn(L):m(L,V)))var V=L,Y=T}return Y}function Nre(c,d,m,C){var E=c.length;for(m=ot(m),m<0&&(m=-m>E?0:E+m),C=C===A||C>E?E:ot(C),C<0&&(C+=E),C=m>C?0:e_(C);m<C;)c[m++]=d;return c}function Nx(c,d){var m=[];return $i(c,function(C,E,T){d(C,E,T)&&m.push(C)}),m}function WA(c,d,m,C,E){var T=-1,L=c.length;for(m||(m=Soe),E||(E=[]);++T<L;){var V=c[T];d>0&&m(V)?d>1?WA(V,d-1,m,C,E):Ri(E,V):C||(E[E.length]=V)}return E}var zy=cT(),Hx=cT(!0);function fo(c,d){return c&&zy(c,d,NA)}function Yy(c,d){return c&&Hx(c,d,NA)}function kh(c,d){return Hi(d,function(m){return Ko(c[m])})}function Vs(c,d){d=Gi(d,c);for(var m=0,C=d.length;c!=null&&m<C;)c=c[po(d[m++])];return m&&m==C?c:A}function Rx(c,d,m){var C=d(c);return tt(c)?C:Ri(C,m(c))}function gn(c){return c==null?c===A?fe:ke:Ns&&Ns in Ot(c)?woe(c):_oe(c)}function Jy(c,d){return c>d}function Hre(c,d){return c!=null&&xt.call(c,d)}function Rre(c,d){return c!=null&&d in Ot(c)}function Pre(c,d,m){return c>=An(d,m)&&c<QA(d,m)}function Xy(c,d,m){for(var C=m?Ty:ih,E=c[0].length,T=c.length,L=T,V=re(T),Y=1/0,de=[];L--;){var pe=c[L];L&&d&&(pe=Yt(pe,Gn(d))),Y=An(pe.length,Y),V[L]=!m&&(d||E>=120&&pe.length>=120)?new Rs(L&&pe):A}pe=c[0];var Be=-1,Ie=V[0];e:for(;++Be<E&&de.length<Y;){var Ne=pe[Be],Ge=d?d(Ne):Ne;if(Ne=m||Ne!==0?Ne:0,!(Ie?Lc(Ie,Ge):C(de,Ge,m))){for(L=T;--L;){var st=V[L];if(!(st?Lc(st,Ge):C(c[L],Ge,m)))continue e}Ie&&Ie.push(Ge),de.push(Ne)}}return de}function Vre(c,d,m,C){return fo(c,function(E,T,L){d(C,m(E),T,L)}),C}function $c(c,d,m){d=Gi(d,c),c=QT(c,d);var C=c==null?c:c[po(pr(d))];return C==null?A:Kn(C,c,m)}function Px(c){return oA(c)&&gn(c)==Ae}function $re(c){return oA(c)&&gn(c)==Je}function Kre(c){return oA(c)&&gn(c)==Se}function Kc(c,d,m,C,E){return c===d?!0:c==null||d==null||!oA(c)&&!oA(d)?c!==c&&d!==d:Gre(c,d,m,C,Kc,E)}function Gre(c,d,m,C,E,T){var L=tt(c),V=tt(d),Y=L?oe:nn(c),de=V?oe:nn(d);Y=Y==Ae?be:Y,de=de==Ae?be:de;var pe=Y==be,Be=de==be,Ie=Y==de;if(Ie&&zi(c)){if(!zi(d))return!1;L=!0,pe=!1}if(Ie&&!pe)return T||(T=new Nr),L||rl(c)?wT(c,d,m,C,E,T):Boe(c,d,Y,m,C,E,T);if(!(m&B)){var Ne=pe&&xt.call(c,"__wrapped__"),Ge=Be&&xt.call(d,"__wrapped__");if(Ne||Ge){var st=Ne?c.value():c,We=Ge?d.value():d;return T||(T=new Nr),E(st,We,m,C,T)}}return Ie?(T||(T=new Nr),yoe(c,d,m,C,E,T)):!1}function Wre(c){return oA(c)&&nn(c)==Ce}function jy(c,d,m,C){var E=m.length,T=E,L=!C;if(c==null)return!T;for(c=Ot(c);E--;){var V=m[E];if(L&&V[2]?V[1]!==c[V[0]]:!(V[0]in c))return!1}for(;++E<T;){V=m[E];var Y=V[0],de=c[Y],pe=V[1];if(L&&V[2]){if(de===A&&!(Y in c))return!1}else{var Be=new Nr;if(C)var Ie=C(de,pe,Y,c,d,Be);if(!(Ie===A?Kc(pe,de,B|y,C,Be):Ie))return!1}}return!0}function Vx(c){if(!qt(c)||Foe(c))return!1;var d=Ko(c)?Wne:OAe;return d.test(Ks(c))}function zre(c){return oA(c)&&gn(c)==ne}function Yre(c){return oA(c)&&nn(c)==ve}function Jre(c){return oA(c)&&Vh(c.length)&&!!Kt[gn(c)]}function $x(c){return typeof c=="function"?c:c==null?Tn:typeof c=="object"?tt(c)?Wx(c[0],c[1]):Gx(c):u_(c)}function qy(c){if(!zc(c))return qne(c);var d=[];for(var m in Ot(c))xt.call(c,m)&&m!="constructor"&&d.push(m);return d}function Xre(c){if(!qt(c))return Toe(c);var d=zc(c),m=[];for(var C in c)C=="constructor"&&(d||!xt.call(c,C))||m.push(C);return m}function Zy(c,d){return c<d}function Kx(c,d){var m=-1,C=In(c)?re(c.length):[];return $i(c,function(E,T,L){C[++m]=d(E,T,L)}),C}function Gx(c){var d=hw(c);return d.length==1&&d[0][2]?kT(d[0][0],d[0][1]):function(m){return m===c||jy(m,c,d)}}function Wx(c,d){return mw(c)&&ET(d)?kT(po(c),d):function(m){var C=Sw(m,c);return C===A&&C===d?Qw(m,c):Kc(d,C,B|y)}}function Sh(c,d,m,C,E){c!==d&&zy(d,function(T,L){if(E||(E=new Nr),qt(T))jre(c,d,L,m,Sh,C,E);else{var V=C?C(Bw(c,L),T,L+"",c,d,E):A;V===A&&(V=T),Gy(c,L,V)}},xn)}function jre(c,d,m,C,E,T,L){var V=Bw(c,m),Y=Bw(d,m),de=L.get(Y);if(de){Gy(c,m,de);return}var pe=T?T(V,Y,m+"",c,d,L):A,Be=pe===A;if(Be){var Ie=tt(Y),Ne=!Ie&&zi(Y),Ge=!Ie&&!Ne&&rl(Y);pe=Y,Ie||Ne||Ge?tt(V)?pe=V:mA(V)?pe=Un(V):Ne?(Be=!1,pe=rT(Y,!0)):Ge?(Be=!1,pe=oT(Y,!0)):pe=[]:Jc(Y)||Gs(Y)?(pe=V,Gs(V)?pe=t_(V):(!qt(V)||Ko(V))&&(pe=vT(Y))):Be=!1}Be&&(L.set(Y,pe),E(pe,Y,C,T,L),L.delete(Y)),Gy(c,m,pe)}function zx(c,d){var m=c.length;if(m)return d+=d<0?m:0,$o(d,m)?c[d]:A}function Yx(c,d,m){d.length?d=Yt(d,function(T){return tt(T)?function(L){return Vs(L,T.length===1?T[0]:T)}:T}):d=[Tn];var C=-1;d=Yt(d,Gn(Ke()));var E=Kx(c,function(T,L,V){var Y=Yt(d,function(de){return de(T)});return{criteria:Y,index:++C,value:T}});return Ene(E,function(T,L){return coe(T,L,m)})}function qre(c,d){return Jx(c,d,function(m,C){return Qw(c,C)})}function Jx(c,d,m){for(var C=-1,E=d.length,T={};++C<E;){var L=d[C],V=Vs(c,L);m(V,L)&&Gc(T,Gi(L,c),V)}return T}function Zre(c){return function(d){return Vs(d,c)}}function ew(c,d,m,C){var E=C?vne:za,T=-1,L=d.length,V=c;for(c===d&&(d=Un(d)),m&&(V=Yt(c,Gn(m)));++T<L;)for(var Y=0,de=d[T],pe=m?m(de):de;(Y=E(V,pe,Y,C))>-1;)V!==c&&mh.call(V,Y,1),mh.call(c,Y,1);return c}function Xx(c,d){for(var m=c?d.length:0,C=m-1;m--;){var E=d[m];if(m==C||E!==T){var T=E;$o(E)?mh.call(c,E,1):rw(c,E)}}return c}function tw(c,d){return c+yh(Ix()*(d-c+1))}function eoe(c,d,m,C){for(var E=-1,T=QA(Bh((d-c)/(m||1)),0),L=re(T);T--;)L[C?T:++E]=c,c+=m;return L}function Aw(c,d){var m="";if(!c||d<1||d>ee)return m;do d%2&&(m+=c),d=yh(d/2),d&&(c+=c);while(d);return m}function lt(c,d){return yw(ST(c,d,Tn),c+"")}function toe(c){return _x(ol(c))}function Aoe(c,d){var m=ol(c);return Oh(m,Ps(d,0,m.length))}function Gc(c,d,m,C){if(!qt(c))return c;d=Gi(d,c);for(var E=-1,T=d.length,L=T-1,V=c;V!=null&&++E<T;){var Y=po(d[E]),de=m;if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return c;if(E!=L){var pe=V[Y];de=C?C(pe,Y,V):A,de===A&&(de=qt(pe)?pe:$o(d[E+1])?[]:{})}Pc(V,Y,de),V=V[Y]}return c}var jx=wh?function(c,d){return wh.set(c,d),c}:Tn,noe=gh?function(c,d){return gh(c,"toString",{configurable:!0,enumerable:!1,value:Uw(d),writable:!0})}:Tn;function roe(c){return Oh(ol(c))}function hr(c,d,m){var C=-1,E=c.length;d<0&&(d=-d>E?0:E+d),m=m>E?E:m,m<0&&(m+=E),E=d>m?0:m-d>>>0,d>>>=0;for(var T=re(E);++C<E;)T[C]=c[C+d];return T}function ooe(c,d){var m;return $i(c,function(C,E,T){return m=d(C,E,T),!m}),!!m}function Qh(c,d,m){var C=0,E=c==null?C:c.length;if(typeof d=="number"&&d===d&&E<=R){for(;C<E;){var T=C+E>>>1,L=c[T];L!==null&&!zn(L)&&(m?L<=d:L<d)?C=T+1:E=T}return E}return nw(c,d,Tn,m)}function nw(c,d,m,C){var E=0,T=c==null?0:c.length;if(T===0)return 0;d=m(d);for(var L=d!==d,V=d===null,Y=zn(d),de=d===A;E<T;){var pe=yh((E+T)/2),Be=m(c[pe]),Ie=Be!==A,Ne=Be===null,Ge=Be===Be,st=zn(Be);if(L)var We=C||Ge;else de?We=Ge&&(C||Ie):V?We=Ge&&Ie&&(C||!Ne):Y?We=Ge&&Ie&&!Ne&&(C||!st):Ne||st?We=!1:We=C?Be<=d:Be<d;We?E=pe+1:T=pe}return An(T,Qe)}function qx(c,d){for(var m=-1,C=c.length,E=0,T=[];++m<C;){var L=c[m],V=d?d(L):L;if(!m||!Hr(V,Y)){var Y=V;T[E++]=L===0?0:L}}return T}function Zx(c){return typeof c=="number"?c:zn(c)?ce:+c}function Wn(c){if(typeof c=="string")return c;if(tt(c))return Yt(c,Wn)+"";if(zn(c))return xx?xx.call(c):"";var d=c+"";return d=="0"&&1/c==-te?"-0":d}function Ki(c,d,m){var C=-1,E=ih,T=c.length,L=!0,V=[],Y=V;if(m)L=!1,E=Ty;else if(T>=r){var de=d?null:moe(c);if(de)return ah(de);L=!1,E=Lc,Y=new Rs}else Y=d?[]:V;e:for(;++C<T;){var pe=c[C],Be=d?d(pe):pe;if(pe=m||pe!==0?pe:0,L&&Be===Be){for(var Ie=Y.length;Ie--;)if(Y[Ie]===Be)continue e;d&&Y.push(Be),V.push(pe)}else E(Y,Be,m)||(Y!==V&&Y.push(Be),V.push(pe))}return V}function rw(c,d){return d=Gi(d,c),c=QT(c,d),c==null||delete c[po(pr(d))]}function eT(c,d,m,C){return Gc(c,d,m(Vs(c,d)),C)}function Fh(c,d,m,C){for(var E=c.length,T=C?E:-1;(C?T--:++T<E)&&d(c[T],T,c););return m?hr(c,C?0:T,C?T+1:E):hr(c,C?T+1:0,C?E:T)}function tT(c,d){var m=c;return m instanceof pt&&(m=m.value()),_y(d,function(C,E){return E.func.apply(E.thisArg,Ri([C],E.args))},m)}function ow(c,d,m){var C=c.length;if(C<2)return C?Ki(c[0]):[];for(var E=-1,T=re(C);++E<C;)for(var L=c[E],V=-1;++V<C;)V!=E&&(T[E]=Vc(T[E]||L,c[V],d,m));return Ki(WA(T,1),d,m)}function AT(c,d,m){for(var C=-1,E=c.length,T=d.length,L={};++C<E;){var V=C<T?d[C]:A;m(L,c[C],V)}return L}function iw(c){return mA(c)?c:[]}function sw(c){return typeof c=="function"?c:Tn}function Gi(c,d){return tt(c)?c:mw(c,d)?[c]:xT(St(c))}var ioe=lt;function Wi(c,d,m){var C=c.length;return m=m===A?C:m,!d&&m>=C?c:hr(c,d,m)}var nT=zne||function(c){return GA.clearTimeout(c)};function rT(c,d){if(d)return c.slice();var m=c.length,C=kx?kx(m):new c.constructor(m);return c.copy(C),C}function aw(c){var d=new c.constructor(c.byteLength);return new hh(d).set(new hh(c)),d}function soe(c,d){var m=d?aw(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function aoe(c){var d=new c.constructor(c.source,PI.exec(c));return d.lastIndex=c.lastIndex,d}function loe(c){return Rc?Ot(Rc.call(c)):{}}function oT(c,d){var m=d?aw(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function iT(c,d){if(c!==d){var m=c!==A,C=c===null,E=c===c,T=zn(c),L=d!==A,V=d===null,Y=d===d,de=zn(d);if(!V&&!de&&!T&&c>d||T&&L&&Y&&!V&&!de||C&&L&&Y||!m&&Y||!E)return 1;if(!C&&!T&&!de&&c<d||de&&m&&E&&!C&&!T||V&&m&&E||!L&&E||!Y)return-1}return 0}function coe(c,d,m){for(var C=-1,E=c.criteria,T=d.criteria,L=E.length,V=m.length;++C<L;){var Y=iT(E[C],T[C]);if(Y){if(C>=V)return Y;var de=m[C];return Y*(de=="desc"?-1:1)}}return c.index-d.index}function sT(c,d,m,C){for(var E=-1,T=c.length,L=m.length,V=-1,Y=d.length,de=QA(T-L,0),pe=re(Y+de),Be=!C;++V<Y;)pe[V]=d[V];for(;++E<L;)(Be||E<T)&&(pe[m[E]]=c[E]);for(;de--;)pe[V++]=c[E++];return pe}function aT(c,d,m,C){for(var E=-1,T=c.length,L=-1,V=m.length,Y=-1,de=d.length,pe=QA(T-V,0),Be=re(pe+de),Ie=!C;++E<pe;)Be[E]=c[E];for(var Ne=E;++Y<de;)Be[Ne+Y]=d[Y];for(;++L<V;)(Ie||E<T)&&(Be[Ne+m[L]]=c[E++]);return Be}function Un(c,d){var m=-1,C=c.length;for(d||(d=re(C));++m<C;)d[m]=c[m];return d}function ho(c,d,m,C){var E=!m;m||(m={});for(var T=-1,L=d.length;++T<L;){var V=d[T],Y=C?C(m[V],c[V],V,m,c):A;Y===A&&(Y=c[V]),E?Ro(m,V,Y):Pc(m,V,Y)}return m}function uoe(c,d){return ho(c,pw(c),d)}function doe(c,d){return ho(c,CT(c),d)}function Uh(c,d){return function(m,C){var E=tt(m)?gne:Dre,T=d?d():{};return E(m,c,Ke(C,2),T)}}function tl(c){return lt(function(d,m){var C=-1,E=m.length,T=E>1?m[E-1]:A,L=E>2?m[2]:A;for(T=c.length>3&&typeof T=="function"?(E--,T):A,L&&Bn(m[0],m[1],L)&&(T=E<3?A:T,E=1),d=Ot(d);++C<E;){var V=m[C];V&&c(d,V,C,T)}return d})}function lT(c,d){return function(m,C){if(m==null)return m;if(!In(m))return c(m,C);for(var E=m.length,T=d?E:-1,L=Ot(m);(d?T--:++T<E)&&C(L[T],T,L)!==!1;);return m}}function cT(c){return function(d,m,C){for(var E=-1,T=Ot(d),L=C(d),V=L.length;V--;){var Y=L[c?V:++E];if(m(T[Y],Y,T)===!1)break}return d}}function foe(c,d,m){var C=d&b,E=Wc(c);function T(){var L=this&&this!==GA&&this instanceof T?E:c;return L.apply(C?m:this,arguments)}return T}function uT(c){return function(d){d=St(d);var m=Ya(d)?Mr(d):A,C=m?m[0]:d.charAt(0),E=m?Wi(m,1).join(""):d.slice(1);return C[c]()+E}}function Al(c){return function(d){return _y(l_(a_(d).replace(nne,"")),c,"")}}function Wc(c){return function(){var d=arguments;switch(d.length){case 0:return new c;case 1:return new c(d[0]);case 2:return new c(d[0],d[1]);case 3:return new c(d[0],d[1],d[2]);case 4:return new c(d[0],d[1],d[2],d[3]);case 5:return new c(d[0],d[1],d[2],d[3],d[4]);case 6:return new c(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new c(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var m=el(c.prototype),C=c.apply(m,d);return qt(C)?C:m}}function hoe(c,d,m){var C=Wc(c);function E(){for(var T=arguments.length,L=re(T),V=T,Y=nl(E);V--;)L[V]=arguments[V];var de=T<3&&L[0]!==Y&&L[T-1]!==Y?[]:Pi(L,Y);if(T-=de.length,T<m)return mT(c,d,Ih,E.placeholder,A,L,de,A,A,m-T);var pe=this&&this!==GA&&this instanceof E?C:c;return Kn(pe,this,L)}return E}function dT(c){return function(d,m,C){var E=Ot(d);if(!In(d)){var T=Ke(m,3);d=NA(d),m=function(V){return T(E[V],V,E)}}var L=c(d,m,C);return L>-1?E[T?d[L]:L]:A}}function fT(c){return Vo(function(d){var m=d.length,C=m,E=dr.prototype.thru;for(c&&d.reverse();C--;){var T=d[C];if(typeof T!="function")throw new ur(i);if(E&&!L&&Dh(T)=="wrapper")var L=new dr([],!0)}for(C=L?C:m;++C<m;){T=d[C];var V=Dh(T),Y=V=="wrapper"?fw(T):A;Y&&gw(Y[0])&&Y[1]==(x|S|I|M)&&!Y[4].length&&Y[9]==1?L=L[Dh(Y[0])].apply(L,Y[3]):L=T.length==1&&gw(T)?L[V]():L.thru(T)}return function(){var de=arguments,pe=de[0];if(L&&de.length==1&&tt(pe))return L.plant(pe).value();for(var Be=0,Ie=m?d[Be].apply(this,de):pe;++Be<m;)Ie=d[Be].call(this,Ie);return Ie}})}function Ih(c,d,m,C,E,T,L,V,Y,de){var pe=d&x,Be=d&b,Ie=d&w,Ne=d&(S|F),Ge=d&O,st=Ie?A:Wc(c);function We(){for(var ct=arguments.length,gt=re(ct),Yn=ct;Yn--;)gt[Yn]=arguments[Yn];if(Ne)var yn=nl(We),Jn=Sne(gt,yn);if(C&&(gt=sT(gt,C,E,Ne)),T&&(gt=aT(gt,T,L,Ne)),ct-=Jn,Ne&&ct<de){var gA=Pi(gt,yn);return mT(c,d,Ih,We.placeholder,m,gt,gA,V,Y,de-ct)}var Rr=Be?m:this,Wo=Ie?Rr[c]:c;return ct=gt.length,V?gt=Doe(gt,V):Ge&&ct>1&&gt.reverse(),pe&&Y<ct&&(gt.length=Y),this&&this!==GA&&this instanceof We&&(Wo=st||Wc(Wo)),Wo.apply(Rr,gt)}return We}function hT(c,d){return function(m,C){return Vre(m,c,d(C),{})}}function xh(c,d){return function(m,C){var E;if(m===A&&C===A)return d;if(m!==A&&(E=m),C!==A){if(E===A)return C;typeof m=="string"||typeof C=="string"?(m=Wn(m),C=Wn(C)):(m=Zx(m),C=Zx(C)),E=c(m,C)}return E}}function lw(c){return Vo(function(d){return d=Yt(d,Gn(Ke())),lt(function(m){var C=this;return c(d,function(E){return Kn(E,C,m)})})})}function Th(c,d){d=d===A?" ":Wn(d);var m=d.length;if(m<2)return m?Aw(d,c):d;var C=Aw(d,Bh(c/Ja(d)));return Ya(d)?Wi(Mr(C),0,c).join(""):C.slice(0,c)}function poe(c,d,m,C){var E=d&b,T=Wc(c);function L(){for(var V=-1,Y=arguments.length,de=-1,pe=C.length,Be=re(pe+Y),Ie=this&&this!==GA&&this instanceof L?T:c;++de<pe;)Be[de]=C[de];for(;Y--;)Be[de++]=arguments[++V];return Kn(Ie,E?m:this,Be)}return L}function pT(c){return function(d,m,C){return C&&typeof C!="number"&&Bn(d,m,C)&&(m=C=A),d=Go(d),m===A?(m=d,d=0):m=Go(m),C=C===A?d<m?1:-1:Go(C),eoe(d,m,C,c)}}function _h(c){return function(d,m){return typeof d=="string"&&typeof m=="string"||(d=mr(d),m=mr(m)),c(d,m)}}function mT(c,d,m,C,E,T,L,V,Y,de){var pe=d&S,Be=pe?L:A,Ie=pe?A:L,Ne=pe?T:A,Ge=pe?A:T;d|=pe?I:Q,d&=~(pe?Q:I),d&v||(d&=-4);var st=[c,d,E,Ne,Be,Ge,Ie,V,Y,de],We=m.apply(A,st);return gw(c)&&FT(We,st),We.placeholder=C,UT(We,c,d)}function cw(c){var d=SA[c];return function(m,C){if(m=mr(m),C=C==null?0:An(ot(C),292),C&&Ux(m)){var E=(St(m)+"e").split("e"),T=d(E[0]+"e"+(+E[1]+C));return E=(St(T)+"e").split("e"),+(E[0]+"e"+(+E[1]-C))}return d(m)}}var moe=qa&&1/ah(new qa([,-0]))[1]==te?function(c){return new qa(c)}:Tw;function gT(c){return function(d){var m=nn(d);return m==Ce?Ry(d):m==ve?_ne(d):kne(d,c(d))}}function Po(c,d,m,C,E,T,L,V){var Y=d&w;if(!Y&&typeof c!="function")throw new ur(i);var de=C?C.length:0;if(de||(d&=-97,C=E=A),L=L===A?L:QA(ot(L),0),V=V===A?V:ot(V),de-=E?E.length:0,d&Q){var pe=C,Be=E;C=E=A}var Ie=Y?A:fw(c),Ne=[c,d,m,C,E,pe,Be,T,L,V];if(Ie&&xoe(Ne,Ie),c=Ne[0],d=Ne[1],m=Ne[2],C=Ne[3],E=Ne[4],V=Ne[9]=Ne[9]===A?Y?0:c.length:QA(Ne[9]-de,0),!V&&d&(S|F)&&(d&=-25),!d||d==b)var Ge=foe(c,d,m);else d==S||d==F?Ge=hoe(c,d,V):(d==I||d==(b|I))&&!E.length?Ge=poe(c,d,m,C):Ge=Ih.apply(A,Ne);var st=Ie?jx:FT;return UT(st(Ge,Ne),c,d)}function BT(c,d,m,C){return c===A||Hr(c,ja[m])&&!xt.call(C,m)?d:c}function yT(c,d,m,C,E,T){return qt(c)&&qt(d)&&(T.set(d,c),Sh(c,d,A,yT,T),T.delete(d)),c}function goe(c){return Jc(c)?A:c}function wT(c,d,m,C,E,T){var L=m&B,V=c.length,Y=d.length;if(V!=Y&&!(L&&Y>V))return!1;var de=T.get(c),pe=T.get(d);if(de&&pe)return de==d&&pe==c;var Be=-1,Ie=!0,Ne=m&y?new Rs:A;for(T.set(c,d),T.set(d,c);++Be<V;){var Ge=c[Be],st=d[Be];if(C)var We=L?C(st,Ge,Be,d,c,T):C(Ge,st,Be,c,d,T);if(We!==A){if(We)continue;Ie=!1;break}if(Ne){if(!Dy(d,function(ct,gt){if(!Lc(Ne,gt)&&(Ge===ct||E(Ge,ct,m,C,T)))return Ne.push(gt)})){Ie=!1;break}}else if(!(Ge===st||E(Ge,st,m,C,T))){Ie=!1;break}}return T.delete(c),T.delete(d),Ie}function Boe(c,d,m,C,E,T,L){switch(m){case Ue:if(c.byteLength!=d.byteLength||c.byteOffset!=d.byteOffset)return!1;c=c.buffer,d=d.buffer;case Je:return!(c.byteLength!=d.byteLength||!T(new hh(c),new hh(d)));case X:case Se:case D:return Hr(+c,+d);case se:return c.name==d.name&&c.message==d.message;case ne:case ze:return c==d+"";case Ce:var V=Ry;case ve:var Y=C&B;if(V||(V=ah),c.size!=d.size&&!Y)return!1;var de=L.get(c);if(de)return de==d;C|=y,L.set(c,d);var pe=wT(V(c),V(d),C,E,T,L);return L.delete(c),pe;case W:if(Rc)return Rc.call(c)==Rc.call(d)}return!1}function yoe(c,d,m,C,E,T){var L=m&B,V=uw(c),Y=V.length,de=uw(d),pe=de.length;if(Y!=pe&&!L)return!1;for(var Be=Y;Be--;){var Ie=V[Be];if(!(L?Ie in d:xt.call(d,Ie)))return!1}var Ne=T.get(c),Ge=T.get(d);if(Ne&&Ge)return Ne==d&&Ge==c;var st=!0;T.set(c,d),T.set(d,c);for(var We=L;++Be<Y;){Ie=V[Be];var ct=c[Ie],gt=d[Ie];if(C)var Yn=L?C(gt,ct,Ie,d,c,T):C(ct,gt,Ie,c,d,T);if(!(Yn===A?ct===gt||E(ct,gt,m,C,T):Yn)){st=!1;break}We||(We=Ie=="constructor")}if(st&&!We){var yn=c.constructor,Jn=d.constructor;yn!=Jn&&"constructor"in c&&"constructor"in d&&!(typeof yn=="function"&&yn instanceof yn&&typeof Jn=="function"&&Jn instanceof Jn)&&(st=!1)}return T.delete(c),T.delete(d),st}function Vo(c){return yw(ST(c,A,LT),c+"")}function uw(c){return Rx(c,NA,pw)}function dw(c){return Rx(c,xn,CT)}var fw=wh?function(c){return wh.get(c)}:Tw;function Dh(c){for(var d=c.name+"",m=Za[d],C=xt.call(Za,d)?m.length:0;C--;){var E=m[C],T=E.func;if(T==null||T==c)return E.name}return d}function nl(c){var d=xt.call(U,"placeholder")?U:c;return d.placeholder}function Ke(){var c=U.iteratee||Iw;return c=c===Iw?$x:c,arguments.length?c(arguments[0],arguments[1]):c}function Lh(c,d){var m=c.__data__;return Qoe(d)?m[typeof d=="string"?"string":"hash"]:m.map}function hw(c){for(var d=NA(c),m=d.length;m--;){var C=d[m],E=c[C];d[m]=[C,E,ET(E)]}return d}function $s(c,d){var m=Ine(c,d);return Vx(m)?m:A}function woe(c){var d=xt.call(c,Ns),m=c[Ns];try{c[Ns]=A;var C=!0}catch{}var E=dh.call(c);return C&&(d?c[Ns]=m:delete c[Ns]),E}var pw=Vy?function(c){return c==null?[]:(c=Ot(c),Hi(Vy(c),function(d){return Qx.call(c,d)}))}:_w,CT=Vy?function(c){for(var d=[];c;)Ri(d,pw(c)),c=ph(c);return d}:_w,nn=gn;($y&&nn(new $y(new ArrayBuffer(1)))!=Ue||Mc&&nn(new Mc)!=Ce||Ky&&nn(Ky.resolve())!=_||qa&&nn(new qa)!=ve||Nc&&nn(new Nc)!=q)&&(nn=function(c){var d=gn(c),m=d==be?c.constructor:A,C=m?Ks(m):"";if(C)switch(C){case Are:return Ue;case nre:return Ce;case rre:return _;case ore:return ve;case ire:return q}return d});function Coe(c,d,m){for(var C=-1,E=m.length;++C<E;){var T=m[C],L=T.size;switch(T.type){case"drop":c+=L;break;case"dropRight":d-=L;break;case"take":d=An(d,c+L);break;case"takeRight":c=QA(c,d-L);break}}return{start:c,end:d}}function boe(c){var d=c.match(FAe);return d?d[1].split(UAe):[]}function bT(c,d,m){d=Gi(d,c);for(var C=-1,E=d.length,T=!1;++C<E;){var L=po(d[C]);if(!(T=c!=null&&m(c,L)))break;c=c[L]}return T||++C!=E?T:(E=c==null?0:c.length,!!E&&Vh(E)&&$o(L,E)&&(tt(c)||Gs(c)))}function voe(c){var d=c.length,m=new c.constructor(d);return d&&typeof c[0]=="string"&&xt.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function vT(c){return typeof c.constructor=="function"&&!zc(c)?el(ph(c)):{}}function Eoe(c,d,m){var C=c.constructor;switch(d){case Je:return aw(c);case X:case Se:return new C(+c);case Ue:return soe(c,m);case kt:case kA:case Fn:case tn:case Mo:case lo:case Ds:case Ls:case Os:return oT(c,m);case Ce:return new C;case D:case ze:return new C(c);case ne:return aoe(c);case ve:return new C;case W:return loe(c)}}function koe(c,d){var m=d.length;if(!m)return c;var C=m-1;return d[C]=(m>1?"& ":"")+d[C],d=d.join(m>2?", ":" "),c.replace(QAe,`{
124
+ */var CG=Ac.exports,V1;function bG(){return V1||(V1=1,(function(t,e){(function(){var A,n="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,p=2,g=4,B=1,y=2,b=1,w=2,v=4,S=8,F=16,I=32,Q=64,x=128,M=256,O=512,P=30,ie="...",ae=800,ue=16,H=1,G=2,$=3,te=1/0,ee=9007199254740991,K=17976931348623157e292,ce=NaN,j=4294967295,Qe=j-1,R=j>>>1,J=[["ary",x],["bind",b],["bindKey",w],["curry",S],["curryRight",F],["flip",O],["partial",I],["partialRight",Q],["rearg",M]],Ae="[object Arguments]",oe="[object Array]",k="[object AsyncFunction]",X="[object Boolean]",Se="[object Date]",ht="[object DOMException]",se="[object Error]",Ye="[object Function]",ge="[object GeneratorFunction]",Ce="[object Map]",D="[object Number]",ke="[object Null]",be="[object Object]",_="[object Promise]",N="[object Proxy]",ne="[object RegExp]",ve="[object Set]",ze="[object String]",W="[object Symbol]",fe="[object Undefined]",q="[object WeakMap]",me="[object WeakSet]",Je="[object ArrayBuffer]",Ue="[object DataView]",kt="[object Float32Array]",kA="[object Float64Array]",Fn="[object Int8Array]",tn="[object Int16Array]",Mo="[object Int32Array]",lo="[object Uint8Array]",Ds="[object Uint8ClampedArray]",Ls="[object Uint16Array]",Os="[object Uint32Array]",Z=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,Ve=/(__e\(.*?\)|\b__t\)) \+\n'';/g,At=/&(?:amp|lt|gt|quot|#39);/g,he=/[&<>"']/g,xe=RegExp(At.source),He=RegExp(he.source),Or=/<%-([\s\S]+?)%>/g,ar=/<%([\s\S]+?)%>/g,co=/<%=([\s\S]+?)%>/g,uo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dc=/^\w*$/,by=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/[\\^$.*+?()[\]{}|]/g,kAe=RegExp(vy.source),Ey=/^\s+/,SAe=/\s/,QAe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,FAe=/\{\n\/\* \[wrapped with (.+)\] \*/,UAe=/,? & /,IAe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xAe=/[()=,{}\[\]\/\s]/,TAe=/\\(\\)?/g,_Ae=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,PI=/\w*$/,DAe=/^[-+]0x[0-9a-f]+$/i,LAe=/^0b[01]+$/i,OAe=/^\[object .+?Constructor\]$/,MAe=/^0o[0-7]+$/i,NAe=/^(?:0|[1-9]\d*)$/,HAe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nh=/($^)/,RAe=/['\n\r\u2028\u2029\\]/g,rh="\\ud800-\\udfff",PAe="\\u0300-\\u036f",VAe="\\ufe20-\\ufe2f",$Ae="\\u20d0-\\u20ff",VI=PAe+VAe+$Ae,$I="\\u2700-\\u27bf",KI="a-z\\xdf-\\xf6\\xf8-\\xff",KAe="\\xac\\xb1\\xd7\\xf7",GAe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",WAe="\\u2000-\\u206f",zAe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",GI="A-Z\\xc0-\\xd6\\xd8-\\xde",WI="\\ufe0e\\ufe0f",zI=KAe+GAe+WAe+zAe,ky="['’]",YAe="["+rh+"]",YI="["+zI+"]",oh="["+VI+"]",JI="\\d+",JAe="["+$I+"]",XI="["+KI+"]",jI="[^"+rh+zI+JI+$I+KI+GI+"]",Sy="\\ud83c[\\udffb-\\udfff]",XAe="(?:"+oh+"|"+Sy+")",qI="[^"+rh+"]",Qy="(?:\\ud83c[\\udde6-\\uddff]){2}",Fy="[\\ud800-\\udbff][\\udc00-\\udfff]",Wa="["+GI+"]",ZI="\\u200d",ex="(?:"+XI+"|"+jI+")",jAe="(?:"+Wa+"|"+jI+")",tx="(?:"+ky+"(?:d|ll|m|re|s|t|ve))?",Ax="(?:"+ky+"(?:D|LL|M|RE|S|T|VE))?",nx=XAe+"?",rx="["+WI+"]?",qAe="(?:"+ZI+"(?:"+[qI,Qy,Fy].join("|")+")"+rx+nx+")*",ZAe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ene="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ox=rx+nx+qAe,tne="(?:"+[JAe,Qy,Fy].join("|")+")"+ox,Ane="(?:"+[qI+oh+"?",oh,Qy,Fy,YAe].join("|")+")",nne=RegExp(ky,"g"),rne=RegExp(oh,"g"),Uy=RegExp(Sy+"(?="+Sy+")|"+Ane+ox,"g"),one=RegExp([Wa+"?"+XI+"+"+tx+"(?="+[YI,Wa,"$"].join("|")+")",jAe+"+"+Ax+"(?="+[YI,Wa+ex,"$"].join("|")+")",Wa+"?"+ex+"+"+tx,Wa+"+"+Ax,ene,ZAe,JI,tne].join("|"),"g"),ine=RegExp("["+ZI+rh+VI+WI+"]"),sne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ane=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],lne=-1,Kt={};Kt[kt]=Kt[kA]=Kt[Fn]=Kt[tn]=Kt[Mo]=Kt[lo]=Kt[Ds]=Kt[Ls]=Kt[Os]=!0,Kt[Ae]=Kt[oe]=Kt[Je]=Kt[X]=Kt[Ue]=Kt[Se]=Kt[se]=Kt[Ye]=Kt[Ce]=Kt[D]=Kt[be]=Kt[ne]=Kt[ve]=Kt[ze]=Kt[q]=!1;var Nt={};Nt[Ae]=Nt[oe]=Nt[Je]=Nt[Ue]=Nt[X]=Nt[Se]=Nt[kt]=Nt[kA]=Nt[Fn]=Nt[tn]=Nt[Mo]=Nt[Ce]=Nt[D]=Nt[be]=Nt[ne]=Nt[ve]=Nt[ze]=Nt[W]=Nt[lo]=Nt[Ds]=Nt[Ls]=Nt[Os]=!0,Nt[se]=Nt[Ye]=Nt[q]=!1;var cne={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},une={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dne={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},fne={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hne=parseFloat,pne=parseInt,ix=typeof Md=="object"&&Md&&Md.Object===Object&&Md,mne=typeof self=="object"&&self&&self.Object===Object&&self,GA=ix||mne||Function("return this")(),Iy=e&&!e.nodeType&&e,Ms=Iy&&!0&&t&&!t.nodeType&&t,sx=Ms&&Ms.exports===Iy,xy=sx&&ix.process,lr=(function(){try{var z=Ms&&Ms.require&&Ms.require("util").types;return z||xy&&xy.binding&&xy.binding("util")}catch{}})(),ax=lr&&lr.isArrayBuffer,lx=lr&&lr.isDate,cx=lr&&lr.isMap,ux=lr&&lr.isRegExp,dx=lr&&lr.isSet,fx=lr&&lr.isTypedArray;function Kn(z,le,re){switch(re.length){case 0:return z.call(le);case 1:return z.call(le,re[0]);case 2:return z.call(le,re[0],re[1]);case 3:return z.call(le,re[0],re[1],re[2])}return z.apply(le,re)}function gne(z,le,re,Oe){for(var et=-1,vt=z==null?0:z.length;++et<vt;){var SA=z[et];le(Oe,SA,re(SA),z)}return Oe}function cr(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe&&le(z[re],re,z)!==!1;);return z}function Bne(z,le){for(var re=z==null?0:z.length;re--&&le(z[re],re,z)!==!1;);return z}function hx(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe;)if(!le(z[re],re,z))return!1;return!0}function Hi(z,le){for(var re=-1,Oe=z==null?0:z.length,et=0,vt=[];++re<Oe;){var SA=z[re];le(SA,re,z)&&(vt[et++]=SA)}return vt}function ih(z,le){var re=z==null?0:z.length;return!!re&&za(z,le,0)>-1}function Ty(z,le,re){for(var Oe=-1,et=z==null?0:z.length;++Oe<et;)if(re(le,z[Oe]))return!0;return!1}function Jt(z,le){for(var re=-1,Oe=z==null?0:z.length,et=Array(Oe);++re<Oe;)et[re]=le(z[re],re,z);return et}function Ri(z,le){for(var re=-1,Oe=le.length,et=z.length;++re<Oe;)z[et+re]=le[re];return z}function _y(z,le,re,Oe){var et=-1,vt=z==null?0:z.length;for(Oe&&vt&&(re=z[++et]);++et<vt;)re=le(re,z[et],et,z);return re}function yne(z,le,re,Oe){var et=z==null?0:z.length;for(Oe&&et&&(re=z[--et]);et--;)re=le(re,z[et],et,z);return re}function Dy(z,le){for(var re=-1,Oe=z==null?0:z.length;++re<Oe;)if(le(z[re],re,z))return!0;return!1}var wne=Ly("length");function Cne(z){return z.split("")}function bne(z){return z.match(IAe)||[]}function px(z,le,re){var Oe;return re(z,function(et,vt,SA){if(le(et,vt,SA))return Oe=vt,!1}),Oe}function sh(z,le,re,Oe){for(var et=z.length,vt=re+(Oe?1:-1);Oe?vt--:++vt<et;)if(le(z[vt],vt,z))return vt;return-1}function za(z,le,re){return le===le?Dne(z,le,re):sh(z,mx,re)}function vne(z,le,re,Oe){for(var et=re-1,vt=z.length;++et<vt;)if(Oe(z[et],le))return et;return-1}function mx(z){return z!==z}function gx(z,le){var re=z==null?0:z.length;return re?My(z,le)/re:ce}function Ly(z){return function(le){return le==null?A:le[z]}}function Oy(z){return function(le){return z==null?A:z[le]}}function Bx(z,le,re,Oe,et){return et(z,function(vt,SA,Ot){re=Oe?(Oe=!1,vt):le(re,vt,SA,Ot)}),re}function Ene(z,le){var re=z.length;for(z.sort(le);re--;)z[re]=z[re].value;return z}function My(z,le){for(var re,Oe=-1,et=z.length;++Oe<et;){var vt=le(z[Oe]);vt!==A&&(re=re===A?vt:re+vt)}return re}function Ny(z,le){for(var re=-1,Oe=Array(z);++re<z;)Oe[re]=le(re);return Oe}function kne(z,le){return Jt(le,function(re){return[re,z[re]]})}function yx(z){return z&&z.slice(0,vx(z)+1).replace(Ey,"")}function Gn(z){return function(le){return z(le)}}function Hy(z,le){return Jt(le,function(re){return z[re]})}function Lc(z,le){return z.has(le)}function wx(z,le){for(var re=-1,Oe=z.length;++re<Oe&&za(le,z[re],0)>-1;);return re}function Cx(z,le){for(var re=z.length;re--&&za(le,z[re],0)>-1;);return re}function Sne(z,le){for(var re=z.length,Oe=0;re--;)z[re]===le&&++Oe;return Oe}var Qne=Oy(cne),Fne=Oy(une);function Une(z){return"\\"+fne[z]}function Ine(z,le){return z==null?A:z[le]}function Ya(z){return ine.test(z)}function xne(z){return sne.test(z)}function Tne(z){for(var le,re=[];!(le=z.next()).done;)re.push(le.value);return re}function Ry(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe,et){re[++le]=[et,Oe]}),re}function bx(z,le){return function(re){return z(le(re))}}function Pi(z,le){for(var re=-1,Oe=z.length,et=0,vt=[];++re<Oe;){var SA=z[re];(SA===le||SA===f)&&(z[re]=f,vt[et++]=re)}return vt}function ah(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe){re[++le]=Oe}),re}function _ne(z){var le=-1,re=Array(z.size);return z.forEach(function(Oe){re[++le]=[Oe,Oe]}),re}function Dne(z,le,re){for(var Oe=re-1,et=z.length;++Oe<et;)if(z[Oe]===le)return Oe;return-1}function Lne(z,le,re){for(var Oe=re+1;Oe--;)if(z[Oe]===le)return Oe;return Oe}function Ja(z){return Ya(z)?Mne(z):wne(z)}function Mr(z){return Ya(z)?Nne(z):Cne(z)}function vx(z){for(var le=z.length;le--&&SAe.test(z.charAt(le)););return le}var One=Oy(dne);function Mne(z){for(var le=Uy.lastIndex=0;Uy.test(z);)++le;return le}function Nne(z){return z.match(Uy)||[]}function Hne(z){return z.match(one)||[]}var Rne=(function z(le){le=le==null?GA:Xa.defaults(GA.Object(),le,Xa.pick(GA,ane));var re=le.Array,Oe=le.Date,et=le.Error,vt=le.Function,SA=le.Math,Ot=le.Object,Py=le.RegExp,Pne=le.String,ur=le.TypeError,lh=re.prototype,Vne=vt.prototype,ja=Ot.prototype,ch=le["__core-js_shared__"],uh=Vne.toString,xt=ja.hasOwnProperty,$ne=0,Ex=(function(){var c=/[^.]+$/.exec(ch&&ch.keys&&ch.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),dh=ja.toString,Kne=uh.call(Ot),Gne=GA._,Wne=Py("^"+uh.call(xt).replace(vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fh=sx?le.Buffer:A,Vi=le.Symbol,hh=le.Uint8Array,kx=fh?fh.allocUnsafe:A,ph=bx(Ot.getPrototypeOf,Ot),Sx=Ot.create,Qx=ja.propertyIsEnumerable,mh=lh.splice,Fx=Vi?Vi.isConcatSpreadable:A,Oc=Vi?Vi.iterator:A,Ns=Vi?Vi.toStringTag:A,gh=(function(){try{var c=$s(Ot,"defineProperty");return c({},"",{}),c}catch{}})(),zne=le.clearTimeout!==GA.clearTimeout&&le.clearTimeout,Yne=Oe&&Oe.now!==GA.Date.now&&Oe.now,Jne=le.setTimeout!==GA.setTimeout&&le.setTimeout,Bh=SA.ceil,yh=SA.floor,Vy=Ot.getOwnPropertySymbols,Xne=fh?fh.isBuffer:A,Ux=le.isFinite,jne=lh.join,qne=bx(Ot.keys,Ot),QA=SA.max,An=SA.min,Zne=Oe.now,ere=le.parseInt,Ix=SA.random,tre=lh.reverse,$y=$s(le,"DataView"),Mc=$s(le,"Map"),Ky=$s(le,"Promise"),qa=$s(le,"Set"),Nc=$s(le,"WeakMap"),Hc=$s(Ot,"create"),wh=Nc&&new Nc,Za={},Are=Ks($y),nre=Ks(Mc),rre=Ks(Ky),ore=Ks(qa),ire=Ks(Nc),Ch=Vi?Vi.prototype:A,Rc=Ch?Ch.valueOf:A,xx=Ch?Ch.toString:A;function U(c){if(oA(c)&&!tt(c)&&!(c instanceof pt)){if(c instanceof dr)return c;if(xt.call(c,"__wrapped__"))return TT(c)}return new dr(c)}var el=(function(){function c(){}return function(d){if(!Zt(d))return{};if(Sx)return Sx(d);c.prototype=d;var m=new c;return c.prototype=A,m}})();function bh(){}function dr(c,d){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=A}U.templateSettings={escape:Or,evaluate:ar,interpolate:co,variable:"",imports:{_:U}},U.prototype=bh.prototype,U.prototype.constructor=U,dr.prototype=el(bh.prototype),dr.prototype.constructor=dr;function pt(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function sre(){var c=new pt(this.__wrapped__);return c.__actions__=Un(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Un(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Un(this.__views__),c}function are(){if(this.__filtered__){var c=new pt(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function lre(){var c=this.__wrapped__.value(),d=this.__dir__,m=tt(c),C=d<0,E=m?c.length:0,T=Coe(0,E,this.__views__),L=T.start,V=T.end,Y=V-L,de=C?V:L-1,pe=this.__iteratees__,Be=pe.length,Ie=0,Ne=An(Y,this.__takeCount__);if(!m||!C&&E==Y&&Ne==Y)return tT(c,this.__actions__);var Ge=[];e:for(;Y--&&Ie<Ne;){de+=d;for(var st=-1,We=c[de];++st<Be;){var ct=pe[st],gt=ct.iteratee,Yn=ct.type,yn=gt(We);if(Yn==G)We=yn;else if(!yn){if(Yn==H)continue e;break e}}Ge[Ie++]=We}return Ge}pt.prototype=el(bh.prototype),pt.prototype.constructor=pt;function Hs(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function cre(){this.__data__=Hc?Hc(null):{},this.size=0}function ure(c){var d=this.has(c)&&delete this.__data__[c];return this.size-=d?1:0,d}function dre(c){var d=this.__data__;if(Hc){var m=d[c];return m===l?A:m}return xt.call(d,c)?d[c]:A}function fre(c){var d=this.__data__;return Hc?d[c]!==A:xt.call(d,c)}function hre(c,d){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=Hc&&d===A?l:d,this}Hs.prototype.clear=cre,Hs.prototype.delete=ure,Hs.prototype.get=dre,Hs.prototype.has=fre,Hs.prototype.set=hre;function No(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function pre(){this.__data__=[],this.size=0}function mre(c){var d=this.__data__,m=vh(d,c);if(m<0)return!1;var C=d.length-1;return m==C?d.pop():mh.call(d,m,1),--this.size,!0}function gre(c){var d=this.__data__,m=vh(d,c);return m<0?A:d[m][1]}function Bre(c){return vh(this.__data__,c)>-1}function yre(c,d){var m=this.__data__,C=vh(m,c);return C<0?(++this.size,m.push([c,d])):m[C][1]=d,this}No.prototype.clear=pre,No.prototype.delete=mre,No.prototype.get=gre,No.prototype.has=Bre,No.prototype.set=yre;function Ho(c){var d=-1,m=c==null?0:c.length;for(this.clear();++d<m;){var C=c[d];this.set(C[0],C[1])}}function wre(){this.size=0,this.__data__={hash:new Hs,map:new(Mc||No),string:new Hs}}function Cre(c){var d=Lh(this,c).delete(c);return this.size-=d?1:0,d}function bre(c){return Lh(this,c).get(c)}function vre(c){return Lh(this,c).has(c)}function Ere(c,d){var m=Lh(this,c),C=m.size;return m.set(c,d),this.size+=m.size==C?0:1,this}Ho.prototype.clear=wre,Ho.prototype.delete=Cre,Ho.prototype.get=bre,Ho.prototype.has=vre,Ho.prototype.set=Ere;function Rs(c){var d=-1,m=c==null?0:c.length;for(this.__data__=new Ho;++d<m;)this.add(c[d])}function kre(c){return this.__data__.set(c,l),this}function Sre(c){return this.__data__.has(c)}Rs.prototype.add=Rs.prototype.push=kre,Rs.prototype.has=Sre;function Nr(c){var d=this.__data__=new No(c);this.size=d.size}function Qre(){this.__data__=new No,this.size=0}function Fre(c){var d=this.__data__,m=d.delete(c);return this.size=d.size,m}function Ure(c){return this.__data__.get(c)}function Ire(c){return this.__data__.has(c)}function xre(c,d){var m=this.__data__;if(m instanceof No){var C=m.__data__;if(!Mc||C.length<r-1)return C.push([c,d]),this.size=++m.size,this;m=this.__data__=new Ho(C)}return m.set(c,d),this.size=m.size,this}Nr.prototype.clear=Qre,Nr.prototype.delete=Fre,Nr.prototype.get=Ure,Nr.prototype.has=Ire,Nr.prototype.set=xre;function Tx(c,d){var m=tt(c),C=!m&&Gs(c),E=!m&&!C&&zi(c),T=!m&&!C&&!E&&rl(c),L=m||C||E||T,V=L?Ny(c.length,Pne):[],Y=V.length;for(var de in c)(d||xt.call(c,de))&&!(L&&(de=="length"||E&&(de=="offset"||de=="parent")||T&&(de=="buffer"||de=="byteLength"||de=="byteOffset")||$o(de,Y)))&&V.push(de);return V}function _x(c){var d=c.length;return d?c[tw(0,d-1)]:A}function Tre(c,d){return Oh(Un(c),Ps(d,0,c.length))}function _re(c){return Oh(Un(c))}function Gy(c,d,m){(m!==A&&!Hr(c[d],m)||m===A&&!(d in c))&&Ro(c,d,m)}function Pc(c,d,m){var C=c[d];(!(xt.call(c,d)&&Hr(C,m))||m===A&&!(d in c))&&Ro(c,d,m)}function vh(c,d){for(var m=c.length;m--;)if(Hr(c[m][0],d))return m;return-1}function Dre(c,d,m,C){return $i(c,function(E,T,L){d(C,E,m(E),L)}),C}function Dx(c,d){return c&&ho(d,NA(d),c)}function Lre(c,d){return c&&ho(d,xn(d),c)}function Ro(c,d,m){d=="__proto__"&&gh?gh(c,d,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[d]=m}function Wy(c,d){for(var m=-1,C=d.length,E=re(C),T=c==null;++m<C;)E[m]=T?A:Sw(c,d[m]);return E}function Ps(c,d,m){return c===c&&(m!==A&&(c=c<=m?c:m),d!==A&&(c=c>=d?c:d)),c}function fr(c,d,m,C,E,T){var L,V=d&h,Y=d&p,de=d&g;if(m&&(L=E?m(c,C,E,T):m(c)),L!==A)return L;if(!Zt(c))return c;var pe=tt(c);if(pe){if(L=voe(c),!V)return Un(c,L)}else{var Be=nn(c),Ie=Be==Ye||Be==ge;if(zi(c))return rT(c,V);if(Be==be||Be==Ae||Ie&&!E){if(L=Y||Ie?{}:vT(c),!V)return Y?doe(c,Lre(L,c)):uoe(c,Dx(L,c))}else{if(!Nt[Be])return E?c:{};L=Eoe(c,Be,V)}}T||(T=new Nr);var Ne=T.get(c);if(Ne)return Ne;T.set(c,L),qT(c)?c.forEach(function(We){L.add(fr(We,d,m,We,c,T))}):XT(c)&&c.forEach(function(We,ct){L.set(ct,fr(We,d,m,ct,c,T))});var Ge=de?Y?dw:uw:Y?xn:NA,st=pe?A:Ge(c);return cr(st||c,function(We,ct){st&&(ct=We,We=c[ct]),Pc(L,ct,fr(We,d,m,ct,c,T))}),L}function Ore(c){var d=NA(c);return function(m){return Lx(m,c,d)}}function Lx(c,d,m){var C=m.length;if(c==null)return!C;for(c=Ot(c);C--;){var E=m[C],T=d[E],L=c[E];if(L===A&&!(E in c)||!T(L))return!1}return!0}function Ox(c,d,m){if(typeof c!="function")throw new ur(i);return Yc(function(){c.apply(A,m)},d)}function Vc(c,d,m,C){var E=-1,T=ih,L=!0,V=c.length,Y=[],de=d.length;if(!V)return Y;m&&(d=Jt(d,Gn(m))),C?(T=Ty,L=!1):d.length>=r&&(T=Lc,L=!1,d=new Rs(d));e:for(;++E<V;){var pe=c[E],Be=m==null?pe:m(pe);if(pe=C||pe!==0?pe:0,L&&Be===Be){for(var Ie=de;Ie--;)if(d[Ie]===Be)continue e;Y.push(pe)}else T(d,Be,C)||Y.push(pe)}return Y}var $i=lT(fo),Mx=lT(Yy,!0);function Mre(c,d){var m=!0;return $i(c,function(C,E,T){return m=!!d(C,E,T),m}),m}function Eh(c,d,m){for(var C=-1,E=c.length;++C<E;){var T=c[C],L=d(T);if(L!=null&&(V===A?L===L&&!zn(L):m(L,V)))var V=L,Y=T}return Y}function Nre(c,d,m,C){var E=c.length;for(m=ot(m),m<0&&(m=-m>E?0:E+m),C=C===A||C>E?E:ot(C),C<0&&(C+=E),C=m>C?0:e_(C);m<C;)c[m++]=d;return c}function Nx(c,d){var m=[];return $i(c,function(C,E,T){d(C,E,T)&&m.push(C)}),m}function WA(c,d,m,C,E){var T=-1,L=c.length;for(m||(m=Soe),E||(E=[]);++T<L;){var V=c[T];d>0&&m(V)?d>1?WA(V,d-1,m,C,E):Ri(E,V):C||(E[E.length]=V)}return E}var zy=cT(),Hx=cT(!0);function fo(c,d){return c&&zy(c,d,NA)}function Yy(c,d){return c&&Hx(c,d,NA)}function kh(c,d){return Hi(d,function(m){return Ko(c[m])})}function Vs(c,d){d=Gi(d,c);for(var m=0,C=d.length;c!=null&&m<C;)c=c[po(d[m++])];return m&&m==C?c:A}function Rx(c,d,m){var C=d(c);return tt(c)?C:Ri(C,m(c))}function gn(c){return c==null?c===A?fe:ke:Ns&&Ns in Ot(c)?woe(c):_oe(c)}function Jy(c,d){return c>d}function Hre(c,d){return c!=null&&xt.call(c,d)}function Rre(c,d){return c!=null&&d in Ot(c)}function Pre(c,d,m){return c>=An(d,m)&&c<QA(d,m)}function Xy(c,d,m){for(var C=m?Ty:ih,E=c[0].length,T=c.length,L=T,V=re(T),Y=1/0,de=[];L--;){var pe=c[L];L&&d&&(pe=Jt(pe,Gn(d))),Y=An(pe.length,Y),V[L]=!m&&(d||E>=120&&pe.length>=120)?new Rs(L&&pe):A}pe=c[0];var Be=-1,Ie=V[0];e:for(;++Be<E&&de.length<Y;){var Ne=pe[Be],Ge=d?d(Ne):Ne;if(Ne=m||Ne!==0?Ne:0,!(Ie?Lc(Ie,Ge):C(de,Ge,m))){for(L=T;--L;){var st=V[L];if(!(st?Lc(st,Ge):C(c[L],Ge,m)))continue e}Ie&&Ie.push(Ge),de.push(Ne)}}return de}function Vre(c,d,m,C){return fo(c,function(E,T,L){d(C,m(E),T,L)}),C}function $c(c,d,m){d=Gi(d,c),c=QT(c,d);var C=c==null?c:c[po(pr(d))];return C==null?A:Kn(C,c,m)}function Px(c){return oA(c)&&gn(c)==Ae}function $re(c){return oA(c)&&gn(c)==Je}function Kre(c){return oA(c)&&gn(c)==Se}function Kc(c,d,m,C,E){return c===d?!0:c==null||d==null||!oA(c)&&!oA(d)?c!==c&&d!==d:Gre(c,d,m,C,Kc,E)}function Gre(c,d,m,C,E,T){var L=tt(c),V=tt(d),Y=L?oe:nn(c),de=V?oe:nn(d);Y=Y==Ae?be:Y,de=de==Ae?be:de;var pe=Y==be,Be=de==be,Ie=Y==de;if(Ie&&zi(c)){if(!zi(d))return!1;L=!0,pe=!1}if(Ie&&!pe)return T||(T=new Nr),L||rl(c)?wT(c,d,m,C,E,T):Boe(c,d,Y,m,C,E,T);if(!(m&B)){var Ne=pe&&xt.call(c,"__wrapped__"),Ge=Be&&xt.call(d,"__wrapped__");if(Ne||Ge){var st=Ne?c.value():c,We=Ge?d.value():d;return T||(T=new Nr),E(st,We,m,C,T)}}return Ie?(T||(T=new Nr),yoe(c,d,m,C,E,T)):!1}function Wre(c){return oA(c)&&nn(c)==Ce}function jy(c,d,m,C){var E=m.length,T=E,L=!C;if(c==null)return!T;for(c=Ot(c);E--;){var V=m[E];if(L&&V[2]?V[1]!==c[V[0]]:!(V[0]in c))return!1}for(;++E<T;){V=m[E];var Y=V[0],de=c[Y],pe=V[1];if(L&&V[2]){if(de===A&&!(Y in c))return!1}else{var Be=new Nr;if(C)var Ie=C(de,pe,Y,c,d,Be);if(!(Ie===A?Kc(pe,de,B|y,C,Be):Ie))return!1}}return!0}function Vx(c){if(!Zt(c)||Foe(c))return!1;var d=Ko(c)?Wne:OAe;return d.test(Ks(c))}function zre(c){return oA(c)&&gn(c)==ne}function Yre(c){return oA(c)&&nn(c)==ve}function Jre(c){return oA(c)&&Vh(c.length)&&!!Kt[gn(c)]}function $x(c){return typeof c=="function"?c:c==null?Tn:typeof c=="object"?tt(c)?Wx(c[0],c[1]):Gx(c):u_(c)}function qy(c){if(!zc(c))return qne(c);var d=[];for(var m in Ot(c))xt.call(c,m)&&m!="constructor"&&d.push(m);return d}function Xre(c){if(!Zt(c))return Toe(c);var d=zc(c),m=[];for(var C in c)C=="constructor"&&(d||!xt.call(c,C))||m.push(C);return m}function Zy(c,d){return c<d}function Kx(c,d){var m=-1,C=In(c)?re(c.length):[];return $i(c,function(E,T,L){C[++m]=d(E,T,L)}),C}function Gx(c){var d=hw(c);return d.length==1&&d[0][2]?kT(d[0][0],d[0][1]):function(m){return m===c||jy(m,c,d)}}function Wx(c,d){return mw(c)&&ET(d)?kT(po(c),d):function(m){var C=Sw(m,c);return C===A&&C===d?Qw(m,c):Kc(d,C,B|y)}}function Sh(c,d,m,C,E){c!==d&&zy(d,function(T,L){if(E||(E=new Nr),Zt(T))jre(c,d,L,m,Sh,C,E);else{var V=C?C(Bw(c,L),T,L+"",c,d,E):A;V===A&&(V=T),Gy(c,L,V)}},xn)}function jre(c,d,m,C,E,T,L){var V=Bw(c,m),Y=Bw(d,m),de=L.get(Y);if(de){Gy(c,m,de);return}var pe=T?T(V,Y,m+"",c,d,L):A,Be=pe===A;if(Be){var Ie=tt(Y),Ne=!Ie&&zi(Y),Ge=!Ie&&!Ne&&rl(Y);pe=Y,Ie||Ne||Ge?tt(V)?pe=V:mA(V)?pe=Un(V):Ne?(Be=!1,pe=rT(Y,!0)):Ge?(Be=!1,pe=oT(Y,!0)):pe=[]:Jc(Y)||Gs(Y)?(pe=V,Gs(V)?pe=t_(V):(!Zt(V)||Ko(V))&&(pe=vT(Y))):Be=!1}Be&&(L.set(Y,pe),E(pe,Y,C,T,L),L.delete(Y)),Gy(c,m,pe)}function zx(c,d){var m=c.length;if(m)return d+=d<0?m:0,$o(d,m)?c[d]:A}function Yx(c,d,m){d.length?d=Jt(d,function(T){return tt(T)?function(L){return Vs(L,T.length===1?T[0]:T)}:T}):d=[Tn];var C=-1;d=Jt(d,Gn(Ke()));var E=Kx(c,function(T,L,V){var Y=Jt(d,function(de){return de(T)});return{criteria:Y,index:++C,value:T}});return Ene(E,function(T,L){return coe(T,L,m)})}function qre(c,d){return Jx(c,d,function(m,C){return Qw(c,C)})}function Jx(c,d,m){for(var C=-1,E=d.length,T={};++C<E;){var L=d[C],V=Vs(c,L);m(V,L)&&Gc(T,Gi(L,c),V)}return T}function Zre(c){return function(d){return Vs(d,c)}}function ew(c,d,m,C){var E=C?vne:za,T=-1,L=d.length,V=c;for(c===d&&(d=Un(d)),m&&(V=Jt(c,Gn(m)));++T<L;)for(var Y=0,de=d[T],pe=m?m(de):de;(Y=E(V,pe,Y,C))>-1;)V!==c&&mh.call(V,Y,1),mh.call(c,Y,1);return c}function Xx(c,d){for(var m=c?d.length:0,C=m-1;m--;){var E=d[m];if(m==C||E!==T){var T=E;$o(E)?mh.call(c,E,1):rw(c,E)}}return c}function tw(c,d){return c+yh(Ix()*(d-c+1))}function eoe(c,d,m,C){for(var E=-1,T=QA(Bh((d-c)/(m||1)),0),L=re(T);T--;)L[C?T:++E]=c,c+=m;return L}function Aw(c,d){var m="";if(!c||d<1||d>ee)return m;do d%2&&(m+=c),d=yh(d/2),d&&(c+=c);while(d);return m}function lt(c,d){return yw(ST(c,d,Tn),c+"")}function toe(c){return _x(ol(c))}function Aoe(c,d){var m=ol(c);return Oh(m,Ps(d,0,m.length))}function Gc(c,d,m,C){if(!Zt(c))return c;d=Gi(d,c);for(var E=-1,T=d.length,L=T-1,V=c;V!=null&&++E<T;){var Y=po(d[E]),de=m;if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return c;if(E!=L){var pe=V[Y];de=C?C(pe,Y,V):A,de===A&&(de=Zt(pe)?pe:$o(d[E+1])?[]:{})}Pc(V,Y,de),V=V[Y]}return c}var jx=wh?function(c,d){return wh.set(c,d),c}:Tn,noe=gh?function(c,d){return gh(c,"toString",{configurable:!0,enumerable:!1,value:Uw(d),writable:!0})}:Tn;function roe(c){return Oh(ol(c))}function hr(c,d,m){var C=-1,E=c.length;d<0&&(d=-d>E?0:E+d),m=m>E?E:m,m<0&&(m+=E),E=d>m?0:m-d>>>0,d>>>=0;for(var T=re(E);++C<E;)T[C]=c[C+d];return T}function ooe(c,d){var m;return $i(c,function(C,E,T){return m=d(C,E,T),!m}),!!m}function Qh(c,d,m){var C=0,E=c==null?C:c.length;if(typeof d=="number"&&d===d&&E<=R){for(;C<E;){var T=C+E>>>1,L=c[T];L!==null&&!zn(L)&&(m?L<=d:L<d)?C=T+1:E=T}return E}return nw(c,d,Tn,m)}function nw(c,d,m,C){var E=0,T=c==null?0:c.length;if(T===0)return 0;d=m(d);for(var L=d!==d,V=d===null,Y=zn(d),de=d===A;E<T;){var pe=yh((E+T)/2),Be=m(c[pe]),Ie=Be!==A,Ne=Be===null,Ge=Be===Be,st=zn(Be);if(L)var We=C||Ge;else de?We=Ge&&(C||Ie):V?We=Ge&&Ie&&(C||!Ne):Y?We=Ge&&Ie&&!Ne&&(C||!st):Ne||st?We=!1:We=C?Be<=d:Be<d;We?E=pe+1:T=pe}return An(T,Qe)}function qx(c,d){for(var m=-1,C=c.length,E=0,T=[];++m<C;){var L=c[m],V=d?d(L):L;if(!m||!Hr(V,Y)){var Y=V;T[E++]=L===0?0:L}}return T}function Zx(c){return typeof c=="number"?c:zn(c)?ce:+c}function Wn(c){if(typeof c=="string")return c;if(tt(c))return Jt(c,Wn)+"";if(zn(c))return xx?xx.call(c):"";var d=c+"";return d=="0"&&1/c==-te?"-0":d}function Ki(c,d,m){var C=-1,E=ih,T=c.length,L=!0,V=[],Y=V;if(m)L=!1,E=Ty;else if(T>=r){var de=d?null:moe(c);if(de)return ah(de);L=!1,E=Lc,Y=new Rs}else Y=d?[]:V;e:for(;++C<T;){var pe=c[C],Be=d?d(pe):pe;if(pe=m||pe!==0?pe:0,L&&Be===Be){for(var Ie=Y.length;Ie--;)if(Y[Ie]===Be)continue e;d&&Y.push(Be),V.push(pe)}else E(Y,Be,m)||(Y!==V&&Y.push(Be),V.push(pe))}return V}function rw(c,d){return d=Gi(d,c),c=QT(c,d),c==null||delete c[po(pr(d))]}function eT(c,d,m,C){return Gc(c,d,m(Vs(c,d)),C)}function Fh(c,d,m,C){for(var E=c.length,T=C?E:-1;(C?T--:++T<E)&&d(c[T],T,c););return m?hr(c,C?0:T,C?T+1:E):hr(c,C?T+1:0,C?E:T)}function tT(c,d){var m=c;return m instanceof pt&&(m=m.value()),_y(d,function(C,E){return E.func.apply(E.thisArg,Ri([C],E.args))},m)}function ow(c,d,m){var C=c.length;if(C<2)return C?Ki(c[0]):[];for(var E=-1,T=re(C);++E<C;)for(var L=c[E],V=-1;++V<C;)V!=E&&(T[E]=Vc(T[E]||L,c[V],d,m));return Ki(WA(T,1),d,m)}function AT(c,d,m){for(var C=-1,E=c.length,T=d.length,L={};++C<E;){var V=C<T?d[C]:A;m(L,c[C],V)}return L}function iw(c){return mA(c)?c:[]}function sw(c){return typeof c=="function"?c:Tn}function Gi(c,d){return tt(c)?c:mw(c,d)?[c]:xT(St(c))}var ioe=lt;function Wi(c,d,m){var C=c.length;return m=m===A?C:m,!d&&m>=C?c:hr(c,d,m)}var nT=zne||function(c){return GA.clearTimeout(c)};function rT(c,d){if(d)return c.slice();var m=c.length,C=kx?kx(m):new c.constructor(m);return c.copy(C),C}function aw(c){var d=new c.constructor(c.byteLength);return new hh(d).set(new hh(c)),d}function soe(c,d){var m=d?aw(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function aoe(c){var d=new c.constructor(c.source,PI.exec(c));return d.lastIndex=c.lastIndex,d}function loe(c){return Rc?Ot(Rc.call(c)):{}}function oT(c,d){var m=d?aw(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function iT(c,d){if(c!==d){var m=c!==A,C=c===null,E=c===c,T=zn(c),L=d!==A,V=d===null,Y=d===d,de=zn(d);if(!V&&!de&&!T&&c>d||T&&L&&Y&&!V&&!de||C&&L&&Y||!m&&Y||!E)return 1;if(!C&&!T&&!de&&c<d||de&&m&&E&&!C&&!T||V&&m&&E||!L&&E||!Y)return-1}return 0}function coe(c,d,m){for(var C=-1,E=c.criteria,T=d.criteria,L=E.length,V=m.length;++C<L;){var Y=iT(E[C],T[C]);if(Y){if(C>=V)return Y;var de=m[C];return Y*(de=="desc"?-1:1)}}return c.index-d.index}function sT(c,d,m,C){for(var E=-1,T=c.length,L=m.length,V=-1,Y=d.length,de=QA(T-L,0),pe=re(Y+de),Be=!C;++V<Y;)pe[V]=d[V];for(;++E<L;)(Be||E<T)&&(pe[m[E]]=c[E]);for(;de--;)pe[V++]=c[E++];return pe}function aT(c,d,m,C){for(var E=-1,T=c.length,L=-1,V=m.length,Y=-1,de=d.length,pe=QA(T-V,0),Be=re(pe+de),Ie=!C;++E<pe;)Be[E]=c[E];for(var Ne=E;++Y<de;)Be[Ne+Y]=d[Y];for(;++L<V;)(Ie||E<T)&&(Be[Ne+m[L]]=c[E++]);return Be}function Un(c,d){var m=-1,C=c.length;for(d||(d=re(C));++m<C;)d[m]=c[m];return d}function ho(c,d,m,C){var E=!m;m||(m={});for(var T=-1,L=d.length;++T<L;){var V=d[T],Y=C?C(m[V],c[V],V,m,c):A;Y===A&&(Y=c[V]),E?Ro(m,V,Y):Pc(m,V,Y)}return m}function uoe(c,d){return ho(c,pw(c),d)}function doe(c,d){return ho(c,CT(c),d)}function Uh(c,d){return function(m,C){var E=tt(m)?gne:Dre,T=d?d():{};return E(m,c,Ke(C,2),T)}}function tl(c){return lt(function(d,m){var C=-1,E=m.length,T=E>1?m[E-1]:A,L=E>2?m[2]:A;for(T=c.length>3&&typeof T=="function"?(E--,T):A,L&&Bn(m[0],m[1],L)&&(T=E<3?A:T,E=1),d=Ot(d);++C<E;){var V=m[C];V&&c(d,V,C,T)}return d})}function lT(c,d){return function(m,C){if(m==null)return m;if(!In(m))return c(m,C);for(var E=m.length,T=d?E:-1,L=Ot(m);(d?T--:++T<E)&&C(L[T],T,L)!==!1;);return m}}function cT(c){return function(d,m,C){for(var E=-1,T=Ot(d),L=C(d),V=L.length;V--;){var Y=L[c?V:++E];if(m(T[Y],Y,T)===!1)break}return d}}function foe(c,d,m){var C=d&b,E=Wc(c);function T(){var L=this&&this!==GA&&this instanceof T?E:c;return L.apply(C?m:this,arguments)}return T}function uT(c){return function(d){d=St(d);var m=Ya(d)?Mr(d):A,C=m?m[0]:d.charAt(0),E=m?Wi(m,1).join(""):d.slice(1);return C[c]()+E}}function Al(c){return function(d){return _y(l_(a_(d).replace(nne,"")),c,"")}}function Wc(c){return function(){var d=arguments;switch(d.length){case 0:return new c;case 1:return new c(d[0]);case 2:return new c(d[0],d[1]);case 3:return new c(d[0],d[1],d[2]);case 4:return new c(d[0],d[1],d[2],d[3]);case 5:return new c(d[0],d[1],d[2],d[3],d[4]);case 6:return new c(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new c(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var m=el(c.prototype),C=c.apply(m,d);return Zt(C)?C:m}}function hoe(c,d,m){var C=Wc(c);function E(){for(var T=arguments.length,L=re(T),V=T,Y=nl(E);V--;)L[V]=arguments[V];var de=T<3&&L[0]!==Y&&L[T-1]!==Y?[]:Pi(L,Y);if(T-=de.length,T<m)return mT(c,d,Ih,E.placeholder,A,L,de,A,A,m-T);var pe=this&&this!==GA&&this instanceof E?C:c;return Kn(pe,this,L)}return E}function dT(c){return function(d,m,C){var E=Ot(d);if(!In(d)){var T=Ke(m,3);d=NA(d),m=function(V){return T(E[V],V,E)}}var L=c(d,m,C);return L>-1?E[T?d[L]:L]:A}}function fT(c){return Vo(function(d){var m=d.length,C=m,E=dr.prototype.thru;for(c&&d.reverse();C--;){var T=d[C];if(typeof T!="function")throw new ur(i);if(E&&!L&&Dh(T)=="wrapper")var L=new dr([],!0)}for(C=L?C:m;++C<m;){T=d[C];var V=Dh(T),Y=V=="wrapper"?fw(T):A;Y&&gw(Y[0])&&Y[1]==(x|S|I|M)&&!Y[4].length&&Y[9]==1?L=L[Dh(Y[0])].apply(L,Y[3]):L=T.length==1&&gw(T)?L[V]():L.thru(T)}return function(){var de=arguments,pe=de[0];if(L&&de.length==1&&tt(pe))return L.plant(pe).value();for(var Be=0,Ie=m?d[Be].apply(this,de):pe;++Be<m;)Ie=d[Be].call(this,Ie);return Ie}})}function Ih(c,d,m,C,E,T,L,V,Y,de){var pe=d&x,Be=d&b,Ie=d&w,Ne=d&(S|F),Ge=d&O,st=Ie?A:Wc(c);function We(){for(var ct=arguments.length,gt=re(ct),Yn=ct;Yn--;)gt[Yn]=arguments[Yn];if(Ne)var yn=nl(We),Jn=Sne(gt,yn);if(C&&(gt=sT(gt,C,E,Ne)),T&&(gt=aT(gt,T,L,Ne)),ct-=Jn,Ne&&ct<de){var gA=Pi(gt,yn);return mT(c,d,Ih,We.placeholder,m,gt,gA,V,Y,de-ct)}var Rr=Be?m:this,Wo=Ie?Rr[c]:c;return ct=gt.length,V?gt=Doe(gt,V):Ge&&ct>1&&gt.reverse(),pe&&Y<ct&&(gt.length=Y),this&&this!==GA&&this instanceof We&&(Wo=st||Wc(Wo)),Wo.apply(Rr,gt)}return We}function hT(c,d){return function(m,C){return Vre(m,c,d(C),{})}}function xh(c,d){return function(m,C){var E;if(m===A&&C===A)return d;if(m!==A&&(E=m),C!==A){if(E===A)return C;typeof m=="string"||typeof C=="string"?(m=Wn(m),C=Wn(C)):(m=Zx(m),C=Zx(C)),E=c(m,C)}return E}}function lw(c){return Vo(function(d){return d=Jt(d,Gn(Ke())),lt(function(m){var C=this;return c(d,function(E){return Kn(E,C,m)})})})}function Th(c,d){d=d===A?" ":Wn(d);var m=d.length;if(m<2)return m?Aw(d,c):d;var C=Aw(d,Bh(c/Ja(d)));return Ya(d)?Wi(Mr(C),0,c).join(""):C.slice(0,c)}function poe(c,d,m,C){var E=d&b,T=Wc(c);function L(){for(var V=-1,Y=arguments.length,de=-1,pe=C.length,Be=re(pe+Y),Ie=this&&this!==GA&&this instanceof L?T:c;++de<pe;)Be[de]=C[de];for(;Y--;)Be[de++]=arguments[++V];return Kn(Ie,E?m:this,Be)}return L}function pT(c){return function(d,m,C){return C&&typeof C!="number"&&Bn(d,m,C)&&(m=C=A),d=Go(d),m===A?(m=d,d=0):m=Go(m),C=C===A?d<m?1:-1:Go(C),eoe(d,m,C,c)}}function _h(c){return function(d,m){return typeof d=="string"&&typeof m=="string"||(d=mr(d),m=mr(m)),c(d,m)}}function mT(c,d,m,C,E,T,L,V,Y,de){var pe=d&S,Be=pe?L:A,Ie=pe?A:L,Ne=pe?T:A,Ge=pe?A:T;d|=pe?I:Q,d&=~(pe?Q:I),d&v||(d&=-4);var st=[c,d,E,Ne,Be,Ge,Ie,V,Y,de],We=m.apply(A,st);return gw(c)&&FT(We,st),We.placeholder=C,UT(We,c,d)}function cw(c){var d=SA[c];return function(m,C){if(m=mr(m),C=C==null?0:An(ot(C),292),C&&Ux(m)){var E=(St(m)+"e").split("e"),T=d(E[0]+"e"+(+E[1]+C));return E=(St(T)+"e").split("e"),+(E[0]+"e"+(+E[1]-C))}return d(m)}}var moe=qa&&1/ah(new qa([,-0]))[1]==te?function(c){return new qa(c)}:Tw;function gT(c){return function(d){var m=nn(d);return m==Ce?Ry(d):m==ve?_ne(d):kne(d,c(d))}}function Po(c,d,m,C,E,T,L,V){var Y=d&w;if(!Y&&typeof c!="function")throw new ur(i);var de=C?C.length:0;if(de||(d&=-97,C=E=A),L=L===A?L:QA(ot(L),0),V=V===A?V:ot(V),de-=E?E.length:0,d&Q){var pe=C,Be=E;C=E=A}var Ie=Y?A:fw(c),Ne=[c,d,m,C,E,pe,Be,T,L,V];if(Ie&&xoe(Ne,Ie),c=Ne[0],d=Ne[1],m=Ne[2],C=Ne[3],E=Ne[4],V=Ne[9]=Ne[9]===A?Y?0:c.length:QA(Ne[9]-de,0),!V&&d&(S|F)&&(d&=-25),!d||d==b)var Ge=foe(c,d,m);else d==S||d==F?Ge=hoe(c,d,V):(d==I||d==(b|I))&&!E.length?Ge=poe(c,d,m,C):Ge=Ih.apply(A,Ne);var st=Ie?jx:FT;return UT(st(Ge,Ne),c,d)}function BT(c,d,m,C){return c===A||Hr(c,ja[m])&&!xt.call(C,m)?d:c}function yT(c,d,m,C,E,T){return Zt(c)&&Zt(d)&&(T.set(d,c),Sh(c,d,A,yT,T),T.delete(d)),c}function goe(c){return Jc(c)?A:c}function wT(c,d,m,C,E,T){var L=m&B,V=c.length,Y=d.length;if(V!=Y&&!(L&&Y>V))return!1;var de=T.get(c),pe=T.get(d);if(de&&pe)return de==d&&pe==c;var Be=-1,Ie=!0,Ne=m&y?new Rs:A;for(T.set(c,d),T.set(d,c);++Be<V;){var Ge=c[Be],st=d[Be];if(C)var We=L?C(st,Ge,Be,d,c,T):C(Ge,st,Be,c,d,T);if(We!==A){if(We)continue;Ie=!1;break}if(Ne){if(!Dy(d,function(ct,gt){if(!Lc(Ne,gt)&&(Ge===ct||E(Ge,ct,m,C,T)))return Ne.push(gt)})){Ie=!1;break}}else if(!(Ge===st||E(Ge,st,m,C,T))){Ie=!1;break}}return T.delete(c),T.delete(d),Ie}function Boe(c,d,m,C,E,T,L){switch(m){case Ue:if(c.byteLength!=d.byteLength||c.byteOffset!=d.byteOffset)return!1;c=c.buffer,d=d.buffer;case Je:return!(c.byteLength!=d.byteLength||!T(new hh(c),new hh(d)));case X:case Se:case D:return Hr(+c,+d);case se:return c.name==d.name&&c.message==d.message;case ne:case ze:return c==d+"";case Ce:var V=Ry;case ve:var Y=C&B;if(V||(V=ah),c.size!=d.size&&!Y)return!1;var de=L.get(c);if(de)return de==d;C|=y,L.set(c,d);var pe=wT(V(c),V(d),C,E,T,L);return L.delete(c),pe;case W:if(Rc)return Rc.call(c)==Rc.call(d)}return!1}function yoe(c,d,m,C,E,T){var L=m&B,V=uw(c),Y=V.length,de=uw(d),pe=de.length;if(Y!=pe&&!L)return!1;for(var Be=Y;Be--;){var Ie=V[Be];if(!(L?Ie in d:xt.call(d,Ie)))return!1}var Ne=T.get(c),Ge=T.get(d);if(Ne&&Ge)return Ne==d&&Ge==c;var st=!0;T.set(c,d),T.set(d,c);for(var We=L;++Be<Y;){Ie=V[Be];var ct=c[Ie],gt=d[Ie];if(C)var Yn=L?C(gt,ct,Ie,d,c,T):C(ct,gt,Ie,c,d,T);if(!(Yn===A?ct===gt||E(ct,gt,m,C,T):Yn)){st=!1;break}We||(We=Ie=="constructor")}if(st&&!We){var yn=c.constructor,Jn=d.constructor;yn!=Jn&&"constructor"in c&&"constructor"in d&&!(typeof yn=="function"&&yn instanceof yn&&typeof Jn=="function"&&Jn instanceof Jn)&&(st=!1)}return T.delete(c),T.delete(d),st}function Vo(c){return yw(ST(c,A,LT),c+"")}function uw(c){return Rx(c,NA,pw)}function dw(c){return Rx(c,xn,CT)}var fw=wh?function(c){return wh.get(c)}:Tw;function Dh(c){for(var d=c.name+"",m=Za[d],C=xt.call(Za,d)?m.length:0;C--;){var E=m[C],T=E.func;if(T==null||T==c)return E.name}return d}function nl(c){var d=xt.call(U,"placeholder")?U:c;return d.placeholder}function Ke(){var c=U.iteratee||Iw;return c=c===Iw?$x:c,arguments.length?c(arguments[0],arguments[1]):c}function Lh(c,d){var m=c.__data__;return Qoe(d)?m[typeof d=="string"?"string":"hash"]:m.map}function hw(c){for(var d=NA(c),m=d.length;m--;){var C=d[m],E=c[C];d[m]=[C,E,ET(E)]}return d}function $s(c,d){var m=Ine(c,d);return Vx(m)?m:A}function woe(c){var d=xt.call(c,Ns),m=c[Ns];try{c[Ns]=A;var C=!0}catch{}var E=dh.call(c);return C&&(d?c[Ns]=m:delete c[Ns]),E}var pw=Vy?function(c){return c==null?[]:(c=Ot(c),Hi(Vy(c),function(d){return Qx.call(c,d)}))}:_w,CT=Vy?function(c){for(var d=[];c;)Ri(d,pw(c)),c=ph(c);return d}:_w,nn=gn;($y&&nn(new $y(new ArrayBuffer(1)))!=Ue||Mc&&nn(new Mc)!=Ce||Ky&&nn(Ky.resolve())!=_||qa&&nn(new qa)!=ve||Nc&&nn(new Nc)!=q)&&(nn=function(c){var d=gn(c),m=d==be?c.constructor:A,C=m?Ks(m):"";if(C)switch(C){case Are:return Ue;case nre:return Ce;case rre:return _;case ore:return ve;case ire:return q}return d});function Coe(c,d,m){for(var C=-1,E=m.length;++C<E;){var T=m[C],L=T.size;switch(T.type){case"drop":c+=L;break;case"dropRight":d-=L;break;case"take":d=An(d,c+L);break;case"takeRight":c=QA(c,d-L);break}}return{start:c,end:d}}function boe(c){var d=c.match(FAe);return d?d[1].split(UAe):[]}function bT(c,d,m){d=Gi(d,c);for(var C=-1,E=d.length,T=!1;++C<E;){var L=po(d[C]);if(!(T=c!=null&&m(c,L)))break;c=c[L]}return T||++C!=E?T:(E=c==null?0:c.length,!!E&&Vh(E)&&$o(L,E)&&(tt(c)||Gs(c)))}function voe(c){var d=c.length,m=new c.constructor(d);return d&&typeof c[0]=="string"&&xt.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function vT(c){return typeof c.constructor=="function"&&!zc(c)?el(ph(c)):{}}function Eoe(c,d,m){var C=c.constructor;switch(d){case Je:return aw(c);case X:case Se:return new C(+c);case Ue:return soe(c,m);case kt:case kA:case Fn:case tn:case Mo:case lo:case Ds:case Ls:case Os:return oT(c,m);case Ce:return new C;case D:case ze:return new C(c);case ne:return aoe(c);case ve:return new C;case W:return loe(c)}}function koe(c,d){var m=d.length;if(!m)return c;var C=m-1;return d[C]=(m>1?"& ":"")+d[C],d=d.join(m>2?", ":" "),c.replace(QAe,`{
125
125
  /* [wrapped with `+d+`] */
126
- `)}function Soe(c){return tt(c)||Gs(c)||!!(Fx&&c&&c[Fx])}function $o(c,d){var m=typeof c;return d=d??ee,!!d&&(m=="number"||m!="symbol"&&NAe.test(c))&&c>-1&&c%1==0&&c<d}function Bn(c,d,m){if(!qt(m))return!1;var C=typeof d;return(C=="number"?In(m)&&$o(d,m.length):C=="string"&&d in m)?Hr(m[d],c):!1}function mw(c,d){if(tt(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||zn(c)?!0:Dc.test(c)||!uo.test(c)||d!=null&&c in Ot(d)}function Qoe(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}function gw(c){var d=Dh(c),m=U[d];if(typeof m!="function"||!(d in pt.prototype))return!1;if(c===m)return!0;var C=fw(m);return!!C&&c===C[0]}function Foe(c){return!!Ex&&Ex in c}var Uoe=ch?Ko:Dw;function zc(c){var d=c&&c.constructor,m=typeof d=="function"&&d.prototype||ja;return c===m}function ET(c){return c===c&&!qt(c)}function kT(c,d){return function(m){return m==null?!1:m[c]===d&&(d!==A||c in Ot(m))}}function Ioe(c){var d=Rh(c,function(C){return m.size===u&&m.clear(),C}),m=d.cache;return d}function xoe(c,d){var m=c[1],C=d[1],E=m|C,T=E<(b|w|x),L=C==x&&m==S||C==x&&m==M&&c[7].length<=d[8]||C==(x|M)&&d[7].length<=d[8]&&m==S;if(!(T||L))return c;C&b&&(c[2]=d[2],E|=m&b?0:v);var V=d[3];if(V){var Y=c[3];c[3]=Y?sT(Y,V,d[4]):V,c[4]=Y?Pi(c[3],f):d[4]}return V=d[5],V&&(Y=c[5],c[5]=Y?aT(Y,V,d[6]):V,c[6]=Y?Pi(c[5],f):d[6]),V=d[7],V&&(c[7]=V),C&x&&(c[8]=c[8]==null?d[8]:An(c[8],d[8])),c[9]==null&&(c[9]=d[9]),c[0]=d[0],c[1]=E,c}function Toe(c){var d=[];if(c!=null)for(var m in Ot(c))d.push(m);return d}function _oe(c){return dh.call(c)}function ST(c,d,m){return d=QA(d===A?c.length-1:d,0),function(){for(var C=arguments,E=-1,T=QA(C.length-d,0),L=re(T);++E<T;)L[E]=C[d+E];E=-1;for(var V=re(d+1);++E<d;)V[E]=C[E];return V[d]=m(L),Kn(c,this,V)}}function QT(c,d){return d.length<2?c:Vs(c,hr(d,0,-1))}function Doe(c,d){for(var m=c.length,C=An(d.length,m),E=Un(c);C--;){var T=d[C];c[C]=$o(T,m)?E[T]:A}return c}function Bw(c,d){if(!(d==="constructor"&&typeof c[d]=="function")&&d!="__proto__")return c[d]}var FT=IT(jx),Yc=Jne||function(c,d){return GA.setTimeout(c,d)},yw=IT(noe);function UT(c,d,m){var C=d+"";return yw(c,koe(C,Loe(boe(C),m)))}function IT(c){var d=0,m=0;return function(){var C=Zne(),E=ue-(C-m);if(m=C,E>0){if(++d>=ae)return arguments[0]}else d=0;return c.apply(A,arguments)}}function Oh(c,d){var m=-1,C=c.length,E=C-1;for(d=d===A?C:d;++m<d;){var T=tw(m,E),L=c[T];c[T]=c[m],c[m]=L}return c.length=d,c}var xT=Ioe(function(c){var d=[];return c.charCodeAt(0)===46&&d.push(""),c.replace(by,function(m,C,E,T){d.push(E?T.replace(TAe,"$1"):C||m)}),d});function po(c){if(typeof c=="string"||zn(c))return c;var d=c+"";return d=="0"&&1/c==-te?"-0":d}function Ks(c){if(c!=null){try{return uh.call(c)}catch{}try{return c+""}catch{}}return""}function Loe(c,d){return cr(J,function(m){var C="_."+m[0];d&m[1]&&!ih(c,C)&&c.push(C)}),c.sort()}function TT(c){if(c instanceof pt)return c.clone();var d=new dr(c.__wrapped__,c.__chain__);return d.__actions__=Un(c.__actions__),d.__index__=c.__index__,d.__values__=c.__values__,d}function Ooe(c,d,m){(m?Bn(c,d,m):d===A)?d=1:d=QA(ot(d),0);var C=c==null?0:c.length;if(!C||d<1)return[];for(var E=0,T=0,L=re(Bh(C/d));E<C;)L[T++]=hr(c,E,E+=d);return L}function Moe(c){for(var d=-1,m=c==null?0:c.length,C=0,E=[];++d<m;){var T=c[d];T&&(E[C++]=T)}return E}function Noe(){var c=arguments.length;if(!c)return[];for(var d=re(c-1),m=arguments[0],C=c;C--;)d[C-1]=arguments[C];return Ri(tt(m)?Un(m):[m],WA(d,1))}var Hoe=lt(function(c,d){return mA(c)?Vc(c,WA(d,1,mA,!0)):[]}),Roe=lt(function(c,d){var m=pr(d);return mA(m)&&(m=A),mA(c)?Vc(c,WA(d,1,mA,!0),Ke(m,2)):[]}),Poe=lt(function(c,d){var m=pr(d);return mA(m)&&(m=A),mA(c)?Vc(c,WA(d,1,mA,!0),A,m):[]});function Voe(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),hr(c,d<0?0:d,C)):[]}function $oe(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),d=C-d,hr(c,0,d<0?0:d)):[]}function Koe(c,d){return c&&c.length?Fh(c,Ke(d,3),!0,!0):[]}function Goe(c,d){return c&&c.length?Fh(c,Ke(d,3),!0):[]}function Woe(c,d,m,C){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Bn(c,d,m)&&(m=0,C=E),Nre(c,d,m,C)):[]}function _T(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=m==null?0:ot(m);return E<0&&(E=QA(C+E,0)),sh(c,Ke(d,3),E)}function DT(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=C-1;return m!==A&&(E=ot(m),E=m<0?QA(C+E,0):An(E,C-1)),sh(c,Ke(d,3),E,!0)}function LT(c){var d=c==null?0:c.length;return d?WA(c,1):[]}function zoe(c){var d=c==null?0:c.length;return d?WA(c,te):[]}function Yoe(c,d){var m=c==null?0:c.length;return m?(d=d===A?1:ot(d),WA(c,d)):[]}function Joe(c){for(var d=-1,m=c==null?0:c.length,C={};++d<m;){var E=c[d];C[E[0]]=E[1]}return C}function OT(c){return c&&c.length?c[0]:A}function Xoe(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=m==null?0:ot(m);return E<0&&(E=QA(C+E,0)),za(c,d,E)}function joe(c){var d=c==null?0:c.length;return d?hr(c,0,-1):[]}var qoe=lt(function(c){var d=Yt(c,iw);return d.length&&d[0]===c[0]?Xy(d):[]}),Zoe=lt(function(c){var d=pr(c),m=Yt(c,iw);return d===pr(m)?d=A:m.pop(),m.length&&m[0]===c[0]?Xy(m,Ke(d,2)):[]}),eie=lt(function(c){var d=pr(c),m=Yt(c,iw);return d=typeof d=="function"?d:A,d&&m.pop(),m.length&&m[0]===c[0]?Xy(m,A,d):[]});function tie(c,d){return c==null?"":jne.call(c,d)}function pr(c){var d=c==null?0:c.length;return d?c[d-1]:A}function Aie(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=C;return m!==A&&(E=ot(m),E=E<0?QA(C+E,0):An(E,C-1)),d===d?Lne(c,d,E):sh(c,mx,E,!0)}function nie(c,d){return c&&c.length?zx(c,ot(d)):A}var rie=lt(MT);function MT(c,d){return c&&c.length&&d&&d.length?ew(c,d):c}function oie(c,d,m){return c&&c.length&&d&&d.length?ew(c,d,Ke(m,2)):c}function iie(c,d,m){return c&&c.length&&d&&d.length?ew(c,d,A,m):c}var sie=Vo(function(c,d){var m=c==null?0:c.length,C=Wy(c,d);return Xx(c,Yt(d,function(E){return $o(E,m)?+E:E}).sort(iT)),C});function aie(c,d){var m=[];if(!(c&&c.length))return m;var C=-1,E=[],T=c.length;for(d=Ke(d,3);++C<T;){var L=c[C];d(L,C,c)&&(m.push(L),E.push(C))}return Xx(c,E),m}function ww(c){return c==null?c:tre.call(c)}function lie(c,d,m){var C=c==null?0:c.length;return C?(m&&typeof m!="number"&&Bn(c,d,m)?(d=0,m=C):(d=d==null?0:ot(d),m=m===A?C:ot(m)),hr(c,d,m)):[]}function cie(c,d){return Qh(c,d)}function uie(c,d,m){return nw(c,d,Ke(m,2))}function die(c,d){var m=c==null?0:c.length;if(m){var C=Qh(c,d);if(C<m&&Hr(c[C],d))return C}return-1}function fie(c,d){return Qh(c,d,!0)}function hie(c,d,m){return nw(c,d,Ke(m,2),!0)}function pie(c,d){var m=c==null?0:c.length;if(m){var C=Qh(c,d,!0)-1;if(Hr(c[C],d))return C}return-1}function mie(c){return c&&c.length?qx(c):[]}function gie(c,d){return c&&c.length?qx(c,Ke(d,2)):[]}function Bie(c){var d=c==null?0:c.length;return d?hr(c,1,d):[]}function yie(c,d,m){return c&&c.length?(d=m||d===A?1:ot(d),hr(c,0,d<0?0:d)):[]}function wie(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),d=C-d,hr(c,d<0?0:d,C)):[]}function Cie(c,d){return c&&c.length?Fh(c,Ke(d,3),!1,!0):[]}function bie(c,d){return c&&c.length?Fh(c,Ke(d,3)):[]}var vie=lt(function(c){return Ki(WA(c,1,mA,!0))}),Eie=lt(function(c){var d=pr(c);return mA(d)&&(d=A),Ki(WA(c,1,mA,!0),Ke(d,2))}),kie=lt(function(c){var d=pr(c);return d=typeof d=="function"?d:A,Ki(WA(c,1,mA,!0),A,d)});function Sie(c){return c&&c.length?Ki(c):[]}function Qie(c,d){return c&&c.length?Ki(c,Ke(d,2)):[]}function Fie(c,d){return d=typeof d=="function"?d:A,c&&c.length?Ki(c,A,d):[]}function Cw(c){if(!(c&&c.length))return[];var d=0;return c=Hi(c,function(m){if(mA(m))return d=QA(m.length,d),!0}),Ny(d,function(m){return Yt(c,Ly(m))})}function NT(c,d){if(!(c&&c.length))return[];var m=Cw(c);return d==null?m:Yt(m,function(C){return Kn(d,A,C)})}var Uie=lt(function(c,d){return mA(c)?Vc(c,d):[]}),Iie=lt(function(c){return ow(Hi(c,mA))}),xie=lt(function(c){var d=pr(c);return mA(d)&&(d=A),ow(Hi(c,mA),Ke(d,2))}),Tie=lt(function(c){var d=pr(c);return d=typeof d=="function"?d:A,ow(Hi(c,mA),A,d)}),_ie=lt(Cw);function Die(c,d){return AT(c||[],d||[],Pc)}function Lie(c,d){return AT(c||[],d||[],Gc)}var Oie=lt(function(c){var d=c.length,m=d>1?c[d-1]:A;return m=typeof m=="function"?(c.pop(),m):A,NT(c,m)});function HT(c){var d=U(c);return d.__chain__=!0,d}function Mie(c,d){return d(c),c}function Mh(c,d){return d(c)}var Nie=Vo(function(c){var d=c.length,m=d?c[0]:0,C=this.__wrapped__,E=function(T){return Wy(T,c)};return d>1||this.__actions__.length||!(C instanceof pt)||!$o(m)?this.thru(E):(C=C.slice(m,+m+(d?1:0)),C.__actions__.push({func:Mh,args:[E],thisArg:A}),new dr(C,this.__chain__).thru(function(T){return d&&!T.length&&T.push(A),T}))});function Hie(){return HT(this)}function Rie(){return new dr(this.value(),this.__chain__)}function Pie(){this.__values__===A&&(this.__values__=ZT(this.value()));var c=this.__index__>=this.__values__.length,d=c?A:this.__values__[this.__index__++];return{done:c,value:d}}function Vie(){return this}function $ie(c){for(var d,m=this;m instanceof bh;){var C=TT(m);C.__index__=0,C.__values__=A,d?E.__wrapped__=C:d=C;var E=C;m=m.__wrapped__}return E.__wrapped__=c,d}function Kie(){var c=this.__wrapped__;if(c instanceof pt){var d=c;return this.__actions__.length&&(d=new pt(this)),d=d.reverse(),d.__actions__.push({func:Mh,args:[ww],thisArg:A}),new dr(d,this.__chain__)}return this.thru(ww)}function Gie(){return tT(this.__wrapped__,this.__actions__)}var Wie=Uh(function(c,d,m){xt.call(c,m)?++c[m]:Ro(c,m,1)});function zie(c,d,m){var C=tt(c)?hx:Mre;return m&&Bn(c,d,m)&&(d=A),C(c,Ke(d,3))}function Yie(c,d){var m=tt(c)?Hi:Nx;return m(c,Ke(d,3))}var Jie=dT(_T),Xie=dT(DT);function jie(c,d){return WA(Nh(c,d),1)}function qie(c,d){return WA(Nh(c,d),te)}function Zie(c,d,m){return m=m===A?1:ot(m),WA(Nh(c,d),m)}function RT(c,d){var m=tt(c)?cr:$i;return m(c,Ke(d,3))}function PT(c,d){var m=tt(c)?Bne:Mx;return m(c,Ke(d,3))}var ese=Uh(function(c,d,m){xt.call(c,m)?c[m].push(d):Ro(c,m,[d])});function tse(c,d,m,C){c=In(c)?c:ol(c),m=m&&!C?ot(m):0;var E=c.length;return m<0&&(m=QA(E+m,0)),$h(c)?m<=E&&c.indexOf(d,m)>-1:!!E&&za(c,d,m)>-1}var Ase=lt(function(c,d,m){var C=-1,E=typeof d=="function",T=In(c)?re(c.length):[];return $i(c,function(L){T[++C]=E?Kn(d,L,m):$c(L,d,m)}),T}),nse=Uh(function(c,d,m){Ro(c,m,d)});function Nh(c,d){var m=tt(c)?Yt:Kx;return m(c,Ke(d,3))}function rse(c,d,m,C){return c==null?[]:(tt(d)||(d=d==null?[]:[d]),m=C?A:m,tt(m)||(m=m==null?[]:[m]),Yx(c,d,m))}var ose=Uh(function(c,d,m){c[m?0:1].push(d)},function(){return[[],[]]});function ise(c,d,m){var C=tt(c)?_y:Bx,E=arguments.length<3;return C(c,Ke(d,4),m,E,$i)}function sse(c,d,m){var C=tt(c)?yne:Bx,E=arguments.length<3;return C(c,Ke(d,4),m,E,Mx)}function ase(c,d){var m=tt(c)?Hi:Nx;return m(c,Ph(Ke(d,3)))}function lse(c){var d=tt(c)?_x:toe;return d(c)}function cse(c,d,m){(m?Bn(c,d,m):d===A)?d=1:d=ot(d);var C=tt(c)?Tre:Aoe;return C(c,d)}function use(c){var d=tt(c)?_re:roe;return d(c)}function dse(c){if(c==null)return 0;if(In(c))return $h(c)?Ja(c):c.length;var d=nn(c);return d==Ce||d==ve?c.size:qy(c).length}function fse(c,d,m){var C=tt(c)?Dy:ooe;return m&&Bn(c,d,m)&&(d=A),C(c,Ke(d,3))}var hse=lt(function(c,d){if(c==null)return[];var m=d.length;return m>1&&Bn(c,d[0],d[1])?d=[]:m>2&&Bn(d[0],d[1],d[2])&&(d=[d[0]]),Yx(c,WA(d,1),[])}),Hh=Yne||function(){return GA.Date.now()};function pse(c,d){if(typeof d!="function")throw new ur(i);return c=ot(c),function(){if(--c<1)return d.apply(this,arguments)}}function VT(c,d,m){return d=m?A:d,d=c&&d==null?c.length:d,Po(c,x,A,A,A,A,d)}function $T(c,d){var m;if(typeof d!="function")throw new ur(i);return c=ot(c),function(){return--c>0&&(m=d.apply(this,arguments)),c<=1&&(d=A),m}}var bw=lt(function(c,d,m){var C=b;if(m.length){var E=Pi(m,nl(bw));C|=I}return Po(c,C,d,m,E)}),KT=lt(function(c,d,m){var C=b|w;if(m.length){var E=Pi(m,nl(KT));C|=I}return Po(d,C,c,m,E)});function GT(c,d,m){d=m?A:d;var C=Po(c,S,A,A,A,A,A,d);return C.placeholder=GT.placeholder,C}function WT(c,d,m){d=m?A:d;var C=Po(c,F,A,A,A,A,A,d);return C.placeholder=WT.placeholder,C}function zT(c,d,m){var C,E,T,L,V,Y,de=0,pe=!1,Be=!1,Ie=!0;if(typeof c!="function")throw new ur(i);d=mr(d)||0,qt(m)&&(pe=!!m.leading,Be="maxWait"in m,T=Be?QA(mr(m.maxWait)||0,d):T,Ie="trailing"in m?!!m.trailing:Ie);function Ne(gA){var Rr=C,Wo=E;return C=E=A,de=gA,L=c.apply(Wo,Rr),L}function Ge(gA){return de=gA,V=Yc(ct,d),pe?Ne(gA):L}function st(gA){var Rr=gA-Y,Wo=gA-de,d_=d-Rr;return Be?An(d_,T-Wo):d_}function We(gA){var Rr=gA-Y,Wo=gA-de;return Y===A||Rr>=d||Rr<0||Be&&Wo>=T}function ct(){var gA=Hh();if(We(gA))return gt(gA);V=Yc(ct,st(gA))}function gt(gA){return V=A,Ie&&C?Ne(gA):(C=E=A,L)}function Yn(){V!==A&&nT(V),de=0,C=Y=E=V=A}function yn(){return V===A?L:gt(Hh())}function Jn(){var gA=Hh(),Rr=We(gA);if(C=arguments,E=this,Y=gA,Rr){if(V===A)return Ge(Y);if(Be)return nT(V),V=Yc(ct,d),Ne(Y)}return V===A&&(V=Yc(ct,d)),L}return Jn.cancel=Yn,Jn.flush=yn,Jn}var mse=lt(function(c,d){return Ox(c,1,d)}),gse=lt(function(c,d,m){return Ox(c,mr(d)||0,m)});function Bse(c){return Po(c,O)}function Rh(c,d){if(typeof c!="function"||d!=null&&typeof d!="function")throw new ur(i);var m=function(){var C=arguments,E=d?d.apply(this,C):C[0],T=m.cache;if(T.has(E))return T.get(E);var L=c.apply(this,C);return m.cache=T.set(E,L)||T,L};return m.cache=new(Rh.Cache||Ho),m}Rh.Cache=Ho;function Ph(c){if(typeof c!="function")throw new ur(i);return function(){var d=arguments;switch(d.length){case 0:return!c.call(this);case 1:return!c.call(this,d[0]);case 2:return!c.call(this,d[0],d[1]);case 3:return!c.call(this,d[0],d[1],d[2])}return!c.apply(this,d)}}function yse(c){return $T(2,c)}var wse=ioe(function(c,d){d=d.length==1&&tt(d[0])?Yt(d[0],Gn(Ke())):Yt(WA(d,1),Gn(Ke()));var m=d.length;return lt(function(C){for(var E=-1,T=An(C.length,m);++E<T;)C[E]=d[E].call(this,C[E]);return Kn(c,this,C)})}),vw=lt(function(c,d){var m=Pi(d,nl(vw));return Po(c,I,A,d,m)}),YT=lt(function(c,d){var m=Pi(d,nl(YT));return Po(c,Q,A,d,m)}),Cse=Vo(function(c,d){return Po(c,M,A,A,A,d)});function bse(c,d){if(typeof c!="function")throw new ur(i);return d=d===A?d:ot(d),lt(c,d)}function vse(c,d){if(typeof c!="function")throw new ur(i);return d=d==null?0:QA(ot(d),0),lt(function(m){var C=m[d],E=Wi(m,0,d);return C&&Ri(E,C),Kn(c,this,E)})}function Ese(c,d,m){var C=!0,E=!0;if(typeof c!="function")throw new ur(i);return qt(m)&&(C="leading"in m?!!m.leading:C,E="trailing"in m?!!m.trailing:E),zT(c,d,{leading:C,maxWait:d,trailing:E})}function kse(c){return VT(c,1)}function Sse(c,d){return vw(sw(d),c)}function Qse(){if(!arguments.length)return[];var c=arguments[0];return tt(c)?c:[c]}function Fse(c){return fr(c,g)}function Use(c,d){return d=typeof d=="function"?d:A,fr(c,g,d)}function Ise(c){return fr(c,h|g)}function xse(c,d){return d=typeof d=="function"?d:A,fr(c,h|g,d)}function Tse(c,d){return d==null||Lx(c,d,NA(d))}function Hr(c,d){return c===d||c!==c&&d!==d}var _se=_h(Jy),Dse=_h(function(c,d){return c>=d}),Gs=Px((function(){return arguments})())?Px:function(c){return oA(c)&&xt.call(c,"callee")&&!Qx.call(c,"callee")},tt=re.isArray,Lse=ax?Gn(ax):$re;function In(c){return c!=null&&Vh(c.length)&&!Ko(c)}function mA(c){return oA(c)&&In(c)}function Ose(c){return c===!0||c===!1||oA(c)&&gn(c)==X}var zi=Xne||Dw,Mse=lx?Gn(lx):Kre;function Nse(c){return oA(c)&&c.nodeType===1&&!Jc(c)}function Hse(c){if(c==null)return!0;if(In(c)&&(tt(c)||typeof c=="string"||typeof c.splice=="function"||zi(c)||rl(c)||Gs(c)))return!c.length;var d=nn(c);if(d==Ce||d==ve)return!c.size;if(zc(c))return!qy(c).length;for(var m in c)if(xt.call(c,m))return!1;return!0}function Rse(c,d){return Kc(c,d)}function Pse(c,d,m){m=typeof m=="function"?m:A;var C=m?m(c,d):A;return C===A?Kc(c,d,A,m):!!C}function Ew(c){if(!oA(c))return!1;var d=gn(c);return d==se||d==ht||typeof c.message=="string"&&typeof c.name=="string"&&!Jc(c)}function Vse(c){return typeof c=="number"&&Ux(c)}function Ko(c){if(!qt(c))return!1;var d=gn(c);return d==Ye||d==ge||d==k||d==N}function JT(c){return typeof c=="number"&&c==ot(c)}function Vh(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=ee}function qt(c){var d=typeof c;return c!=null&&(d=="object"||d=="function")}function oA(c){return c!=null&&typeof c=="object"}var XT=cx?Gn(cx):Wre;function $se(c,d){return c===d||jy(c,d,hw(d))}function Kse(c,d,m){return m=typeof m=="function"?m:A,jy(c,d,hw(d),m)}function Gse(c){return jT(c)&&c!=+c}function Wse(c){if(Uoe(c))throw new et(o);return Vx(c)}function zse(c){return c===null}function Yse(c){return c==null}function jT(c){return typeof c=="number"||oA(c)&&gn(c)==D}function Jc(c){if(!oA(c)||gn(c)!=be)return!1;var d=ph(c);if(d===null)return!0;var m=xt.call(d,"constructor")&&d.constructor;return typeof m=="function"&&m instanceof m&&uh.call(m)==Kne}var kw=ux?Gn(ux):zre;function Jse(c){return JT(c)&&c>=-ee&&c<=ee}var qT=dx?Gn(dx):Yre;function $h(c){return typeof c=="string"||!tt(c)&&oA(c)&&gn(c)==ze}function zn(c){return typeof c=="symbol"||oA(c)&&gn(c)==W}var rl=fx?Gn(fx):Jre;function Xse(c){return c===A}function jse(c){return oA(c)&&nn(c)==q}function qse(c){return oA(c)&&gn(c)==me}var Zse=_h(Zy),eae=_h(function(c,d){return c<=d});function ZT(c){if(!c)return[];if(In(c))return $h(c)?Mr(c):Un(c);if(Oc&&c[Oc])return Tne(c[Oc]());var d=nn(c),m=d==Ce?Ry:d==ve?ah:ol;return m(c)}function Go(c){if(!c)return c===0?c:0;if(c=mr(c),c===te||c===-te){var d=c<0?-1:1;return d*K}return c===c?c:0}function ot(c){var d=Go(c),m=d%1;return d===d?m?d-m:d:0}function e_(c){return c?Ps(ot(c),0,j):0}function mr(c){if(typeof c=="number")return c;if(zn(c))return ce;if(qt(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=qt(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=yx(c);var m=LAe.test(c);return m||MAe.test(c)?pne(c.slice(2),m?2:8):DAe.test(c)?ce:+c}function t_(c){return ho(c,xn(c))}function tae(c){return c?Ps(ot(c),-ee,ee):c===0?c:0}function St(c){return c==null?"":Wn(c)}var Aae=tl(function(c,d){if(zc(d)||In(d)){ho(d,NA(d),c);return}for(var m in d)xt.call(d,m)&&Pc(c,m,d[m])}),A_=tl(function(c,d){ho(d,xn(d),c)}),Kh=tl(function(c,d,m,C){ho(d,xn(d),c,C)}),nae=tl(function(c,d,m,C){ho(d,NA(d),c,C)}),rae=Vo(Wy);function oae(c,d){var m=el(c);return d==null?m:Dx(m,d)}var iae=lt(function(c,d){c=Ot(c);var m=-1,C=d.length,E=C>2?d[2]:A;for(E&&Bn(d[0],d[1],E)&&(C=1);++m<C;)for(var T=d[m],L=xn(T),V=-1,Y=L.length;++V<Y;){var de=L[V],pe=c[de];(pe===A||Hr(pe,ja[de])&&!xt.call(c,de))&&(c[de]=T[de])}return c}),sae=lt(function(c){return c.push(A,yT),Kn(n_,A,c)});function aae(c,d){return px(c,Ke(d,3),fo)}function lae(c,d){return px(c,Ke(d,3),Yy)}function cae(c,d){return c==null?c:zy(c,Ke(d,3),xn)}function uae(c,d){return c==null?c:Hx(c,Ke(d,3),xn)}function dae(c,d){return c&&fo(c,Ke(d,3))}function fae(c,d){return c&&Yy(c,Ke(d,3))}function hae(c){return c==null?[]:kh(c,NA(c))}function pae(c){return c==null?[]:kh(c,xn(c))}function Sw(c,d,m){var C=c==null?A:Vs(c,d);return C===A?m:C}function mae(c,d){return c!=null&&bT(c,d,Hre)}function Qw(c,d){return c!=null&&bT(c,d,Rre)}var gae=hT(function(c,d,m){d!=null&&typeof d.toString!="function"&&(d=dh.call(d)),c[d]=m},Uw(Tn)),Bae=hT(function(c,d,m){d!=null&&typeof d.toString!="function"&&(d=dh.call(d)),xt.call(c,d)?c[d].push(m):c[d]=[m]},Ke),yae=lt($c);function NA(c){return In(c)?Tx(c):qy(c)}function xn(c){return In(c)?Tx(c,!0):Xre(c)}function wae(c,d){var m={};return d=Ke(d,3),fo(c,function(C,E,T){Ro(m,d(C,E,T),C)}),m}function Cae(c,d){var m={};return d=Ke(d,3),fo(c,function(C,E,T){Ro(m,E,d(C,E,T))}),m}var bae=tl(function(c,d,m){Sh(c,d,m)}),n_=tl(function(c,d,m,C){Sh(c,d,m,C)}),vae=Vo(function(c,d){var m={};if(c==null)return m;var C=!1;d=Yt(d,function(T){return T=Gi(T,c),C||(C=T.length>1),T}),ho(c,dw(c),m),C&&(m=fr(m,h|p|g,goe));for(var E=d.length;E--;)rw(m,d[E]);return m});function Eae(c,d){return r_(c,Ph(Ke(d)))}var kae=Vo(function(c,d){return c==null?{}:qre(c,d)});function r_(c,d){if(c==null)return{};var m=Yt(dw(c),function(C){return[C]});return d=Ke(d),Jx(c,m,function(C,E){return d(C,E[0])})}function Sae(c,d,m){d=Gi(d,c);var C=-1,E=d.length;for(E||(E=1,c=A);++C<E;){var T=c==null?A:c[po(d[C])];T===A&&(C=E,T=m),c=Ko(T)?T.call(c):T}return c}function Qae(c,d,m){return c==null?c:Gc(c,d,m)}function Fae(c,d,m,C){return C=typeof C=="function"?C:A,c==null?c:Gc(c,d,m,C)}var o_=gT(NA),i_=gT(xn);function Uae(c,d,m){var C=tt(c),E=C||zi(c)||rl(c);if(d=Ke(d,4),m==null){var T=c&&c.constructor;E?m=C?new T:[]:qt(c)?m=Ko(T)?el(ph(c)):{}:m={}}return(E?cr:fo)(c,function(L,V,Y){return d(m,L,V,Y)}),m}function Iae(c,d){return c==null?!0:rw(c,d)}function xae(c,d,m){return c==null?c:eT(c,d,sw(m))}function Tae(c,d,m,C){return C=typeof C=="function"?C:A,c==null?c:eT(c,d,sw(m),C)}function ol(c){return c==null?[]:Hy(c,NA(c))}function _ae(c){return c==null?[]:Hy(c,xn(c))}function Dae(c,d,m){return m===A&&(m=d,d=A),m!==A&&(m=mr(m),m=m===m?m:0),d!==A&&(d=mr(d),d=d===d?d:0),Ps(mr(c),d,m)}function Lae(c,d,m){return d=Go(d),m===A?(m=d,d=0):m=Go(m),c=mr(c),Pre(c,d,m)}function Oae(c,d,m){if(m&&typeof m!="boolean"&&Bn(c,d,m)&&(d=m=A),m===A&&(typeof d=="boolean"?(m=d,d=A):typeof c=="boolean"&&(m=c,c=A)),c===A&&d===A?(c=0,d=1):(c=Go(c),d===A?(d=c,c=0):d=Go(d)),c>d){var C=c;c=d,d=C}if(m||c%1||d%1){var E=Ix();return An(c+E*(d-c+hne("1e-"+((E+"").length-1))),d)}return tw(c,d)}var Mae=Al(function(c,d,m){return d=d.toLowerCase(),c+(m?s_(d):d)});function s_(c){return Fw(St(c).toLowerCase())}function a_(c){return c=St(c),c&&c.replace(HAe,Qne).replace(rne,"")}function Nae(c,d,m){c=St(c),d=Wn(d);var C=c.length;m=m===A?C:Ps(ot(m),0,C);var E=m;return m-=d.length,m>=0&&c.slice(m,E)==d}function Hae(c){return c=St(c),c&&He.test(c)?c.replace(he,Fne):c}function Rae(c){return c=St(c),c&&kAe.test(c)?c.replace(vy,"\\$&"):c}var Pae=Al(function(c,d,m){return c+(m?"-":"")+d.toLowerCase()}),Vae=Al(function(c,d,m){return c+(m?" ":"")+d.toLowerCase()}),$ae=uT("toLowerCase");function Kae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;if(!d||C>=d)return c;var E=(d-C)/2;return Th(yh(E),m)+c+Th(Bh(E),m)}function Gae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;return d&&C<d?c+Th(d-C,m):c}function Wae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;return d&&C<d?Th(d-C,m)+c:c}function zae(c,d,m){return m||d==null?d=0:d&&(d=+d),ere(St(c).replace(Ey,""),d||0)}function Yae(c,d,m){return(m?Bn(c,d,m):d===A)?d=1:d=ot(d),Aw(St(c),d)}function Jae(){var c=arguments,d=St(c[0]);return c.length<3?d:d.replace(c[1],c[2])}var Xae=Al(function(c,d,m){return c+(m?"_":"")+d.toLowerCase()});function jae(c,d,m){return m&&typeof m!="number"&&Bn(c,d,m)&&(d=m=A),m=m===A?j:m>>>0,m?(c=St(c),c&&(typeof d=="string"||d!=null&&!kw(d))&&(d=Wn(d),!d&&Ya(c))?Wi(Mr(c),0,m):c.split(d,m)):[]}var qae=Al(function(c,d,m){return c+(m?" ":"")+Fw(d)});function Zae(c,d,m){return c=St(c),m=m==null?0:Ps(ot(m),0,c.length),d=Wn(d),c.slice(m,m+d.length)==d}function ele(c,d,m){var C=U.templateSettings;m&&Bn(c,d,m)&&(d=A),c=St(c),d=Kh({},d,C,BT);var E=Kh({},d.imports,C.imports,BT),T=NA(E),L=Hy(E,T),V,Y,de=0,pe=d.interpolate||nh,Be="__p += '",Ie=Py((d.escape||nh).source+"|"+pe.source+"|"+(pe===co?_Ae:nh).source+"|"+(d.evaluate||nh).source+"|$","g"),Ne="//# sourceURL="+(xt.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lne+"]")+`
126
+ `)}function Soe(c){return tt(c)||Gs(c)||!!(Fx&&c&&c[Fx])}function $o(c,d){var m=typeof c;return d=d??ee,!!d&&(m=="number"||m!="symbol"&&NAe.test(c))&&c>-1&&c%1==0&&c<d}function Bn(c,d,m){if(!Zt(m))return!1;var C=typeof d;return(C=="number"?In(m)&&$o(d,m.length):C=="string"&&d in m)?Hr(m[d],c):!1}function mw(c,d){if(tt(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||zn(c)?!0:Dc.test(c)||!uo.test(c)||d!=null&&c in Ot(d)}function Qoe(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}function gw(c){var d=Dh(c),m=U[d];if(typeof m!="function"||!(d in pt.prototype))return!1;if(c===m)return!0;var C=fw(m);return!!C&&c===C[0]}function Foe(c){return!!Ex&&Ex in c}var Uoe=ch?Ko:Dw;function zc(c){var d=c&&c.constructor,m=typeof d=="function"&&d.prototype||ja;return c===m}function ET(c){return c===c&&!Zt(c)}function kT(c,d){return function(m){return m==null?!1:m[c]===d&&(d!==A||c in Ot(m))}}function Ioe(c){var d=Rh(c,function(C){return m.size===u&&m.clear(),C}),m=d.cache;return d}function xoe(c,d){var m=c[1],C=d[1],E=m|C,T=E<(b|w|x),L=C==x&&m==S||C==x&&m==M&&c[7].length<=d[8]||C==(x|M)&&d[7].length<=d[8]&&m==S;if(!(T||L))return c;C&b&&(c[2]=d[2],E|=m&b?0:v);var V=d[3];if(V){var Y=c[3];c[3]=Y?sT(Y,V,d[4]):V,c[4]=Y?Pi(c[3],f):d[4]}return V=d[5],V&&(Y=c[5],c[5]=Y?aT(Y,V,d[6]):V,c[6]=Y?Pi(c[5],f):d[6]),V=d[7],V&&(c[7]=V),C&x&&(c[8]=c[8]==null?d[8]:An(c[8],d[8])),c[9]==null&&(c[9]=d[9]),c[0]=d[0],c[1]=E,c}function Toe(c){var d=[];if(c!=null)for(var m in Ot(c))d.push(m);return d}function _oe(c){return dh.call(c)}function ST(c,d,m){return d=QA(d===A?c.length-1:d,0),function(){for(var C=arguments,E=-1,T=QA(C.length-d,0),L=re(T);++E<T;)L[E]=C[d+E];E=-1;for(var V=re(d+1);++E<d;)V[E]=C[E];return V[d]=m(L),Kn(c,this,V)}}function QT(c,d){return d.length<2?c:Vs(c,hr(d,0,-1))}function Doe(c,d){for(var m=c.length,C=An(d.length,m),E=Un(c);C--;){var T=d[C];c[C]=$o(T,m)?E[T]:A}return c}function Bw(c,d){if(!(d==="constructor"&&typeof c[d]=="function")&&d!="__proto__")return c[d]}var FT=IT(jx),Yc=Jne||function(c,d){return GA.setTimeout(c,d)},yw=IT(noe);function UT(c,d,m){var C=d+"";return yw(c,koe(C,Loe(boe(C),m)))}function IT(c){var d=0,m=0;return function(){var C=Zne(),E=ue-(C-m);if(m=C,E>0){if(++d>=ae)return arguments[0]}else d=0;return c.apply(A,arguments)}}function Oh(c,d){var m=-1,C=c.length,E=C-1;for(d=d===A?C:d;++m<d;){var T=tw(m,E),L=c[T];c[T]=c[m],c[m]=L}return c.length=d,c}var xT=Ioe(function(c){var d=[];return c.charCodeAt(0)===46&&d.push(""),c.replace(by,function(m,C,E,T){d.push(E?T.replace(TAe,"$1"):C||m)}),d});function po(c){if(typeof c=="string"||zn(c))return c;var d=c+"";return d=="0"&&1/c==-te?"-0":d}function Ks(c){if(c!=null){try{return uh.call(c)}catch{}try{return c+""}catch{}}return""}function Loe(c,d){return cr(J,function(m){var C="_."+m[0];d&m[1]&&!ih(c,C)&&c.push(C)}),c.sort()}function TT(c){if(c instanceof pt)return c.clone();var d=new dr(c.__wrapped__,c.__chain__);return d.__actions__=Un(c.__actions__),d.__index__=c.__index__,d.__values__=c.__values__,d}function Ooe(c,d,m){(m?Bn(c,d,m):d===A)?d=1:d=QA(ot(d),0);var C=c==null?0:c.length;if(!C||d<1)return[];for(var E=0,T=0,L=re(Bh(C/d));E<C;)L[T++]=hr(c,E,E+=d);return L}function Moe(c){for(var d=-1,m=c==null?0:c.length,C=0,E=[];++d<m;){var T=c[d];T&&(E[C++]=T)}return E}function Noe(){var c=arguments.length;if(!c)return[];for(var d=re(c-1),m=arguments[0],C=c;C--;)d[C-1]=arguments[C];return Ri(tt(m)?Un(m):[m],WA(d,1))}var Hoe=lt(function(c,d){return mA(c)?Vc(c,WA(d,1,mA,!0)):[]}),Roe=lt(function(c,d){var m=pr(d);return mA(m)&&(m=A),mA(c)?Vc(c,WA(d,1,mA,!0),Ke(m,2)):[]}),Poe=lt(function(c,d){var m=pr(d);return mA(m)&&(m=A),mA(c)?Vc(c,WA(d,1,mA,!0),A,m):[]});function Voe(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),hr(c,d<0?0:d,C)):[]}function $oe(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),d=C-d,hr(c,0,d<0?0:d)):[]}function Koe(c,d){return c&&c.length?Fh(c,Ke(d,3),!0,!0):[]}function Goe(c,d){return c&&c.length?Fh(c,Ke(d,3),!0):[]}function Woe(c,d,m,C){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Bn(c,d,m)&&(m=0,C=E),Nre(c,d,m,C)):[]}function _T(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=m==null?0:ot(m);return E<0&&(E=QA(C+E,0)),sh(c,Ke(d,3),E)}function DT(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=C-1;return m!==A&&(E=ot(m),E=m<0?QA(C+E,0):An(E,C-1)),sh(c,Ke(d,3),E,!0)}function LT(c){var d=c==null?0:c.length;return d?WA(c,1):[]}function zoe(c){var d=c==null?0:c.length;return d?WA(c,te):[]}function Yoe(c,d){var m=c==null?0:c.length;return m?(d=d===A?1:ot(d),WA(c,d)):[]}function Joe(c){for(var d=-1,m=c==null?0:c.length,C={};++d<m;){var E=c[d];C[E[0]]=E[1]}return C}function OT(c){return c&&c.length?c[0]:A}function Xoe(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=m==null?0:ot(m);return E<0&&(E=QA(C+E,0)),za(c,d,E)}function joe(c){var d=c==null?0:c.length;return d?hr(c,0,-1):[]}var qoe=lt(function(c){var d=Jt(c,iw);return d.length&&d[0]===c[0]?Xy(d):[]}),Zoe=lt(function(c){var d=pr(c),m=Jt(c,iw);return d===pr(m)?d=A:m.pop(),m.length&&m[0]===c[0]?Xy(m,Ke(d,2)):[]}),eie=lt(function(c){var d=pr(c),m=Jt(c,iw);return d=typeof d=="function"?d:A,d&&m.pop(),m.length&&m[0]===c[0]?Xy(m,A,d):[]});function tie(c,d){return c==null?"":jne.call(c,d)}function pr(c){var d=c==null?0:c.length;return d?c[d-1]:A}function Aie(c,d,m){var C=c==null?0:c.length;if(!C)return-1;var E=C;return m!==A&&(E=ot(m),E=E<0?QA(C+E,0):An(E,C-1)),d===d?Lne(c,d,E):sh(c,mx,E,!0)}function nie(c,d){return c&&c.length?zx(c,ot(d)):A}var rie=lt(MT);function MT(c,d){return c&&c.length&&d&&d.length?ew(c,d):c}function oie(c,d,m){return c&&c.length&&d&&d.length?ew(c,d,Ke(m,2)):c}function iie(c,d,m){return c&&c.length&&d&&d.length?ew(c,d,A,m):c}var sie=Vo(function(c,d){var m=c==null?0:c.length,C=Wy(c,d);return Xx(c,Jt(d,function(E){return $o(E,m)?+E:E}).sort(iT)),C});function aie(c,d){var m=[];if(!(c&&c.length))return m;var C=-1,E=[],T=c.length;for(d=Ke(d,3);++C<T;){var L=c[C];d(L,C,c)&&(m.push(L),E.push(C))}return Xx(c,E),m}function ww(c){return c==null?c:tre.call(c)}function lie(c,d,m){var C=c==null?0:c.length;return C?(m&&typeof m!="number"&&Bn(c,d,m)?(d=0,m=C):(d=d==null?0:ot(d),m=m===A?C:ot(m)),hr(c,d,m)):[]}function cie(c,d){return Qh(c,d)}function uie(c,d,m){return nw(c,d,Ke(m,2))}function die(c,d){var m=c==null?0:c.length;if(m){var C=Qh(c,d);if(C<m&&Hr(c[C],d))return C}return-1}function fie(c,d){return Qh(c,d,!0)}function hie(c,d,m){return nw(c,d,Ke(m,2),!0)}function pie(c,d){var m=c==null?0:c.length;if(m){var C=Qh(c,d,!0)-1;if(Hr(c[C],d))return C}return-1}function mie(c){return c&&c.length?qx(c):[]}function gie(c,d){return c&&c.length?qx(c,Ke(d,2)):[]}function Bie(c){var d=c==null?0:c.length;return d?hr(c,1,d):[]}function yie(c,d,m){return c&&c.length?(d=m||d===A?1:ot(d),hr(c,0,d<0?0:d)):[]}function wie(c,d,m){var C=c==null?0:c.length;return C?(d=m||d===A?1:ot(d),d=C-d,hr(c,d<0?0:d,C)):[]}function Cie(c,d){return c&&c.length?Fh(c,Ke(d,3),!1,!0):[]}function bie(c,d){return c&&c.length?Fh(c,Ke(d,3)):[]}var vie=lt(function(c){return Ki(WA(c,1,mA,!0))}),Eie=lt(function(c){var d=pr(c);return mA(d)&&(d=A),Ki(WA(c,1,mA,!0),Ke(d,2))}),kie=lt(function(c){var d=pr(c);return d=typeof d=="function"?d:A,Ki(WA(c,1,mA,!0),A,d)});function Sie(c){return c&&c.length?Ki(c):[]}function Qie(c,d){return c&&c.length?Ki(c,Ke(d,2)):[]}function Fie(c,d){return d=typeof d=="function"?d:A,c&&c.length?Ki(c,A,d):[]}function Cw(c){if(!(c&&c.length))return[];var d=0;return c=Hi(c,function(m){if(mA(m))return d=QA(m.length,d),!0}),Ny(d,function(m){return Jt(c,Ly(m))})}function NT(c,d){if(!(c&&c.length))return[];var m=Cw(c);return d==null?m:Jt(m,function(C){return Kn(d,A,C)})}var Uie=lt(function(c,d){return mA(c)?Vc(c,d):[]}),Iie=lt(function(c){return ow(Hi(c,mA))}),xie=lt(function(c){var d=pr(c);return mA(d)&&(d=A),ow(Hi(c,mA),Ke(d,2))}),Tie=lt(function(c){var d=pr(c);return d=typeof d=="function"?d:A,ow(Hi(c,mA),A,d)}),_ie=lt(Cw);function Die(c,d){return AT(c||[],d||[],Pc)}function Lie(c,d){return AT(c||[],d||[],Gc)}var Oie=lt(function(c){var d=c.length,m=d>1?c[d-1]:A;return m=typeof m=="function"?(c.pop(),m):A,NT(c,m)});function HT(c){var d=U(c);return d.__chain__=!0,d}function Mie(c,d){return d(c),c}function Mh(c,d){return d(c)}var Nie=Vo(function(c){var d=c.length,m=d?c[0]:0,C=this.__wrapped__,E=function(T){return Wy(T,c)};return d>1||this.__actions__.length||!(C instanceof pt)||!$o(m)?this.thru(E):(C=C.slice(m,+m+(d?1:0)),C.__actions__.push({func:Mh,args:[E],thisArg:A}),new dr(C,this.__chain__).thru(function(T){return d&&!T.length&&T.push(A),T}))});function Hie(){return HT(this)}function Rie(){return new dr(this.value(),this.__chain__)}function Pie(){this.__values__===A&&(this.__values__=ZT(this.value()));var c=this.__index__>=this.__values__.length,d=c?A:this.__values__[this.__index__++];return{done:c,value:d}}function Vie(){return this}function $ie(c){for(var d,m=this;m instanceof bh;){var C=TT(m);C.__index__=0,C.__values__=A,d?E.__wrapped__=C:d=C;var E=C;m=m.__wrapped__}return E.__wrapped__=c,d}function Kie(){var c=this.__wrapped__;if(c instanceof pt){var d=c;return this.__actions__.length&&(d=new pt(this)),d=d.reverse(),d.__actions__.push({func:Mh,args:[ww],thisArg:A}),new dr(d,this.__chain__)}return this.thru(ww)}function Gie(){return tT(this.__wrapped__,this.__actions__)}var Wie=Uh(function(c,d,m){xt.call(c,m)?++c[m]:Ro(c,m,1)});function zie(c,d,m){var C=tt(c)?hx:Mre;return m&&Bn(c,d,m)&&(d=A),C(c,Ke(d,3))}function Yie(c,d){var m=tt(c)?Hi:Nx;return m(c,Ke(d,3))}var Jie=dT(_T),Xie=dT(DT);function jie(c,d){return WA(Nh(c,d),1)}function qie(c,d){return WA(Nh(c,d),te)}function Zie(c,d,m){return m=m===A?1:ot(m),WA(Nh(c,d),m)}function RT(c,d){var m=tt(c)?cr:$i;return m(c,Ke(d,3))}function PT(c,d){var m=tt(c)?Bne:Mx;return m(c,Ke(d,3))}var ese=Uh(function(c,d,m){xt.call(c,m)?c[m].push(d):Ro(c,m,[d])});function tse(c,d,m,C){c=In(c)?c:ol(c),m=m&&!C?ot(m):0;var E=c.length;return m<0&&(m=QA(E+m,0)),$h(c)?m<=E&&c.indexOf(d,m)>-1:!!E&&za(c,d,m)>-1}var Ase=lt(function(c,d,m){var C=-1,E=typeof d=="function",T=In(c)?re(c.length):[];return $i(c,function(L){T[++C]=E?Kn(d,L,m):$c(L,d,m)}),T}),nse=Uh(function(c,d,m){Ro(c,m,d)});function Nh(c,d){var m=tt(c)?Jt:Kx;return m(c,Ke(d,3))}function rse(c,d,m,C){return c==null?[]:(tt(d)||(d=d==null?[]:[d]),m=C?A:m,tt(m)||(m=m==null?[]:[m]),Yx(c,d,m))}var ose=Uh(function(c,d,m){c[m?0:1].push(d)},function(){return[[],[]]});function ise(c,d,m){var C=tt(c)?_y:Bx,E=arguments.length<3;return C(c,Ke(d,4),m,E,$i)}function sse(c,d,m){var C=tt(c)?yne:Bx,E=arguments.length<3;return C(c,Ke(d,4),m,E,Mx)}function ase(c,d){var m=tt(c)?Hi:Nx;return m(c,Ph(Ke(d,3)))}function lse(c){var d=tt(c)?_x:toe;return d(c)}function cse(c,d,m){(m?Bn(c,d,m):d===A)?d=1:d=ot(d);var C=tt(c)?Tre:Aoe;return C(c,d)}function use(c){var d=tt(c)?_re:roe;return d(c)}function dse(c){if(c==null)return 0;if(In(c))return $h(c)?Ja(c):c.length;var d=nn(c);return d==Ce||d==ve?c.size:qy(c).length}function fse(c,d,m){var C=tt(c)?Dy:ooe;return m&&Bn(c,d,m)&&(d=A),C(c,Ke(d,3))}var hse=lt(function(c,d){if(c==null)return[];var m=d.length;return m>1&&Bn(c,d[0],d[1])?d=[]:m>2&&Bn(d[0],d[1],d[2])&&(d=[d[0]]),Yx(c,WA(d,1),[])}),Hh=Yne||function(){return GA.Date.now()};function pse(c,d){if(typeof d!="function")throw new ur(i);return c=ot(c),function(){if(--c<1)return d.apply(this,arguments)}}function VT(c,d,m){return d=m?A:d,d=c&&d==null?c.length:d,Po(c,x,A,A,A,A,d)}function $T(c,d){var m;if(typeof d!="function")throw new ur(i);return c=ot(c),function(){return--c>0&&(m=d.apply(this,arguments)),c<=1&&(d=A),m}}var bw=lt(function(c,d,m){var C=b;if(m.length){var E=Pi(m,nl(bw));C|=I}return Po(c,C,d,m,E)}),KT=lt(function(c,d,m){var C=b|w;if(m.length){var E=Pi(m,nl(KT));C|=I}return Po(d,C,c,m,E)});function GT(c,d,m){d=m?A:d;var C=Po(c,S,A,A,A,A,A,d);return C.placeholder=GT.placeholder,C}function WT(c,d,m){d=m?A:d;var C=Po(c,F,A,A,A,A,A,d);return C.placeholder=WT.placeholder,C}function zT(c,d,m){var C,E,T,L,V,Y,de=0,pe=!1,Be=!1,Ie=!0;if(typeof c!="function")throw new ur(i);d=mr(d)||0,Zt(m)&&(pe=!!m.leading,Be="maxWait"in m,T=Be?QA(mr(m.maxWait)||0,d):T,Ie="trailing"in m?!!m.trailing:Ie);function Ne(gA){var Rr=C,Wo=E;return C=E=A,de=gA,L=c.apply(Wo,Rr),L}function Ge(gA){return de=gA,V=Yc(ct,d),pe?Ne(gA):L}function st(gA){var Rr=gA-Y,Wo=gA-de,d_=d-Rr;return Be?An(d_,T-Wo):d_}function We(gA){var Rr=gA-Y,Wo=gA-de;return Y===A||Rr>=d||Rr<0||Be&&Wo>=T}function ct(){var gA=Hh();if(We(gA))return gt(gA);V=Yc(ct,st(gA))}function gt(gA){return V=A,Ie&&C?Ne(gA):(C=E=A,L)}function Yn(){V!==A&&nT(V),de=0,C=Y=E=V=A}function yn(){return V===A?L:gt(Hh())}function Jn(){var gA=Hh(),Rr=We(gA);if(C=arguments,E=this,Y=gA,Rr){if(V===A)return Ge(Y);if(Be)return nT(V),V=Yc(ct,d),Ne(Y)}return V===A&&(V=Yc(ct,d)),L}return Jn.cancel=Yn,Jn.flush=yn,Jn}var mse=lt(function(c,d){return Ox(c,1,d)}),gse=lt(function(c,d,m){return Ox(c,mr(d)||0,m)});function Bse(c){return Po(c,O)}function Rh(c,d){if(typeof c!="function"||d!=null&&typeof d!="function")throw new ur(i);var m=function(){var C=arguments,E=d?d.apply(this,C):C[0],T=m.cache;if(T.has(E))return T.get(E);var L=c.apply(this,C);return m.cache=T.set(E,L)||T,L};return m.cache=new(Rh.Cache||Ho),m}Rh.Cache=Ho;function Ph(c){if(typeof c!="function")throw new ur(i);return function(){var d=arguments;switch(d.length){case 0:return!c.call(this);case 1:return!c.call(this,d[0]);case 2:return!c.call(this,d[0],d[1]);case 3:return!c.call(this,d[0],d[1],d[2])}return!c.apply(this,d)}}function yse(c){return $T(2,c)}var wse=ioe(function(c,d){d=d.length==1&&tt(d[0])?Jt(d[0],Gn(Ke())):Jt(WA(d,1),Gn(Ke()));var m=d.length;return lt(function(C){for(var E=-1,T=An(C.length,m);++E<T;)C[E]=d[E].call(this,C[E]);return Kn(c,this,C)})}),vw=lt(function(c,d){var m=Pi(d,nl(vw));return Po(c,I,A,d,m)}),YT=lt(function(c,d){var m=Pi(d,nl(YT));return Po(c,Q,A,d,m)}),Cse=Vo(function(c,d){return Po(c,M,A,A,A,d)});function bse(c,d){if(typeof c!="function")throw new ur(i);return d=d===A?d:ot(d),lt(c,d)}function vse(c,d){if(typeof c!="function")throw new ur(i);return d=d==null?0:QA(ot(d),0),lt(function(m){var C=m[d],E=Wi(m,0,d);return C&&Ri(E,C),Kn(c,this,E)})}function Ese(c,d,m){var C=!0,E=!0;if(typeof c!="function")throw new ur(i);return Zt(m)&&(C="leading"in m?!!m.leading:C,E="trailing"in m?!!m.trailing:E),zT(c,d,{leading:C,maxWait:d,trailing:E})}function kse(c){return VT(c,1)}function Sse(c,d){return vw(sw(d),c)}function Qse(){if(!arguments.length)return[];var c=arguments[0];return tt(c)?c:[c]}function Fse(c){return fr(c,g)}function Use(c,d){return d=typeof d=="function"?d:A,fr(c,g,d)}function Ise(c){return fr(c,h|g)}function xse(c,d){return d=typeof d=="function"?d:A,fr(c,h|g,d)}function Tse(c,d){return d==null||Lx(c,d,NA(d))}function Hr(c,d){return c===d||c!==c&&d!==d}var _se=_h(Jy),Dse=_h(function(c,d){return c>=d}),Gs=Px((function(){return arguments})())?Px:function(c){return oA(c)&&xt.call(c,"callee")&&!Qx.call(c,"callee")},tt=re.isArray,Lse=ax?Gn(ax):$re;function In(c){return c!=null&&Vh(c.length)&&!Ko(c)}function mA(c){return oA(c)&&In(c)}function Ose(c){return c===!0||c===!1||oA(c)&&gn(c)==X}var zi=Xne||Dw,Mse=lx?Gn(lx):Kre;function Nse(c){return oA(c)&&c.nodeType===1&&!Jc(c)}function Hse(c){if(c==null)return!0;if(In(c)&&(tt(c)||typeof c=="string"||typeof c.splice=="function"||zi(c)||rl(c)||Gs(c)))return!c.length;var d=nn(c);if(d==Ce||d==ve)return!c.size;if(zc(c))return!qy(c).length;for(var m in c)if(xt.call(c,m))return!1;return!0}function Rse(c,d){return Kc(c,d)}function Pse(c,d,m){m=typeof m=="function"?m:A;var C=m?m(c,d):A;return C===A?Kc(c,d,A,m):!!C}function Ew(c){if(!oA(c))return!1;var d=gn(c);return d==se||d==ht||typeof c.message=="string"&&typeof c.name=="string"&&!Jc(c)}function Vse(c){return typeof c=="number"&&Ux(c)}function Ko(c){if(!Zt(c))return!1;var d=gn(c);return d==Ye||d==ge||d==k||d==N}function JT(c){return typeof c=="number"&&c==ot(c)}function Vh(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=ee}function Zt(c){var d=typeof c;return c!=null&&(d=="object"||d=="function")}function oA(c){return c!=null&&typeof c=="object"}var XT=cx?Gn(cx):Wre;function $se(c,d){return c===d||jy(c,d,hw(d))}function Kse(c,d,m){return m=typeof m=="function"?m:A,jy(c,d,hw(d),m)}function Gse(c){return jT(c)&&c!=+c}function Wse(c){if(Uoe(c))throw new et(o);return Vx(c)}function zse(c){return c===null}function Yse(c){return c==null}function jT(c){return typeof c=="number"||oA(c)&&gn(c)==D}function Jc(c){if(!oA(c)||gn(c)!=be)return!1;var d=ph(c);if(d===null)return!0;var m=xt.call(d,"constructor")&&d.constructor;return typeof m=="function"&&m instanceof m&&uh.call(m)==Kne}var kw=ux?Gn(ux):zre;function Jse(c){return JT(c)&&c>=-ee&&c<=ee}var qT=dx?Gn(dx):Yre;function $h(c){return typeof c=="string"||!tt(c)&&oA(c)&&gn(c)==ze}function zn(c){return typeof c=="symbol"||oA(c)&&gn(c)==W}var rl=fx?Gn(fx):Jre;function Xse(c){return c===A}function jse(c){return oA(c)&&nn(c)==q}function qse(c){return oA(c)&&gn(c)==me}var Zse=_h(Zy),eae=_h(function(c,d){return c<=d});function ZT(c){if(!c)return[];if(In(c))return $h(c)?Mr(c):Un(c);if(Oc&&c[Oc])return Tne(c[Oc]());var d=nn(c),m=d==Ce?Ry:d==ve?ah:ol;return m(c)}function Go(c){if(!c)return c===0?c:0;if(c=mr(c),c===te||c===-te){var d=c<0?-1:1;return d*K}return c===c?c:0}function ot(c){var d=Go(c),m=d%1;return d===d?m?d-m:d:0}function e_(c){return c?Ps(ot(c),0,j):0}function mr(c){if(typeof c=="number")return c;if(zn(c))return ce;if(Zt(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=Zt(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=yx(c);var m=LAe.test(c);return m||MAe.test(c)?pne(c.slice(2),m?2:8):DAe.test(c)?ce:+c}function t_(c){return ho(c,xn(c))}function tae(c){return c?Ps(ot(c),-ee,ee):c===0?c:0}function St(c){return c==null?"":Wn(c)}var Aae=tl(function(c,d){if(zc(d)||In(d)){ho(d,NA(d),c);return}for(var m in d)xt.call(d,m)&&Pc(c,m,d[m])}),A_=tl(function(c,d){ho(d,xn(d),c)}),Kh=tl(function(c,d,m,C){ho(d,xn(d),c,C)}),nae=tl(function(c,d,m,C){ho(d,NA(d),c,C)}),rae=Vo(Wy);function oae(c,d){var m=el(c);return d==null?m:Dx(m,d)}var iae=lt(function(c,d){c=Ot(c);var m=-1,C=d.length,E=C>2?d[2]:A;for(E&&Bn(d[0],d[1],E)&&(C=1);++m<C;)for(var T=d[m],L=xn(T),V=-1,Y=L.length;++V<Y;){var de=L[V],pe=c[de];(pe===A||Hr(pe,ja[de])&&!xt.call(c,de))&&(c[de]=T[de])}return c}),sae=lt(function(c){return c.push(A,yT),Kn(n_,A,c)});function aae(c,d){return px(c,Ke(d,3),fo)}function lae(c,d){return px(c,Ke(d,3),Yy)}function cae(c,d){return c==null?c:zy(c,Ke(d,3),xn)}function uae(c,d){return c==null?c:Hx(c,Ke(d,3),xn)}function dae(c,d){return c&&fo(c,Ke(d,3))}function fae(c,d){return c&&Yy(c,Ke(d,3))}function hae(c){return c==null?[]:kh(c,NA(c))}function pae(c){return c==null?[]:kh(c,xn(c))}function Sw(c,d,m){var C=c==null?A:Vs(c,d);return C===A?m:C}function mae(c,d){return c!=null&&bT(c,d,Hre)}function Qw(c,d){return c!=null&&bT(c,d,Rre)}var gae=hT(function(c,d,m){d!=null&&typeof d.toString!="function"&&(d=dh.call(d)),c[d]=m},Uw(Tn)),Bae=hT(function(c,d,m){d!=null&&typeof d.toString!="function"&&(d=dh.call(d)),xt.call(c,d)?c[d].push(m):c[d]=[m]},Ke),yae=lt($c);function NA(c){return In(c)?Tx(c):qy(c)}function xn(c){return In(c)?Tx(c,!0):Xre(c)}function wae(c,d){var m={};return d=Ke(d,3),fo(c,function(C,E,T){Ro(m,d(C,E,T),C)}),m}function Cae(c,d){var m={};return d=Ke(d,3),fo(c,function(C,E,T){Ro(m,E,d(C,E,T))}),m}var bae=tl(function(c,d,m){Sh(c,d,m)}),n_=tl(function(c,d,m,C){Sh(c,d,m,C)}),vae=Vo(function(c,d){var m={};if(c==null)return m;var C=!1;d=Jt(d,function(T){return T=Gi(T,c),C||(C=T.length>1),T}),ho(c,dw(c),m),C&&(m=fr(m,h|p|g,goe));for(var E=d.length;E--;)rw(m,d[E]);return m});function Eae(c,d){return r_(c,Ph(Ke(d)))}var kae=Vo(function(c,d){return c==null?{}:qre(c,d)});function r_(c,d){if(c==null)return{};var m=Jt(dw(c),function(C){return[C]});return d=Ke(d),Jx(c,m,function(C,E){return d(C,E[0])})}function Sae(c,d,m){d=Gi(d,c);var C=-1,E=d.length;for(E||(E=1,c=A);++C<E;){var T=c==null?A:c[po(d[C])];T===A&&(C=E,T=m),c=Ko(T)?T.call(c):T}return c}function Qae(c,d,m){return c==null?c:Gc(c,d,m)}function Fae(c,d,m,C){return C=typeof C=="function"?C:A,c==null?c:Gc(c,d,m,C)}var o_=gT(NA),i_=gT(xn);function Uae(c,d,m){var C=tt(c),E=C||zi(c)||rl(c);if(d=Ke(d,4),m==null){var T=c&&c.constructor;E?m=C?new T:[]:Zt(c)?m=Ko(T)?el(ph(c)):{}:m={}}return(E?cr:fo)(c,function(L,V,Y){return d(m,L,V,Y)}),m}function Iae(c,d){return c==null?!0:rw(c,d)}function xae(c,d,m){return c==null?c:eT(c,d,sw(m))}function Tae(c,d,m,C){return C=typeof C=="function"?C:A,c==null?c:eT(c,d,sw(m),C)}function ol(c){return c==null?[]:Hy(c,NA(c))}function _ae(c){return c==null?[]:Hy(c,xn(c))}function Dae(c,d,m){return m===A&&(m=d,d=A),m!==A&&(m=mr(m),m=m===m?m:0),d!==A&&(d=mr(d),d=d===d?d:0),Ps(mr(c),d,m)}function Lae(c,d,m){return d=Go(d),m===A?(m=d,d=0):m=Go(m),c=mr(c),Pre(c,d,m)}function Oae(c,d,m){if(m&&typeof m!="boolean"&&Bn(c,d,m)&&(d=m=A),m===A&&(typeof d=="boolean"?(m=d,d=A):typeof c=="boolean"&&(m=c,c=A)),c===A&&d===A?(c=0,d=1):(c=Go(c),d===A?(d=c,c=0):d=Go(d)),c>d){var C=c;c=d,d=C}if(m||c%1||d%1){var E=Ix();return An(c+E*(d-c+hne("1e-"+((E+"").length-1))),d)}return tw(c,d)}var Mae=Al(function(c,d,m){return d=d.toLowerCase(),c+(m?s_(d):d)});function s_(c){return Fw(St(c).toLowerCase())}function a_(c){return c=St(c),c&&c.replace(HAe,Qne).replace(rne,"")}function Nae(c,d,m){c=St(c),d=Wn(d);var C=c.length;m=m===A?C:Ps(ot(m),0,C);var E=m;return m-=d.length,m>=0&&c.slice(m,E)==d}function Hae(c){return c=St(c),c&&He.test(c)?c.replace(he,Fne):c}function Rae(c){return c=St(c),c&&kAe.test(c)?c.replace(vy,"\\$&"):c}var Pae=Al(function(c,d,m){return c+(m?"-":"")+d.toLowerCase()}),Vae=Al(function(c,d,m){return c+(m?" ":"")+d.toLowerCase()}),$ae=uT("toLowerCase");function Kae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;if(!d||C>=d)return c;var E=(d-C)/2;return Th(yh(E),m)+c+Th(Bh(E),m)}function Gae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;return d&&C<d?c+Th(d-C,m):c}function Wae(c,d,m){c=St(c),d=ot(d);var C=d?Ja(c):0;return d&&C<d?Th(d-C,m)+c:c}function zae(c,d,m){return m||d==null?d=0:d&&(d=+d),ere(St(c).replace(Ey,""),d||0)}function Yae(c,d,m){return(m?Bn(c,d,m):d===A)?d=1:d=ot(d),Aw(St(c),d)}function Jae(){var c=arguments,d=St(c[0]);return c.length<3?d:d.replace(c[1],c[2])}var Xae=Al(function(c,d,m){return c+(m?"_":"")+d.toLowerCase()});function jae(c,d,m){return m&&typeof m!="number"&&Bn(c,d,m)&&(d=m=A),m=m===A?j:m>>>0,m?(c=St(c),c&&(typeof d=="string"||d!=null&&!kw(d))&&(d=Wn(d),!d&&Ya(c))?Wi(Mr(c),0,m):c.split(d,m)):[]}var qae=Al(function(c,d,m){return c+(m?" ":"")+Fw(d)});function Zae(c,d,m){return c=St(c),m=m==null?0:Ps(ot(m),0,c.length),d=Wn(d),c.slice(m,m+d.length)==d}function ele(c,d,m){var C=U.templateSettings;m&&Bn(c,d,m)&&(d=A),c=St(c),d=Kh({},d,C,BT);var E=Kh({},d.imports,C.imports,BT),T=NA(E),L=Hy(E,T),V,Y,de=0,pe=d.interpolate||nh,Be="__p += '",Ie=Py((d.escape||nh).source+"|"+pe.source+"|"+(pe===co?_Ae:nh).source+"|"+(d.evaluate||nh).source+"|$","g"),Ne="//# sourceURL="+(xt.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++lne+"]")+`
127
127
  `;c.replace(Ie,function(We,ct,gt,Yn,yn,Jn){return gt||(gt=Yn),Be+=c.slice(de,Jn).replace(RAe,Une),ct&&(V=!0,Be+=`' +
128
128
  __e(`+ct+`) +
129
129
  '`),yn&&(Y=!0,Be+=`';
@@ -140,7 +140,7 @@ __p += '`),gt&&(Be+=`' +
140
140
  function print() { __p += __j.call(arguments, '') }
141
141
  `:`;
142
142
  `)+Be+`return __p
143
- }`;var st=c_(function(){return vt(T,Ne+"return "+Be).apply(A,L)});if(st.source=Be,Ew(st))throw st;return st}function tle(c){return St(c).toLowerCase()}function Ale(c){return St(c).toUpperCase()}function nle(c,d,m){if(c=St(c),c&&(m||d===A))return yx(c);if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=Mr(d),T=wx(C,E),L=Cx(C,E)+1;return Wi(C,T,L).join("")}function rle(c,d,m){if(c=St(c),c&&(m||d===A))return c.slice(0,vx(c)+1);if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=Cx(C,Mr(d))+1;return Wi(C,0,E).join("")}function ole(c,d,m){if(c=St(c),c&&(m||d===A))return c.replace(Ey,"");if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=wx(C,Mr(d));return Wi(C,E).join("")}function ile(c,d){var m=P,C=ie;if(qt(d)){var E="separator"in d?d.separator:E;m="length"in d?ot(d.length):m,C="omission"in d?Wn(d.omission):C}c=St(c);var T=c.length;if(Ya(c)){var L=Mr(c);T=L.length}if(m>=T)return c;var V=m-Ja(C);if(V<1)return C;var Y=L?Wi(L,0,V).join(""):c.slice(0,V);if(E===A)return Y+C;if(L&&(V+=Y.length-V),kw(E)){if(c.slice(V).search(E)){var de,pe=Y;for(E.global||(E=Py(E.source,St(PI.exec(E))+"g")),E.lastIndex=0;de=E.exec(pe);)var Be=de.index;Y=Y.slice(0,Be===A?V:Be)}}else if(c.indexOf(Wn(E),V)!=V){var Ie=Y.lastIndexOf(E);Ie>-1&&(Y=Y.slice(0,Ie))}return Y+C}function sle(c){return c=St(c),c&&xe.test(c)?c.replace(At,One):c}var ale=Al(function(c,d,m){return c+(m?" ":"")+d.toUpperCase()}),Fw=uT("toUpperCase");function l_(c,d,m){return c=St(c),d=m?A:d,d===A?xne(c)?Hne(c):bne(c):c.match(d)||[]}var c_=lt(function(c,d){try{return Kn(c,A,d)}catch(m){return Ew(m)?m:new et(m)}}),lle=Vo(function(c,d){return cr(d,function(m){m=po(m),Ro(c,m,bw(c[m],c))}),c});function cle(c){var d=c==null?0:c.length,m=Ke();return c=d?Yt(c,function(C){if(typeof C[1]!="function")throw new ur(i);return[m(C[0]),C[1]]}):[],lt(function(C){for(var E=-1;++E<d;){var T=c[E];if(Kn(T[0],this,C))return Kn(T[1],this,C)}})}function ule(c){return Ore(fr(c,h))}function Uw(c){return function(){return c}}function dle(c,d){return c==null||c!==c?d:c}var fle=fT(),hle=fT(!0);function Tn(c){return c}function Iw(c){return $x(typeof c=="function"?c:fr(c,h))}function ple(c){return Gx(fr(c,h))}function mle(c,d){return Wx(c,fr(d,h))}var gle=lt(function(c,d){return function(m){return $c(m,c,d)}}),Ble=lt(function(c,d){return function(m){return $c(c,m,d)}});function xw(c,d,m){var C=NA(d),E=kh(d,C);m==null&&!(qt(d)&&(E.length||!C.length))&&(m=d,d=c,c=this,E=kh(d,NA(d)));var T=!(qt(m)&&"chain"in m)||!!m.chain,L=Ko(c);return cr(E,function(V){var Y=d[V];c[V]=Y,L&&(c.prototype[V]=function(){var de=this.__chain__;if(T||de){var pe=c(this.__wrapped__),Be=pe.__actions__=Un(this.__actions__);return Be.push({func:Y,args:arguments,thisArg:c}),pe.__chain__=de,pe}return Y.apply(c,Ri([this.value()],arguments))})}),c}function yle(){return GA._===this&&(GA._=Gne),this}function Tw(){}function wle(c){return c=ot(c),lt(function(d){return zx(d,c)})}var Cle=lw(Yt),ble=lw(hx),vle=lw(Dy);function u_(c){return mw(c)?Ly(po(c)):Zre(c)}function Ele(c){return function(d){return c==null?A:Vs(c,d)}}var kle=pT(),Sle=pT(!0);function _w(){return[]}function Dw(){return!1}function Qle(){return{}}function Fle(){return""}function Ule(){return!0}function Ile(c,d){if(c=ot(c),c<1||c>ee)return[];var m=j,C=An(c,j);d=Ke(d),c-=j;for(var E=Ny(C,d);++m<c;)d(m);return E}function xle(c){return tt(c)?Yt(c,po):zn(c)?[c]:Un(xT(St(c)))}function Tle(c){var d=++$ne;return St(c)+d}var _le=xh(function(c,d){return c+d},0),Dle=cw("ceil"),Lle=xh(function(c,d){return c/d},1),Ole=cw("floor");function Mle(c){return c&&c.length?Eh(c,Tn,Jy):A}function Nle(c,d){return c&&c.length?Eh(c,Ke(d,2),Jy):A}function Hle(c){return gx(c,Tn)}function Rle(c,d){return gx(c,Ke(d,2))}function Ple(c){return c&&c.length?Eh(c,Tn,Zy):A}function Vle(c,d){return c&&c.length?Eh(c,Ke(d,2),Zy):A}var $le=xh(function(c,d){return c*d},1),Kle=cw("round"),Gle=xh(function(c,d){return c-d},0);function Wle(c){return c&&c.length?My(c,Tn):0}function zle(c,d){return c&&c.length?My(c,Ke(d,2)):0}return U.after=pse,U.ary=VT,U.assign=Aae,U.assignIn=A_,U.assignInWith=Kh,U.assignWith=nae,U.at=rae,U.before=$T,U.bind=bw,U.bindAll=lle,U.bindKey=KT,U.castArray=Qse,U.chain=HT,U.chunk=Ooe,U.compact=Moe,U.concat=Noe,U.cond=cle,U.conforms=ule,U.constant=Uw,U.countBy=Wie,U.create=oae,U.curry=GT,U.curryRight=WT,U.debounce=zT,U.defaults=iae,U.defaultsDeep=sae,U.defer=mse,U.delay=gse,U.difference=Hoe,U.differenceBy=Roe,U.differenceWith=Poe,U.drop=Voe,U.dropRight=$oe,U.dropRightWhile=Koe,U.dropWhile=Goe,U.fill=Woe,U.filter=Yie,U.flatMap=jie,U.flatMapDeep=qie,U.flatMapDepth=Zie,U.flatten=LT,U.flattenDeep=zoe,U.flattenDepth=Yoe,U.flip=Bse,U.flow=fle,U.flowRight=hle,U.fromPairs=Joe,U.functions=hae,U.functionsIn=pae,U.groupBy=ese,U.initial=joe,U.intersection=qoe,U.intersectionBy=Zoe,U.intersectionWith=eie,U.invert=gae,U.invertBy=Bae,U.invokeMap=Ase,U.iteratee=Iw,U.keyBy=nse,U.keys=NA,U.keysIn=xn,U.map=Nh,U.mapKeys=wae,U.mapValues=Cae,U.matches=ple,U.matchesProperty=mle,U.memoize=Rh,U.merge=bae,U.mergeWith=n_,U.method=gle,U.methodOf=Ble,U.mixin=xw,U.negate=Ph,U.nthArg=wle,U.omit=vae,U.omitBy=Eae,U.once=yse,U.orderBy=rse,U.over=Cle,U.overArgs=wse,U.overEvery=ble,U.overSome=vle,U.partial=vw,U.partialRight=YT,U.partition=ose,U.pick=kae,U.pickBy=r_,U.property=u_,U.propertyOf=Ele,U.pull=rie,U.pullAll=MT,U.pullAllBy=oie,U.pullAllWith=iie,U.pullAt=sie,U.range=kle,U.rangeRight=Sle,U.rearg=Cse,U.reject=ase,U.remove=aie,U.rest=bse,U.reverse=ww,U.sampleSize=cse,U.set=Qae,U.setWith=Fae,U.shuffle=use,U.slice=lie,U.sortBy=hse,U.sortedUniq=mie,U.sortedUniqBy=gie,U.split=jae,U.spread=vse,U.tail=Bie,U.take=yie,U.takeRight=wie,U.takeRightWhile=Cie,U.takeWhile=bie,U.tap=Mie,U.throttle=Ese,U.thru=Mh,U.toArray=ZT,U.toPairs=o_,U.toPairsIn=i_,U.toPath=xle,U.toPlainObject=t_,U.transform=Uae,U.unary=kse,U.union=vie,U.unionBy=Eie,U.unionWith=kie,U.uniq=Sie,U.uniqBy=Qie,U.uniqWith=Fie,U.unset=Iae,U.unzip=Cw,U.unzipWith=NT,U.update=xae,U.updateWith=Tae,U.values=ol,U.valuesIn=_ae,U.without=Uie,U.words=l_,U.wrap=Sse,U.xor=Iie,U.xorBy=xie,U.xorWith=Tie,U.zip=_ie,U.zipObject=Die,U.zipObjectDeep=Lie,U.zipWith=Oie,U.entries=o_,U.entriesIn=i_,U.extend=A_,U.extendWith=Kh,xw(U,U),U.add=_le,U.attempt=c_,U.camelCase=Mae,U.capitalize=s_,U.ceil=Dle,U.clamp=Dae,U.clone=Fse,U.cloneDeep=Ise,U.cloneDeepWith=xse,U.cloneWith=Use,U.conformsTo=Tse,U.deburr=a_,U.defaultTo=dle,U.divide=Lle,U.endsWith=Nae,U.eq=Hr,U.escape=Hae,U.escapeRegExp=Rae,U.every=zie,U.find=Jie,U.findIndex=_T,U.findKey=aae,U.findLast=Xie,U.findLastIndex=DT,U.findLastKey=lae,U.floor=Ole,U.forEach=RT,U.forEachRight=PT,U.forIn=cae,U.forInRight=uae,U.forOwn=dae,U.forOwnRight=fae,U.get=Sw,U.gt=_se,U.gte=Dse,U.has=mae,U.hasIn=Qw,U.head=OT,U.identity=Tn,U.includes=tse,U.indexOf=Xoe,U.inRange=Lae,U.invoke=yae,U.isArguments=Gs,U.isArray=tt,U.isArrayBuffer=Lse,U.isArrayLike=In,U.isArrayLikeObject=mA,U.isBoolean=Ose,U.isBuffer=zi,U.isDate=Mse,U.isElement=Nse,U.isEmpty=Hse,U.isEqual=Rse,U.isEqualWith=Pse,U.isError=Ew,U.isFinite=Vse,U.isFunction=Ko,U.isInteger=JT,U.isLength=Vh,U.isMap=XT,U.isMatch=$se,U.isMatchWith=Kse,U.isNaN=Gse,U.isNative=Wse,U.isNil=Yse,U.isNull=zse,U.isNumber=jT,U.isObject=qt,U.isObjectLike=oA,U.isPlainObject=Jc,U.isRegExp=kw,U.isSafeInteger=Jse,U.isSet=qT,U.isString=$h,U.isSymbol=zn,U.isTypedArray=rl,U.isUndefined=Xse,U.isWeakMap=jse,U.isWeakSet=qse,U.join=tie,U.kebabCase=Pae,U.last=pr,U.lastIndexOf=Aie,U.lowerCase=Vae,U.lowerFirst=$ae,U.lt=Zse,U.lte=eae,U.max=Mle,U.maxBy=Nle,U.mean=Hle,U.meanBy=Rle,U.min=Ple,U.minBy=Vle,U.stubArray=_w,U.stubFalse=Dw,U.stubObject=Qle,U.stubString=Fle,U.stubTrue=Ule,U.multiply=$le,U.nth=nie,U.noConflict=yle,U.noop=Tw,U.now=Hh,U.pad=Kae,U.padEnd=Gae,U.padStart=Wae,U.parseInt=zae,U.random=Oae,U.reduce=ise,U.reduceRight=sse,U.repeat=Yae,U.replace=Jae,U.result=Sae,U.round=Kle,U.runInContext=z,U.sample=lse,U.size=dse,U.snakeCase=Xae,U.some=fse,U.sortedIndex=cie,U.sortedIndexBy=uie,U.sortedIndexOf=die,U.sortedLastIndex=fie,U.sortedLastIndexBy=hie,U.sortedLastIndexOf=pie,U.startCase=qae,U.startsWith=Zae,U.subtract=Gle,U.sum=Wle,U.sumBy=zle,U.template=ele,U.times=Ile,U.toFinite=Go,U.toInteger=ot,U.toLength=e_,U.toLower=tle,U.toNumber=mr,U.toSafeInteger=tae,U.toString=St,U.toUpper=Ale,U.trim=nle,U.trimEnd=rle,U.trimStart=ole,U.truncate=ile,U.unescape=sle,U.uniqueId=Tle,U.upperCase=ale,U.upperFirst=Fw,U.each=RT,U.eachRight=PT,U.first=OT,xw(U,(function(){var c={};return fo(U,function(d,m){xt.call(U.prototype,m)||(c[m]=d)}),c})(),{chain:!1}),U.VERSION=n,cr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){U[c].placeholder=U}),cr(["drop","take"],function(c,d){pt.prototype[c]=function(m){m=m===A?1:QA(ot(m),0);var C=this.__filtered__&&!d?new pt(this):this.clone();return C.__filtered__?C.__takeCount__=An(m,C.__takeCount__):C.__views__.push({size:An(m,j),type:c+(C.__dir__<0?"Right":"")}),C},pt.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),cr(["filter","map","takeWhile"],function(c,d){var m=d+1,C=m==H||m==$;pt.prototype[c]=function(E){var T=this.clone();return T.__iteratees__.push({iteratee:Ke(E,3),type:m}),T.__filtered__=T.__filtered__||C,T}}),cr(["head","last"],function(c,d){var m="take"+(d?"Right":"");pt.prototype[c]=function(){return this[m](1).value()[0]}}),cr(["initial","tail"],function(c,d){var m="drop"+(d?"":"Right");pt.prototype[c]=function(){return this.__filtered__?new pt(this):this[m](1)}}),pt.prototype.compact=function(){return this.filter(Tn)},pt.prototype.find=function(c){return this.filter(c).head()},pt.prototype.findLast=function(c){return this.reverse().find(c)},pt.prototype.invokeMap=lt(function(c,d){return typeof c=="function"?new pt(this):this.map(function(m){return $c(m,c,d)})}),pt.prototype.reject=function(c){return this.filter(Ph(Ke(c)))},pt.prototype.slice=function(c,d){c=ot(c);var m=this;return m.__filtered__&&(c>0||d<0)?new pt(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),d!==A&&(d=ot(d),m=d<0?m.dropRight(-d):m.take(d-c)),m)},pt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},pt.prototype.toArray=function(){return this.take(j)},fo(pt.prototype,function(c,d){var m=/^(?:filter|find|map|reject)|While$/.test(d),C=/^(?:head|last)$/.test(d),E=U[C?"take"+(d=="last"?"Right":""):d],T=C||/^find/.test(d);E&&(U.prototype[d]=function(){var L=this.__wrapped__,V=C?[1]:arguments,Y=L instanceof pt,de=V[0],pe=Y||tt(L),Be=function(ct){var gt=E.apply(U,Ri([ct],V));return C&&Ie?gt[0]:gt};pe&&m&&typeof de=="function"&&de.length!=1&&(Y=pe=!1);var Ie=this.__chain__,Ne=!!this.__actions__.length,Ge=T&&!Ie,st=Y&&!Ne;if(!T&&pe){L=st?L:new pt(this);var We=c.apply(L,V);return We.__actions__.push({func:Mh,args:[Be],thisArg:A}),new dr(We,Ie)}return Ge&&st?c.apply(this,V):(We=this.thru(Be),Ge?C?We.value()[0]:We.value():We)})}),cr(["pop","push","shift","sort","splice","unshift"],function(c){var d=lh[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",C=/^(?:pop|shift)$/.test(c);U.prototype[c]=function(){var E=arguments;if(C&&!this.__chain__){var T=this.value();return d.apply(tt(T)?T:[],E)}return this[m](function(L){return d.apply(tt(L)?L:[],E)})}}),fo(pt.prototype,function(c,d){var m=U[d];if(m){var C=m.name+"";xt.call(Za,C)||(Za[C]=[]),Za[C].push({name:d,func:m})}}),Za[Ih(A,w).name]=[{name:"wrapper",func:A}],pt.prototype.clone=sre,pt.prototype.reverse=are,pt.prototype.value=lre,U.prototype.at=Nie,U.prototype.chain=Hie,U.prototype.commit=Rie,U.prototype.next=Pie,U.prototype.plant=$ie,U.prototype.reverse=Kie,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=Gie,U.prototype.first=U.prototype.head,Oc&&(U.prototype[Oc]=Vie),U}),Xa=Rne();Ms?((Ms.exports=Xa)._=Xa,Iy._=Xa):GA._=Xa}).call(CG)})(Ac,Ac.exports)),Ac.exports}var $1=bG();const vG="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==",EG={class:"camera__preview"},kG={key:0,class:"camera__bg-notification"},SG=["innerHTML"],QG=["width","height"],FG={key:1,class:"camera__countdown-overlay"},UG=["innerHTML","data-countdown"],IG=["src"],xG={class:"camera__controls"},TG={class:"container"},_G={class:"row"},DG={class:"col"},LG={class:"btn-group"},OG={key:0},MG={key:1},NG={key:0,class:"camera__switch-cam"},HG={key:1,class:"base-camera__devices"},RG={name:"BaseCamera",inheritAttrs:!1};function PG(t){const e=atob(t.split(",")[1]),A=new ArrayBuffer(e.length),n=new Uint8Array(A);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return new Blob([A],{type:"image/png"})}const VG=s.defineComponent({...RG,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:()=>vG},countdown:{type:Number,default:0},ratio:{type:String,default:"4x5"},enableAudio:{type:Boolean,default:!1},enableSelectDevice:{type:Boolean,default:!1},enableCropImage:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:e,emit:A}){const n={"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}},r=t,o=A,i=s.ref(),a=s.ref(),l=s.ref(!1),u=s.ref([]),f=s.ref(),h=s.ref(),p=s.ref(!1),g=s.ref(!1),B=s.ref(0),y=s.ref(0),b=s.ref(),w=s.computed(()=>u.value.filter(ee=>ee.kind==="videoinput")),v=s.computed(()=>u.value.filter(ee=>ee.kind==="audioinput")),S=s.computed({get(){return f.value&&f.value.deviceId},set(ee){f.value=w.value.find(K=>K.deviceId===ee)}}),F=s.computed({get(){return h.value&&h.value.deviceId},set(ee){h.value=v.value.find(K=>K.deviceId===ee)}}),I=s.computed(()=>{const ee=f.value&&w.value.findIndex(K=>K.deviceId===f.value.deviceId);return r.enableMirrorCamera&&ee===0?"mirror-cam":""}),Q=s.computed(()=>{const ee=f.value&&u.value.findIndex(K=>K.deviceId===f.value.deviceId);return I.value?`${I.value} mirror-device-${ee}`:""});function x(){B.value=n[r.ratio]?n[r.ratio].width:i.value.parentElement&&i.value.parentElement.clientWidth,y.value=n[r.ratio]?n[r.ratio].height:i.value.parentElement&&i.value.parentElement.clientHeight}const M=$1.debounce(()=>{x()},300,{trailing:!0,leading:!1});async function O(){const ee={audio:r.enableAudio&&{...h.value?{deviceId:h.value.deviceId}:{}},video:{...f.value?{deviceId:f.value.deviceId}:{},width:{ideal:1024},height:{ideal:1024}}};return navigator.mediaDevices.getUserMedia(ee).catch(K=>{console.error(K,"navigator.mediaDevices.getUserMedia: failed")})}function P(){i.value&&i.value.srcObject&&i.value.srcObject.getTracks().forEach(K=>{K.stop()})}async function ie(){return i.value.srcObject=await O(),u.value=await navigator.mediaDevices.enumerateDevices(),{stream:i.value.srcObject,devices:u.value}}function ae(){p.value?(p.value=!1,g.value=!1,P()):(p.value=!0,ie())}function ue(){u.value.length>1&&(P(),f.value=f.value&&f.value.deviceId===w.value[0].deviceId?w.value[w.value.length-1]:w.value[0],ie())}async function H(ee,K){P(),ee&&(!K||ee.deviceId!==K.deviceId)&&await ie()}s.watch(()=>f.value,H),s.watch(()=>h.value,H);function G(){r.countdown?(b.value=b.value?b.value-1:r.countdown,b.value?setTimeout(G,1e3):$()):$()}e({onCapture:G,camera:i.value});function $(){g.value=!0;const ee=a.value.getContext("2d"),K=i.value,ce=K&&K.srcObject&&K.srcObject.getTracks(),{aspectRatio:j,width:Qe,height:R}=ce.length&&ce[0].getSettings(),J=n[r.ratio],Ae=J.width/J.height;let oe=J.width,k=J.height;r.enableCropImage?j>Ae?oe=k*j:j<Ae&&(k=oe/j):(oe=Qe,k=R,a.value.width=oe,a.value.height=k);const X=I.value?-1:1;ee.save(),ee.scale(X,1),ee.drawImage(K,oe>a.value.width?(a.value.width-oe)/2:0,k>a.value.height?(a.value.height-k)/2:0,oe*X,k),ee.restore();const Se=a.value.toDataURL("image/png");te(Se)}function te(ee){const K=PG(ee);o("update:modelValue",{name:`cam-pic-${new Date().toISOString()}`,id:`cam-pic-${new Date().toISOString()}`,blob:K,size:K.size})}return s.onMounted(async()=>{P(),await ie(),f.value=w.value[0],r.enableAudio&&(h.value=v.value[0]),navigator.mediaDevices.addEventListener("devicechange",async ee=>{await ie()}),r.defaultRearCamera&&ue(),ae(),window.addEventListener("resize",M),x(),await s.nextTick(),l.value=!0}),s.onBeforeUnmount(()=>{p.value=!1,g.value=!1,P(),window.removeEventListener("resize",M)}),(ee,K)=>{const ce=s.resolveComponent("loading-spinner"),j=s.resolveComponent("svg-icon"),Qe=s.resolveComponent("input-dropdown");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["camera",Q.value])},[s.createElementVNode("div",EG,[l.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",kG,[s.createVNode(ce,{color:"#000"},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass("d-block text-center"),innerHTML:ee.$t("camera.waitForCameraNotification")},null,8,SG)]),_:1})])),s.withDirectives(s.createElementVNode("video",{ref_key:"camera",ref:i,class:s.normalizeClass(["camera__video",`aspect-ratio--${r.ratio}`]),autoplay:"",playsinline:""},null,2),[[s.vShow,l.value]]),s.withDirectives(s.createElementVNode("canvas",{ref_key:"canvas",ref:a,class:"camera__canvas",width:B.value,height:y.value},null,8,QG),[[s.vShow,g.value]]),b.value?(s.openBlock(),s.createElementBlock("div",FG,[(s.openBlock(),s.createElementBlock("p",{class:"countdown",key:b.value,innerHTML:b.value,"data-countdown":b.value},null,8,UG))])):s.createCommentVNode("",!0),t.enableGuide&&p.value&&l.value?(s.openBlock(),s.createElementBlock("img",{key:2,class:"camera__guide",src:t.guideSrc},null,8,IG)):s.createCommentVNode("",!0)]),s.createElementVNode("div",xG,[s.createElementVNode("div",TG,[s.createElementVNode("div",_G,[s.createElementVNode("div",DG,[s.createElementVNode("div",LG,[s.createElementVNode("button",{type:"button",class:"camera__toggle btn btn-primary",onClick:ae},[p.value?(s.openBlock(),s.createElementBlock("span",MG,s.toDisplayString(ee.$t("common.pause")),1)):(s.openBlock(),s.createElementBlock("span",OG,s.toDisplayString(ee.$t("common.play")),1))]),s.createElementVNode("button",{type:"button",class:"camera__capture btn btn-primary",onClick:G},s.toDisplayString(ee.$t("camera.capture")),1)])])])])]),t.enableSwitchCamera&&w.value&&w.value.length>1?(s.openBlock(),s.createElementBlock("div",NG,[s.createElementVNode("button",{class:"btn",onClick:s.withModifiers(ue,["prevent"])},[s.createVNode(j,{symbol:"switch-camera"})])])):s.createCommentVNode("",!0),t.enableSelectDevice?(s.openBlock(),s.createElementBlock("div",HG,[v.value.length&&h.value?(s.openBlock(),s.createBlock(Qe,{key:0,modelValue:F.value,"onUpdate:modelValue":K[0]||(K[0]=R=>F.value=R),options:v.value.map((R,J)=>({text:R.label||`Microphone ${J+1}`,value:R.deviceId}))},null,8,["modelValue","options"])):s.createCommentVNode("",!0),w.value.length?(s.openBlock(),s.createBlock(Qe,{key:1,modelValue:S.value,"onUpdate:modelValue":K[1]||(K[1]=R=>S.value=R),options:w.value.map((R,J)=>({text:R.label||`Camera ${J+1}`,value:R.deviceId}))},null,8,["modelValue","options"])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],2)}}}),$G=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,KG=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,GG=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function WG(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){zG(t);return}return e}function zG(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function YG(t,e={}){if(typeof t!="string")return t;const A=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return A.slice(1,-1);if(A.length<=9){const n=A.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!GG.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if($G.test(t)||KG.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,WG)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const JG=/#/g,XG=/&/g,jG=/\//g,qG=/=/g,xg=/\+/g,ZG=/%5e/gi,eW=/%60/gi,tW=/%7c/gi,AW=/%20/gi;function nW(t){return encodeURI(""+t).replace(tW,"|")}function Tg(t){return nW(typeof t=="string"?t:JSON.stringify(t)).replace(xg,"%2B").replace(AW,"+").replace(JG,"%23").replace(XG,"%26").replace(eW,"`").replace(ZG,"^").replace(jG,"%2F")}function _g(t){return Tg(t).replace(qG,"%3D")}function K1(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function rW(t){return K1(t.replace(xg," "))}function oW(t){return K1(t.replace(xg," "))}function iW(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const A of t.split("&")){const n=A.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const r=rW(n[1]);if(r==="__proto__"||r==="constructor")continue;const o=oW(n[2]||"");e[r]===void 0?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}return e}function sW(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(A=>`${_g(t)}=${Tg(A)}`).join("&"):`${_g(t)}=${Tg(e)}`:_g(t)}function aW(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>sW(e,t[e])).filter(Boolean).join("&")}const lW=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,cW=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,uW=/^([/\\]\s*){2,}[^/\\]/,dW=/^\.?\//;function G1(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?lW.test(t):cW.test(t)||(e.acceptRelative?uW.test(t):!1)}function fW(t="",e){return t.endsWith("/")}function hW(t="",e){return(fW(t)?t.slice(0,-1):t)||"/"}function pW(t="",e){return t.endsWith("/")?t:t+"/"}function mW(t,e){if(BW(e)||G1(t))return t;const A=hW(e);return t.startsWith(A)?t:wW(A,t)}function gW(t,e){const A=CW(t),n={...iW(A.search),...e};return A.search=aW(n),bW(A)}function BW(t){return!t||t==="/"}function yW(t){return t&&t!=="/"}function wW(t,...e){let A=t||"";for(const n of e.filter(r=>yW(r)))if(A){const r=n.replace(dW,"");A=pW(A)+r}else A=n;return A}const W1=Symbol.for("ufo:protocolRelative");function CW(t="",e){const A=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(A){const[,h,p=""]=A;return{protocol:h.toLowerCase(),pathname:p,href:h+p,auth:"",host:"",search:"",hash:""}}if(!G1(t,{acceptRelative:!0}))return z1(t);const[,n="",r,o=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,i="",a=""]=o.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:u,hash:f}=z1(a);return{protocol:n.toLowerCase(),auth:r?r.slice(0,Math.max(0,r.length-1)):"",host:i,pathname:l,search:u,hash:f,[W1]:!n}}function z1(t=""){const[e="",A="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:A,hash:n}}function bW(t){const e=t.pathname||"",A=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",r=t.auth?t.auth+"@":"",o=t.host||"";return(t.protocol||t[W1]?(t.protocol||"")+"//":"")+r+o+e+A+n}class vW extends Error{constructor(e,A){super(e,A),this.name="FetchError",A?.cause&&!this.cause&&(this.cause=A.cause)}}function EW(t){const e=t.error?.message||t.error?.toString()||"",A=t.request?.method||t.options?.method||"GET",n=t.request?.url||String(t.request)||"/",r=`[${A}] ${JSON.stringify(n)}`,o=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",i=`${r}: ${o}${e?` ${e}`:""}`,a=new vW(i,t.error?{cause:t.error}:void 0);for(const l of["request","options","response"])Object.defineProperty(a,l,{get(){return t[l]}});for(const[l,u]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,l,{get(){return t.response&&t.response[u]}});return a}const kW=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Y1(t="GET"){return kW.has(t.toUpperCase())}function SW(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const QW=new Set(["image/svg","application/xml","application/xhtml","application/html"]),FW=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function UW(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return FW.test(e)?"json":QW.has(e)||e.startsWith("text/")?"text":"blob"}function IW(t,e,A,n){const r=xW(e?.headers??t?.headers,A?.headers,n);let o;return(A?.query||A?.params||e?.params||e?.query)&&(o={...A?.params,...A?.query,...e?.params,...e?.query}),{...A,...e,query:o,params:o,headers:r}}function xW(t,e,A){if(!e)return new A(t);const n=new A(e);if(t)for(const[r,o]of Symbol.iterator in t||Array.isArray(t)?t:new A(t))n.set(r,o);return n}async function Nd(t,e){if(e)if(Array.isArray(e))for(const A of e)await A(t);else await e(t)}const TW=new Set([408,409,425,429,500,502,503,504]),_W=new Set([101,204,205,304]);function J1(t={}){const{fetch:e=globalThis.fetch,Headers:A=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function r(a){const l=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!l){let f;typeof a.options.retry=="number"?f=a.options.retry:f=Y1(a.options.method)?0:1;const h=a.response&&a.response.status||500;if(f>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(h):TW.has(h))){const p=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return p>0&&await new Promise(g=>setTimeout(g,p)),o(a.request,{...a.options,retry:f-1})}}const u=EW(a);throw Error.captureStackTrace&&Error.captureStackTrace(u,o),u}const o=async function(l,u={}){const f={request:l,options:IW(l,u,t.defaults,A),response:void 0,error:void 0};f.options.method&&(f.options.method=f.options.method.toUpperCase()),f.options.onRequest&&await Nd(f,f.options.onRequest),typeof f.request=="string"&&(f.options.baseURL&&(f.request=mW(f.request,f.options.baseURL)),f.options.query&&(f.request=gW(f.request,f.options.query),delete f.options.query),"query"in f.options&&delete f.options.query,"params"in f.options&&delete f.options.params),f.options.body&&Y1(f.options.method)&&(SW(f.options.body)?(f.options.body=typeof f.options.body=="string"?f.options.body:JSON.stringify(f.options.body),f.options.headers=new A(f.options.headers||{}),f.options.headers.has("content-type")||f.options.headers.set("content-type","application/json"),f.options.headers.has("accept")||f.options.headers.set("accept","application/json")):("pipeTo"in f.options.body&&typeof f.options.body.pipeTo=="function"||typeof f.options.body.pipe=="function")&&("duplex"in f.options||(f.options.duplex="half")));let h;if(!f.options.signal&&f.options.timeout){const g=new n;h=setTimeout(()=>{const B=new Error("[TimeoutError]: The operation was aborted due to timeout");B.name="TimeoutError",B.code=23,g.abort(B)},f.options.timeout),f.options.signal=g.signal}try{f.response=await e(f.request,f.options)}catch(g){return f.error=g,f.options.onRequestError&&await Nd(f,f.options.onRequestError),await r(f)}finally{h&&clearTimeout(h)}if((f.response.body||f.response._bodyInit)&&!_W.has(f.response.status)&&f.options.method!=="HEAD"){const g=(f.options.parseResponse?"json":f.options.responseType)||UW(f.response.headers.get("content-type")||"");switch(g){case"json":{const B=await f.response.text(),y=f.options.parseResponse||YG;f.response._data=y(B);break}case"stream":{f.response._data=f.response.body||f.response._bodyInit;break}default:f.response._data=await f.response[g]()}}return f.options.onResponse&&await Nd(f,f.options.onResponse),!f.options.ignoreResponseError&&f.response.status>=400&&f.response.status<600?(f.options.onResponseError&&await Nd(f,f.options.onResponseError),await r(f)):f.response},i=async function(l,u){return(await o(l,u))._data};return i.raw=o,i.native=(...a)=>e(...a),i.create=(a={},l={})=>J1({...t,...l,defaults:{...t.defaults,...l.defaults,...a}}),i}const Hd=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),DW=Hd.fetch?(...t)=>Hd.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),LW=Hd.Headers,OW=Hd.AbortController,MW=J1({fetch:DW,Headers:LW,AbortController:OW}),NW=["src"],HW=["onClick"],RW=["onClick"],PW=["for"],VW=["innerHTML"],$W={key:0,class:"file-upload__loading-spinner"};async function KW(t){return await new Promise(e=>{let A=new FileReader;A.onload=()=>e(A.result),A.readAsDataURL(t)})}const GW=s.defineComponent({__name:"file-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:"Select file"},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,default:"image/*"},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/media"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1}},emits:["update:modelValue","update:src"],setup(t,{emit:e}){const A=t,n=e,r=s.ref([]),o=s.ref([]),i=s.ref(!1),a=s.ref(!1),l=s.computed(()=>A.modelValue.length?A.modelValue:A.src?[{type:"",src:A.src}]:o.value);s.watch(()=>r.value,async B=>{o.value=await Promise.all(B.map(async y=>({src:A.toDataUrl?await KW(y):await f(y),type:y.type})))},{deep:!0}),s.watch(()=>o.value,async B=>{const y=A.multiple?B:B[0];n("update:modelValue",y),A.multiple||n("update:src",B[0]&&B[0].src)},{deep:!0});function u(B){r.value.splice(B,1),(!o.value||!o.value.length)&&n("update:src","")}async function f(B){const y=new FormData;y.append("file",B),i.value=!0;const w=await(A.customFetch||MW)(A.endpoint,{method:"POST",...A.customFetch?{}:{headers:{Accept:"application/json",...A.authToken?{Authorization:`Bearer ${A.authToken}`}:{}}},body:y}).catch(S=>{console.error("Error",S)});return i.value=!1,`${A.baseResponsePath==="/media"&&w.path.endsWith(".svg")?"/api/v1/assets":A.baseResponsePath}/${w.path}`}function h(B){B.preventDefault(),a.value=!0}function p(B){B.preventDefault(),a.value=!1}function g(B){B.preventDefault(),a.value=!1;const y=B.dataTransfer,b=y&&Array.from(y.files||[]);r.value=b||[]}return s.onMounted(()=>{A.dropFiles&&(["dragenter","dragover"].forEach(B=>{document.body.addEventListener(B,h,!1)}),["dragleave","drop"].forEach(B=>{document.body.addEventListener(B,p,!1)}),document.body.addEventListener("drop",g,!1))}),s.onBeforeUnmount(()=>{A.dropFiles&&(["dragenter","dragover"].forEach(B=>{document.body.removeEventListener(B,h,!1)}),["dragleave","drop"].forEach(B=>{document.body.removeEventListener(B,p,!1)}),document.body.removeEventListener("drop",g,!1))}),(B,y)=>{const b=s.resolveComponent("svg-icon"),w=s.resolveComponent("input-file");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["file-upload",{"has-dragging":t.dropFiles,"is-dragging":a.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(v,S)=>(s.openBlock(),s.createElementBlock("div",{key:v.src,class:s.normalizeClass(t.enablePreview?"file-upload__thumbnail":"file-upload__reset")},[t.enablePreview?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("img",{src:`${v.src}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail rounded"},null,8,NW),s.createElementVNode("button",{onClick:s.withModifiers(F=>u(S),["prevent"]),class:"btn btn--close"},[s.createVNode(b,{symbol:"x"})],8,HW)],64)):(s.openBlock(),s.createElementBlock("button",{key:1,onClick:s.withModifiers(F=>u(S),["prevent"]),class:"btn btn--close btn-outline-contrast"},[s.createVNode(b,{symbol:"x"})],8,RW))],2))),128)),s.createVNode(w,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=v=>r.value=v),id:t.id,name:t.name,accept:t.accept,class:"d-none"},null,8,["modelValue","id","name","accept"]),s.createElementVNode("label",{for:t.id,class:"file-upload__label"},[s.renderSlot(B.$slots,"button",{},()=>[s.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:t.label},null,8,VW)]),s.createVNode(s.Transition,{name:"fade"},{default:s.withCtx(()=>[i.value?(s.openBlock(),s.createElementBlock("span",$W,y[1]||(y[1]=[s.createElementVNode("span",{class:"spinner-border",role:"status"},[s.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)]))):s.createCommentVNode("",!0)]),_:1})],8,PW)],2)}}}),WW={class:"upload-group"},zW=["innerHTML"],YW={class:"upload-group__list"},JW={class:"img-container"},XW=["src"],jW=["onClick"],qW={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},X1=s.defineComponent({__name:"upload-group",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/media"},previewWidth:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(""),o=s.computed({get(){return A.modelValue},set(a){n("update:modelValue",a)}});function i(a){o.value.splice(a,1),n("update:modelValue",o.value)}return s.watch(r,(a,l)=>{a&&(n("update:modelValue",[...o.value,a]),r.value="")}),(a,l)=>{const u=s.resolveComponent("svg-icon"),f=s.resolveComponent("file-upload"),h=s.resolveComponent("sortable-list");return s.openBlock(),s.createElementBlock("div",WW,[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,innerHTML:t.label},null,8,zW)):s.createCommentVNode("",!0),s.createElementVNode("div",YW,[s.createVNode(h,{modelValue:o.value,"onUpdate:modelValue":l[1]||(l[1]=p=>o.value=p),vertical:!1,class:"mb-3"},{"list-item":s.withCtx(({item:p,index:g})=>[s.createElementVNode("div",JW,[s.createElementVNode("img",{src:`${p}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail"},null,8,XW),s.createElementVNode("button",{onClick:s.withModifiers(B=>i(g),["prevent"]),class:"btn btn--close"},[s.createVNode(u,{symbol:"x"})],8,jW)])]),"list-append":s.withCtx(()=>[s.createVNode(f,{src:r.value,"onUpdate:src":l[0]||(l[0]=p=>r.value=p),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},{button:s.withCtx(()=>[s.createElementVNode("span",qW,[s.createVNode(u,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path"])]),_:1},8,["modelValue"])])])}}}),ZW={class:"asset-uploader"},e5=["innerHTML"],t5=s.defineComponent({__name:"asset-uploader",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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,default:"image/*"},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,mediaTypeMap:{type:Object,default:()=>({svg:"Svg",png:"Image",jpg:"Image"})},baseResponsePath:{type:String,default:"/media"},previewWidth:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue.map(o=>o.src)},set(o){n("update:modelValue",o.map((i,a)=>({mediaType:A.modelValue[a]&&A.modelValue[a].mediaType||i.includes("data:image")?i.includes("data:image/svg")?"Svg":"Image":A.mediaTypeMap[i.split(".")[1]],src:i,name:A.modelValue[a]&&A.modelValue[a].name||`${A.name}-${a}`,...A.type?{type:A.type}:{}})))}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",ZW,[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,innerHTML:t.label},null,8,e5)):s.createCommentVNode("",!0),s.createVNode(X1,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),endpoint:t.endpoint,"custom-fetch":t.customFetch,"auth-token":t.authToken,disabled:t.disabled,"preview-width":t.previewWidth,"base-response-path":t.baseResponsePath},null,8,["modelValue","endpoint","custom-fetch","auth-token","disabled","preview-width","base-response-path"])]))}}),A5={class:"carousel d-flex"},n5=["onClick"],j1=s.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:e}){const A=e,n=s.ref(),r=s.ref();function o(){n.value.scrollTo({top:0,left:n.value.scrollLeft-n.value.clientWidth>0?n.value.scrollLeft-n.value.clientWidth:0,behavior:"smooth"})}function i(){console.log(n.value.clientWidth,n.value.scrollLeft),n.value.scrollTo({top:0,left:n.value.scrollLeft-n.value.clientWidth<=r.value.clientWidth?n.value.scrollLeft+n.value.clientWidth:r.value.clientWidth,behavior:"smooth"})}function a(l){A("update:modelValue",l)}return(l,u)=>{const f=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("div",A5,[t.navigation?(s.openBlock(),s.createElementBlock("button",{key:0,class:"carousel__control btn btn-link text-light",type:"button",onClick:s.withModifiers(o,["prevent","stop"])},[s.createVNode(f,{symbol:"chevron-left"})])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"viewport",ref:n,class:"carousel__viewport flex-grow-1"},[s.createElementVNode("div",{ref_key:"track",ref:r,class:"carousel__track d-flex justify-center align-items-center"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,(h,p)=>s.renderSlot(l.$slots,"carousel-item",{key:h.src,item:h,index:p},()=>[s.createElementVNode("div",{class:s.normalizeClass(["carousel__item",p===t.modelValue?"selected":""]),onClick:g=>a(p)},s.toDisplayString(h),11,n5)])),128))],512)],512),t.navigation?(s.openBlock(),s.createElementBlock("button",{key:1,class:"carousel__control btn btn-link text-light",type:"button",onClick:s.withModifiers(i,["prevent","stop"])},[s.createVNode(f,{symbol:"chevron-right"})])):s.createCommentVNode("",!0)])}}}),r5={class:"media-thumbnails"},o5=["onClick"],i5={class:"img-container"},s5=s.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:e}){const A=e,n=s.ref(-1);function r(o){n.value=o,A("update:modelValue",o),A("select",o)}return(o,i)=>{const a=s.resolveComponent("base-image");return s.openBlock(),s.createElementBlock("div",r5,[s.createVNode(j1,{items:t.assets},{"carousel-item":s.withCtx(l=>[s.createElementVNode("a",{role:"button",class:s.normalizeClass(["carousel__item media-thumbnails__thumbnail",l.index===t.modelValue||l.index===n.value?"is-active":""]),onClick:u=>r(l.index)},[s.createElementVNode("div",i5,[s.createVNode(a,{src:l.item.thumbnail||l.item.src,class:"img-fluid"},null,8,["src"])])],10,o5)]),_:1},8,["items"])])}}}),a5={class:"progress-steps"},l5={class:"progress-steps__list"},c5={class:"progress-step"},u5=["checked","id","value","disabled","read-only","required","onChange"],d5=["for"],f5=["innerHTML"],h5=["for"],p5=["innerHTML"],m5=s.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:e}){const A=t,n=e;function r(o){n("update:modelValue",o),o>=A.progress&&n("update:progress",o)}return(o,i)=>(s.openBlock(),s.createElementBlock("div",a5,[s.createElementVNode("ul",l5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.steps,(a,l)=>(s.openBlock(),s.createElementBlock("li",{key:l,class:s.normalizeClass(["progress-steps__step",{"progress-steps__step--disabled":l>t.progress+(t.reveal?1:0),"progress-steps__step--active":l===(t.modelValue||0)}])},[s.renderSlot(o.$slots,"step",{},()=>[s.createElementVNode("div",c5,[s.createElementVNode("input",{type:"radio",checked:l<=(t.progress||0),id:`step-${l}`,name:"step",class:"form-check-input",value:a.value,disabled:a.disabled||l>t.progress+(t.reveal?1:0),"read-only":a.readOnly,required:a.required,onChange:u=>r(l)},null,40,u5),s.createElementVNode("label",{for:`step-${l}`},[s.renderSlot(o.$slots,"button",{step:a},()=>[s.createElementVNode("span",{class:"btn rounded-circle",innerHTML:a.text},null,8,f5)])],8,d5),s.createElementVNode("label",{for:`step-${l}`},[s.renderSlot(o.$slots,"label",{step:a},()=>[s.createElementVNode("span",{class:"form-check-label",innerHTML:a.label},null,8,p5)])],8,h5)])])],2))),128))])]))}});/*!
143
+ }`;var st=c_(function(){return vt(T,Ne+"return "+Be).apply(A,L)});if(st.source=Be,Ew(st))throw st;return st}function tle(c){return St(c).toLowerCase()}function Ale(c){return St(c).toUpperCase()}function nle(c,d,m){if(c=St(c),c&&(m||d===A))return yx(c);if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=Mr(d),T=wx(C,E),L=Cx(C,E)+1;return Wi(C,T,L).join("")}function rle(c,d,m){if(c=St(c),c&&(m||d===A))return c.slice(0,vx(c)+1);if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=Cx(C,Mr(d))+1;return Wi(C,0,E).join("")}function ole(c,d,m){if(c=St(c),c&&(m||d===A))return c.replace(Ey,"");if(!c||!(d=Wn(d)))return c;var C=Mr(c),E=wx(C,Mr(d));return Wi(C,E).join("")}function ile(c,d){var m=P,C=ie;if(Zt(d)){var E="separator"in d?d.separator:E;m="length"in d?ot(d.length):m,C="omission"in d?Wn(d.omission):C}c=St(c);var T=c.length;if(Ya(c)){var L=Mr(c);T=L.length}if(m>=T)return c;var V=m-Ja(C);if(V<1)return C;var Y=L?Wi(L,0,V).join(""):c.slice(0,V);if(E===A)return Y+C;if(L&&(V+=Y.length-V),kw(E)){if(c.slice(V).search(E)){var de,pe=Y;for(E.global||(E=Py(E.source,St(PI.exec(E))+"g")),E.lastIndex=0;de=E.exec(pe);)var Be=de.index;Y=Y.slice(0,Be===A?V:Be)}}else if(c.indexOf(Wn(E),V)!=V){var Ie=Y.lastIndexOf(E);Ie>-1&&(Y=Y.slice(0,Ie))}return Y+C}function sle(c){return c=St(c),c&&xe.test(c)?c.replace(At,One):c}var ale=Al(function(c,d,m){return c+(m?" ":"")+d.toUpperCase()}),Fw=uT("toUpperCase");function l_(c,d,m){return c=St(c),d=m?A:d,d===A?xne(c)?Hne(c):bne(c):c.match(d)||[]}var c_=lt(function(c,d){try{return Kn(c,A,d)}catch(m){return Ew(m)?m:new et(m)}}),lle=Vo(function(c,d){return cr(d,function(m){m=po(m),Ro(c,m,bw(c[m],c))}),c});function cle(c){var d=c==null?0:c.length,m=Ke();return c=d?Jt(c,function(C){if(typeof C[1]!="function")throw new ur(i);return[m(C[0]),C[1]]}):[],lt(function(C){for(var E=-1;++E<d;){var T=c[E];if(Kn(T[0],this,C))return Kn(T[1],this,C)}})}function ule(c){return Ore(fr(c,h))}function Uw(c){return function(){return c}}function dle(c,d){return c==null||c!==c?d:c}var fle=fT(),hle=fT(!0);function Tn(c){return c}function Iw(c){return $x(typeof c=="function"?c:fr(c,h))}function ple(c){return Gx(fr(c,h))}function mle(c,d){return Wx(c,fr(d,h))}var gle=lt(function(c,d){return function(m){return $c(m,c,d)}}),Ble=lt(function(c,d){return function(m){return $c(c,m,d)}});function xw(c,d,m){var C=NA(d),E=kh(d,C);m==null&&!(Zt(d)&&(E.length||!C.length))&&(m=d,d=c,c=this,E=kh(d,NA(d)));var T=!(Zt(m)&&"chain"in m)||!!m.chain,L=Ko(c);return cr(E,function(V){var Y=d[V];c[V]=Y,L&&(c.prototype[V]=function(){var de=this.__chain__;if(T||de){var pe=c(this.__wrapped__),Be=pe.__actions__=Un(this.__actions__);return Be.push({func:Y,args:arguments,thisArg:c}),pe.__chain__=de,pe}return Y.apply(c,Ri([this.value()],arguments))})}),c}function yle(){return GA._===this&&(GA._=Gne),this}function Tw(){}function wle(c){return c=ot(c),lt(function(d){return zx(d,c)})}var Cle=lw(Jt),ble=lw(hx),vle=lw(Dy);function u_(c){return mw(c)?Ly(po(c)):Zre(c)}function Ele(c){return function(d){return c==null?A:Vs(c,d)}}var kle=pT(),Sle=pT(!0);function _w(){return[]}function Dw(){return!1}function Qle(){return{}}function Fle(){return""}function Ule(){return!0}function Ile(c,d){if(c=ot(c),c<1||c>ee)return[];var m=j,C=An(c,j);d=Ke(d),c-=j;for(var E=Ny(C,d);++m<c;)d(m);return E}function xle(c){return tt(c)?Jt(c,po):zn(c)?[c]:Un(xT(St(c)))}function Tle(c){var d=++$ne;return St(c)+d}var _le=xh(function(c,d){return c+d},0),Dle=cw("ceil"),Lle=xh(function(c,d){return c/d},1),Ole=cw("floor");function Mle(c){return c&&c.length?Eh(c,Tn,Jy):A}function Nle(c,d){return c&&c.length?Eh(c,Ke(d,2),Jy):A}function Hle(c){return gx(c,Tn)}function Rle(c,d){return gx(c,Ke(d,2))}function Ple(c){return c&&c.length?Eh(c,Tn,Zy):A}function Vle(c,d){return c&&c.length?Eh(c,Ke(d,2),Zy):A}var $le=xh(function(c,d){return c*d},1),Kle=cw("round"),Gle=xh(function(c,d){return c-d},0);function Wle(c){return c&&c.length?My(c,Tn):0}function zle(c,d){return c&&c.length?My(c,Ke(d,2)):0}return U.after=pse,U.ary=VT,U.assign=Aae,U.assignIn=A_,U.assignInWith=Kh,U.assignWith=nae,U.at=rae,U.before=$T,U.bind=bw,U.bindAll=lle,U.bindKey=KT,U.castArray=Qse,U.chain=HT,U.chunk=Ooe,U.compact=Moe,U.concat=Noe,U.cond=cle,U.conforms=ule,U.constant=Uw,U.countBy=Wie,U.create=oae,U.curry=GT,U.curryRight=WT,U.debounce=zT,U.defaults=iae,U.defaultsDeep=sae,U.defer=mse,U.delay=gse,U.difference=Hoe,U.differenceBy=Roe,U.differenceWith=Poe,U.drop=Voe,U.dropRight=$oe,U.dropRightWhile=Koe,U.dropWhile=Goe,U.fill=Woe,U.filter=Yie,U.flatMap=jie,U.flatMapDeep=qie,U.flatMapDepth=Zie,U.flatten=LT,U.flattenDeep=zoe,U.flattenDepth=Yoe,U.flip=Bse,U.flow=fle,U.flowRight=hle,U.fromPairs=Joe,U.functions=hae,U.functionsIn=pae,U.groupBy=ese,U.initial=joe,U.intersection=qoe,U.intersectionBy=Zoe,U.intersectionWith=eie,U.invert=gae,U.invertBy=Bae,U.invokeMap=Ase,U.iteratee=Iw,U.keyBy=nse,U.keys=NA,U.keysIn=xn,U.map=Nh,U.mapKeys=wae,U.mapValues=Cae,U.matches=ple,U.matchesProperty=mle,U.memoize=Rh,U.merge=bae,U.mergeWith=n_,U.method=gle,U.methodOf=Ble,U.mixin=xw,U.negate=Ph,U.nthArg=wle,U.omit=vae,U.omitBy=Eae,U.once=yse,U.orderBy=rse,U.over=Cle,U.overArgs=wse,U.overEvery=ble,U.overSome=vle,U.partial=vw,U.partialRight=YT,U.partition=ose,U.pick=kae,U.pickBy=r_,U.property=u_,U.propertyOf=Ele,U.pull=rie,U.pullAll=MT,U.pullAllBy=oie,U.pullAllWith=iie,U.pullAt=sie,U.range=kle,U.rangeRight=Sle,U.rearg=Cse,U.reject=ase,U.remove=aie,U.rest=bse,U.reverse=ww,U.sampleSize=cse,U.set=Qae,U.setWith=Fae,U.shuffle=use,U.slice=lie,U.sortBy=hse,U.sortedUniq=mie,U.sortedUniqBy=gie,U.split=jae,U.spread=vse,U.tail=Bie,U.take=yie,U.takeRight=wie,U.takeRightWhile=Cie,U.takeWhile=bie,U.tap=Mie,U.throttle=Ese,U.thru=Mh,U.toArray=ZT,U.toPairs=o_,U.toPairsIn=i_,U.toPath=xle,U.toPlainObject=t_,U.transform=Uae,U.unary=kse,U.union=vie,U.unionBy=Eie,U.unionWith=kie,U.uniq=Sie,U.uniqBy=Qie,U.uniqWith=Fie,U.unset=Iae,U.unzip=Cw,U.unzipWith=NT,U.update=xae,U.updateWith=Tae,U.values=ol,U.valuesIn=_ae,U.without=Uie,U.words=l_,U.wrap=Sse,U.xor=Iie,U.xorBy=xie,U.xorWith=Tie,U.zip=_ie,U.zipObject=Die,U.zipObjectDeep=Lie,U.zipWith=Oie,U.entries=o_,U.entriesIn=i_,U.extend=A_,U.extendWith=Kh,xw(U,U),U.add=_le,U.attempt=c_,U.camelCase=Mae,U.capitalize=s_,U.ceil=Dle,U.clamp=Dae,U.clone=Fse,U.cloneDeep=Ise,U.cloneDeepWith=xse,U.cloneWith=Use,U.conformsTo=Tse,U.deburr=a_,U.defaultTo=dle,U.divide=Lle,U.endsWith=Nae,U.eq=Hr,U.escape=Hae,U.escapeRegExp=Rae,U.every=zie,U.find=Jie,U.findIndex=_T,U.findKey=aae,U.findLast=Xie,U.findLastIndex=DT,U.findLastKey=lae,U.floor=Ole,U.forEach=RT,U.forEachRight=PT,U.forIn=cae,U.forInRight=uae,U.forOwn=dae,U.forOwnRight=fae,U.get=Sw,U.gt=_se,U.gte=Dse,U.has=mae,U.hasIn=Qw,U.head=OT,U.identity=Tn,U.includes=tse,U.indexOf=Xoe,U.inRange=Lae,U.invoke=yae,U.isArguments=Gs,U.isArray=tt,U.isArrayBuffer=Lse,U.isArrayLike=In,U.isArrayLikeObject=mA,U.isBoolean=Ose,U.isBuffer=zi,U.isDate=Mse,U.isElement=Nse,U.isEmpty=Hse,U.isEqual=Rse,U.isEqualWith=Pse,U.isError=Ew,U.isFinite=Vse,U.isFunction=Ko,U.isInteger=JT,U.isLength=Vh,U.isMap=XT,U.isMatch=$se,U.isMatchWith=Kse,U.isNaN=Gse,U.isNative=Wse,U.isNil=Yse,U.isNull=zse,U.isNumber=jT,U.isObject=Zt,U.isObjectLike=oA,U.isPlainObject=Jc,U.isRegExp=kw,U.isSafeInteger=Jse,U.isSet=qT,U.isString=$h,U.isSymbol=zn,U.isTypedArray=rl,U.isUndefined=Xse,U.isWeakMap=jse,U.isWeakSet=qse,U.join=tie,U.kebabCase=Pae,U.last=pr,U.lastIndexOf=Aie,U.lowerCase=Vae,U.lowerFirst=$ae,U.lt=Zse,U.lte=eae,U.max=Mle,U.maxBy=Nle,U.mean=Hle,U.meanBy=Rle,U.min=Ple,U.minBy=Vle,U.stubArray=_w,U.stubFalse=Dw,U.stubObject=Qle,U.stubString=Fle,U.stubTrue=Ule,U.multiply=$le,U.nth=nie,U.noConflict=yle,U.noop=Tw,U.now=Hh,U.pad=Kae,U.padEnd=Gae,U.padStart=Wae,U.parseInt=zae,U.random=Oae,U.reduce=ise,U.reduceRight=sse,U.repeat=Yae,U.replace=Jae,U.result=Sae,U.round=Kle,U.runInContext=z,U.sample=lse,U.size=dse,U.snakeCase=Xae,U.some=fse,U.sortedIndex=cie,U.sortedIndexBy=uie,U.sortedIndexOf=die,U.sortedLastIndex=fie,U.sortedLastIndexBy=hie,U.sortedLastIndexOf=pie,U.startCase=qae,U.startsWith=Zae,U.subtract=Gle,U.sum=Wle,U.sumBy=zle,U.template=ele,U.times=Ile,U.toFinite=Go,U.toInteger=ot,U.toLength=e_,U.toLower=tle,U.toNumber=mr,U.toSafeInteger=tae,U.toString=St,U.toUpper=Ale,U.trim=nle,U.trimEnd=rle,U.trimStart=ole,U.truncate=ile,U.unescape=sle,U.uniqueId=Tle,U.upperCase=ale,U.upperFirst=Fw,U.each=RT,U.eachRight=PT,U.first=OT,xw(U,(function(){var c={};return fo(U,function(d,m){xt.call(U.prototype,m)||(c[m]=d)}),c})(),{chain:!1}),U.VERSION=n,cr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){U[c].placeholder=U}),cr(["drop","take"],function(c,d){pt.prototype[c]=function(m){m=m===A?1:QA(ot(m),0);var C=this.__filtered__&&!d?new pt(this):this.clone();return C.__filtered__?C.__takeCount__=An(m,C.__takeCount__):C.__views__.push({size:An(m,j),type:c+(C.__dir__<0?"Right":"")}),C},pt.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),cr(["filter","map","takeWhile"],function(c,d){var m=d+1,C=m==H||m==$;pt.prototype[c]=function(E){var T=this.clone();return T.__iteratees__.push({iteratee:Ke(E,3),type:m}),T.__filtered__=T.__filtered__||C,T}}),cr(["head","last"],function(c,d){var m="take"+(d?"Right":"");pt.prototype[c]=function(){return this[m](1).value()[0]}}),cr(["initial","tail"],function(c,d){var m="drop"+(d?"":"Right");pt.prototype[c]=function(){return this.__filtered__?new pt(this):this[m](1)}}),pt.prototype.compact=function(){return this.filter(Tn)},pt.prototype.find=function(c){return this.filter(c).head()},pt.prototype.findLast=function(c){return this.reverse().find(c)},pt.prototype.invokeMap=lt(function(c,d){return typeof c=="function"?new pt(this):this.map(function(m){return $c(m,c,d)})}),pt.prototype.reject=function(c){return this.filter(Ph(Ke(c)))},pt.prototype.slice=function(c,d){c=ot(c);var m=this;return m.__filtered__&&(c>0||d<0)?new pt(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),d!==A&&(d=ot(d),m=d<0?m.dropRight(-d):m.take(d-c)),m)},pt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},pt.prototype.toArray=function(){return this.take(j)},fo(pt.prototype,function(c,d){var m=/^(?:filter|find|map|reject)|While$/.test(d),C=/^(?:head|last)$/.test(d),E=U[C?"take"+(d=="last"?"Right":""):d],T=C||/^find/.test(d);E&&(U.prototype[d]=function(){var L=this.__wrapped__,V=C?[1]:arguments,Y=L instanceof pt,de=V[0],pe=Y||tt(L),Be=function(ct){var gt=E.apply(U,Ri([ct],V));return C&&Ie?gt[0]:gt};pe&&m&&typeof de=="function"&&de.length!=1&&(Y=pe=!1);var Ie=this.__chain__,Ne=!!this.__actions__.length,Ge=T&&!Ie,st=Y&&!Ne;if(!T&&pe){L=st?L:new pt(this);var We=c.apply(L,V);return We.__actions__.push({func:Mh,args:[Be],thisArg:A}),new dr(We,Ie)}return Ge&&st?c.apply(this,V):(We=this.thru(Be),Ge?C?We.value()[0]:We.value():We)})}),cr(["pop","push","shift","sort","splice","unshift"],function(c){var d=lh[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",C=/^(?:pop|shift)$/.test(c);U.prototype[c]=function(){var E=arguments;if(C&&!this.__chain__){var T=this.value();return d.apply(tt(T)?T:[],E)}return this[m](function(L){return d.apply(tt(L)?L:[],E)})}}),fo(pt.prototype,function(c,d){var m=U[d];if(m){var C=m.name+"";xt.call(Za,C)||(Za[C]=[]),Za[C].push({name:d,func:m})}}),Za[Ih(A,w).name]=[{name:"wrapper",func:A}],pt.prototype.clone=sre,pt.prototype.reverse=are,pt.prototype.value=lre,U.prototype.at=Nie,U.prototype.chain=Hie,U.prototype.commit=Rie,U.prototype.next=Pie,U.prototype.plant=$ie,U.prototype.reverse=Kie,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=Gie,U.prototype.first=U.prototype.head,Oc&&(U.prototype[Oc]=Vie),U}),Xa=Rne();Ms?((Ms.exports=Xa)._=Xa,Iy._=Xa):GA._=Xa}).call(CG)})(Ac,Ac.exports)),Ac.exports}var $1=bG();const vG="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==",EG={class:"camera__preview"},kG={key:0,class:"camera__bg-notification"},SG=["innerHTML"],QG=["width","height"],FG={key:1,class:"camera__countdown-overlay"},UG=["innerHTML","data-countdown"],IG=["src"],xG={class:"camera__controls"},TG={class:"container"},_G={class:"row"},DG={class:"col"},LG={class:"btn-group"},OG={key:0},MG={key:1},NG={key:0,class:"camera__switch-cam"},HG={key:1,class:"base-camera__devices"},RG={name:"BaseCamera",inheritAttrs:!1};function PG(t){const e=atob(t.split(",")[1]),A=new ArrayBuffer(e.length),n=new Uint8Array(A);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return new Blob([A],{type:"image/png"})}const VG=s.defineComponent({...RG,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:()=>vG},countdown:{type:Number,default:0},ratio:{type:String,default:"4x5"},enableAudio:{type:Boolean,default:!1},enableSelectDevice:{type:Boolean,default:!1},enableCropImage:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:e,emit:A}){const n={"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}},r=t,o=A,i=s.ref(),a=s.ref(),l=s.ref(!1),u=s.ref([]),f=s.ref(),h=s.ref(),p=s.ref(!1),g=s.ref(!1),B=s.ref(0),y=s.ref(0),b=s.ref(),w=s.computed(()=>u.value.filter(ee=>ee.kind==="videoinput")),v=s.computed(()=>u.value.filter(ee=>ee.kind==="audioinput")),S=s.computed({get(){return f.value&&f.value.deviceId},set(ee){f.value=w.value.find(K=>K.deviceId===ee)}}),F=s.computed({get(){return h.value&&h.value.deviceId},set(ee){h.value=v.value.find(K=>K.deviceId===ee)}}),I=s.computed(()=>{const ee=f.value&&w.value.findIndex(K=>K.deviceId===f.value.deviceId);return r.enableMirrorCamera&&ee===0?"mirror-cam":""}),Q=s.computed(()=>{const ee=f.value&&u.value.findIndex(K=>K.deviceId===f.value.deviceId);return I.value?`${I.value} mirror-device-${ee}`:""});function x(){B.value=n[r.ratio]?n[r.ratio].width:i.value.parentElement&&i.value.parentElement.clientWidth,y.value=n[r.ratio]?n[r.ratio].height:i.value.parentElement&&i.value.parentElement.clientHeight}const M=$1.debounce(()=>{x()},300,{trailing:!0,leading:!1});async function O(){const ee={audio:r.enableAudio&&{...h.value?{deviceId:h.value.deviceId}:{}},video:{...f.value?{deviceId:f.value.deviceId}:{},width:{ideal:1024},height:{ideal:1024}}};return navigator.mediaDevices.getUserMedia(ee).catch(K=>{console.error(K,"navigator.mediaDevices.getUserMedia: failed")})}function P(){i.value&&i.value.srcObject&&i.value.srcObject.getTracks().forEach(K=>{K.stop()})}async function ie(){return i.value.srcObject=await O(),u.value=await navigator.mediaDevices.enumerateDevices(),{stream:i.value.srcObject,devices:u.value}}function ae(){p.value?(p.value=!1,g.value=!1,P()):(p.value=!0,ie())}function ue(){u.value.length>1&&(P(),f.value=f.value&&f.value.deviceId===w.value[0].deviceId?w.value[w.value.length-1]:w.value[0],ie())}async function H(ee,K){P(),ee&&(!K||ee.deviceId!==K.deviceId)&&await ie()}s.watch(()=>f.value,H),s.watch(()=>h.value,H);function G(){r.countdown?(b.value=b.value?b.value-1:r.countdown,b.value?setTimeout(G,1e3):$()):$()}e({onCapture:G,camera:i.value});function $(){g.value=!0;const ee=a.value.getContext("2d"),K=i.value,ce=K&&K.srcObject&&K.srcObject.getTracks(),{aspectRatio:j,width:Qe,height:R}=ce.length&&ce[0].getSettings(),J=n[r.ratio],Ae=J.width/J.height;let oe=J.width,k=J.height;r.enableCropImage?j>Ae?oe=k*j:j<Ae&&(k=oe/j):(oe=Qe,k=R,a.value.width=oe,a.value.height=k);const X=I.value?-1:1;ee.save(),ee.scale(X,1),ee.drawImage(K,oe>a.value.width?(a.value.width-oe)/2:0,k>a.value.height?(a.value.height-k)/2:0,oe*X,k),ee.restore();const Se=a.value.toDataURL("image/png");te(Se)}function te(ee){const K=PG(ee);o("update:modelValue",{name:`cam-pic-${new Date().toISOString()}`,id:`cam-pic-${new Date().toISOString()}`,blob:K,size:K.size})}return s.onMounted(async()=>{P(),await ie(),f.value=w.value[0],r.enableAudio&&(h.value=v.value[0]),navigator.mediaDevices.addEventListener("devicechange",async ee=>{await ie()}),r.defaultRearCamera&&ue(),ae(),window.addEventListener("resize",M),x(),await s.nextTick(),l.value=!0}),s.onBeforeUnmount(()=>{p.value=!1,g.value=!1,P(),window.removeEventListener("resize",M)}),(ee,K)=>{const ce=s.resolveComponent("loading-spinner"),j=s.resolveComponent("svg-icon"),Qe=s.resolveComponent("input-dropdown");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["camera",Q.value])},[s.createElementVNode("div",EG,[l.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",kG,[s.createVNode(ce,{color:"#000"},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass("d-block text-center"),innerHTML:ee.$t("camera.waitForCameraNotification")},null,8,SG)]),_:1})])),s.withDirectives(s.createElementVNode("video",{ref_key:"camera",ref:i,class:s.normalizeClass(["camera__video",`aspect-ratio--${r.ratio}`]),autoplay:"",playsinline:""},null,2),[[s.vShow,l.value]]),s.withDirectives(s.createElementVNode("canvas",{ref_key:"canvas",ref:a,class:"camera__canvas",width:B.value,height:y.value},null,8,QG),[[s.vShow,g.value]]),b.value?(s.openBlock(),s.createElementBlock("div",FG,[(s.openBlock(),s.createElementBlock("p",{class:"countdown",key:b.value,innerHTML:b.value,"data-countdown":b.value},null,8,UG))])):s.createCommentVNode("",!0),t.enableGuide&&p.value&&l.value?(s.openBlock(),s.createElementBlock("img",{key:2,class:"camera__guide",src:t.guideSrc},null,8,IG)):s.createCommentVNode("",!0)]),s.createElementVNode("div",xG,[s.createElementVNode("div",TG,[s.createElementVNode("div",_G,[s.createElementVNode("div",DG,[s.createElementVNode("div",LG,[s.createElementVNode("button",{type:"button",class:"camera__toggle btn btn-primary",onClick:ae},[p.value?(s.openBlock(),s.createElementBlock("span",MG,s.toDisplayString(ee.$t("common.pause")),1)):(s.openBlock(),s.createElementBlock("span",OG,s.toDisplayString(ee.$t("common.play")),1))]),s.createElementVNode("button",{type:"button",class:"camera__capture btn btn-primary",onClick:G},s.toDisplayString(ee.$t("camera.capture")),1)])])])])]),t.enableSwitchCamera&&w.value&&w.value.length>1?(s.openBlock(),s.createElementBlock("div",NG,[s.createElementVNode("button",{class:"btn",onClick:s.withModifiers(ue,["prevent"])},[s.createVNode(j,{symbol:"switch-camera"})])])):s.createCommentVNode("",!0),t.enableSelectDevice?(s.openBlock(),s.createElementBlock("div",HG,[v.value.length&&h.value?(s.openBlock(),s.createBlock(Qe,{key:0,modelValue:F.value,"onUpdate:modelValue":K[0]||(K[0]=R=>F.value=R),options:v.value.map((R,J)=>({text:R.label||`Microphone ${J+1}`,value:R.deviceId}))},null,8,["modelValue","options"])):s.createCommentVNode("",!0),w.value.length?(s.openBlock(),s.createBlock(Qe,{key:1,modelValue:S.value,"onUpdate:modelValue":K[1]||(K[1]=R=>S.value=R),options:w.value.map((R,J)=>({text:R.label||`Camera ${J+1}`,value:R.deviceId}))},null,8,["modelValue","options"])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],2)}}}),$G=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,KG=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,GG=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function WG(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){zG(t);return}return e}function zG(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function YG(t,e={}){if(typeof t!="string")return t;const A=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return A.slice(1,-1);if(A.length<=9){const n=A.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!GG.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if($G.test(t)||KG.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,WG)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const JG=/#/g,XG=/&/g,jG=/\//g,qG=/=/g,xg=/\+/g,ZG=/%5e/gi,eW=/%60/gi,tW=/%7c/gi,AW=/%20/gi;function nW(t){return encodeURI(""+t).replace(tW,"|")}function Tg(t){return nW(typeof t=="string"?t:JSON.stringify(t)).replace(xg,"%2B").replace(AW,"+").replace(JG,"%23").replace(XG,"%26").replace(eW,"`").replace(ZG,"^").replace(jG,"%2F")}function _g(t){return Tg(t).replace(qG,"%3D")}function K1(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function rW(t){return K1(t.replace(xg," "))}function oW(t){return K1(t.replace(xg," "))}function iW(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const A of t.split("&")){const n=A.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const r=rW(n[1]);if(r==="__proto__"||r==="constructor")continue;const o=oW(n[2]||"");e[r]===void 0?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}return e}function sW(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(A=>`${_g(t)}=${Tg(A)}`).join("&"):`${_g(t)}=${Tg(e)}`:_g(t)}function aW(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>sW(e,t[e])).filter(Boolean).join("&")}const lW=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,cW=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,uW=/^([/\\]\s*){2,}[^/\\]/,dW=/^\.?\//;function G1(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?lW.test(t):cW.test(t)||(e.acceptRelative?uW.test(t):!1)}function fW(t="",e){return t.endsWith("/")}function hW(t="",e){return(fW(t)?t.slice(0,-1):t)||"/"}function pW(t="",e){return t.endsWith("/")?t:t+"/"}function mW(t,e){if(BW(e)||G1(t))return t;const A=hW(e);return t.startsWith(A)?t:wW(A,t)}function gW(t,e){const A=CW(t),n={...iW(A.search),...e};return A.search=aW(n),bW(A)}function BW(t){return!t||t==="/"}function yW(t){return t&&t!=="/"}function wW(t,...e){let A=t||"";for(const n of e.filter(r=>yW(r)))if(A){const r=n.replace(dW,"");A=pW(A)+r}else A=n;return A}const W1=Symbol.for("ufo:protocolRelative");function CW(t="",e){const A=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(A){const[,h,p=""]=A;return{protocol:h.toLowerCase(),pathname:p,href:h+p,auth:"",host:"",search:"",hash:""}}if(!G1(t,{acceptRelative:!0}))return z1(t);const[,n="",r,o=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,i="",a=""]=o.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:u,hash:f}=z1(a);return{protocol:n.toLowerCase(),auth:r?r.slice(0,Math.max(0,r.length-1)):"",host:i,pathname:l,search:u,hash:f,[W1]:!n}}function z1(t=""){const[e="",A="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:A,hash:n}}function bW(t){const e=t.pathname||"",A=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",r=t.auth?t.auth+"@":"",o=t.host||"";return(t.protocol||t[W1]?(t.protocol||"")+"//":"")+r+o+e+A+n}class vW extends Error{constructor(e,A){super(e,A),this.name="FetchError",A?.cause&&!this.cause&&(this.cause=A.cause)}}function EW(t){const e=t.error?.message||t.error?.toString()||"",A=t.request?.method||t.options?.method||"GET",n=t.request?.url||String(t.request)||"/",r=`[${A}] ${JSON.stringify(n)}`,o=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",i=`${r}: ${o}${e?` ${e}`:""}`,a=new vW(i,t.error?{cause:t.error}:void 0);for(const l of["request","options","response"])Object.defineProperty(a,l,{get(){return t[l]}});for(const[l,u]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,l,{get(){return t.response&&t.response[u]}});return a}const kW=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Y1(t="GET"){return kW.has(t.toUpperCase())}function SW(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const QW=new Set(["image/svg","application/xml","application/xhtml","application/html"]),FW=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function UW(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return FW.test(e)?"json":QW.has(e)||e.startsWith("text/")?"text":"blob"}function IW(t,e,A,n){const r=xW(e?.headers??t?.headers,A?.headers,n);let o;return(A?.query||A?.params||e?.params||e?.query)&&(o={...A?.params,...A?.query,...e?.params,...e?.query}),{...A,...e,query:o,params:o,headers:r}}function xW(t,e,A){if(!e)return new A(t);const n=new A(e);if(t)for(const[r,o]of Symbol.iterator in t||Array.isArray(t)?t:new A(t))n.set(r,o);return n}async function Nd(t,e){if(e)if(Array.isArray(e))for(const A of e)await A(t);else await e(t)}const TW=new Set([408,409,425,429,500,502,503,504]),_W=new Set([101,204,205,304]);function J1(t={}){const{fetch:e=globalThis.fetch,Headers:A=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function r(a){const l=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!l){let f;typeof a.options.retry=="number"?f=a.options.retry:f=Y1(a.options.method)?0:1;const h=a.response&&a.response.status||500;if(f>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(h):TW.has(h))){const p=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return p>0&&await new Promise(g=>setTimeout(g,p)),o(a.request,{...a.options,retry:f-1})}}const u=EW(a);throw Error.captureStackTrace&&Error.captureStackTrace(u,o),u}const o=async function(l,u={}){const f={request:l,options:IW(l,u,t.defaults,A),response:void 0,error:void 0};f.options.method&&(f.options.method=f.options.method.toUpperCase()),f.options.onRequest&&await Nd(f,f.options.onRequest),typeof f.request=="string"&&(f.options.baseURL&&(f.request=mW(f.request,f.options.baseURL)),f.options.query&&(f.request=gW(f.request,f.options.query),delete f.options.query),"query"in f.options&&delete f.options.query,"params"in f.options&&delete f.options.params),f.options.body&&Y1(f.options.method)&&(SW(f.options.body)?(f.options.body=typeof f.options.body=="string"?f.options.body:JSON.stringify(f.options.body),f.options.headers=new A(f.options.headers||{}),f.options.headers.has("content-type")||f.options.headers.set("content-type","application/json"),f.options.headers.has("accept")||f.options.headers.set("accept","application/json")):("pipeTo"in f.options.body&&typeof f.options.body.pipeTo=="function"||typeof f.options.body.pipe=="function")&&("duplex"in f.options||(f.options.duplex="half")));let h;if(!f.options.signal&&f.options.timeout){const g=new n;h=setTimeout(()=>{const B=new Error("[TimeoutError]: The operation was aborted due to timeout");B.name="TimeoutError",B.code=23,g.abort(B)},f.options.timeout),f.options.signal=g.signal}try{f.response=await e(f.request,f.options)}catch(g){return f.error=g,f.options.onRequestError&&await Nd(f,f.options.onRequestError),await r(f)}finally{h&&clearTimeout(h)}if((f.response.body||f.response._bodyInit)&&!_W.has(f.response.status)&&f.options.method!=="HEAD"){const g=(f.options.parseResponse?"json":f.options.responseType)||UW(f.response.headers.get("content-type")||"");switch(g){case"json":{const B=await f.response.text(),y=f.options.parseResponse||YG;f.response._data=y(B);break}case"stream":{f.response._data=f.response.body||f.response._bodyInit;break}default:f.response._data=await f.response[g]()}}return f.options.onResponse&&await Nd(f,f.options.onResponse),!f.options.ignoreResponseError&&f.response.status>=400&&f.response.status<600?(f.options.onResponseError&&await Nd(f,f.options.onResponseError),await r(f)):f.response},i=async function(l,u){return(await o(l,u))._data};return i.raw=o,i.native=(...a)=>e(...a),i.create=(a={},l={})=>J1({...t,...l,defaults:{...t.defaults,...l.defaults,...a}}),i}const Hd=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),DW=Hd.fetch?(...t)=>Hd.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),LW=Hd.Headers,OW=Hd.AbortController,MW=J1({fetch:DW,Headers:LW,AbortController:OW}),NW=["src"],HW=["onClick"],RW=["onClick"],PW=["for"],VW=["innerHTML"],$W={key:0,class:"file-upload__loading-spinner"};async function KW(t){return await new Promise(e=>{let A=new FileReader;A.onload=()=>e(A.result),A.readAsDataURL(t)})}const GW=s.defineComponent({__name:"file-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:"Select file"},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,default:"image/*"},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/media"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1}},emits:["update:modelValue","update:src"],setup(t,{emit:e}){const A=t,n=e,r=s.ref([]),o=s.ref([]),i=s.ref(!1),a=s.ref(!1),l=s.computed(()=>A.modelValue.length?A.modelValue:A.src?[{type:"",src:A.src}]:o.value);s.watch(()=>r.value,async B=>{o.value=await Promise.all(B.map(async y=>({src:A.toDataUrl?await KW(y):await f(y),type:y.type})))},{deep:!0}),s.watch(()=>o.value,async B=>{const y=A.multiple?B:B[0];n("update:modelValue",y),A.multiple||n("update:src",B[0]&&B[0].src)},{deep:!0});function u(B){r.value.splice(B,1),(!o.value||!o.value.length)&&n("update:src","")}async function f(B){const y=new FormData;y.append("file",B),i.value=!0;const w=await(A.customFetch||MW)(A.endpoint,{method:"POST",...A.customFetch?{}:{headers:{Accept:"application/json",...A.authToken?{Authorization:`Bearer ${A.authToken}`}:{}}},body:y}).catch(S=>{console.error("Error",S)});return i.value=!1,`${A.baseResponsePath==="/media"&&w.path.endsWith(".svg")?"/api/v1/assets":A.baseResponsePath}/${w.path}`}function h(B){B.preventDefault(),a.value=!0}function p(B){B.preventDefault(),a.value=!1}function g(B){B.preventDefault(),a.value=!1;const y=B.dataTransfer,b=y&&Array.from(y.files||[]);r.value=b||[]}return s.onMounted(()=>{A.dropFiles&&(["dragenter","dragover"].forEach(B=>{document.body.addEventListener(B,h,!1)}),["dragleave","drop"].forEach(B=>{document.body.addEventListener(B,p,!1)}),document.body.addEventListener("drop",g,!1))}),s.onBeforeUnmount(()=>{A.dropFiles&&(["dragenter","dragover"].forEach(B=>{document.body.removeEventListener(B,h,!1)}),["dragleave","drop"].forEach(B=>{document.body.removeEventListener(B,p,!1)}),document.body.removeEventListener("drop",g,!1))}),(B,y)=>{const b=s.resolveComponent("svg-icon"),w=s.resolveComponent("input-file");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["file-upload",{"has-dragging":t.dropFiles,"is-dragging":a.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(v,S)=>(s.openBlock(),s.createElementBlock("div",{key:v.src,class:s.normalizeClass(t.enablePreview?"file-upload__thumbnail":"file-upload__reset")},[t.enablePreview?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("img",{src:`${v.src}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail rounded"},null,8,NW),s.createElementVNode("button",{onClick:s.withModifiers(F=>u(S),["prevent"]),class:"btn btn--close"},[s.createVNode(b,{symbol:"x"})],8,HW)],64)):(s.openBlock(),s.createElementBlock("button",{key:1,onClick:s.withModifiers(F=>u(S),["prevent"]),class:"btn btn--close btn-outline-contrast"},[s.createVNode(b,{symbol:"x"})],8,RW))],2))),128)),s.createVNode(w,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=v=>r.value=v),id:t.id,name:t.name,accept:t.accept,class:"d-none"},null,8,["modelValue","id","name","accept"]),s.createElementVNode("label",{for:t.id,class:"file-upload__label"},[s.renderSlot(B.$slots,"button",{},()=>[s.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:t.label},null,8,VW)]),s.createVNode(s.Transition,{name:"fade"},{default:s.withCtx(()=>[i.value?(s.openBlock(),s.createElementBlock("span",$W,y[1]||(y[1]=[s.createElementVNode("span",{class:"spinner-border",role:"status"},[s.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)]))):s.createCommentVNode("",!0)]),_:1})],8,PW)],2)}}}),WW={class:"upload-group"},zW=["innerHTML"],YW={class:"upload-group__list"},JW={class:"img-container"},XW=["src"],jW=["onClick"],qW={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},X1=s.defineComponent({__name:"upload-group",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/media"},previewWidth:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(""),o=s.computed({get(){return A.modelValue},set(a){n("update:modelValue",a)}});function i(a){o.value.splice(a,1),n("update:modelValue",o.value)}return s.watch(r,(a,l)=>{a&&(n("update:modelValue",[...o.value,a]),r.value="")}),(a,l)=>{const u=s.resolveComponent("svg-icon"),f=s.resolveComponent("file-upload"),h=s.resolveComponent("sortable-list");return s.openBlock(),s.createElementBlock("div",WW,[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,innerHTML:t.label},null,8,zW)):s.createCommentVNode("",!0),s.createElementVNode("div",YW,[s.createVNode(h,{modelValue:o.value,"onUpdate:modelValue":l[1]||(l[1]=p=>o.value=p),vertical:!1,class:"mb-3"},{"list-item":s.withCtx(({item:p,index:g})=>[s.createElementVNode("div",JW,[s.createElementVNode("img",{src:`${p}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail"},null,8,XW),s.createElementVNode("button",{onClick:s.withModifiers(B=>i(g),["prevent"]),class:"btn btn--close"},[s.createVNode(u,{symbol:"x"})],8,jW)])]),"list-append":s.withCtx(()=>[s.createVNode(f,{src:r.value,"onUpdate:src":l[0]||(l[0]=p=>r.value=p),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},{button:s.withCtx(()=>[s.createElementVNode("span",qW,[s.createVNode(u,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path"])]),_:1},8,["modelValue"])])])}}}),ZW={class:"asset-uploader"},e5=["innerHTML"],t5=s.defineComponent({__name:"asset-uploader",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>Bt()},id:{type:String,default:()=>Bt()},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,default:"image/*"},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,mediaTypeMap:{type:Object,default:()=>({svg:"Svg",png:"Image",jpg:"Image"})},baseResponsePath:{type:String,default:"/media"},previewWidth:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:e}){const A=t,n=e,r=s.computed({get(){return A.modelValue.map(o=>o.src)},set(o){n("update:modelValue",o.map((i,a)=>({mediaType:A.modelValue[a]&&A.modelValue[a].mediaType||i.includes("data:image")?i.includes("data:image/svg")?"Svg":"Image":A.mediaTypeMap[i.split(".")[1]],src:i,name:A.modelValue[a]&&A.modelValue[a].name||`${A.name}-${a}`,...A.type?{type:A.type}:{}})))}});return(o,i)=>(s.openBlock(),s.createElementBlock("div",ZW,[t.label?(s.openBlock(),s.createElementBlock("label",{key:0,innerHTML:t.label},null,8,e5)):s.createCommentVNode("",!0),s.createVNode(X1,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=a=>r.value=a),endpoint:t.endpoint,"custom-fetch":t.customFetch,"auth-token":t.authToken,disabled:t.disabled,"preview-width":t.previewWidth,"base-response-path":t.baseResponsePath},null,8,["modelValue","endpoint","custom-fetch","auth-token","disabled","preview-width","base-response-path"])]))}}),A5={class:"carousel d-flex"},n5=["onClick"],j1=s.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:e}){const A=e,n=s.ref(),r=s.ref();function o(){n.value.scrollTo({top:0,left:n.value.scrollLeft-n.value.clientWidth>0?n.value.scrollLeft-n.value.clientWidth:0,behavior:"smooth"})}function i(){n.value.scrollTo({top:0,left:n.value.scrollLeft-n.value.clientWidth<=r.value.clientWidth?n.value.scrollLeft+n.value.clientWidth:r.value.clientWidth,behavior:"smooth"})}function a(l){A("update:modelValue",l)}return(l,u)=>{const f=s.resolveComponent("svg-icon");return s.openBlock(),s.createElementBlock("div",A5,[t.navigation?(s.openBlock(),s.createElementBlock("button",{key:0,class:"carousel__control btn btn-link text-light",type:"button",onClick:s.withModifiers(o,["prevent","stop"])},[s.createVNode(f,{symbol:"chevron-left"})])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_key:"viewport",ref:n,class:"carousel__viewport flex-grow-1"},[s.createElementVNode("div",{ref_key:"track",ref:r,class:"carousel__track d-flex justify-center align-items-center"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,(h,p)=>s.renderSlot(l.$slots,"carousel-item",{key:h.src,item:h,index:p},()=>[s.createElementVNode("div",{class:s.normalizeClass(["carousel__item",p===t.modelValue?"selected":""]),onClick:g=>a(p)},s.toDisplayString(h),11,n5)])),128))],512)],512),t.navigation?(s.openBlock(),s.createElementBlock("button",{key:1,class:"carousel__control btn btn-link text-light",type:"button",onClick:s.withModifiers(i,["prevent","stop"])},[s.createVNode(f,{symbol:"chevron-right"})])):s.createCommentVNode("",!0)])}}}),r5={class:"media-thumbnails"},o5=["onClick"],i5={class:"img-container"},s5=s.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:e}){const A=e,n=s.ref(-1);function r(o){n.value=o,A("update:modelValue",o),A("select",o)}return(o,i)=>{const a=s.resolveComponent("base-image");return s.openBlock(),s.createElementBlock("div",r5,[s.createVNode(j1,{items:t.assets},{"carousel-item":s.withCtx(l=>[s.createElementVNode("a",{role:"button",class:s.normalizeClass(["carousel__item media-thumbnails__thumbnail",l.index===t.modelValue||l.index===n.value?"is-active":""]),onClick:u=>r(l.index)},[s.createElementVNode("div",i5,[s.createVNode(a,{src:l.item.thumbnail||l.item.src,class:"img-fluid"},null,8,["src"])])],10,o5)]),_:1},8,["items"])])}}}),a5={class:"progress-steps"},l5={class:"progress-steps__list"},c5={class:"progress-step"},u5=["checked","id","value","disabled","read-only","required","onChange"],d5=["for"],f5=["innerHTML"],h5=["for"],p5=["innerHTML"],m5=s.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:e}){const A=t,n=e;function r(o){n("update:modelValue",o),o>=A.progress&&n("update:progress",o)}return(o,i)=>(s.openBlock(),s.createElementBlock("div",a5,[s.createElementVNode("ul",l5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.steps,(a,l)=>(s.openBlock(),s.createElementBlock("li",{key:l,class:s.normalizeClass(["progress-steps__step",{"progress-steps__step--disabled":l>t.progress+(t.reveal?1:0),"progress-steps__step--active":l===(t.modelValue||0)}])},[s.renderSlot(o.$slots,"step",{},()=>[s.createElementVNode("div",c5,[s.createElementVNode("input",{type:"radio",checked:l<=(t.progress||0),id:`step-${l}`,name:"step",class:"form-check-input",value:a.value,disabled:a.disabled||l>t.progress+(t.reveal?1:0),"read-only":a.readOnly,required:a.required,onChange:u=>r(l)},null,40,u5),s.createElementVNode("label",{for:`step-${l}`},[s.renderSlot(o.$slots,"button",{step:a},()=>[s.createElementVNode("span",{class:"btn rounded-circle",innerHTML:a.text},null,8,f5)])],8,d5),s.createElementVNode("label",{for:`step-${l}`},[s.renderSlot(o.$slots,"label",{step:a},()=>[s.createElementVNode("span",{class:"form-check-label",innerHTML:a.label},null,8,p5)])],8,h5)])])],2))),128))])]))}});/*!
144
144
  * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
145
145
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
146
146
  * Released under MIT License
@@ -161,13 +161,13 @@ function print() { __p += __j.call(arguments, '') }
161
161
  content: "" !important;
162
162
  display: none !important;
163
163
  }`,AJ=function(t){nJ(t,"."+kB+eJ+$S+`
164
- .`+SB+tJ+$S)},nJ=function(t,e){var A=t.ownerDocument;if(A){var n=A.createElement("style");n.textContent=e,t.appendChild(n)}},KS=(function(){function t(){}return t.getOrigin=function(e){var A=t._link;return A?(A.href=e,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t})(),rJ=(function(){function t(e,A){this.context=e,this._options=A,this._cache={}}return t.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(FB(e)||aJ(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return dn(this,void 0,void 0,function(){var A,n,r,o,i=this;return ZA(this,function(a){switch(a.label){case 0:return A=KS.isSameOrigin(e),n=!QB(e)&&this._options.useCORS===!0&&KA.SUPPORT_CORS_IMAGES&&!A,r=!QB(e)&&!A&&!FB(e)&&typeof this._options.proxy=="string"&&KA.SUPPORT_CORS_XHR&&!n,!A&&this._options.allowTaint===!1&&!QB(e)&&!FB(e)&&!r&&!n?[2]:(o=e,r?[4,this.proxy(o)]:[3,2]);case 1:o=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(l,u){var f=new Image;f.onload=function(){return l(f)},f.onerror=u,(lJ(o)||n)&&(f.crossOrigin="anonymous"),f.src=o,f.complete===!0&&setTimeout(function(){return l(f)},500),i._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var A=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(o,i){var a=KA.SUPPORT_RESPONSE_TYPE?"blob":"text",l=new XMLHttpRequest;l.onload=function(){if(l.status===200)if(a==="text")o(l.response);else{var h=new FileReader;h.addEventListener("load",function(){return o(h.result)},!1),h.addEventListener("error",function(p){return i(p)},!1),h.readAsDataURL(l.response)}else i("Failed to proxy resource "+r+" with status code "+l.status)},l.onerror=i;var u=n.indexOf("?")>-1?"&":"?";if(l.open("GET",""+n+u+"url="+encodeURIComponent(e)+"&responseType="+a),a!=="text"&&l instanceof XMLHttpRequest&&(l.responseType=a),A._options.imageTimeout){var f=A._options.imageTimeout;l.timeout=f,l.ontimeout=function(){return i("Timed out ("+f+"ms) proxying "+r)}}l.send()})},t})(),oJ=/^data:image\/svg\+xml/i,iJ=/^data:image\/.*;base64,/i,sJ=/^data:image\/.*/i,aJ=function(t){return KA.SUPPORT_SVG_DRAWING||!cJ(t)},QB=function(t){return sJ.test(t)},lJ=function(t){return iJ.test(t)},FB=function(t){return t.substr(0,4)==="blob"},cJ=function(t){return t.substr(-3).toLowerCase()==="svg"||oJ.test(t)},Te=(function(){function t(e,A){this.type=0,this.x=e,this.y=A}return t.prototype.add=function(e,A){return new t(this.x+e,this.y+A)},t})(),xa=function(t,e,A){return new Te(t.x+(e.x-t.x)*A,t.y+(e.y-t.y)*A)},Qf=(function(){function t(e,A,n,r){this.type=1,this.start=e,this.startControl=A,this.endControl=n,this.end=r}return t.prototype.subdivide=function(e,A){var n=xa(this.start,this.startControl,e),r=xa(this.startControl,this.endControl,e),o=xa(this.endControl,this.end,e),i=xa(n,r,e),a=xa(r,o,e),l=xa(i,a,e);return A?new t(this.start,n,i,l):new t(l,a,o,this.end)},t.prototype.add=function(e,A){return new t(this.start.add(e,A),this.startControl.add(e,A),this.endControl.add(e,A),this.end.add(e,A))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t})(),or=function(t){return t.type===1},uJ=(function(){function t(e){var A=e.styles,n=e.bounds,r=mc(A.borderTopLeftRadius,n.width,n.height),o=r[0],i=r[1],a=mc(A.borderTopRightRadius,n.width,n.height),l=a[0],u=a[1],f=mc(A.borderBottomRightRadius,n.width,n.height),h=f[0],p=f[1],g=mc(A.borderBottomLeftRadius,n.width,n.height),B=g[0],y=g[1],b=[];b.push((o+l)/n.width),b.push((B+h)/n.width),b.push((i+y)/n.height),b.push((u+p)/n.height);var w=Math.max.apply(Math,b);w>1&&(o/=w,i/=w,l/=w,u/=w,h/=w,p/=w,B/=w,y/=w);var v=n.width-l,S=n.height-p,F=n.width-h,I=n.height-y,Q=A.borderTopWidth,x=A.borderRightWidth,M=A.borderBottomWidth,O=A.borderLeftWidth,P=Mt(A.paddingTop,e.bounds.width),ie=Mt(A.paddingRight,e.bounds.width),ae=Mt(A.paddingBottom,e.bounds.width),ue=Mt(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||i>0?zt(n.left+O/3,n.top+Q/3,o-O/3,i-Q/3,Et.TOP_LEFT):new Te(n.left+O/3,n.top+Q/3),this.topRightBorderDoubleOuterBox=o>0||i>0?zt(n.left+v,n.top+Q/3,l-x/3,u-Q/3,Et.TOP_RIGHT):new Te(n.left+n.width-x/3,n.top+Q/3),this.bottomRightBorderDoubleOuterBox=h>0||p>0?zt(n.left+F,n.top+S,h-x/3,p-M/3,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x/3,n.top+n.height-M/3),this.bottomLeftBorderDoubleOuterBox=B>0||y>0?zt(n.left+O/3,n.top+I,B-O/3,y-M/3,Et.BOTTOM_LEFT):new Te(n.left+O/3,n.top+n.height-M/3),this.topLeftBorderDoubleInnerBox=o>0||i>0?zt(n.left+O*2/3,n.top+Q*2/3,o-O*2/3,i-Q*2/3,Et.TOP_LEFT):new Te(n.left+O*2/3,n.top+Q*2/3),this.topRightBorderDoubleInnerBox=o>0||i>0?zt(n.left+v,n.top+Q*2/3,l-x*2/3,u-Q*2/3,Et.TOP_RIGHT):new Te(n.left+n.width-x*2/3,n.top+Q*2/3),this.bottomRightBorderDoubleInnerBox=h>0||p>0?zt(n.left+F,n.top+S,h-x*2/3,p-M*2/3,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x*2/3,n.top+n.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=B>0||y>0?zt(n.left+O*2/3,n.top+I,B-O*2/3,y-M*2/3,Et.BOTTOM_LEFT):new Te(n.left+O*2/3,n.top+n.height-M*2/3),this.topLeftBorderStroke=o>0||i>0?zt(n.left+O/2,n.top+Q/2,o-O/2,i-Q/2,Et.TOP_LEFT):new Te(n.left+O/2,n.top+Q/2),this.topRightBorderStroke=o>0||i>0?zt(n.left+v,n.top+Q/2,l-x/2,u-Q/2,Et.TOP_RIGHT):new Te(n.left+n.width-x/2,n.top+Q/2),this.bottomRightBorderStroke=h>0||p>0?zt(n.left+F,n.top+S,h-x/2,p-M/2,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x/2,n.top+n.height-M/2),this.bottomLeftBorderStroke=B>0||y>0?zt(n.left+O/2,n.top+I,B-O/2,y-M/2,Et.BOTTOM_LEFT):new Te(n.left+O/2,n.top+n.height-M/2),this.topLeftBorderBox=o>0||i>0?zt(n.left,n.top,o,i,Et.TOP_LEFT):new Te(n.left,n.top),this.topRightBorderBox=l>0||u>0?zt(n.left+v,n.top,l,u,Et.TOP_RIGHT):new Te(n.left+n.width,n.top),this.bottomRightBorderBox=h>0||p>0?zt(n.left+F,n.top+S,h,p,Et.BOTTOM_RIGHT):new Te(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=B>0||y>0?zt(n.left,n.top+I,B,y,Et.BOTTOM_LEFT):new Te(n.left,n.top+n.height),this.topLeftPaddingBox=o>0||i>0?zt(n.left+O,n.top+Q,Math.max(0,o-O),Math.max(0,i-Q),Et.TOP_LEFT):new Te(n.left+O,n.top+Q),this.topRightPaddingBox=l>0||u>0?zt(n.left+Math.min(v,n.width-x),n.top+Q,v>n.width+x?0:Math.max(0,l-x),Math.max(0,u-Q),Et.TOP_RIGHT):new Te(n.left+n.width-x,n.top+Q),this.bottomRightPaddingBox=h>0||p>0?zt(n.left+Math.min(F,n.width-O),n.top+Math.min(S,n.height-M),Math.max(0,h-x),Math.max(0,p-M),Et.BOTTOM_RIGHT):new Te(n.left+n.width-x,n.top+n.height-M),this.bottomLeftPaddingBox=B>0||y>0?zt(n.left+O,n.top+Math.min(I,n.height-M),Math.max(0,B-O),Math.max(0,y-M),Et.BOTTOM_LEFT):new Te(n.left+O,n.top+n.height-M),this.topLeftContentBox=o>0||i>0?zt(n.left+O+ue,n.top+Q+P,Math.max(0,o-(O+ue)),Math.max(0,i-(Q+P)),Et.TOP_LEFT):new Te(n.left+O+ue,n.top+Q+P),this.topRightContentBox=l>0||u>0?zt(n.left+Math.min(v,n.width+O+ue),n.top+Q+P,v>n.width+O+ue?0:l-O+ue,u-(Q+P),Et.TOP_RIGHT):new Te(n.left+n.width-(x+ie),n.top+Q+P),this.bottomRightContentBox=h>0||p>0?zt(n.left+Math.min(F,n.width-(O+ue)),n.top+Math.min(S,n.height+Q+P),Math.max(0,h-(x+ie)),p-(M+ae),Et.BOTTOM_RIGHT):new Te(n.left+n.width-(x+ie),n.top+n.height-(M+ae)),this.bottomLeftContentBox=B>0||y>0?zt(n.left+O+ue,n.top+I,Math.max(0,B-(O+ue)),y-(M+ae),Et.BOTTOM_LEFT):new Te(n.left+O+ue,n.top+n.height-(M+ae))}return t})(),Et;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Et||(Et={}));var zt=function(t,e,A,n,r){var o=4*((Math.sqrt(2)-1)/3),i=A*o,a=n*o,l=t+A,u=e+n;switch(r){case Et.TOP_LEFT:return new Qf(new Te(t,u),new Te(t,u-a),new Te(l-i,e),new Te(l,e));case Et.TOP_RIGHT:return new Qf(new Te(t,e),new Te(t+i,e),new Te(l,u-a),new Te(l,u));case Et.BOTTOM_RIGHT:return new Qf(new Te(l,e),new Te(l,e+a),new Te(t+i,u),new Te(t,u));case Et.BOTTOM_LEFT:default:return new Qf(new Te(l,u),new Te(l-i,u),new Te(t,e+a),new Te(t,e))}},Ff=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},dJ=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},Uf=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},fJ=(function(){function t(e,A,n){this.offsetX=e,this.offsetY=A,this.matrix=n,this.type=0,this.target=6}return t})(),If=(function(){function t(e,A){this.path=e,this.target=A,this.type=1}return t})(),hJ=(function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t})(),pJ=function(t){return t.type===0},GS=function(t){return t.type===1},mJ=function(t){return t.type===2},WS=function(t,e){return t.length===e.length?t.some(function(A,n){return A===e[n]}):!1},gJ=function(t,e,A,n,r){return t.map(function(o,i){switch(i){case 0:return o.add(e,A);case 1:return o.add(e+n,A);case 2:return o.add(e+n,A+r);case 3:return o.add(e,A+r)}return o})},zS=(function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t})(),YS=(function(){function t(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new uJ(this.container),this.container.styles.opacity<1&&this.effects.push(new hJ(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new fJ(n,r,o))}if(this.container.styles.overflowX!==0){var i=Ff(this.curves),a=Uf(this.curves);WS(i,a)?this.effects.push(new If(i,6)):(this.effects.push(new If(i,2)),this.effects.push(new If(a,4)))}}return t.prototype.getEffects=function(e){for(var A=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var o=n.effects.filter(function(l){return!GS(l)});if(A||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,o),A=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var i=Ff(n.curves),a=Uf(n.curves);WS(i,a)||r.unshift(new If(a,6))}}else r.unshift.apply(r,o);n=n.parent}return r.filter(function(l){return vA(l.target,e)})},t})(),UB=function(t,e,A,n){t.container.elements.forEach(function(r){var o=vA(r.flags,4),i=vA(r.flags,2),a=new YS(r,t);vA(r.styles.display,2048)&&n.push(a);var l=vA(r.flags,8)?[]:n;if(o||i){var u=o||r.styles.isPositioned()?A:e,f=new zS(a);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var h=r.styles.zIndex.order;if(h<0){var p=0;u.negativeZIndex.some(function(B,y){return h>B.element.container.styles.zIndex.order?(p=y,!1):p>0}),u.negativeZIndex.splice(p,0,f)}else if(h>0){var g=0;u.positiveZIndex.some(function(B,y){return h>=B.element.container.styles.zIndex.order?(g=y+1,!1):g>0}),u.positiveZIndex.splice(g,0,f)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else r.styles.isFloating()?u.nonPositionedFloats.push(f):u.nonPositionedInlineLevel.push(f);UB(a,f,o?f:A,l)}else r.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),UB(a,e,A,l);vA(r.flags,8)&&JS(r,l)})},JS=function(t,e){for(var A=t instanceof BB?t.start:1,n=t instanceof BB?t.reversed:!1,r=0;r<e.length;r++){var o=e[r];o.container instanceof wS&&typeof o.container.value=="number"&&o.container.value!==0&&(A=o.container.value),o.listValue=bc(A,o.container.styles.listStyleType,!0),A+=n?-1:1}},BJ=function(t){var e=new YS(t,null),A=new zS(e),n=[];return UB(e,A,A,n),JS(e.container,n),A},XS=function(t,e){switch(e){case 0:return ir(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return ir(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return ir(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return ir(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},yJ=function(t,e){switch(e){case 0:return ir(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return ir(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return ir(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return ir(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},wJ=function(t,e){switch(e){case 0:return ir(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return ir(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return ir(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return ir(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},CJ=function(t,e){switch(e){case 0:return xf(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return xf(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return xf(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return xf(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},xf=function(t,e){var A=[];return or(t)?A.push(t.subdivide(.5,!1)):A.push(t),or(e)?A.push(e.subdivide(.5,!0)):A.push(e),A},ir=function(t,e,A,n){var r=[];return or(t)?r.push(t.subdivide(.5,!1)):r.push(t),or(A)?r.push(A.subdivide(.5,!0)):r.push(A),or(n)?r.push(n.subdivide(.5,!0).reverse()):r.push(n),or(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r},jS=function(t){var e=t.bounds,A=t.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Tf=function(t){var e=t.styles,A=t.bounds,n=Mt(e.paddingLeft,A.width),r=Mt(e.paddingRight,A.width),o=Mt(e.paddingTop,A.width),i=Mt(e.paddingBottom,A.width);return A.add(n+e.borderLeftWidth,o+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+r),-(e.borderTopWidth+e.borderBottomWidth+o+i))},bJ=function(t,e){return t===0?e.bounds:t===2?Tf(e):jS(e)},vJ=function(t,e){return t===0?e.bounds:t===2?Tf(e):jS(e)},IB=function(t,e,A){var n=bJ(_a(t.styles.backgroundOrigin,e),t),r=vJ(_a(t.styles.backgroundClip,e),t),o=EJ(_a(t.styles.backgroundSize,e),A,n),i=o[0],a=o[1],l=mc(_a(t.styles.backgroundPosition,e),n.width-i,n.height-a),u=kJ(_a(t.styles.backgroundRepeat,e),l,o,n,r),f=Math.round(n.left+l[0]),h=Math.round(n.top+l[1]);return[u,f,h,i,a]},Ta=function(t){return Dt(t)&&t.value===Qa.AUTO},_f=function(t){return typeof t=="number"},EJ=function(t,e,A){var n=e[0],r=e[1],o=e[2],i=t[0],a=t[1];if(!i)return[0,0];if(CA(i)&&a&&CA(a))return[Mt(i,A.width),Mt(a,A.height)];var l=_f(o);if(Dt(i)&&(i.value===Qa.CONTAIN||i.value===Qa.COVER)){if(_f(o)){var u=A.width/A.height;return u<o!=(i.value===Qa.COVER)?[A.width,A.width/o]:[A.height*o,A.height]}return[A.width,A.height]}var f=_f(n),h=_f(r),p=f||h;if(Ta(i)&&(!a||Ta(a))){if(f&&h)return[n,r];if(!l&&!p)return[A.width,A.height];if(p&&l){var g=f?n:r*o,B=h?r:n/o;return[g,B]}var y=f?n:A.width,b=h?r:A.height;return[y,b]}if(l){var w=0,v=0;return CA(i)?w=Mt(i,A.width):CA(a)&&(v=Mt(a,A.height)),Ta(i)?w=v*o:(!a||Ta(a))&&(v=w/o),[w,v]}var S=null,F=null;if(CA(i)?S=Mt(i,A.width):a&&CA(a)&&(F=Mt(a,A.height)),S!==null&&(!a||Ta(a))&&(F=f&&h?S/n*r:A.height),F!==null&&Ta(i)&&(S=f&&h?F/r*n:A.width),S!==null&&F!==null)return[S,F];throw new Error("Unable to calculate background-size for element")},_a=function(t,e){var A=t[e];return typeof A>"u"?t[0]:A},kJ=function(t,e,A,n,r){var o=e[0],i=e[1],a=A[0],l=A[1];switch(t){case 2:return[new Te(Math.round(n.left),Math.round(n.top+i)),new Te(Math.round(n.left+n.width),Math.round(n.top+i)),new Te(Math.round(n.left+n.width),Math.round(l+n.top+i)),new Te(Math.round(n.left),Math.round(l+n.top+i))];case 3:return[new Te(Math.round(n.left+o),Math.round(n.top)),new Te(Math.round(n.left+o+a),Math.round(n.top)),new Te(Math.round(n.left+o+a),Math.round(n.height+n.top)),new Te(Math.round(n.left+o),Math.round(n.height+n.top))];case 1:return[new Te(Math.round(n.left+o),Math.round(n.top+i)),new Te(Math.round(n.left+o+a),Math.round(n.top+i)),new Te(Math.round(n.left+o+a),Math.round(n.top+i+l)),new Te(Math.round(n.left+o),Math.round(n.top+i+l))];default:return[new Te(Math.round(r.left),Math.round(r.top)),new Te(Math.round(r.left+r.width),Math.round(r.top)),new Te(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Te(Math.round(r.left),Math.round(r.height+r.top))]}},SJ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",qS="Hidden Text",QJ=(function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,A){var n=this._document.createElement("div"),r=this._document.createElement("img"),o=this._document.createElement("span"),i=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=A,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",i.appendChild(n),r.src=SJ,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",o.style.fontFamily=e,o.style.fontSize=A,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(qS)),n.appendChild(o),n.appendChild(r);var a=r.offsetTop-o.offsetTop+2;n.removeChild(o),n.appendChild(this._document.createTextNode(qS)),n.style.lineHeight="normal",r.style.verticalAlign="super";var l=r.offsetTop-n.offsetTop+2;return i.removeChild(n),{baseline:a,middle:l}},t.prototype.getMetrics=function(e,A){var n=e+" "+A;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,A)),this._data[n]},t})(),ZS=(function(){function t(e,A){this.context=e,this.options=A}return t})(),FJ=1e4,UJ=(function(t){Fr(e,t);function e(A,n){var r=t.call(this,A,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px"),r.fontMetrics=new QJ(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),r}return e.prototype.applyEffects=function(A){for(var n=this;this._activeEffects.length;)this.popEffect();A.forEach(function(r){return n.applyEffect(r)})},e.prototype.applyEffect=function(A){this.ctx.save(),mJ(A)&&(this.ctx.globalAlpha=A.opacity),pJ(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),GS(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(A){return dn(this,void 0,void 0,function(){var n;return ZA(this,function(r){switch(r.label){case 0:return n=A.element.container.styles,n.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(A){return dn(this,void 0,void 0,function(){return ZA(this,function(n){switch(n.label){case 0:if(vA(A.container.flags,16))debugger;return A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(A)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(A,n,r){var o=this;if(n===0)this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+r);else{var i=gB(A.text);i.reduce(function(a,l){return o.ctx.fillText(l,a,A.bounds.top+r),a+o.ctx.measureText(l).width},A.bounds.left)}},e.prototype.createFontStyle=function(A){var n=A.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),r=DJ(A.fontFamily).join(", "),o=pc(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,n,A.fontWeight,o,r].join(" "),r,o]},e.prototype.renderTextNode=function(A,n){return dn(this,void 0,void 0,function(){var r,o,i,a,l,u,f,h,p=this;return ZA(this,function(g){return r=this.createFontStyle(n),o=r[0],i=r[1],a=r[2],this.ctx.font=o,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",l=this.fontMetrics.getMetrics(i,a),u=l.baseline,f=l.middle,h=n.paintOrder,A.textBounds.forEach(function(B){h.forEach(function(y){switch(y){case 0:p.ctx.fillStyle=OA(n.color),p.renderTextWithLetterSpacing(B,n.letterSpacing,u);var b=n.textShadow;b.length&&B.text.trim().length&&(b.slice(0).reverse().forEach(function(w){p.ctx.shadowColor=OA(w.color),p.ctx.shadowOffsetX=w.offsetX.number*p.options.scale,p.ctx.shadowOffsetY=w.offsetY.number*p.options.scale,p.ctx.shadowBlur=w.blur.number,p.renderTextWithLetterSpacing(B,n.letterSpacing,u)}),p.ctx.shadowColor="",p.ctx.shadowOffsetX=0,p.ctx.shadowOffsetY=0,p.ctx.shadowBlur=0),n.textDecorationLine.length&&(p.ctx.fillStyle=OA(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(w){switch(w){case 1:p.ctx.fillRect(B.bounds.left,Math.round(B.bounds.top+u),B.bounds.width,1);break;case 2:p.ctx.fillRect(B.bounds.left,Math.round(B.bounds.top),B.bounds.width,1);break;case 3:p.ctx.fillRect(B.bounds.left,Math.ceil(B.bounds.top+f),B.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&B.text.trim().length&&(p.ctx.strokeStyle=OA(n.webkitTextStrokeColor),p.ctx.lineWidth=n.webkitTextStrokeWidth,p.ctx.lineJoin=window.chrome?"miter":"round",p.ctx.strokeText(B.text,B.bounds.left,B.bounds.top+u)),p.ctx.strokeStyle="",p.ctx.lineWidth=0,p.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(A,n,r){if(r&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var o=Tf(A),i=Uf(n);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,A.intrinsicWidth,A.intrinsicHeight,o.left,o.top,o.width,o.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l,v,v,u,f,h,p,F,g,B,I,y,b,w,v,S,F,I;return ZA(this,function(Q){switch(Q.label){case 0:this.applyEffects(A.getEffects(4)),n=A.container,r=A.curves,o=n.styles,i=0,a=n.textNodes,Q.label=1;case 1:return i<a.length?(l=a[i],[4,this.renderTextNode(l,o)]):[3,4];case 2:Q.sent(),Q.label=3;case 3:return i++,[3,1];case 4:if(!(n instanceof gS))return[3,8];Q.label=5;case 5:return Q.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return v=Q.sent(),this.renderReplacedElement(n,r,v),[3,8];case 7:return Q.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof BS&&this.renderReplacedElement(n,r,n.canvas),!(n instanceof yS))return[3,12];Q.label=9;case 9:return Q.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return v=Q.sent(),this.renderReplacedElement(n,r,v),[3,12];case 11:return Q.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof ES&&n.tree?(u=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,u.render(n.tree)]):[3,14];case 13:f=Q.sent(),n.width&&n.height&&this.ctx.drawImage(f,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),Q.label=14;case 14:if(n instanceof yB&&(h=Math.min(n.bounds.width,n.bounds.height),n.type===Cf?n.checked&&(this.ctx.save(),this.path([new Te(n.bounds.left+h*.39363,n.bounds.top+h*.79),new Te(n.bounds.left+h*.16,n.bounds.top+h*.5549),new Te(n.bounds.left+h*.27347,n.bounds.top+h*.44071),new Te(n.bounds.left+h*.39694,n.bounds.top+h*.5649),new Te(n.bounds.left+h*.72983,n.bounds.top+h*.23),new Te(n.bounds.left+h*.84,n.bounds.top+h*.34085),new Te(n.bounds.left+h*.39363,n.bounds.top+h*.79)]),this.ctx.fillStyle=OA(CS),this.ctx.fill(),this.ctx.restore()):n.type===bf&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+h/2,n.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=OA(CS),this.ctx.fill(),this.ctx.restore())),IJ(n)&&n.value.length){switch(p=this.createFontStyle(o),F=p[0],g=p[1],B=this.fontMetrics.getMetrics(F,g).baseline,this.ctx.font=F,this.ctx.fillStyle=OA(o.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=TJ(n.styles.textAlign),I=Tf(n),y=0,n.styles.textAlign){case 1:y+=I.width/2;break;case 2:y+=I.width;break}b=I.add(y,0,0,-I.height/2+1),this.ctx.save(),this.path([new Te(I.left,I.top),new Te(I.left+I.width,I.top),new Te(I.left+I.width,I.top+I.height),new Te(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new wc(n.value,b),o.letterSpacing,B),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!vA(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(w=n.styles.listStyleImage,w.type!==0)return[3,18];v=void 0,S=w.url,Q.label=15;case 15:return Q.trys.push([15,17,,18]),[4,this.context.cache.match(S)];case 16:return v=Q.sent(),this.ctx.drawImage(v,n.bounds.left-(v.width+10),n.bounds.top),[3,18];case 17:return Q.sent(),this.context.logger.error("Error loading list-style-image "+S),[3,18];case 18:return[3,20];case 19:A.listValue&&n.styles.listStyleType!==-1&&(F=this.createFontStyle(o)[0],this.ctx.font=F,this.ctx.fillStyle=OA(o.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new To(n.bounds.left,n.bounds.top+Mt(n.styles.paddingTop,n.bounds.width),n.bounds.width,qk(o.lineHeight,o.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new wc(A.listValue,I),o.letterSpacing,qk(o.lineHeight,o.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Q.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(A){return dn(this,void 0,void 0,function(){var n,r,w,o,i,w,a,l,w,u,f,w,h,p,w,g,B,w,y,b,w;return ZA(this,function(v){switch(v.label){case 0:if(vA(A.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:v.sent(),n=0,r=A.negativeZIndex,v.label=2;case 2:return n<r.length?(w=r[n],[4,this.renderStack(w)]):[3,5];case 3:v.sent(),v.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:v.sent(),o=0,i=A.nonInlineLevel,v.label=7;case 7:return o<i.length?(w=i[o],[4,this.renderNode(w)]):[3,10];case 8:v.sent(),v.label=9;case 9:return o++,[3,7];case 10:a=0,l=A.nonPositionedFloats,v.label=11;case 11:return a<l.length?(w=l[a],[4,this.renderStack(w)]):[3,14];case 12:v.sent(),v.label=13;case 13:return a++,[3,11];case 14:u=0,f=A.nonPositionedInlineLevel,v.label=15;case 15:return u<f.length?(w=f[u],[4,this.renderStack(w)]):[3,18];case 16:v.sent(),v.label=17;case 17:return u++,[3,15];case 18:h=0,p=A.inlineLevel,v.label=19;case 19:return h<p.length?(w=p[h],[4,this.renderNode(w)]):[3,22];case 20:v.sent(),v.label=21;case 21:return h++,[3,19];case 22:g=0,B=A.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return g<B.length?(w=B[g],[4,this.renderStack(w)]):[3,26];case 24:v.sent(),v.label=25;case 25:return g++,[3,23];case 26:y=0,b=A.positiveZIndex,v.label=27;case 27:return y<b.length?(w=b[y],[4,this.renderStack(w)]):[3,30];case 28:v.sent(),v.label=29;case 29:return y++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},e.prototype.formatPath=function(A){var n=this;A.forEach(function(r,o){var i=or(r)?r.start:r;o===0?n.ctx.moveTo(i.x,i.y):n.ctx.lineTo(i.x,i.y),or(r)&&n.ctx.bezierCurveTo(r.startControl.x,r.startControl.y,r.endControl.x,r.endControl.y,r.end.x,r.end.y)})},e.prototype.renderRepeat=function(A,n,r,o){this.path(A),this.ctx.fillStyle=n,this.ctx.translate(r,o),this.ctx.fill(),this.ctx.translate(-r,-o)},e.prototype.resizeImage=function(A,n,r){var o;if(A.width===n&&A.height===r)return A;var i=(o=this.canvas.ownerDocument)!==null&&o!==void 0?o:document,a=i.createElement("canvas");a.width=Math.max(1,n),a.height=Math.max(1,r);var l=a.getContext("2d");return l.drawImage(A,0,0,A.width,A.height,0,0,n,r),a},e.prototype.renderBackgroundImage=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l;return ZA(this,function(u){switch(u.label){case 0:n=A.styles.backgroundImage.length-1,r=function(f){var h,p,g,P,$,te,ue,H,M,B,P,$,te,ue,H,y,b,w,v,S,F,I,Q,x,M,O,P,ie,ae,ue,H,G,$,te,ee,K,ce,j,Qe,R,J,Ae;return ZA(this,function(oe){switch(oe.label){case 0:if(f.type!==0)return[3,5];h=void 0,p=f.url,oe.label=1;case 1:return oe.trys.push([1,3,,4]),[4,o.context.cache.match(p)];case 2:return h=oe.sent(),[3,4];case 3:return oe.sent(),o.context.logger.error("Error loading background-image "+p),[3,4];case 4:return h&&(g=IB(A,n,[h.width,h.height,h.width/h.height]),P=g[0],$=g[1],te=g[2],ue=g[3],H=g[4],M=o.ctx.createPattern(o.resizeImage(h,ue,H),"repeat"),o.renderRepeat(P,M,$,te)),[3,6];case 5:pY(f)?(B=IB(A,n,[null,null,null]),P=B[0],$=B[1],te=B[2],ue=B[3],H=B[4],y=cY(f.angle,ue,H),b=y[0],w=y[1],v=y[2],S=y[3],F=y[4],I=document.createElement("canvas"),I.width=ue,I.height=H,Q=I.getContext("2d"),x=Q.createLinearGradient(w,S,v,F),Pk(f.stops,b).forEach(function(k){return x.addColorStop(k.stop,OA(k.color))}),Q.fillStyle=x,Q.fillRect(0,0,ue,H),ue>0&&H>0&&(M=o.ctx.createPattern(I,"repeat"),o.renderRepeat(P,M,$,te))):mY(f)&&(O=IB(A,n,[null,null,null]),P=O[0],ie=O[1],ae=O[2],ue=O[3],H=O[4],G=f.position.length===0?[AB]:f.position,$=Mt(G[0],ue),te=Mt(G[G.length-1],H),ee=uY(f,$,te,ue,H),K=ee[0],ce=ee[1],K>0&&ce>0&&(j=o.ctx.createRadialGradient(ie+$,ae+te,0,ie+$,ae+te,K),Pk(f.stops,K*2).forEach(function(k){return j.addColorStop(k.stop,OA(k.color))}),o.path(P),o.ctx.fillStyle=j,K!==ce?(Qe=A.bounds.left+.5*A.bounds.width,R=A.bounds.top+.5*A.bounds.height,J=ce/K,Ae=1/J,o.ctx.save(),o.ctx.translate(Qe,R),o.ctx.transform(1,0,0,J,0,0),o.ctx.translate(-Qe,-R),o.ctx.fillRect(ie,Ae*(ae-R)+R,ue,H*Ae),o.ctx.restore()):o.ctx.fill())),oe.label=6;case 6:return n--,[2]}})},o=this,i=0,a=A.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return i<a.length?(l=a[i],[5,r(l)]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(A,n,r){return dn(this,void 0,void 0,function(){return ZA(this,function(o){return this.path(XS(r,n)),this.ctx.fillStyle=OA(A),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(A,n,r,o){return dn(this,void 0,void 0,function(){var i,a;return ZA(this,function(l){switch(l.label){case 0:return n<3?[4,this.renderSolidBorder(A,r,o)]:[3,2];case 1:return l.sent(),[2];case 2:return i=yJ(o,r),this.path(i),this.ctx.fillStyle=OA(A),this.ctx.fill(),a=wJ(o,r),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l,u,f,h=this;return ZA(this,function(p){switch(p.label){case 0:return this.applyEffects(A.getEffects(2)),n=A.container.styles,r=!Ii(n.backgroundColor)||n.backgroundImage.length,o=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],i=xJ(_a(n.backgroundClip,0),A.curves),r||n.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ii(n.backgroundColor)||(this.ctx.fillStyle=OA(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:p.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(g){h.ctx.save();var B=Ff(A.curves),y=g.inset?0:FJ,b=gJ(B,-y+(g.inset?1:-1)*g.spread.number,(g.inset?1:-1)*g.spread.number,g.spread.number*(g.inset?-2:2),g.spread.number*(g.inset?-2:2));g.inset?(h.path(B),h.ctx.clip(),h.mask(b)):(h.mask(B),h.ctx.clip(),h.path(b)),h.ctx.shadowOffsetX=g.offsetX.number+y,h.ctx.shadowOffsetY=g.offsetY.number,h.ctx.shadowColor=OA(g.color),h.ctx.shadowBlur=g.blur.number,h.ctx.fillStyle=g.inset?OA(g.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),p.label=2;case 2:a=0,l=0,u=o,p.label=3;case 3:return l<u.length?(f=u[l],f.style!==0&&!Ii(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,a,A.curves,2)]:[3,11]):[3,13];case 4:return p.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,a,A.curves,3)];case 6:return p.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,a,A.curves)];case 8:return p.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,a,A.curves)];case 10:p.sent(),p.label=11;case 11:a++,p.label=12;case 12:return l++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(A,n,r,o,i){return dn(this,void 0,void 0,function(){var a,l,u,f,h,p,g,B,y,b,w,v,S,F,I,Q,I,Q;return ZA(this,function(x){return this.ctx.save(),a=CJ(o,r),l=XS(o,r),i===2&&(this.path(l),this.ctx.clip()),or(l[0])?(u=l[0].start.x,f=l[0].start.y):(u=l[0].x,f=l[0].y),or(l[1])?(h=l[1].end.x,p=l[1].end.y):(h=l[1].x,p=l[1].y),r===0||r===2?g=Math.abs(u-h):g=Math.abs(f-p),this.ctx.beginPath(),i===3?this.formatPath(a):this.formatPath(l.slice(0,2)),B=n<3?n*3:n*2,y=n<3?n*2:n,i===3&&(B=n,y=n),b=!0,g<=B*2?b=!1:g<=B*2+y?(w=g/(2*B+y),B*=w,y*=w):(v=Math.floor((g+y)/(B+y)),S=(g-v*B)/(v-1),F=(g-(v+1)*B)/v,y=F<=0||Math.abs(y-S)<Math.abs(y-F)?S:F),b&&(i===3?this.ctx.setLineDash([0,B+y]):this.ctx.setLineDash([B,y])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=OA(A),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(or(l[0])&&(I=l[3],Q=l[0],this.ctx.beginPath(),this.formatPath([new Te(I.end.x,I.end.y),new Te(Q.start.x,Q.start.y)]),this.ctx.stroke()),or(l[1])&&(I=l[1],Q=l[2],this.ctx.beginPath(),this.formatPath([new Te(I.end.x,I.end.y),new Te(Q.start.x,Q.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(A){return dn(this,void 0,void 0,function(){var n;return ZA(this,function(r){switch(r.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=OA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=BJ(A),[4,this.renderStack(n)];case 1:return r.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(ZS),IJ=function(t){return t instanceof vS||t instanceof bS?!0:t instanceof yB&&t.type!==bf&&t.type!==Cf},xJ=function(t,e){switch(t){case 0:return Ff(e);case 2:return dJ(e);case 1:default:return Uf(e)}},TJ=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},_J=["-apple-system","system-ui"],DJ=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return _J.indexOf(e)===-1}):t},LJ=(function(t){Fr(e,t);function e(A,n){var r=t.call(this,A,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),r}return e.prototype.render=function(A){return dn(this,void 0,void 0,function(){var n,r;return ZA(this,function(o){switch(o.label){case 0:return n=mB(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,OJ(n)];case 1:return r=o.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=OA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(r,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(ZS),OJ=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},MJ=(function(){function t(e){var A=e.id,n=e.enabled;this.id=A,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Rd([this.id,this.getTime()+"ms"],e))},t.prototype.warn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.instances={},t})(),NJ=(function(){function t(e,A){var n;this.windowBounds=A,this.instanceName="#"+t.instanceCount++,this.logger=new MJ({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new rJ(this,e)}return t.instanceCount=1,t})(),HJ=function(t,e){return e===void 0&&(e={}),RJ(t,e)};typeof window<"u"&&KS.setContext(window);var RJ=function(t,e){return dn(void 0,void 0,void 0,function(){var A,n,r,o,i,a,l,u,f,h,p,g,B,y,b,w,v,S,F,I,x,Q,x,M,O,P,ie,ae,ue,H,G,$,te,ee,K,ce,j,Qe,R,J;return ZA(this,function(Ae){switch(Ae.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(A=t.ownerDocument,!A)throw new Error("Element is not attached to a Document");if(n=A.defaultView,!n)throw new Error("Document is not attached to a Window");return r={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(O=e.imageTimeout)!==null&&O!==void 0?O:15e3,proxy:e.proxy,useCORS:(P=e.useCORS)!==null&&P!==void 0?P:!1},o=Lg({logging:(ie=e.logging)!==null&&ie!==void 0?ie:!0,cache:e.cache},r),i={windowWidth:(ae=e.windowWidth)!==null&&ae!==void 0?ae:n.innerWidth,windowHeight:(ue=e.windowHeight)!==null&&ue!==void 0?ue:n.innerHeight,scrollX:(H=e.scrollX)!==null&&H!==void 0?H:n.pageXOffset,scrollY:(G=e.scrollY)!==null&&G!==void 0?G:n.pageYOffset},a=new To(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),l=new NJ(o,a),u=($=e.foreignObjectRendering)!==null&&$!==void 0?$:!1,f={allowTaint:(te=e.allowTaint)!==null&&te!==void 0?te:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),h=new VS(l,t,f),p=h.clonedReferenceElement,p?[4,h.toIFrame(A,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=Ae.sent(),B=CB(p)||P6(p)?g5(p.ownerDocument):Pd(l,p),y=B.width,b=B.height,w=B.left,v=B.top,S=PJ(l,p,e.backgroundColor),F={canvas:e.canvas,backgroundColor:S,scale:(K=(ee=e.scale)!==null&&ee!==void 0?ee:n.devicePixelRatio)!==null&&K!==void 0?K:1,x:((ce=e.x)!==null&&ce!==void 0?ce:0)+w,y:((j=e.y)!==null&&j!==void 0?j:0)+v,width:(Qe=e.width)!==null&&Qe!==void 0?Qe:Math.ceil(y),height:(R=e.height)!==null&&R!==void 0?R:Math.ceil(b)},u?(l.logger.debug("Document cloned, using foreign object rendering"),x=new LJ(l,F),[4,x.render(p)]):[3,3];case 2:return I=Ae.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+w+","+v+" with size "+y+"x"+b+" using computed rendering"),l.logger.debug("Starting DOM parsing"),Q=SS(l,p),S===Q.styles.backgroundColor&&(Q.styles.backgroundColor=Do.TRANSPARENT),l.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),x=new UJ(l,F),[4,x.render(Q)];case 4:I=Ae.sent(),Ae.label=5;case 5:return(!((J=e.removeContainer)!==null&&J!==void 0)||J)&&(VS.destroy(g)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,I]}})})},PJ=function(t,e,A){var n=e.ownerDocument,r=n.documentElement?gc(t,getComputedStyle(n.documentElement).backgroundColor):Do.TRANSPARENT,o=n.body?gc(t,getComputedStyle(n.body).backgroundColor):Do.TRANSPARENT,i=typeof A=="string"?gc(t,A):A===null?Do.TRANSPARENT:4294967295;return e===n.documentElement?Ii(r)?Ii(o)?i:o:r:i};const VJ=s.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},debug:{type:Boolean,default:!1}},emits:["update:modelValue","update:pending"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.ref(""),i=s.ref();async function a(){if(r.value){n("update:pending",!0);const u=r.value,f=u.firstElementChild,h=f.offsetWidth,p=f.offsetHeight,B=(await HJ(u.firstElementChild,{backgroundColor:"rgba(0, 0, 0, 0)",scale:1,width:h,height:p,...A.options})).toDataURL();if(n("update:modelValue",B),n("update:pending",!1),A.debug){const y=new Image;y.src=B,document.body.appendChild(y)}return B}return""}const l=$1.debounce(async()=>{o.value=await a()},300,{trailing:!0,leading:!1});return s.onMounted(()=>{const u=r.value;A.renderUpdates&&(i.value=new MutationObserver(async f=>{l()}),i.value.observe(u,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),setTimeout(()=>{l()},500)}),(u,f)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["dom-renderer",{"off-screen":!t.debug}]),ref_key:"renderer",ref:r,style:s.normalizeStyle(t.fixedWidth>0?{width:`${t.fixedWidth}px`}:{})},[s.renderSlot(u.$slots,"default")],6))}}),$J=["id","popover"],xB=s.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:e}){const A=t,n=e,r=s.ref(),o=s.ref(),i=s.ref(!1),a=s.computed(()=>"ontouchstart"in window||navigator.maxTouchPoints>0);function l(){clearTimeout(o.value),A.hover&&r.value?.showPopover()}function u(){i.value=!0,clearTimeout(o.value),l()}function f(){i.value=!1,(A.hover||A.closeTimeout)&&(o.value=setTimeout(()=>{r.value?.hidePopover()},A.closeTimeout||A.hoverDelay))}s.watch(()=>A.modelValue,(p,g)=>{p&&!g?r.value?.matches(":popover-open")||r.value?.showPopover():!p&&g&&r.value?.matches(":popover-open")&&r.value?.hidePopover()});function h(p){p.newState==="open"?(A.closeTimeout&&!i.value&&(clearTimeout(o.value),o.value=setTimeout(()=>{i.value||r.value?.hidePopover()},A.closeTimeout)),A.modelValue||n("update:modelValue",!0)):p.newState==="closed"&&(i.value=!1,A.modelValue&&n("update:modelValue",!1))}return s.onMounted(()=>{if(r.value?.addEventListener("toggle",h),A.modelValue&&r.value?.showPopover(),!a.value){r.value?.addEventListener("mouseenter",u),r.value?.addEventListener("mouseleave",f);const p=document.querySelector(`[popovertarget="${A.id}"]`);p&&(p.addEventListener("mouseenter",u),p.addEventListener("mouseleave",f))}}),s.onBeforeUnmount(()=>{if(clearTimeout(o.value),r.value?.removeEventListener("toggle",h),!a.value){r.value?.removeEventListener("mouseenter",u),r.value?.removeEventListener("mouseleave",f);const p=document.querySelector(`[popovertarget="${A.id}"]`);p&&(p.removeEventListener("mouseenter",u),p.removeEventListener("mouseleave",f))}}),(p,g)=>(s.openBlock(),s.createElementBlock("span",{class:"popover-dialog",id:t.id,popover:t.type,ref_key:"popover",ref:r},[s.renderSlot(p.$slots,"default",{},()=>[g[0]||(g[0]=s.createTextVNode(" Popover content goes here. ",-1))])],8,$J))}});var KJ=Object.defineProperty,GJ=Object.defineProperties,WJ=Object.getOwnPropertyDescriptors,eQ=Object.getOwnPropertySymbols,zJ=Object.prototype.hasOwnProperty,YJ=Object.prototype.propertyIsEnumerable,tQ=(t,e,A)=>e in t?KJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,MA=(t,e)=>{for(var A in e||(e={}))zJ.call(e,A)&&tQ(t,A,e[A]);if(eQ)for(var A of eQ(e))YJ.call(e,A)&&tQ(t,A,e[A]);return t},kn=(t,e)=>GJ(t,WJ(e)),Vt=(t,e,A)=>new Promise((n,r)=>{var o=l=>{try{a(A.next(l))}catch(u){r(u)}},i=l=>{try{a(A.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,i);a((A=A.apply(t,e)).next())});const TB=Math.min,Da=Math.max,Df=Math.round,Lf=Math.floor,Ao=t=>({x:t,y:t});function JJ(t,e){return typeof t=="function"?t(e):t}function XJ(t){return MA({top:0,right:0,bottom:0,left:0},t)}function jJ(t){return typeof t!="number"?XJ(t):{top:t,right:t,bottom:t,left:t}}function Of(t){const{x:e,y:A,width:n,height:r}=t;return{width:n,height:r,top:A,left:e,right:e+n,bottom:A+r,x:e,y:A}}function qJ(t,e){return Vt(this,null,function*(){var A;e===void 0&&(e={});const{x:n,y:r,platform:o,rects:i,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=JJ(e,t),B=jJ(g),y=a[p?h==="floating"?"reference":"floating":h],b=Of(yield o.getClippingRect({element:(A=yield o.isElement==null?void 0:o.isElement(y))==null||A?y:y.contextElement||(yield o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:n,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=yield o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating),S=(yield o.isElement==null?void 0:o.isElement(v))?(yield o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},F=Of(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(b.top-F.top+B.top)/S.y,bottom:(F.bottom-b.bottom+B.bottom)/S.y,left:(b.left-F.left+B.left)/S.x,right:(F.right-b.right+B.right)/S.x}})}function Mf(){return typeof window<"u"}function La(t){return AQ(t)?(t.nodeName||"").toLowerCase():"#document"}function Hn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function no(t){var e;return(e=(AQ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function AQ(t){return Mf()?t instanceof Node||t instanceof Hn(t).Node:!1}function Ir(t){return Mf()?t instanceof Element||t instanceof Hn(t).Element:!1}function ro(t){return Mf()?t instanceof HTMLElement||t instanceof Hn(t).HTMLElement:!1}function nQ(t){return!Mf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Hn(t).ShadowRoot}function Ec(t){const{overflow:e,overflowX:A,overflowY:n,display:r}=xr(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+A)&&!["inline","contents"].includes(r)}function ZJ(t){return["table","td","th"].includes(La(t))}function Nf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function _B(t){const e=DB(),A=Ir(t)?xr(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>A[n]?A[n]!=="none":!1)||(A.containerType?A.containerType!=="normal":!1)||!e&&(A.backdropFilter?A.backdropFilter!=="none":!1)||!e&&(A.filter?A.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(A.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(A.contain||"").includes(n))}function eX(t){let e=Di(t);for(;ro(e)&&!Oa(e);){if(_B(e))return e;if(Nf(e))return null;e=Di(e)}return null}function DB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oa(t){return["html","body","#document"].includes(La(t))}function xr(t){return Hn(t).getComputedStyle(t)}function Hf(t){return Ir(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Di(t){if(La(t)==="html")return t;const e=t.assignedSlot||t.parentNode||nQ(t)&&t.host||no(t);return nQ(e)?e.host:e}function rQ(t){const e=Di(t);return Oa(e)?t.ownerDocument?t.ownerDocument.body:t.body:ro(e)&&Ec(e)?e:rQ(e)}function kc(t,e,A){var n;e===void 0&&(e=[]),A===void 0&&(A=!0);const r=rQ(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Hn(r);if(o){const a=LB(i);return e.concat(i,i.visualViewport||[],Ec(r)?r:[],a&&A?kc(a):[])}return e.concat(r,kc(r,[],A))}function LB(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function oQ(t){const e=xr(t);let A=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const r=ro(t),o=r?t.offsetWidth:A,i=r?t.offsetHeight:n,a=Df(A)!==o||Df(n)!==i;return a&&(A=o,n=i),{width:A,height:n,$:a}}function OB(t){return Ir(t)?t:t.contextElement}function Ma(t){const e=OB(t);if(!ro(e))return Ao(1);const A=e.getBoundingClientRect(),{width:n,height:r,$:o}=oQ(e);let i=(o?Df(A.width):A.width)/n,a=(o?Df(A.height):A.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const tX=Ao(0);function iQ(t){const e=Hn(t);return!DB()||!e.visualViewport?tX:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function AX(t,e,A){return e===void 0&&(e=!1),!A||e&&A!==Hn(t)?!1:e}function Ss(t,e,A,n){e===void 0&&(e=!1),A===void 0&&(A=!1);const r=t.getBoundingClientRect(),o=OB(t);let i=Ao(1);e&&(n?Ir(n)&&(i=Ma(n)):i=Ma(t));const a=AX(o,A,n)?iQ(o):Ao(0);let l=(r.left+a.x)/i.x,u=(r.top+a.y)/i.y,f=r.width/i.x,h=r.height/i.y;if(o){const p=Hn(o),g=n&&Ir(n)?Hn(n):n;let B=p,y=LB(B);for(;y&&n&&g!==B;){const b=Ma(y),w=y.getBoundingClientRect(),v=xr(y),S=w.left+(y.clientLeft+parseFloat(v.paddingLeft))*b.x,F=w.top+(y.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,u*=b.y,f*=b.x,h*=b.y,l+=S,u+=F,B=Hn(y),y=LB(B)}}return Of({width:f,height:h,x:l,y:u})}function MB(t,e){const A=Hf(t).scrollLeft;return e?e.left+A:Ss(no(t)).left+A}function sQ(t,e,A){A===void 0&&(A=!1);const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-(A?0:MB(t,n)),o=n.top+e.scrollTop;return{x:r,y:o}}function nX(t){let{elements:e,rect:A,offsetParent:n,strategy:r}=t;const o=r==="fixed",i=no(n),a=e?Nf(e.floating):!1;if(n===i||a&&o)return A;let l={scrollLeft:0,scrollTop:0},u=Ao(1);const f=Ao(0),h=ro(n);if((h||!h&&!o)&&((La(n)!=="body"||Ec(i))&&(l=Hf(n)),ro(n))){const g=Ss(n);u=Ma(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const p=i&&!h&&!o?sQ(i,l,!0):Ao(0);return{width:A.width*u.x,height:A.height*u.y,x:A.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:A.y*u.y-l.scrollTop*u.y+f.y+p.y}}function rX(t){return Array.from(t.getClientRects())}function oX(t){const e=no(t),A=Hf(t),n=t.ownerDocument.body,r=Da(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Da(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-A.scrollLeft+MB(t);const a=-A.scrollTop;return xr(n).direction==="rtl"&&(i+=Da(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:a}}function iX(t,e){const A=Hn(t),n=no(t),r=A.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(r){o=r.width,i=r.height;const u=DB();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:i,x:a,y:l}}function sX(t,e){const A=Ss(t,!0,e==="fixed"),n=A.top+t.clientTop,r=A.left+t.clientLeft,o=ro(t)?Ma(t):Ao(1),i=t.clientWidth*o.x,a=t.clientHeight*o.y,l=r*o.x,u=n*o.y;return{width:i,height:a,x:l,y:u}}function aQ(t,e,A){let n;if(e==="viewport")n=iX(t,A);else if(e==="document")n=oX(no(t));else if(Ir(e))n=sX(e,A);else{const r=iQ(t);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Of(n)}function lQ(t,e){const A=Di(t);return A===e||!Ir(A)||Oa(A)?!1:xr(A).position==="fixed"||lQ(A,e)}function aX(t,e){const A=e.get(t);if(A)return A;let n=kc(t,[],!1).filter(a=>Ir(a)&&La(a)!=="body"),r=null;const o=xr(t).position==="fixed";let i=o?Di(t):t;for(;Ir(i)&&!Oa(i);){const a=xr(i),l=_B(i);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&r&&["absolute","fixed"].includes(r.position)||Ec(i)&&!l&&lQ(t,i))?n=n.filter(u=>u!==i):r=a,i=Di(i)}return e.set(t,n),n}function lX(t){let{element:e,boundary:A,rootBoundary:n,strategy:r}=t;const o=[...A==="clippingAncestors"?Nf(e)?[]:aX(e,this._c):[].concat(A),n],i=o[0],a=o.reduce((l,u)=>{const f=aQ(e,u,r);return l.top=Da(f.top,l.top),l.right=TB(f.right,l.right),l.bottom=TB(f.bottom,l.bottom),l.left=Da(f.left,l.left),l},aQ(e,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function cX(t){const{width:e,height:A}=oQ(t);return{width:e,height:A}}function uX(t,e,A){const n=ro(e),r=no(e),o=A==="fixed",i=Ss(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ao(0);function u(){l.x=MB(r)}if(n||!n&&!o)if((La(e)!=="body"||Ec(r))&&(a=Hf(e)),n){const g=Ss(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else r&&u();o&&!n&&r&&u();const f=r&&!n&&!o?sQ(r,a):Ao(0),h=i.left+a.scrollLeft-l.x-f.x,p=i.top+a.scrollTop-l.y-f.y;return{x:h,y:p,width:i.width,height:i.height}}function NB(t){return xr(t).position==="static"}function cQ(t,e){if(!ro(t)||xr(t).position==="fixed")return null;if(e)return e(t);let A=t.offsetParent;return no(t)===A&&(A=A.ownerDocument.body),A}function uQ(t,e){const A=Hn(t);if(Nf(t))return A;if(!ro(t)){let r=Di(t);for(;r&&!Oa(r);){if(Ir(r)&&!NB(r))return r;r=Di(r)}return A}let n=cQ(t,e);for(;n&&ZJ(n)&&NB(n);)n=cQ(n,e);return n&&Oa(n)&&NB(n)&&!_B(n)?A:n||eX(t)||A}const dX=function(t){return Vt(this,null,function*(){const e=this.getOffsetParent||uQ,A=this.getDimensions,n=yield A(t.floating);return{reference:uX(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function fX(t){return xr(t).direction==="rtl"}const Rn={convertOffsetParentRelativeRectToViewportRelativeRect:nX,getDocumentElement:no,getClippingRect:lX,getOffsetParent:uQ,getElementRects:dX,getClientRects:rX,getDimensions:cX,getScale:Ma,isElement:Ir,isRTL:fX};function dQ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function hX(t,e){let A=null,n;const r=no(t);function o(){var a;clearTimeout(n),(a=A)==null||a.disconnect(),A=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:f,top:h,width:p,height:g}=u;if(a||e(),!p||!g)return;const B=Lf(h),y=Lf(r.clientWidth-(f+p)),b=Lf(r.clientHeight-(h+g)),w=Lf(f),v={rootMargin:-B+"px "+-y+"px "+-b+"px "+-w+"px",threshold:Da(0,TB(1,l))||1};let S=!0;function F(I){const Q=I[0].intersectionRatio;if(Q!==l){if(!S)return i();Q?i(!1,Q):n=setTimeout(()=>{i(!1,1e-7)},1e3)}Q===1&&!dQ(u,t.getBoundingClientRect())&&i(),S=!1}try{A=new IntersectionObserver(F,kn(MA({},v),{root:r.ownerDocument}))}catch{A=new IntersectionObserver(F,v)}A.observe(t)}return i(!0),o}function HB(t,e,A,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=OB(t),f=r||o?[...u?kc(u):[],...kc(e)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",A,{passive:!0}),o&&w.addEventListener("resize",A)});const h=u&&a?hX(u,A):null;let p=-1,g=null;i&&(g=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(e)})),A()}),u&&!l&&g.observe(u),g.observe(e));let B,y=l?Ss(t):null;l&&b();function b(){const w=Ss(t);y&&!dQ(y,w)&&A(),y=w,B=requestAnimationFrame(b)}return A(),()=>{var w;f.forEach(v=>{r&&v.removeEventListener("scroll",A),o&&v.removeEventListener("resize",A)}),h?.(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(B)}}const pX=qJ,{hasOwnProperty:RB}=Object.prototype,Sc=function(){};function fQ(t){return typeof t=="function"?t:Sc}function hQ(t,e){return function(A,n,r){A.type===e&&t.call(this,A,n,r)}}function mX(t,e){const A=e.structure,n=[];for(const r in A){if(RB.call(A,r)===!1)continue;let o=A[r];const i={name:r,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(const a of o)a===null?i.nullable=!0:typeof a=="string"?i.type="node":Array.isArray(a)&&(i.type="list");i.type&&n.push(i)}return n.length?{context:e.walkContext,fields:n}:null}function gX(t){const e={};for(const A in t.node)if(RB.call(t.node,A)){const n=t.node[A];if(!n.structure)throw new Error("Missed `structure` field in `"+A+"` node type definition");e[A]=mX(A,n)}return e}function pQ(t,e){const A=t.fields.slice(),n=t.context,r=typeof n=="string";return e&&A.reverse(),function(o,i,a,l){let u;r&&(u=i[n],i[n]=o);for(const f of A){const h=o[f.name];if(!f.nullable||h){if(f.type==="list"){if(e?h.reduceRight(l,!1):h.reduce(l,!1))return!0}else if(a(h))return!0}}r&&(i[n]=u)}}function mQ({StyleSheet:t,Atrule:e,Rule:A,Block:n,DeclarationList:r}){return{Atrule:{StyleSheet:t,Atrule:e,Rule:A,Block:n},Rule:{StyleSheet:t,Atrule:e,Rule:A,Block:n},Declaration:{StyleSheet:t,Atrule:e,Rule:A,Block:n,DeclarationList:r}}}function BX(t){const e=gX(t),A={},n={},r=Symbol("break-walk"),o=Symbol("skip-node");for(const u in e)RB.call(e,u)&&e[u]!==null&&(A[u]=pQ(e[u],!1),n[u]=pQ(e[u],!0));const i=mQ(A),a=mQ(n),l=function(u,f){function h(w,v,S){const F=p.call(b,w,v,S);return F===r?!0:F===o?!1:!!(B.hasOwnProperty(w.type)&&B[w.type](w,b,h,y)||g.call(b,w,v,S)===r)}let p=Sc,g=Sc,B=A,y=(w,v,S,F)=>w||h(v,S,F);const b={break:r,skip:o,root:u,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof f=="function")p=f;else if(f&&(p=fQ(f.enter),g=fQ(f.leave),f.reverse&&(B=n),f.visit)){if(i.hasOwnProperty(f.visit))B=f.reverse?a[f.visit]:i[f.visit];else if(!e.hasOwnProperty(f.visit))throw new Error("Bad value `"+f.visit+"` for `visit` option (should be: "+Object.keys(e).sort().join(", ")+")");p=hQ(p,f.visit),g=hQ(g,f.visit)}if(p===Sc&&g===Sc)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(u)};return l.break=r,l.skip=o,l.find=function(u,f){let h=null;return l(u,function(p,g,B){if(f.call(this,p,g,B))return h=p,r}),h},l.findLast=function(u,f){let h=null;return l(u,{reverse:!0,enter(p,g,B){if(f.call(this,p,g,B))return h=p,r}}),h},l.findAll=function(u,f){const h=[];return l(u,function(p,g,B){f.call(this,p,g,B)&&h.push(p)}),h},l}const Li=0,_e=1,mt=2,EA=3,jt=4,Oo=5,yX=6,fn=7,Tr=8,It=9,at=10,pA=11,bt=12,bA=13,Rf=14,Pn=15,hn=16,Sn=17,_r=18,Na=19,Qc=20,$t=21,rt=22,Dr=23,Ha=24,pn=25,wX=0;function Vn(t){return t>=48&&t<=57}function Ra(t){return Vn(t)||t>=65&&t<=70||t>=97&&t<=102}function PB(t){return t>=65&&t<=90}function CX(t){return t>=97&&t<=122}function bX(t){return PB(t)||CX(t)}function vX(t){return t>=128}function Pf(t){return bX(t)||vX(t)||t===95}function gQ(t){return Pf(t)||Vn(t)||t===45}function EX(t){return t>=0&&t<=8||t===11||t>=14&&t<=31||t===127}function Vf(t){return t===10||t===13||t===12}function Qs(t){return Vf(t)||t===32||t===9}function oo(t,e){return!(t!==92||Vf(e)||e===wX)}function VB(t,e,A){return t===45?Pf(e)||e===45||oo(e,A):Pf(t)?!0:t===92?oo(t,e):!1}function $B(t,e,A){return t===43||t===45?Vn(e)?2:e===46&&Vn(A)?3:0:t===46?Vn(e)?2:0:Vn(t)?1:0}function BQ(t){return t===65279||t===65534?1:0}const KB=new Array(128),kX=128,$f=130,yQ=131,GB=132,wQ=133;for(let t=0;t<KB.length;t++)KB[t]=Qs(t)&&$f||Vn(t)&&yQ||Pf(t)&&GB||EX(t)&&wQ||t||kX;function WB(t){return t<128?KB[t]:GB}function Pa(t,e){return e<t.length?t.charCodeAt(e):0}function zB(t,e,A){return A===13&&Pa(t,e+1)===10?2:1}function CQ(t,e,A){let n=t.charCodeAt(e);return PB(n)&&(n=n|32),n===A}function Kf(t,e,A,n){if(A-e!==n.length||e<0||A>t.length)return!1;for(let r=e;r<A;r++){const o=n.charCodeAt(r-e);let i=t.charCodeAt(r);if(PB(i)&&(i=i|32),i!==o)return!1}return!0}function SX(t,e){for(;e>=0&&Qs(t.charCodeAt(e));e--);return e+1}function Gf(t,e){for(;e<t.length&&Qs(t.charCodeAt(e));e++);return e}function YB(t,e){for(;e<t.length&&Vn(t.charCodeAt(e));e++);return e}function Va(t,e){if(e+=2,Ra(Pa(t,e-1))){for(const n=Math.min(t.length,e+5);e<n&&Ra(Pa(t,e));e++);const A=Pa(t,e);Qs(A)&&(e+=zB(t,e,A))}return e}function Wf(t,e){for(;e<t.length;e++){const A=t.charCodeAt(e);if(!gQ(A)){if(oo(A,Pa(t,e+1))){e=Va(t,e)-1;continue}break}}return e}function bQ(t,e){let A=t.charCodeAt(e);if((A===43||A===45)&&(A=t.charCodeAt(e+=1)),Vn(A)&&(e=YB(t,e+1),A=t.charCodeAt(e)),A===46&&Vn(t.charCodeAt(e+1))&&(e+=2,e=YB(t,e)),CQ(t,e,101)){let n=0;A=t.charCodeAt(e+1),(A===45||A===43)&&(n=1,A=t.charCodeAt(e+2)),Vn(A)&&(e=YB(t,e+1+n+1))}return e}function JB(t,e){for(;e<t.length;e++){const A=t.charCodeAt(e);if(A===41){e++;break}oo(A,Pa(t,e+1))&&(e=Va(t,e))}return e}function vQ(t){if(t.length===1&&!Ra(t.charCodeAt(0)))return t[0];let e=parseInt(t,16);return(e===0||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}const EQ=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"],QX=16*1024;function zf(t=null,e){return t===null||t.length<e?new Uint32Array(Math.max(e+1024,QX)):t}const kQ=10,FX=12,SQ=13;function QQ(t){const e=t.source,A=e.length,n=e.length>0?BQ(e.charCodeAt(0)):0,r=zf(t.lines,A),o=zf(t.columns,A);let i=t.startLine,a=t.startColumn;for(let l=n;l<A;l++){const u=e.charCodeAt(l);r[l]=i,o[l]=a++,(u===kQ||u===SQ||u===FX)&&(u===SQ&&l+1<A&&e.charCodeAt(l+1)===kQ&&(l++,r[l]=i,o[l]=a),i++,a=1)}r[A]=i,o[A]=a,t.lines=r,t.columns=o,t.computed=!0}class UX{constructor(e,A,n,r){this.setSource(e,A,n,r),this.lines=null,this.columns=null}setSource(e="",A=0,n=1,r=1){this.source=e,this.startOffset=A,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,A){return this.computed||QQ(this),{source:A,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,A,n){return this.computed||QQ(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+A,line:this.lines[A],column:this.columns[A]}}}}const io=16777215,so=24,Fs=new Uint8Array(32);Fs[mt]=rt,Fs[$t]=rt,Fs[Na]=Qc,Fs[Dr]=Ha;function FQ(t){return Fs[t]!==0}class IX{constructor(e,A){this.setSource(e,A)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",A=()=>{}){e=String(e||"");const n=e.length,r=zf(this.offsetAndType,e.length+1),o=zf(this.balance,e.length+1);let i=0,a=-1,l=0,u=e.length;this.offsetAndType=null,this.balance=null,o.fill(0),A(e,(f,h,p)=>{const g=i++;if(r[g]=f<<so|p,a===-1&&(a=h),o[g]=u,f===l){const B=o[u];o[u]=g,u=B,l=Fs[r[B]>>so]}else FQ(f)&&(u=g,l=Fs[f])}),r[i]=Li<<so|n,o[i]=i;for(let f=0;f<i;f++){const h=o[f];if(h<=f){const p=o[h];p!==f&&(o[f]=p)}else h>i&&(o[f]=i)}this.source=e,this.firstCharOffset=a===-1?0:a,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>so:Li}lookupTypeNonSC(e){for(let A=this.tokenIndex;A<this.tokenCount;A++){const n=this.offsetAndType[A]>>so;if(n!==bA&&n!==pn&&e--===0)return n}return Li}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&io:this.source.length}lookupOffsetNonSC(e){for(let A=this.tokenIndex;A<this.tokenCount;A++){const n=this.offsetAndType[A]>>so;if(n!==bA&&n!==pn&&e--===0)return A-this.tokenIndex}return Li}lookupValue(e,A){return e+=this.tokenIndex,e<this.tokenCount?Kf(this.source,this.offsetAndType[e-1]&io,this.offsetAndType[e]&io,A):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&io:this.offsetAndType[this.tokenCount]&io:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,A){return A?this.lookupType(A)===It&&this.source.charCodeAt(this.lookupOffset(A))===e:this.tokenType===It&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let A=this.tokenIndex+e;A<this.tokenCount?(this.tokenIndex=A,this.tokenStart=this.offsetAndType[A-1]&io,A=this.offsetAndType[A],this.tokenType=A>>so,this.tokenEnd=A&io):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>so,this.tokenEnd=e&io):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=Li,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===bA||this.tokenType===pn;)this.next()}skipUntilBalanced(e,A){let n=e,r=0,o=0;e:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break e;switch(o=n>0?this.offsetAndType[n-1]&io:this.firstCharOffset,A(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:FQ(this.offsetAndType[n]>>so)&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let A=0,n=this.firstCharOffset;A<this.tokenCount;A++){const r=n,o=this.offsetAndType[A],i=o&io,a=o>>so;n=i,e(a,r,i,A)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((A,n,r,o)=>{e[o]={idx:o,type:EQ[A],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}}function UQ(t,e){function A(h){return h<a?t.charCodeAt(h):0}function n(){if(u=bQ(t,u),VB(A(u),A(u+1),A(u+2))){f=bt,u=Wf(t,u);return}if(A(u)===37){f=pA,u++;return}f=at}function r(){const h=u;if(u=Wf(t,u),Kf(t,h,u,"url")&&A(u)===40){if(u=Gf(t,u+1),A(u)===34||A(u)===39){f=mt,u=h+4;return}i();return}if(A(u)===40){f=mt,u++;return}f=_e}function o(h){for(h||(h=A(u++)),f=Oo;u<t.length;u++){const p=t.charCodeAt(u);switch(WB(p)){case h:u++;return;case $f:if(Vf(p)){u+=zB(t,u,p),f=yX;return}break;case 92:if(u===t.length-1)break;const g=A(u+1);Vf(g)?u+=zB(t,u+1,g):oo(p,g)&&(u=Va(t,u)-1);break}}}function i(){for(f=fn,u=Gf(t,u);u<t.length;u++){const h=t.charCodeAt(u);switch(WB(h)){case 41:u++;return;case $f:if(u=Gf(t,u),A(u)===41||u>=t.length){u<t.length&&u++;return}u=JB(t,u),f=Tr;return;case 34:case 39:case 40:case wQ:u=JB(t,u),f=Tr;return;case 92:if(oo(h,A(u+1))){u=Va(t,u)-1;break}u=JB(t,u),f=Tr;return}}}t=String(t||"");const a=t.length;let l=BQ(A(0)),u=l,f;for(;u<a;){const h=t.charCodeAt(u);switch(WB(h)){case $f:f=bA,u=Gf(t,u+1);break;case 34:o();break;case 35:gQ(A(u+1))||oo(A(u+1),A(u+2))?(f=jt,u=Wf(t,u+1)):(f=It,u++);break;case 39:o();break;case 40:f=$t,u++;break;case 41:f=rt,u++;break;case 43:$B(h,A(u+1),A(u+2))?n():(f=It,u++);break;case 44:f=_r,u++;break;case 45:$B(h,A(u+1),A(u+2))?n():A(u+1)===45&&A(u+2)===62?(f=Pn,u=u+3):VB(h,A(u+1),A(u+2))?r():(f=It,u++);break;case 46:$B(h,A(u+1),A(u+2))?n():(f=It,u++);break;case 47:A(u+1)===42?(f=pn,u=t.indexOf("*/",u+2),u=u===-1?t.length:u+2):(f=It,u++);break;case 58:f=hn,u++;break;case 59:f=Sn,u++;break;case 60:A(u+1)===33&&A(u+2)===45&&A(u+3)===45?(f=Rf,u=u+4):(f=It,u++);break;case 64:VB(A(u+1),A(u+2),A(u+3))?(f=EA,u=Wf(t,u+1)):(f=It,u++);break;case 91:f=Na,u++;break;case 92:oo(h,A(u+1))?r():(f=It,u++);break;case 93:f=Qc,u++;break;case 123:f=Dr,u++;break;case 125:f=Ha,u++;break;case yQ:n();break;case GB:r();break;default:f=It,u++}e(f,l,l=u)}}const ao=43,$n=45,Yf=110,Us=!0,xX=!1;function Jf(t,e){let A=this.tokenStart+t;const n=this.charCodeAt(A);for((n===ao||n===$n)&&(e&&this.error("Number sign is not allowed"),A++);A<this.tokenEnd;A++)Vn(this.charCodeAt(A))||this.error("Integer is expected",A)}function $a(t){return Jf.call(this,0,t)}function Oi(t,e){if(!this.cmpChar(this.tokenStart+t,e)){let A="";switch(e){case Yf:A="N is expected";break;case $n:A="HyphenMinus is expected";break}this.error(A,this.tokenStart+t)}}function XB(){let t=0,e=0,A=this.tokenType;for(;A===bA||A===pn;)A=this.lookupType(++t);if(A!==at)if(this.isDelim(ao,t)||this.isDelim($n,t)){e=this.isDelim(ao,t)?ao:$n;do A=this.lookupType(++t);while(A===bA||A===pn);A!==at&&(this.skip(t),$a.call(this,Us))}else return null;return t>0&&this.skip(t),e===0&&(A=this.charCodeAt(this.tokenStart),A!==ao&&A!==$n&&this.error("Number sign is expected")),$a.call(this,e!==0),e===$n?"-"+this.consume(at):this.consume(at)}const TX="AnPlusB",_X={a:[String,null],b:[String,null]};function IQ(){const t=this.tokenStart;let e=null,A=null;if(this.tokenType===at)$a.call(this,xX),A=this.consume(at);else if(this.tokenType===_e&&this.cmpChar(this.tokenStart,$n))switch(e="-1",Oi.call(this,1,Yf),this.tokenEnd-this.tokenStart){case 2:this.next(),A=XB.call(this);break;case 3:Oi.call(this,2,$n),this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at);break;default:Oi.call(this,2,$n),Jf.call(this,3,Us),this.next(),A=this.substrToCursor(t+2)}else if(this.tokenType===_e||this.isDelim(ao)&&this.lookupType(1)===_e){let n=0;switch(e="1",this.isDelim(ao)&&(n=1,this.next()),Oi.call(this,0,Yf),this.tokenEnd-this.tokenStart){case 1:this.next(),A=XB.call(this);break;case 2:Oi.call(this,1,$n),this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at);break;default:Oi.call(this,1,$n),Jf.call(this,2,Us),this.next(),A=this.substrToCursor(t+n+1)}}else if(this.tokenType===bt){const n=this.charCodeAt(this.tokenStart),r=n===ao||n===$n;let o=this.tokenStart+r;for(;o<this.tokenEnd&&Vn(this.charCodeAt(o));o++);o===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),Oi.call(this,o-this.tokenStart,Yf),e=this.substring(t,o),o+1===this.tokenEnd?(this.next(),A=XB.call(this)):(Oi.call(this,o-this.tokenStart+1,$n),o+2===this.tokenEnd?(this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at)):(Jf.call(this,o-this.tokenStart+2,Us),this.next(),A=this.substrToCursor(o+1)))}else this.error();return e!==null&&e.charCodeAt(0)===ao&&(e=e.substr(1)),A!==null&&A.charCodeAt(0)===ao&&(A=A.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.tokenStart),a:e,b:A}}function xQ(t){if(t.a){const e=t.a==="+1"&&"n"||t.a==="1"&&"n"||t.a==="-1"&&"-n"||t.a+"n";if(t.b){const A=t.b[0]==="-"||t.b[0]==="+"?t.b:"+"+t.b;this.tokenize(e+A)}else this.tokenize(e)}else this.tokenize(t.b)}const DX=Object.freeze(Object.defineProperty({__proto__:null,generate:xQ,name:TX,parse:IQ,structure:_X},Symbol.toStringTag,{value:"Module"}));function TQ(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function LX(){for(let t=1,e;e=this.lookupType(t);t++){if(e===Ha)return!0;if(e===Dr||e===EA)return!1}return!1}const OX="Atrule",MX="atrule",NX={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function _Q(t=!1){const e=this.tokenStart;let A,n,r=null,o=null;switch(this.eat(EA),A=this.substrToCursor(e+1),n=A.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==Dr&&this.tokenType!==Sn&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,A,t),TQ):r=TQ.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Sn:this.next();break;case Dr:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?o=this.atrule[n].block.call(this,t):o=this.Block(LX.call(this));break}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:A,prelude:r,block:o}}function DQ(t){this.token(EA,"@"+t.name),t.prelude!==null&&this.node(t.prelude),t.block?this.node(t.block):this.token(Sn,";")}const HX=Object.freeze(Object.defineProperty({__proto__:null,generate:DQ,name:OX,parse:_Q,structure:NX,walkContext:MX},Symbol.toStringTag,{value:"Module"})),RX="AtrulePrelude",PX="atrulePrelude",VX={children:[[]]};function LQ(t){let e=null;return t!==null&&(t=t.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,t)&&typeof this.atrule[t].prelude=="function"?e=this.atrule[t].prelude.call(this):e=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==Dr&&this.tokenType!==Sn&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}}function OQ(t){this.children(t)}const $X=Object.freeze(Object.defineProperty({__proto__:null,generate:OQ,name:RX,parse:LQ,structure:VX,walkContext:PX},Symbol.toStringTag,{value:"Module"})),KX=36,MQ=42,Xf=61,GX=94,jB=124,WX=126;function zX(){this.eof&&this.error("Unexpected end of input");const t=this.tokenStart;let e=!1;return this.isDelim(MQ)?(e=!0,this.next()):this.isDelim(jB)||this.eat(_e),this.isDelim(jB)?this.charCodeAt(this.tokenStart+1)!==Xf?(this.next(),this.eat(_e)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function YX(){const t=this.tokenStart,e=this.charCodeAt(t);return e!==Xf&&e!==WX&&e!==GX&&e!==KX&&e!==MQ&&e!==jB&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),e!==Xf&&(this.isDelim(Xf)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(t)}const JX="AttributeSelector",XX={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function NQ(){const t=this.tokenStart;let e,A=null,n=null,r=null;return this.eat(Na),this.skipSC(),e=zX.call(this),this.skipSC(),this.tokenType!==Qc&&(this.tokenType!==_e&&(A=YX.call(this),this.skipSC(),n=this.tokenType===Oo?this.String():this.Identifier(),this.skipSC()),this.tokenType===_e&&(r=this.consume(_e),this.skipSC())),this.eat(Qc),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:A,value:n,flags:r}}function HQ(t){this.token(It,"["),this.node(t.name),t.matcher!==null&&(this.tokenize(t.matcher),this.node(t.value)),t.flags!==null&&this.token(_e,t.flags),this.token(It,"]")}const jX=Object.freeze(Object.defineProperty({__proto__:null,generate:HQ,name:JX,parse:NQ,structure:XX},Symbol.toStringTag,{value:"Module"})),qX=38;function RQ(){return this.Raw(null,!0)}function PQ(){return this.parseWithFallback(this.Rule,RQ)}function VQ(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function ZX(){if(this.tokenType===Sn)return VQ.call(this,this.tokenIndex);const t=this.parseWithFallback(this.Declaration,VQ);return this.tokenType===Sn&&this.next(),t}const ej="Block",tj="block",Aj={children:[["Atrule","Rule","Declaration"]]};function $Q(t){const e=t?ZX:PQ,A=this.tokenStart;let n=this.createList();this.eat(Dr);e:for(;!this.eof;)switch(this.tokenType){case Ha:break e;case bA:case pn:this.next();break;case EA:n.push(this.parseWithFallback(this.Atrule.bind(this,t),RQ));break;default:t&&this.isDelim(qX)?n.push(PQ.call(this)):n.push(e.call(this))}return this.eof||this.eat(Ha),{type:"Block",loc:this.getLocation(A,this.tokenStart),children:n}}function KQ(t){this.token(Dr,"{"),this.children(t,e=>{e.type==="Declaration"&&this.token(Sn,";")}),this.token(Ha,"}")}const nj=Object.freeze(Object.defineProperty({__proto__:null,generate:KQ,name:ej,parse:$Q,structure:Aj,walkContext:tj},Symbol.toStringTag,{value:"Module"})),rj="Brackets",oj={children:[[]]};function GQ(t,e){const A=this.tokenStart;let n=null;return this.eat(Na),n=t.call(this,e),this.eof||this.eat(Qc),{type:"Brackets",loc:this.getLocation(A,this.tokenStart),children:n}}function WQ(t){this.token(It,"["),this.children(t),this.token(It,"]")}const ij=Object.freeze(Object.defineProperty({__proto__:null,generate:WQ,name:rj,parse:GQ,structure:oj},Symbol.toStringTag,{value:"Module"})),sj="CDC",aj=[];function zQ(){const t=this.tokenStart;return this.eat(Pn),{type:"CDC",loc:this.getLocation(t,this.tokenStart)}}function YQ(){this.token(Pn,"-->")}const lj=Object.freeze(Object.defineProperty({__proto__:null,generate:YQ,name:sj,parse:zQ,structure:aj},Symbol.toStringTag,{value:"Module"})),cj="CDO",uj=[];function JQ(){const t=this.tokenStart;return this.eat(Rf),{type:"CDO",loc:this.getLocation(t,this.tokenStart)}}function XQ(){this.token(Rf,"<!--")}const dj=Object.freeze(Object.defineProperty({__proto__:null,generate:XQ,name:cj,parse:JQ,structure:uj},Symbol.toStringTag,{value:"Module"})),fj=46,hj="ClassSelector",pj={name:String};function jQ(){return this.eatDelim(fj),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(_e)}}function qQ(t){this.token(It,"."),this.token(_e,t.name)}const mj=Object.freeze(Object.defineProperty({__proto__:null,generate:qQ,name:hj,parse:jQ,structure:pj},Symbol.toStringTag,{value:"Module"})),gj=43,ZQ=47,Bj=62,yj=126,wj="Combinator",Cj={name:String};function eF(){const t=this.tokenStart;let e;switch(this.tokenType){case bA:e=" ";break;case It:switch(this.charCodeAt(this.tokenStart)){case Bj:case gj:case yj:this.next();break;case ZQ:this.next(),this.eatIdent("deep"),this.eatDelim(ZQ);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t);break}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function tF(t){this.tokenize(t.name)}const bj=Object.freeze(Object.defineProperty({__proto__:null,generate:tF,name:wj,parse:eF,structure:Cj},Symbol.toStringTag,{value:"Module"})),vj=42,Ej=47,kj="Comment",Sj={value:String};function AF(){const t=this.tokenStart;let e=this.tokenEnd;return this.eat(pn),e-t+2>=2&&this.charCodeAt(e-2)===vj&&this.charCodeAt(e-1)===Ej&&(e-=2),{type:"Comment",loc:this.getLocation(t,this.tokenStart),value:this.substring(t+2,e)}}function nF(t){this.token(pn,"/*"+t.value+"*/")}const Qj=Object.freeze(Object.defineProperty({__proto__:null,generate:nF,name:kj,parse:AF,structure:Sj},Symbol.toStringTag,{value:"Module"})),Fj=new Set([hn,rt,Li]),Uj="Condition",Ij={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function rF(t){return this.lookupTypeNonSC(1)===_e&&Fj.has(this.lookupTypeNonSC(2))?this.Feature(t):this.FeatureRange(t)}const xj={media:rF,container:rF,supports(){return this.SupportsDeclaration()}};function oF(t="media"){const e=this.createList();e:for(;!this.eof;)switch(this.tokenType){case pn:case bA:this.next();continue;case _e:e.push(this.Identifier());break;case $t:{let A=this.parseWithFallback(()=>xj[t].call(this,t),()=>null);A||(A=this.parseWithFallback(()=>{this.eat($t);const n=this.Condition(t);return this.eat(rt),n},()=>this.GeneralEnclosed(t))),e.push(A);break}case mt:{let A=this.parseWithFallback(()=>this.FeatureFunction(t),()=>null);A||(A=this.GeneralEnclosed(t)),e.push(A);break}default:break e}return e.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(e),kind:t,children:e}}function iF(t){t.children.forEach(e=>{e.type==="Condition"?(this.token($t,"("),this.node(e),this.token(rt,")")):this.node(e)})}const Tj=Object.freeze(Object.defineProperty({__proto__:null,generate:iF,name:Uj,parse:oF,structure:Ij},Symbol.toStringTag,{value:"Module"})),sF=45;function _j(t,e){return e=e||0,t.length-e>=2&&t.charCodeAt(e)===sF&&t.charCodeAt(e+1)===sF}const aF=33,Dj=35,Lj=36,Oj=38,Mj=42,Nj=43,lF=47;function Hj(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Rj(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Pj(){const t=this.tokenIndex,e=this.Value();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==Sn&&this.isDelim(aF)===!1&&this.isBalanceEdge(t)===!1&&this.error(),e}const Vj="Declaration",$j="declaration",Kj={important:[Boolean,String],property:String,value:["Value","Raw"]};function cF(){const t=this.tokenStart,e=this.tokenIndex,A=Gj.call(this),n=_j(A),r=n?this.parseCustomProperty:this.parseValue,o=n?Rj:Hj;let i=!1,a;this.skipSC(),this.eat(hn);const l=this.tokenIndex;if(n||this.skipSC(),r?a=this.parseWithFallback(Pj,o):a=o.call(this,this.tokenIndex),n&&a.type==="Value"&&a.children.isEmpty){for(let u=l-this.tokenIndex;u<=0;u++)if(this.lookupType(u)===bA){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(aF)&&(i=Wj.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Sn&&this.isBalanceEdge(e)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.tokenStart),important:i,property:A,value:a}}function uF(t){this.token(_e,t.property),this.token(hn,":"),this.node(t.value),t.important&&(this.token(It,"!"),this.token(_e,t.important===!0?"important":t.important))}function Gj(){const t=this.tokenStart;if(this.tokenType===It)switch(this.charCodeAt(this.tokenStart)){case Mj:case Lj:case Nj:case Dj:case Oj:this.next();break;case lF:this.next(),this.isDelim(lF)&&this.next();break}return this.tokenType===jt?this.eat(jt):this.eat(_e),this.substrToCursor(t)}function Wj(){this.eat(It),this.skipSC();const t=this.consume(_e);return t==="important"?!0:t}const zj=Object.freeze(Object.defineProperty({__proto__:null,generate:uF,name:Vj,parse:cF,structure:Kj,walkContext:$j},Symbol.toStringTag,{value:"Module"})),Yj=38;function qB(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const Jj="DeclarationList",Xj={children:[["Declaration","Atrule","Rule"]]};function dF(){const t=this.createList();for(;!this.eof;)switch(this.tokenType){case bA:case pn:case Sn:this.next();break;case EA:t.push(this.parseWithFallback(this.Atrule.bind(this,!0),qB));break;default:this.isDelim(Yj)?t.push(this.parseWithFallback(this.Rule,qB)):t.push(this.parseWithFallback(this.Declaration,qB))}return{type:"DeclarationList",loc:this.getLocationFromList(t),children:t}}function fF(t){this.children(t,e=>{e.type==="Declaration"&&this.token(Sn,";")})}const jj=Object.freeze(Object.defineProperty({__proto__:null,generate:fF,name:Jj,parse:dF,structure:Xj},Symbol.toStringTag,{value:"Module"})),qj="Dimension",Zj={value:String,unit:String};function hF(){const t=this.tokenStart,e=this.consumeNumber(bt);return{type:"Dimension",loc:this.getLocation(t,this.tokenStart),value:e,unit:this.substring(t+e.length,this.tokenStart)}}function pF(t){this.token(bt,t.value+t.unit)}const e7=Object.freeze(Object.defineProperty({__proto__:null,generate:pF,name:qj,parse:hF,structure:Zj},Symbol.toStringTag,{value:"Module"})),t7=47,A7="Feature",n7={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function mF(t){const e=this.tokenStart;let A,n=null;if(this.eat($t),this.skipSC(),A=this.consume(_e),this.skipSC(),this.tokenType!==rt){switch(this.eat(hn),this.skipSC(),this.tokenType){case at:this.lookupNonWSType(1)===It?n=this.Ratio():n=this.Number();break;case bt:n=this.Dimension();break;case _e:n=this.Identifier();break;case mt:n=this.parseWithFallback(()=>{const r=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(t7)&&this.error(),r},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(rt),{type:"Feature",loc:this.getLocation(e,this.tokenStart),kind:t,name:A,value:n}}function gF(t){this.token($t,"("),this.token(_e,t.name),t.value!==null&&(this.token(hn,":"),this.node(t.value)),this.token(rt,")")}const r7=Object.freeze(Object.defineProperty({__proto__:null,generate:gF,name:A7,parse:mF,structure:n7},Symbol.toStringTag,{value:"Module"})),o7="FeatureFunction",i7={kind:String,feature:String,value:["Declaration","Selector"]};function s7(t,e){const A=(this.features[t]||{})[e];return typeof A!="function"&&this.error(`Unknown feature ${e}()`),A}function BF(t="unknown"){const e=this.tokenStart,A=this.consumeFunctionName(),n=s7.call(this,t,A.toLowerCase());this.skipSC();const r=this.parseWithFallback(()=>{const o=this.tokenIndex,i=n.call(this);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>this.Raw(null,!1));return this.eof||this.eat(rt),{type:"FeatureFunction",loc:this.getLocation(e,this.tokenStart),kind:t,feature:A,value:r}}function yF(t){this.token(mt,t.feature+"("),this.node(t.value),this.token(rt,")")}const a7=Object.freeze(Object.defineProperty({__proto__:null,generate:yF,name:o7,parse:BF,structure:i7},Symbol.toStringTag,{value:"Module"})),wF=47,l7=60,CF=61,c7=62,u7="FeatureRange",d7={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function ZB(){switch(this.skipSC(),this.tokenType){case at:return this.isDelim(wF,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case bt:return this.Dimension();case _e:return this.Identifier();case mt:return this.parseWithFallback(()=>{const t=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(wF)&&this.error(),t},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function bF(t){if(this.skipSC(),this.isDelim(l7)||this.isDelim(c7)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(CF)?(this.next(),e+"="):e}if(this.isDelim(CF))return"=";this.error(`Expected ${t?'":", ':""}"<", ">", "=" or ")"`)}function vF(t="unknown"){const e=this.tokenStart;this.skipSC(),this.eat($t);const A=ZB.call(this),n=bF.call(this,A.type==="Identifier"),r=ZB.call(this);let o=null,i=null;return this.lookupNonWSType(0)!==rt&&(o=bF.call(this),i=ZB.call(this)),this.skipSC(),this.eat(rt),{type:"FeatureRange",loc:this.getLocation(e,this.tokenStart),kind:t,left:A,leftComparison:n,middle:r,rightComparison:o,right:i}}function EF(t){this.token($t,"("),this.node(t.left),this.tokenize(t.leftComparison),this.node(t.middle),t.right&&(this.tokenize(t.rightComparison),this.node(t.right)),this.token(rt,")")}const f7=Object.freeze(Object.defineProperty({__proto__:null,generate:EF,name:u7,parse:vF,structure:d7},Symbol.toStringTag,{value:"Module"})),h7="Function",p7="function",m7={name:String,children:[[]]};function kF(t,e){const A=this.tokenStart,n=this.consumeFunctionName(),r=n.toLowerCase();let o;return o=e.hasOwnProperty(r)?e[r].call(this,e):t.call(this,e),this.eof||this.eat(rt),{type:"Function",loc:this.getLocation(A,this.tokenStart),name:n,children:o}}function SF(t){this.token(mt,t.name+"("),this.children(t),this.token(rt,")")}const g7=Object.freeze(Object.defineProperty({__proto__:null,generate:SF,name:h7,parse:kF,structure:m7,walkContext:p7},Symbol.toStringTag,{value:"Module"})),B7="GeneralEnclosed",y7={kind:String,function:[String,null],children:[[]]};function QF(t){const e=this.tokenStart;let A=null;this.tokenType===mt?A=this.consumeFunctionName():this.eat($t);const n=this.parseWithFallback(()=>{const r=this.tokenIndex,o=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),o},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(rt),{type:"GeneralEnclosed",loc:this.getLocation(e,this.tokenStart),kind:t,function:A,children:n}}function FF(t){t.function?this.token(mt,t.function+"("):this.token($t,"("),this.children(t),this.token(rt,")")}const w7=Object.freeze(Object.defineProperty({__proto__:null,generate:FF,name:B7,parse:QF,structure:y7},Symbol.toStringTag,{value:"Module"})),C7="XXX",b7="Hash",v7={value:String};function UF(){const t=this.tokenStart;return this.eat(jt),{type:"Hash",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t+1)}}function IF(t){this.token(jt,"#"+t.value)}const E7=Object.freeze(Object.defineProperty({__proto__:null,generate:IF,name:b7,parse:UF,structure:v7,xxx:C7},Symbol.toStringTag,{value:"Module"})),k7="Identifier",S7={name:String};function xF(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(_e)}}function TF(t){this.token(_e,t.name)}const Q7=Object.freeze(Object.defineProperty({__proto__:null,generate:TF,name:k7,parse:xF,structure:S7},Symbol.toStringTag,{value:"Module"})),F7="IdSelector",U7={name:String};function _F(){const t=this.tokenStart;return this.eat(jt),{type:"IdSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t+1)}}function DF(t){this.token(It,"#"+t.name)}const I7=Object.freeze(Object.defineProperty({__proto__:null,generate:DF,name:F7,parse:_F,structure:U7},Symbol.toStringTag,{value:"Module"})),x7=46,T7="Layer",_7={name:String};function LF(){let t=this.tokenStart,e=this.consume(_e);for(;this.isDelim(x7);)this.eat(It),e+="."+this.consume(_e);return{type:"Layer",loc:this.getLocation(t,this.tokenStart),name:e}}function OF(t){this.tokenize(t.name)}const D7=Object.freeze(Object.defineProperty({__proto__:null,generate:OF,name:T7,parse:LF,structure:_7},Symbol.toStringTag,{value:"Module"})),L7="LayerList",O7={children:[["Layer"]]};function MF(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.Layer()),this.lookupTypeNonSC(0)===_r);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(t),children:t}}function NF(t){this.children(t,()=>this.token(_r,","))}const M7=Object.freeze(Object.defineProperty({__proto__:null,generate:NF,name:L7,parse:MF,structure:O7},Symbol.toStringTag,{value:"Module"})),N7="MediaQuery",H7={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function HF(){const t=this.tokenStart;let e=null,A=null,n=null;if(this.skipSC(),this.tokenType===_e&&this.lookupTypeNonSC(1)!==$t){const r=this.consume(_e),o=r.toLowerCase();switch(o==="not"||o==="only"?(this.skipSC(),e=o,A=this.consume(_e)):A=r,this.lookupTypeNonSC(0)){case _e:{this.skipSC(),this.eatIdent("and"),n=this.Condition("media");break}case Dr:case Sn:case _r:case Li:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case _e:case $t:case mt:{n=this.Condition("media");break}case Dr:case Sn:case Li:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(t,this.tokenStart),modifier:e,mediaType:A,condition:n}}function RF(t){t.mediaType?(t.modifier&&this.token(_e,t.modifier),this.token(_e,t.mediaType),t.condition&&(this.token(_e,"and"),this.node(t.condition))):t.condition&&this.node(t.condition)}const R7=Object.freeze(Object.defineProperty({__proto__:null,generate:RF,name:N7,parse:HF,structure:H7},Symbol.toStringTag,{value:"Module"})),P7="MediaQueryList",V7={children:[["MediaQuery"]]};function PF(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.MediaQuery()),this.tokenType===_r);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}}function VF(t){this.children(t,()=>this.token(_r,","))}const $7=Object.freeze(Object.defineProperty({__proto__:null,generate:VF,name:P7,parse:PF,structure:V7},Symbol.toStringTag,{value:"Module"})),K7=38,G7="NestingSelector",W7={};function $F(){const t=this.tokenStart;return this.eatDelim(K7),{type:"NestingSelector",loc:this.getLocation(t,this.tokenStart)}}function KF(){this.token(It,"&")}const z7=Object.freeze(Object.defineProperty({__proto__:null,generate:KF,name:G7,parse:$F,structure:W7},Symbol.toStringTag,{value:"Module"})),Y7="Nth",J7={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function GF(){this.skipSC();const t=this.tokenStart;let e=t,A=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),e=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),A=this.SelectorList(),e=this.tokenStart),{type:"Nth",loc:this.getLocation(t,e),nth:n,selector:A}}function WF(t){this.node(t.nth),t.selector!==null&&(this.token(_e,"of"),this.node(t.selector))}const X7=Object.freeze(Object.defineProperty({__proto__:null,generate:WF,name:Y7,parse:GF,structure:J7},Symbol.toStringTag,{value:"Module"})),j7="Number",q7={value:String};function zF(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(at)}}function YF(t){this.token(at,t.value)}const Z7=Object.freeze(Object.defineProperty({__proto__:null,generate:YF,name:j7,parse:zF,structure:q7},Symbol.toStringTag,{value:"Module"})),eq="Operator",tq={value:String};function JF(){const t=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function XF(t){this.tokenize(t.value)}const Aq=Object.freeze(Object.defineProperty({__proto__:null,generate:XF,name:eq,parse:JF,structure:tq},Symbol.toStringTag,{value:"Module"})),nq="Parentheses",rq={children:[[]]};function jF(t,e){const A=this.tokenStart;let n=null;return this.eat($t),n=t.call(this,e),this.eof||this.eat(rt),{type:"Parentheses",loc:this.getLocation(A,this.tokenStart),children:n}}function qF(t){this.token($t,"("),this.children(t),this.token(rt,")")}const oq=Object.freeze(Object.defineProperty({__proto__:null,generate:qF,name:nq,parse:jF,structure:rq},Symbol.toStringTag,{value:"Module"})),iq="Percentage",sq={value:String};function ZF(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(pA)}}function eU(t){this.token(pA,t.value+"%")}const aq=Object.freeze(Object.defineProperty({__proto__:null,generate:eU,name:iq,parse:ZF,structure:sq},Symbol.toStringTag,{value:"Module"})),lq="PseudoClassSelector",cq="function",uq={name:String,children:[["Raw"],null]};function tU(){const t=this.tokenStart;let e=null,A,n;return this.eat(hn),this.tokenType===mt?(A=this.consumeFunctionName(),n=A.toLowerCase(),this.lookupNonWSType(0)==rt?e=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),e=this.pseudo[n].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(rt)):A=this.consume(_e),{type:"PseudoClassSelector",loc:this.getLocation(t,this.tokenStart),name:A,children:e}}function AU(t){this.token(hn,":"),t.children===null?this.token(_e,t.name):(this.token(mt,t.name+"("),this.children(t),this.token(rt,")"))}const dq=Object.freeze(Object.defineProperty({__proto__:null,generate:AU,name:lq,parse:tU,structure:uq,walkContext:cq},Symbol.toStringTag,{value:"Module"})),fq="PseudoElementSelector",hq="function",pq={name:String,children:[["Raw"],null]};function nU(){const t=this.tokenStart;let e=null,A,n;return this.eat(hn),this.eat(hn),this.tokenType===mt?(A=this.consumeFunctionName(),n=A.toLowerCase(),this.lookupNonWSType(0)==rt?e=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),e=this.pseudo[n].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(rt)):A=this.consume(_e),{type:"PseudoElementSelector",loc:this.getLocation(t,this.tokenStart),name:A,children:e}}function rU(t){this.token(hn,":"),this.token(hn,":"),t.children===null?this.token(_e,t.name):(this.token(mt,t.name+"("),this.children(t),this.token(rt,")"))}const mq=Object.freeze(Object.defineProperty({__proto__:null,generate:rU,name:fq,parse:nU,structure:pq,walkContext:hq},Symbol.toStringTag,{value:"Module"})),oU=47;function iU(){switch(this.skipSC(),this.tokenType){case at:return this.Number();case mt:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const gq="Ratio",Bq={left:["Number","Function"],right:["Number","Function",null]};function sU(){const t=this.tokenStart,e=iU.call(this);let A=null;return this.skipSC(),this.isDelim(oU)&&(this.eatDelim(oU),A=iU.call(this)),{type:"Ratio",loc:this.getLocation(t,this.tokenStart),left:e,right:A}}function aU(t){this.node(t.left),this.token(It,"/"),t.right?this.node(t.right):this.node(at,1)}const yq=Object.freeze(Object.defineProperty({__proto__:null,generate:aU,name:gq,parse:sU,structure:Bq},Symbol.toStringTag,{value:"Module"}));function wq(){return this.tokenIndex>0&&this.lookupType(-1)===bA?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Cq="Raw",bq={value:String};function lU(t,e){const A=this.getTokenStart(this.tokenIndex);let n;return this.skipUntilBalanced(this.tokenIndex,t||this.consumeUntilBalanceEnd),e&&this.tokenStart>A?n=wq.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(A,n),value:this.substring(A,n)}}function cU(t){this.tokenize(t.value)}const vq=Object.freeze(Object.defineProperty({__proto__:null,generate:cU,name:Cq,parse:lU,structure:bq},Symbol.toStringTag,{value:"Module"}));function uU(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Eq(){const t=this.SelectorList();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Dr&&this.error(),t}const kq="Rule",Sq="rule",Qq={prelude:["SelectorList","Raw"],block:["Block"]};function dU(){const t=this.tokenIndex,e=this.tokenStart;let A,n;return this.parseRulePrelude?A=this.parseWithFallback(Eq,uU):A=uU.call(this,t),n=this.Block(!0),{type:"Rule",loc:this.getLocation(e,this.tokenStart),prelude:A,block:n}}function fU(t){this.node(t.prelude),this.node(t.block)}const Fq=Object.freeze(Object.defineProperty({__proto__:null,generate:fU,name:kq,parse:dU,structure:Qq,walkContext:Sq},Symbol.toStringTag,{value:"Module"})),Uq="Scope",Iq={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function hU(){let t=null,e=null;this.skipSC();const A=this.tokenStart;return this.tokenType===$t&&(this.next(),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(rt)),this.lookupNonWSType(0)===_e&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat($t),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(rt)),{type:"Scope",loc:this.getLocation(A,this.tokenStart),root:t,limit:e}}function pU(t){t.root&&(this.token($t,"("),this.node(t.root),this.token(rt,")")),t.limit&&(this.token(_e,"to"),this.token($t,"("),this.node(t.limit),this.token(rt,")"))}const xq=Object.freeze(Object.defineProperty({__proto__:null,generate:pU,name:Uq,parse:hU,structure:Iq},Symbol.toStringTag,{value:"Module"})),Tq="Selector",_q={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function mU(){const t=this.readSequence(this.scope.Selector);return this.getFirstListNode(t)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(t),children:t}}function gU(t){this.children(t)}const Dq=Object.freeze(Object.defineProperty({__proto__:null,generate:gU,name:Tq,parse:mU,structure:_q},Symbol.toStringTag,{value:"Module"})),Lq="SelectorList",Oq="selector",Mq={children:[["Selector","Raw"]]};function BU(){const t=this.createList();for(;!this.eof;){if(t.push(this.Selector()),this.tokenType===_r){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(t),children:t}}function yU(t){this.children(t,()=>this.token(_r,","))}const Nq=Object.freeze(Object.defineProperty({__proto__:null,generate:yU,name:Lq,parse:BU,structure:Mq,walkContext:Oq},Symbol.toStringTag,{value:"Module"})),ey=92,wU=34,Hq=39;function CU(t){const e=t.length,A=t.charCodeAt(0),n=A===wU||A===Hq?1:0,r=n===1&&e>1&&t.charCodeAt(e-1)===A?e-2:e-1;let o="";for(let i=n;i<=r;i++){let a=t.charCodeAt(i);if(a===ey){if(i===r){i!==e-1&&(o=t.substr(i+1));break}if(a=t.charCodeAt(++i),oo(ey,a)){const l=i-1,u=Va(t,l);i=u-1,o+=vQ(t.substring(l+1,u))}else a===13&&t.charCodeAt(i+1)===10&&i++}else o+=t[i]}return o}function Rq(t,e){const n=wU;let r="",o=!1;for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);if(a===0){r+="�";continue}if(a<=31||a===127){r+="\\"+a.toString(16),o=!0;continue}a===n||a===ey?(r+="\\"+t.charAt(i),o=!1):(o&&(Ra(a)||Qs(a))&&(r+=" "),r+=t.charAt(i),o=!1)}return'"'+r+'"'}const Pq="String",Vq={value:String};function bU(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:CU(this.consume(Oo))}}function vU(t){this.token(Oo,Rq(t.value))}const $q=Object.freeze(Object.defineProperty({__proto__:null,generate:vU,name:Pq,parse:bU,structure:Vq},Symbol.toStringTag,{value:"Module"})),Kq=33;function EU(){return this.Raw(null,!1)}const Gq="StyleSheet",Wq="stylesheet",zq={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function kU(){const t=this.tokenStart,e=this.createList();let A;for(;!this.eof;){switch(this.tokenType){case bA:this.next();continue;case pn:if(this.charCodeAt(this.tokenStart+2)!==Kq){this.next();continue}A=this.Comment();break;case Rf:A=this.CDO();break;case Pn:A=this.CDC();break;case EA:A=this.parseWithFallback(this.Atrule,EU);break;default:A=this.parseWithFallback(this.Rule,EU)}e.push(A)}return{type:"StyleSheet",loc:this.getLocation(t,this.tokenStart),children:e}}function SU(t){this.children(t)}const Yq=Object.freeze(Object.defineProperty({__proto__:null,generate:SU,name:Gq,parse:kU,structure:zq,walkContext:Wq},Symbol.toStringTag,{value:"Module"})),Jq="SupportsDeclaration",Xq={declaration:"Declaration"};function QU(){const t=this.tokenStart;this.eat($t),this.skipSC();const e=this.Declaration();return this.eof||this.eat(rt),{type:"SupportsDeclaration",loc:this.getLocation(t,this.tokenStart),declaration:e}}function FU(t){this.token($t,"("),this.node(t.declaration),this.token(rt,")")}const jq=Object.freeze(Object.defineProperty({__proto__:null,generate:FU,name:Jq,parse:QU,structure:Xq},Symbol.toStringTag,{value:"Module"})),qq=42,UU=124;function ty(){this.tokenType!==_e&&this.isDelim(qq)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const Zq="TypeSelector",e9={name:String};function IU(){const t=this.tokenStart;return this.isDelim(UU)?(this.next(),ty.call(this)):(ty.call(this),this.isDelim(UU)&&(this.next(),ty.call(this))),{type:"TypeSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function xU(t){this.tokenize(t.name)}const t9=Object.freeze(Object.defineProperty({__proto__:null,generate:xU,name:Zq,parse:IU,structure:e9},Symbol.toStringTag,{value:"Module"})),TU=43,_U=45,Ay=63;function Fc(t,e){let A=0;for(let n=this.tokenStart+t;n<this.tokenEnd;n++){const r=this.charCodeAt(n);if(r===_U&&e&&A!==0)return Fc.call(this,t+A+1,!1),-1;Ra(r)||this.error(e&&A!==0?"Hyphen minus"+(A<6?" or hex digit":"")+" is expected":A<6?"Hex digit is expected":"Unexpected input",n),++A>6&&this.error("Too many hex digits",n)}return this.next(),A}function jf(t){let e=0;for(;this.isDelim(Ay);)++e>t&&this.error("Too many question marks"),this.next()}function A9(t){this.charCodeAt(this.tokenStart)!==t&&this.error((t===TU?"Plus sign":"Hyphen minus")+" is expected")}function n9(){let t=0;switch(this.tokenType){case at:if(t=Fc.call(this,1,!0),this.isDelim(Ay)){jf.call(this,6-t);break}if(this.tokenType===bt||this.tokenType===at){A9.call(this,_U),Fc.call(this,1,!1);break}break;case bt:t=Fc.call(this,1,!0),t>0&&jf.call(this,6-t);break;default:if(this.eatDelim(TU),this.tokenType===_e){t=Fc.call(this,0,!0),t>0&&jf.call(this,6-t);break}if(this.isDelim(Ay)){this.next(),jf.call(this,5);break}this.error("Hex digit or question mark is expected")}}const r9="UnicodeRange",o9={value:String};function DU(){const t=this.tokenStart;return this.eatIdent("u"),n9.call(this),{type:"UnicodeRange",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function LU(t){this.tokenize(t.value)}const i9=Object.freeze(Object.defineProperty({__proto__:null,generate:LU,name:r9,parse:DU,structure:o9},Symbol.toStringTag,{value:"Module"})),s9=32,ny=92,a9=34,l9=39,c9=40,OU=41;function u9(t){const e=t.length;let A=4,n=t.charCodeAt(e-1)===OU?e-2:e-1,r="";for(;A<n&&Qs(t.charCodeAt(A));)A++;for(;A<n&&Qs(t.charCodeAt(n));)n--;for(let o=A;o<=n;o++){let i=t.charCodeAt(o);if(i===ny){if(o===n){o!==e-1&&(r=t.substr(o+1));break}if(i=t.charCodeAt(++o),oo(ny,i)){const a=o-1,l=Va(t,a);o=l-1,r+=vQ(t.substring(a+1,l))}else i===13&&t.charCodeAt(o+1)===10&&o++}else r+=t[o]}return r}function d9(t){let e="",A=!1;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(r===0){e+="�";continue}if(r<=31||r===127){e+="\\"+r.toString(16),A=!0;continue}r===s9||r===ny||r===a9||r===l9||r===c9||r===OU?(e+="\\"+t.charAt(n),A=!1):(A&&Ra(r)&&(e+=" "),e+=t.charAt(n),A=!1)}return"url("+e+")"}const f9="Url",h9={value:String};function MU(){const t=this.tokenStart;let e;switch(this.tokenType){case fn:e=u9(this.consume(fn));break;case mt:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(mt),this.skipSC(),e=CU(this.consume(Oo)),this.skipSC(),this.eof||this.eat(rt);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(t,this.tokenStart),value:e}}function NU(t){this.token(fn,d9(t.value))}const p9=Object.freeze(Object.defineProperty({__proto__:null,generate:NU,name:f9,parse:MU,structure:h9},Symbol.toStringTag,{value:"Module"})),m9="Value",g9={children:[[]]};function HU(){const t=this.tokenStart,e=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(t,this.tokenStart),children:e}}function RU(t){this.children(t)}const B9=Object.freeze(Object.defineProperty({__proto__:null,generate:RU,name:m9,parse:HU,structure:g9},Symbol.toStringTag,{value:"Module"})),y9=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),w9="WhiteSpace",C9={value:String};function PU(){return this.eat(bA),y9}function VU(t){this.token(bA,t.value)}const b9=Object.freeze(Object.defineProperty({__proto__:null,generate:VU,name:w9,parse:PU,structure:C9},Symbol.toStringTag,{value:"Module"})),v9=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:DX,Atrule:HX,AtrulePrelude:$X,AttributeSelector:jX,Block:nj,Brackets:ij,CDC:lj,CDO:dj,ClassSelector:mj,Combinator:bj,Comment:Qj,Condition:Tj,Declaration:zj,DeclarationList:jj,Dimension:e7,Feature:r7,FeatureFunction:a7,FeatureRange:f7,Function:g7,GeneralEnclosed:w7,Hash:E7,IdSelector:I7,Identifier:Q7,Layer:D7,LayerList:M7,MediaQuery:R7,MediaQueryList:$7,NestingSelector:z7,Nth:X7,Number:Z7,Operator:Aq,Parentheses:oq,Percentage:aq,PseudoClassSelector:dq,PseudoElementSelector:mq,Ratio:yq,Raw:vq,Rule:Fq,Scope:xq,Selector:Dq,SelectorList:Nq,String:$q,StyleSheet:Yq,SupportsDeclaration:jq,TypeSelector:t9,UnicodeRange:i9,Url:p9,Value:B9,WhiteSpace:b9},Symbol.toStringTag,{value:"Module"})),E9={node:v9},Mi=BX(E9),ry=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function Uc(t){return ry.includes(t)}const oy=["margin-block-start","margin-block-end","margin-block","margin-inline-start","margin-inline-end","margin-inline","margin-bottom","margin-left","margin-right","margin-top","margin"];function k9(t){return oy.includes(t)}const iy=["width","height","min-width","min-height","max-width","max-height","block-size","inline-size","min-block-size","min-inline-size","max-block-size","max-inline-size"];function $U(t){return iy.includes(t)}const KU=["justify-self","align-self","place-self"];function S9(t){return KU.includes(t)}const GU=[...ry,...oy,...iy,...KU,"position-anchor","position-area"],Q9=[...iy,...ry,...oy];function WU(t){return Q9.includes(t)}const F9=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function zU(t){return F9.includes(t)}const U9=["width","height","block","inline","self-block","self-inline"];function I9(t){return U9.includes(t)}const YU=new Set(["Atrule","Selector","Declaration"]);function x9(t){const e=new SourceMapGenerator,A={line:1,column:0},n={line:0,column:0},r={line:1,column:0},o={generated:r};let i=1,a=0,l=!1;const u=t.node;t.node=function(p){if(p.loc&&p.loc.start&&YU.has(p.type)){const g=p.loc.start.line,B=p.loc.start.column-1;(n.line!==g||n.column!==B)&&(n.line=g,n.column=B,A.line=i,A.column=a,l&&(l=!1,(A.line!==r.line||A.column!==r.column)&&e.addMapping(o)),l=!0,e.addMapping({source:p.loc.source,original:n,generated:A}))}u.call(this,p),l&&YU.has(p.type)&&(r.line=i,r.column=a)};const f=t.emit;t.emit=function(p,g,B){for(let y=0;y<p.length;y++)p.charCodeAt(y)===10?(i++,a=0):a++;f(p,g,B)};const h=t.result;return t.result=function(){return l&&e.addMapping(o),{css:h(),map:e}},t}const T9=43,_9=45,sy=(t,e)=>{if(t===It&&(t=e),typeof t=="string"){const A=t.charCodeAt(0);return A>127?32768:A<<8}return t},JU=[[_e,_e],[_e,mt],[_e,fn],[_e,Tr],[_e,"-"],[_e,at],[_e,pA],[_e,bt],[_e,Pn],[_e,$t],[EA,_e],[EA,mt],[EA,fn],[EA,Tr],[EA,"-"],[EA,at],[EA,pA],[EA,bt],[EA,Pn],[jt,_e],[jt,mt],[jt,fn],[jt,Tr],[jt,"-"],[jt,at],[jt,pA],[jt,bt],[jt,Pn],[bt,_e],[bt,mt],[bt,fn],[bt,Tr],[bt,"-"],[bt,at],[bt,pA],[bt,bt],[bt,Pn],["#",_e],["#",mt],["#",fn],["#",Tr],["#","-"],["#",at],["#",pA],["#",bt],["#",Pn],["-",_e],["-",mt],["-",fn],["-",Tr],["-","-"],["-",at],["-",pA],["-",bt],["-",Pn],[at,_e],[at,mt],[at,fn],[at,Tr],[at,at],[at,pA],[at,bt],[at,"%"],[at,Pn],["@",_e],["@",mt],["@",fn],["@",Tr],["@","-"],["@",Pn],[".",at],[".",pA],[".",bt],["+",at],["+",pA],["+",bt],["/","*"]],D9=JU.concat([[_e,jt],[bt,jt],[jt,jt],[EA,$t],[EA,Oo],[EA,hn],[pA,pA],[pA,bt],[pA,mt],[pA,"-"],[rt,_e],[rt,mt],[rt,pA],[rt,bt],[rt,jt],[rt,"-"]]);function XU(t){const e=new Set(t.map(([A,n])=>sy(A)<<16|sy(n)));return function(A,n,r){const o=sy(n,r),i=r.charCodeAt(0);return(i===_9&&n!==_e&&n!==mt&&n!==Pn||i===T9?e.has(A<<16|i<<8):e.has(A<<16|o))&&this.emit(" ",bA,!0),o}}const L9=XU(JU),jU=XU(D9),qU=Object.freeze(Object.defineProperty({__proto__:null,safe:jU,spec:L9},Symbol.toStringTag,{value:"Module"})),O9=92;function M9(t,e){if(typeof e=="function"){let A=null;t.children.forEach(n=>{A!==null&&e.call(this,A),this.node(n),A=n});return}t.children.forEach(this.node,this)}function N9(t){UQ(t,(e,A,n)=>{this.token(e,t.slice(A,n))})}function H9(t){const e=new Map;for(let[A,n]of Object.entries(t.node))typeof(n.generate||n)=="function"&&e.set(A,n.generate||n);return function(A,n){let r="",o=0,i={node(l){if(e.has(l.type))e.get(l.type).call(a,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:jU,token(l,u){o=this.tokenBefore(o,l,u),this.emit(u,l,!1),l===It&&u.charCodeAt(0)===O9&&this.emit(`
164
+ .`+SB+tJ+$S)},nJ=function(t,e){var A=t.ownerDocument;if(A){var n=A.createElement("style");n.textContent=e,t.appendChild(n)}},KS=(function(){function t(){}return t.getOrigin=function(e){var A=t._link;return A?(A.href=e,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t})(),rJ=(function(){function t(e,A){this.context=e,this._options=A,this._cache={}}return t.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(FB(e)||aJ(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return dn(this,void 0,void 0,function(){var A,n,r,o,i=this;return ZA(this,function(a){switch(a.label){case 0:return A=KS.isSameOrigin(e),n=!QB(e)&&this._options.useCORS===!0&&KA.SUPPORT_CORS_IMAGES&&!A,r=!QB(e)&&!A&&!FB(e)&&typeof this._options.proxy=="string"&&KA.SUPPORT_CORS_XHR&&!n,!A&&this._options.allowTaint===!1&&!QB(e)&&!FB(e)&&!r&&!n?[2]:(o=e,r?[4,this.proxy(o)]:[3,2]);case 1:o=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(l,u){var f=new Image;f.onload=function(){return l(f)},f.onerror=u,(lJ(o)||n)&&(f.crossOrigin="anonymous"),f.src=o,f.complete===!0&&setTimeout(function(){return l(f)},500),i._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var A=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(o,i){var a=KA.SUPPORT_RESPONSE_TYPE?"blob":"text",l=new XMLHttpRequest;l.onload=function(){if(l.status===200)if(a==="text")o(l.response);else{var h=new FileReader;h.addEventListener("load",function(){return o(h.result)},!1),h.addEventListener("error",function(p){return i(p)},!1),h.readAsDataURL(l.response)}else i("Failed to proxy resource "+r+" with status code "+l.status)},l.onerror=i;var u=n.indexOf("?")>-1?"&":"?";if(l.open("GET",""+n+u+"url="+encodeURIComponent(e)+"&responseType="+a),a!=="text"&&l instanceof XMLHttpRequest&&(l.responseType=a),A._options.imageTimeout){var f=A._options.imageTimeout;l.timeout=f,l.ontimeout=function(){return i("Timed out ("+f+"ms) proxying "+r)}}l.send()})},t})(),oJ=/^data:image\/svg\+xml/i,iJ=/^data:image\/.*;base64,/i,sJ=/^data:image\/.*/i,aJ=function(t){return KA.SUPPORT_SVG_DRAWING||!cJ(t)},QB=function(t){return sJ.test(t)},lJ=function(t){return iJ.test(t)},FB=function(t){return t.substr(0,4)==="blob"},cJ=function(t){return t.substr(-3).toLowerCase()==="svg"||oJ.test(t)},Te=(function(){function t(e,A){this.type=0,this.x=e,this.y=A}return t.prototype.add=function(e,A){return new t(this.x+e,this.y+A)},t})(),xa=function(t,e,A){return new Te(t.x+(e.x-t.x)*A,t.y+(e.y-t.y)*A)},Qf=(function(){function t(e,A,n,r){this.type=1,this.start=e,this.startControl=A,this.endControl=n,this.end=r}return t.prototype.subdivide=function(e,A){var n=xa(this.start,this.startControl,e),r=xa(this.startControl,this.endControl,e),o=xa(this.endControl,this.end,e),i=xa(n,r,e),a=xa(r,o,e),l=xa(i,a,e);return A?new t(this.start,n,i,l):new t(l,a,o,this.end)},t.prototype.add=function(e,A){return new t(this.start.add(e,A),this.startControl.add(e,A),this.endControl.add(e,A),this.end.add(e,A))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t})(),or=function(t){return t.type===1},uJ=(function(){function t(e){var A=e.styles,n=e.bounds,r=mc(A.borderTopLeftRadius,n.width,n.height),o=r[0],i=r[1],a=mc(A.borderTopRightRadius,n.width,n.height),l=a[0],u=a[1],f=mc(A.borderBottomRightRadius,n.width,n.height),h=f[0],p=f[1],g=mc(A.borderBottomLeftRadius,n.width,n.height),B=g[0],y=g[1],b=[];b.push((o+l)/n.width),b.push((B+h)/n.width),b.push((i+y)/n.height),b.push((u+p)/n.height);var w=Math.max.apply(Math,b);w>1&&(o/=w,i/=w,l/=w,u/=w,h/=w,p/=w,B/=w,y/=w);var v=n.width-l,S=n.height-p,F=n.width-h,I=n.height-y,Q=A.borderTopWidth,x=A.borderRightWidth,M=A.borderBottomWidth,O=A.borderLeftWidth,P=Mt(A.paddingTop,e.bounds.width),ie=Mt(A.paddingRight,e.bounds.width),ae=Mt(A.paddingBottom,e.bounds.width),ue=Mt(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||i>0?Yt(n.left+O/3,n.top+Q/3,o-O/3,i-Q/3,Et.TOP_LEFT):new Te(n.left+O/3,n.top+Q/3),this.topRightBorderDoubleOuterBox=o>0||i>0?Yt(n.left+v,n.top+Q/3,l-x/3,u-Q/3,Et.TOP_RIGHT):new Te(n.left+n.width-x/3,n.top+Q/3),this.bottomRightBorderDoubleOuterBox=h>0||p>0?Yt(n.left+F,n.top+S,h-x/3,p-M/3,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x/3,n.top+n.height-M/3),this.bottomLeftBorderDoubleOuterBox=B>0||y>0?Yt(n.left+O/3,n.top+I,B-O/3,y-M/3,Et.BOTTOM_LEFT):new Te(n.left+O/3,n.top+n.height-M/3),this.topLeftBorderDoubleInnerBox=o>0||i>0?Yt(n.left+O*2/3,n.top+Q*2/3,o-O*2/3,i-Q*2/3,Et.TOP_LEFT):new Te(n.left+O*2/3,n.top+Q*2/3),this.topRightBorderDoubleInnerBox=o>0||i>0?Yt(n.left+v,n.top+Q*2/3,l-x*2/3,u-Q*2/3,Et.TOP_RIGHT):new Te(n.left+n.width-x*2/3,n.top+Q*2/3),this.bottomRightBorderDoubleInnerBox=h>0||p>0?Yt(n.left+F,n.top+S,h-x*2/3,p-M*2/3,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x*2/3,n.top+n.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=B>0||y>0?Yt(n.left+O*2/3,n.top+I,B-O*2/3,y-M*2/3,Et.BOTTOM_LEFT):new Te(n.left+O*2/3,n.top+n.height-M*2/3),this.topLeftBorderStroke=o>0||i>0?Yt(n.left+O/2,n.top+Q/2,o-O/2,i-Q/2,Et.TOP_LEFT):new Te(n.left+O/2,n.top+Q/2),this.topRightBorderStroke=o>0||i>0?Yt(n.left+v,n.top+Q/2,l-x/2,u-Q/2,Et.TOP_RIGHT):new Te(n.left+n.width-x/2,n.top+Q/2),this.bottomRightBorderStroke=h>0||p>0?Yt(n.left+F,n.top+S,h-x/2,p-M/2,Et.BOTTOM_RIGHT):new Te(n.left+n.width-x/2,n.top+n.height-M/2),this.bottomLeftBorderStroke=B>0||y>0?Yt(n.left+O/2,n.top+I,B-O/2,y-M/2,Et.BOTTOM_LEFT):new Te(n.left+O/2,n.top+n.height-M/2),this.topLeftBorderBox=o>0||i>0?Yt(n.left,n.top,o,i,Et.TOP_LEFT):new Te(n.left,n.top),this.topRightBorderBox=l>0||u>0?Yt(n.left+v,n.top,l,u,Et.TOP_RIGHT):new Te(n.left+n.width,n.top),this.bottomRightBorderBox=h>0||p>0?Yt(n.left+F,n.top+S,h,p,Et.BOTTOM_RIGHT):new Te(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=B>0||y>0?Yt(n.left,n.top+I,B,y,Et.BOTTOM_LEFT):new Te(n.left,n.top+n.height),this.topLeftPaddingBox=o>0||i>0?Yt(n.left+O,n.top+Q,Math.max(0,o-O),Math.max(0,i-Q),Et.TOP_LEFT):new Te(n.left+O,n.top+Q),this.topRightPaddingBox=l>0||u>0?Yt(n.left+Math.min(v,n.width-x),n.top+Q,v>n.width+x?0:Math.max(0,l-x),Math.max(0,u-Q),Et.TOP_RIGHT):new Te(n.left+n.width-x,n.top+Q),this.bottomRightPaddingBox=h>0||p>0?Yt(n.left+Math.min(F,n.width-O),n.top+Math.min(S,n.height-M),Math.max(0,h-x),Math.max(0,p-M),Et.BOTTOM_RIGHT):new Te(n.left+n.width-x,n.top+n.height-M),this.bottomLeftPaddingBox=B>0||y>0?Yt(n.left+O,n.top+Math.min(I,n.height-M),Math.max(0,B-O),Math.max(0,y-M),Et.BOTTOM_LEFT):new Te(n.left+O,n.top+n.height-M),this.topLeftContentBox=o>0||i>0?Yt(n.left+O+ue,n.top+Q+P,Math.max(0,o-(O+ue)),Math.max(0,i-(Q+P)),Et.TOP_LEFT):new Te(n.left+O+ue,n.top+Q+P),this.topRightContentBox=l>0||u>0?Yt(n.left+Math.min(v,n.width+O+ue),n.top+Q+P,v>n.width+O+ue?0:l-O+ue,u-(Q+P),Et.TOP_RIGHT):new Te(n.left+n.width-(x+ie),n.top+Q+P),this.bottomRightContentBox=h>0||p>0?Yt(n.left+Math.min(F,n.width-(O+ue)),n.top+Math.min(S,n.height+Q+P),Math.max(0,h-(x+ie)),p-(M+ae),Et.BOTTOM_RIGHT):new Te(n.left+n.width-(x+ie),n.top+n.height-(M+ae)),this.bottomLeftContentBox=B>0||y>0?Yt(n.left+O+ue,n.top+I,Math.max(0,B-(O+ue)),y-(M+ae),Et.BOTTOM_LEFT):new Te(n.left+O+ue,n.top+n.height-(M+ae))}return t})(),Et;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Et||(Et={}));var Yt=function(t,e,A,n,r){var o=4*((Math.sqrt(2)-1)/3),i=A*o,a=n*o,l=t+A,u=e+n;switch(r){case Et.TOP_LEFT:return new Qf(new Te(t,u),new Te(t,u-a),new Te(l-i,e),new Te(l,e));case Et.TOP_RIGHT:return new Qf(new Te(t,e),new Te(t+i,e),new Te(l,u-a),new Te(l,u));case Et.BOTTOM_RIGHT:return new Qf(new Te(l,e),new Te(l,e+a),new Te(t+i,u),new Te(t,u));case Et.BOTTOM_LEFT:default:return new Qf(new Te(l,u),new Te(l-i,u),new Te(t,e+a),new Te(t,e))}},Ff=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},dJ=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},Uf=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},fJ=(function(){function t(e,A,n){this.offsetX=e,this.offsetY=A,this.matrix=n,this.type=0,this.target=6}return t})(),If=(function(){function t(e,A){this.path=e,this.target=A,this.type=1}return t})(),hJ=(function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t})(),pJ=function(t){return t.type===0},GS=function(t){return t.type===1},mJ=function(t){return t.type===2},WS=function(t,e){return t.length===e.length?t.some(function(A,n){return A===e[n]}):!1},gJ=function(t,e,A,n,r){return t.map(function(o,i){switch(i){case 0:return o.add(e,A);case 1:return o.add(e+n,A);case 2:return o.add(e+n,A+r);case 3:return o.add(e,A+r)}return o})},zS=(function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t})(),YS=(function(){function t(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new uJ(this.container),this.container.styles.opacity<1&&this.effects.push(new hJ(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new fJ(n,r,o))}if(this.container.styles.overflowX!==0){var i=Ff(this.curves),a=Uf(this.curves);WS(i,a)?this.effects.push(new If(i,6)):(this.effects.push(new If(i,2)),this.effects.push(new If(a,4)))}}return t.prototype.getEffects=function(e){for(var A=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var o=n.effects.filter(function(l){return!GS(l)});if(A||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,o),A=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var i=Ff(n.curves),a=Uf(n.curves);WS(i,a)||r.unshift(new If(a,6))}}else r.unshift.apply(r,o);n=n.parent}return r.filter(function(l){return vA(l.target,e)})},t})(),UB=function(t,e,A,n){t.container.elements.forEach(function(r){var o=vA(r.flags,4),i=vA(r.flags,2),a=new YS(r,t);vA(r.styles.display,2048)&&n.push(a);var l=vA(r.flags,8)?[]:n;if(o||i){var u=o||r.styles.isPositioned()?A:e,f=new zS(a);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var h=r.styles.zIndex.order;if(h<0){var p=0;u.negativeZIndex.some(function(B,y){return h>B.element.container.styles.zIndex.order?(p=y,!1):p>0}),u.negativeZIndex.splice(p,0,f)}else if(h>0){var g=0;u.positiveZIndex.some(function(B,y){return h>=B.element.container.styles.zIndex.order?(g=y+1,!1):g>0}),u.positiveZIndex.splice(g,0,f)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else r.styles.isFloating()?u.nonPositionedFloats.push(f):u.nonPositionedInlineLevel.push(f);UB(a,f,o?f:A,l)}else r.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),UB(a,e,A,l);vA(r.flags,8)&&JS(r,l)})},JS=function(t,e){for(var A=t instanceof BB?t.start:1,n=t instanceof BB?t.reversed:!1,r=0;r<e.length;r++){var o=e[r];o.container instanceof wS&&typeof o.container.value=="number"&&o.container.value!==0&&(A=o.container.value),o.listValue=bc(A,o.container.styles.listStyleType,!0),A+=n?-1:1}},BJ=function(t){var e=new YS(t,null),A=new zS(e),n=[];return UB(e,A,A,n),JS(e.container,n),A},XS=function(t,e){switch(e){case 0:return ir(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return ir(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return ir(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return ir(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},yJ=function(t,e){switch(e){case 0:return ir(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return ir(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return ir(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return ir(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},wJ=function(t,e){switch(e){case 0:return ir(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return ir(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return ir(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return ir(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},CJ=function(t,e){switch(e){case 0:return xf(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return xf(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return xf(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return xf(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},xf=function(t,e){var A=[];return or(t)?A.push(t.subdivide(.5,!1)):A.push(t),or(e)?A.push(e.subdivide(.5,!0)):A.push(e),A},ir=function(t,e,A,n){var r=[];return or(t)?r.push(t.subdivide(.5,!1)):r.push(t),or(A)?r.push(A.subdivide(.5,!0)):r.push(A),or(n)?r.push(n.subdivide(.5,!0).reverse()):r.push(n),or(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r},jS=function(t){var e=t.bounds,A=t.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Tf=function(t){var e=t.styles,A=t.bounds,n=Mt(e.paddingLeft,A.width),r=Mt(e.paddingRight,A.width),o=Mt(e.paddingTop,A.width),i=Mt(e.paddingBottom,A.width);return A.add(n+e.borderLeftWidth,o+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+r),-(e.borderTopWidth+e.borderBottomWidth+o+i))},bJ=function(t,e){return t===0?e.bounds:t===2?Tf(e):jS(e)},vJ=function(t,e){return t===0?e.bounds:t===2?Tf(e):jS(e)},IB=function(t,e,A){var n=bJ(_a(t.styles.backgroundOrigin,e),t),r=vJ(_a(t.styles.backgroundClip,e),t),o=EJ(_a(t.styles.backgroundSize,e),A,n),i=o[0],a=o[1],l=mc(_a(t.styles.backgroundPosition,e),n.width-i,n.height-a),u=kJ(_a(t.styles.backgroundRepeat,e),l,o,n,r),f=Math.round(n.left+l[0]),h=Math.round(n.top+l[1]);return[u,f,h,i,a]},Ta=function(t){return Dt(t)&&t.value===Qa.AUTO},_f=function(t){return typeof t=="number"},EJ=function(t,e,A){var n=e[0],r=e[1],o=e[2],i=t[0],a=t[1];if(!i)return[0,0];if(CA(i)&&a&&CA(a))return[Mt(i,A.width),Mt(a,A.height)];var l=_f(o);if(Dt(i)&&(i.value===Qa.CONTAIN||i.value===Qa.COVER)){if(_f(o)){var u=A.width/A.height;return u<o!=(i.value===Qa.COVER)?[A.width,A.width/o]:[A.height*o,A.height]}return[A.width,A.height]}var f=_f(n),h=_f(r),p=f||h;if(Ta(i)&&(!a||Ta(a))){if(f&&h)return[n,r];if(!l&&!p)return[A.width,A.height];if(p&&l){var g=f?n:r*o,B=h?r:n/o;return[g,B]}var y=f?n:A.width,b=h?r:A.height;return[y,b]}if(l){var w=0,v=0;return CA(i)?w=Mt(i,A.width):CA(a)&&(v=Mt(a,A.height)),Ta(i)?w=v*o:(!a||Ta(a))&&(v=w/o),[w,v]}var S=null,F=null;if(CA(i)?S=Mt(i,A.width):a&&CA(a)&&(F=Mt(a,A.height)),S!==null&&(!a||Ta(a))&&(F=f&&h?S/n*r:A.height),F!==null&&Ta(i)&&(S=f&&h?F/r*n:A.width),S!==null&&F!==null)return[S,F];throw new Error("Unable to calculate background-size for element")},_a=function(t,e){var A=t[e];return typeof A>"u"?t[0]:A},kJ=function(t,e,A,n,r){var o=e[0],i=e[1],a=A[0],l=A[1];switch(t){case 2:return[new Te(Math.round(n.left),Math.round(n.top+i)),new Te(Math.round(n.left+n.width),Math.round(n.top+i)),new Te(Math.round(n.left+n.width),Math.round(l+n.top+i)),new Te(Math.round(n.left),Math.round(l+n.top+i))];case 3:return[new Te(Math.round(n.left+o),Math.round(n.top)),new Te(Math.round(n.left+o+a),Math.round(n.top)),new Te(Math.round(n.left+o+a),Math.round(n.height+n.top)),new Te(Math.round(n.left+o),Math.round(n.height+n.top))];case 1:return[new Te(Math.round(n.left+o),Math.round(n.top+i)),new Te(Math.round(n.left+o+a),Math.round(n.top+i)),new Te(Math.round(n.left+o+a),Math.round(n.top+i+l)),new Te(Math.round(n.left+o),Math.round(n.top+i+l))];default:return[new Te(Math.round(r.left),Math.round(r.top)),new Te(Math.round(r.left+r.width),Math.round(r.top)),new Te(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Te(Math.round(r.left),Math.round(r.height+r.top))]}},SJ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",qS="Hidden Text",QJ=(function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,A){var n=this._document.createElement("div"),r=this._document.createElement("img"),o=this._document.createElement("span"),i=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=A,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",i.appendChild(n),r.src=SJ,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",o.style.fontFamily=e,o.style.fontSize=A,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(qS)),n.appendChild(o),n.appendChild(r);var a=r.offsetTop-o.offsetTop+2;n.removeChild(o),n.appendChild(this._document.createTextNode(qS)),n.style.lineHeight="normal",r.style.verticalAlign="super";var l=r.offsetTop-n.offsetTop+2;return i.removeChild(n),{baseline:a,middle:l}},t.prototype.getMetrics=function(e,A){var n=e+" "+A;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,A)),this._data[n]},t})(),ZS=(function(){function t(e,A){this.context=e,this.options=A}return t})(),FJ=1e4,UJ=(function(t){Fr(e,t);function e(A,n){var r=t.call(this,A,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px"),r.fontMetrics=new QJ(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),r}return e.prototype.applyEffects=function(A){for(var n=this;this._activeEffects.length;)this.popEffect();A.forEach(function(r){return n.applyEffect(r)})},e.prototype.applyEffect=function(A){this.ctx.save(),mJ(A)&&(this.ctx.globalAlpha=A.opacity),pJ(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),GS(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(A){return dn(this,void 0,void 0,function(){var n;return ZA(this,function(r){switch(r.label){case 0:return n=A.element.container.styles,n.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(A){return dn(this,void 0,void 0,function(){return ZA(this,function(n){switch(n.label){case 0:if(vA(A.container.flags,16))debugger;return A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(A)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(A,n,r){var o=this;if(n===0)this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+r);else{var i=gB(A.text);i.reduce(function(a,l){return o.ctx.fillText(l,a,A.bounds.top+r),a+o.ctx.measureText(l).width},A.bounds.left)}},e.prototype.createFontStyle=function(A){var n=A.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),r=DJ(A.fontFamily).join(", "),o=pc(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,n,A.fontWeight,o,r].join(" "),r,o]},e.prototype.renderTextNode=function(A,n){return dn(this,void 0,void 0,function(){var r,o,i,a,l,u,f,h,p=this;return ZA(this,function(g){return r=this.createFontStyle(n),o=r[0],i=r[1],a=r[2],this.ctx.font=o,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",l=this.fontMetrics.getMetrics(i,a),u=l.baseline,f=l.middle,h=n.paintOrder,A.textBounds.forEach(function(B){h.forEach(function(y){switch(y){case 0:p.ctx.fillStyle=OA(n.color),p.renderTextWithLetterSpacing(B,n.letterSpacing,u);var b=n.textShadow;b.length&&B.text.trim().length&&(b.slice(0).reverse().forEach(function(w){p.ctx.shadowColor=OA(w.color),p.ctx.shadowOffsetX=w.offsetX.number*p.options.scale,p.ctx.shadowOffsetY=w.offsetY.number*p.options.scale,p.ctx.shadowBlur=w.blur.number,p.renderTextWithLetterSpacing(B,n.letterSpacing,u)}),p.ctx.shadowColor="",p.ctx.shadowOffsetX=0,p.ctx.shadowOffsetY=0,p.ctx.shadowBlur=0),n.textDecorationLine.length&&(p.ctx.fillStyle=OA(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(w){switch(w){case 1:p.ctx.fillRect(B.bounds.left,Math.round(B.bounds.top+u),B.bounds.width,1);break;case 2:p.ctx.fillRect(B.bounds.left,Math.round(B.bounds.top),B.bounds.width,1);break;case 3:p.ctx.fillRect(B.bounds.left,Math.ceil(B.bounds.top+f),B.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&B.text.trim().length&&(p.ctx.strokeStyle=OA(n.webkitTextStrokeColor),p.ctx.lineWidth=n.webkitTextStrokeWidth,p.ctx.lineJoin=window.chrome?"miter":"round",p.ctx.strokeText(B.text,B.bounds.left,B.bounds.top+u)),p.ctx.strokeStyle="",p.ctx.lineWidth=0,p.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(A,n,r){if(r&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var o=Tf(A),i=Uf(n);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,A.intrinsicWidth,A.intrinsicHeight,o.left,o.top,o.width,o.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l,v,v,u,f,h,p,F,g,B,I,y,b,w,v,S,F,I;return ZA(this,function(Q){switch(Q.label){case 0:this.applyEffects(A.getEffects(4)),n=A.container,r=A.curves,o=n.styles,i=0,a=n.textNodes,Q.label=1;case 1:return i<a.length?(l=a[i],[4,this.renderTextNode(l,o)]):[3,4];case 2:Q.sent(),Q.label=3;case 3:return i++,[3,1];case 4:if(!(n instanceof gS))return[3,8];Q.label=5;case 5:return Q.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return v=Q.sent(),this.renderReplacedElement(n,r,v),[3,8];case 7:return Q.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof BS&&this.renderReplacedElement(n,r,n.canvas),!(n instanceof yS))return[3,12];Q.label=9;case 9:return Q.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return v=Q.sent(),this.renderReplacedElement(n,r,v),[3,12];case 11:return Q.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof ES&&n.tree?(u=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,u.render(n.tree)]):[3,14];case 13:f=Q.sent(),n.width&&n.height&&this.ctx.drawImage(f,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),Q.label=14;case 14:if(n instanceof yB&&(h=Math.min(n.bounds.width,n.bounds.height),n.type===Cf?n.checked&&(this.ctx.save(),this.path([new Te(n.bounds.left+h*.39363,n.bounds.top+h*.79),new Te(n.bounds.left+h*.16,n.bounds.top+h*.5549),new Te(n.bounds.left+h*.27347,n.bounds.top+h*.44071),new Te(n.bounds.left+h*.39694,n.bounds.top+h*.5649),new Te(n.bounds.left+h*.72983,n.bounds.top+h*.23),new Te(n.bounds.left+h*.84,n.bounds.top+h*.34085),new Te(n.bounds.left+h*.39363,n.bounds.top+h*.79)]),this.ctx.fillStyle=OA(CS),this.ctx.fill(),this.ctx.restore()):n.type===bf&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+h/2,n.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=OA(CS),this.ctx.fill(),this.ctx.restore())),IJ(n)&&n.value.length){switch(p=this.createFontStyle(o),F=p[0],g=p[1],B=this.fontMetrics.getMetrics(F,g).baseline,this.ctx.font=F,this.ctx.fillStyle=OA(o.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=TJ(n.styles.textAlign),I=Tf(n),y=0,n.styles.textAlign){case 1:y+=I.width/2;break;case 2:y+=I.width;break}b=I.add(y,0,0,-I.height/2+1),this.ctx.save(),this.path([new Te(I.left,I.top),new Te(I.left+I.width,I.top),new Te(I.left+I.width,I.top+I.height),new Te(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new wc(n.value,b),o.letterSpacing,B),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!vA(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(w=n.styles.listStyleImage,w.type!==0)return[3,18];v=void 0,S=w.url,Q.label=15;case 15:return Q.trys.push([15,17,,18]),[4,this.context.cache.match(S)];case 16:return v=Q.sent(),this.ctx.drawImage(v,n.bounds.left-(v.width+10),n.bounds.top),[3,18];case 17:return Q.sent(),this.context.logger.error("Error loading list-style-image "+S),[3,18];case 18:return[3,20];case 19:A.listValue&&n.styles.listStyleType!==-1&&(F=this.createFontStyle(o)[0],this.ctx.font=F,this.ctx.fillStyle=OA(o.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new To(n.bounds.left,n.bounds.top+Mt(n.styles.paddingTop,n.bounds.width),n.bounds.width,qk(o.lineHeight,o.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new wc(A.listValue,I),o.letterSpacing,qk(o.lineHeight,o.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Q.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(A){return dn(this,void 0,void 0,function(){var n,r,w,o,i,w,a,l,w,u,f,w,h,p,w,g,B,w,y,b,w;return ZA(this,function(v){switch(v.label){case 0:if(vA(A.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:v.sent(),n=0,r=A.negativeZIndex,v.label=2;case 2:return n<r.length?(w=r[n],[4,this.renderStack(w)]):[3,5];case 3:v.sent(),v.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:v.sent(),o=0,i=A.nonInlineLevel,v.label=7;case 7:return o<i.length?(w=i[o],[4,this.renderNode(w)]):[3,10];case 8:v.sent(),v.label=9;case 9:return o++,[3,7];case 10:a=0,l=A.nonPositionedFloats,v.label=11;case 11:return a<l.length?(w=l[a],[4,this.renderStack(w)]):[3,14];case 12:v.sent(),v.label=13;case 13:return a++,[3,11];case 14:u=0,f=A.nonPositionedInlineLevel,v.label=15;case 15:return u<f.length?(w=f[u],[4,this.renderStack(w)]):[3,18];case 16:v.sent(),v.label=17;case 17:return u++,[3,15];case 18:h=0,p=A.inlineLevel,v.label=19;case 19:return h<p.length?(w=p[h],[4,this.renderNode(w)]):[3,22];case 20:v.sent(),v.label=21;case 21:return h++,[3,19];case 22:g=0,B=A.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return g<B.length?(w=B[g],[4,this.renderStack(w)]):[3,26];case 24:v.sent(),v.label=25;case 25:return g++,[3,23];case 26:y=0,b=A.positiveZIndex,v.label=27;case 27:return y<b.length?(w=b[y],[4,this.renderStack(w)]):[3,30];case 28:v.sent(),v.label=29;case 29:return y++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},e.prototype.formatPath=function(A){var n=this;A.forEach(function(r,o){var i=or(r)?r.start:r;o===0?n.ctx.moveTo(i.x,i.y):n.ctx.lineTo(i.x,i.y),or(r)&&n.ctx.bezierCurveTo(r.startControl.x,r.startControl.y,r.endControl.x,r.endControl.y,r.end.x,r.end.y)})},e.prototype.renderRepeat=function(A,n,r,o){this.path(A),this.ctx.fillStyle=n,this.ctx.translate(r,o),this.ctx.fill(),this.ctx.translate(-r,-o)},e.prototype.resizeImage=function(A,n,r){var o;if(A.width===n&&A.height===r)return A;var i=(o=this.canvas.ownerDocument)!==null&&o!==void 0?o:document,a=i.createElement("canvas");a.width=Math.max(1,n),a.height=Math.max(1,r);var l=a.getContext("2d");return l.drawImage(A,0,0,A.width,A.height,0,0,n,r),a},e.prototype.renderBackgroundImage=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l;return ZA(this,function(u){switch(u.label){case 0:n=A.styles.backgroundImage.length-1,r=function(f){var h,p,g,P,$,te,ue,H,M,B,P,$,te,ue,H,y,b,w,v,S,F,I,Q,x,M,O,P,ie,ae,ue,H,G,$,te,ee,K,ce,j,Qe,R,J,Ae;return ZA(this,function(oe){switch(oe.label){case 0:if(f.type!==0)return[3,5];h=void 0,p=f.url,oe.label=1;case 1:return oe.trys.push([1,3,,4]),[4,o.context.cache.match(p)];case 2:return h=oe.sent(),[3,4];case 3:return oe.sent(),o.context.logger.error("Error loading background-image "+p),[3,4];case 4:return h&&(g=IB(A,n,[h.width,h.height,h.width/h.height]),P=g[0],$=g[1],te=g[2],ue=g[3],H=g[4],M=o.ctx.createPattern(o.resizeImage(h,ue,H),"repeat"),o.renderRepeat(P,M,$,te)),[3,6];case 5:pY(f)?(B=IB(A,n,[null,null,null]),P=B[0],$=B[1],te=B[2],ue=B[3],H=B[4],y=cY(f.angle,ue,H),b=y[0],w=y[1],v=y[2],S=y[3],F=y[4],I=document.createElement("canvas"),I.width=ue,I.height=H,Q=I.getContext("2d"),x=Q.createLinearGradient(w,S,v,F),Pk(f.stops,b).forEach(function(k){return x.addColorStop(k.stop,OA(k.color))}),Q.fillStyle=x,Q.fillRect(0,0,ue,H),ue>0&&H>0&&(M=o.ctx.createPattern(I,"repeat"),o.renderRepeat(P,M,$,te))):mY(f)&&(O=IB(A,n,[null,null,null]),P=O[0],ie=O[1],ae=O[2],ue=O[3],H=O[4],G=f.position.length===0?[AB]:f.position,$=Mt(G[0],ue),te=Mt(G[G.length-1],H),ee=uY(f,$,te,ue,H),K=ee[0],ce=ee[1],K>0&&ce>0&&(j=o.ctx.createRadialGradient(ie+$,ae+te,0,ie+$,ae+te,K),Pk(f.stops,K*2).forEach(function(k){return j.addColorStop(k.stop,OA(k.color))}),o.path(P),o.ctx.fillStyle=j,K!==ce?(Qe=A.bounds.left+.5*A.bounds.width,R=A.bounds.top+.5*A.bounds.height,J=ce/K,Ae=1/J,o.ctx.save(),o.ctx.translate(Qe,R),o.ctx.transform(1,0,0,J,0,0),o.ctx.translate(-Qe,-R),o.ctx.fillRect(ie,Ae*(ae-R)+R,ue,H*Ae),o.ctx.restore()):o.ctx.fill())),oe.label=6;case 6:return n--,[2]}})},o=this,i=0,a=A.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return i<a.length?(l=a[i],[5,r(l)]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(A,n,r){return dn(this,void 0,void 0,function(){return ZA(this,function(o){return this.path(XS(r,n)),this.ctx.fillStyle=OA(A),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(A,n,r,o){return dn(this,void 0,void 0,function(){var i,a;return ZA(this,function(l){switch(l.label){case 0:return n<3?[4,this.renderSolidBorder(A,r,o)]:[3,2];case 1:return l.sent(),[2];case 2:return i=yJ(o,r),this.path(i),this.ctx.fillStyle=OA(A),this.ctx.fill(),a=wJ(o,r),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(A){return dn(this,void 0,void 0,function(){var n,r,o,i,a,l,u,f,h=this;return ZA(this,function(p){switch(p.label){case 0:return this.applyEffects(A.getEffects(2)),n=A.container.styles,r=!Ii(n.backgroundColor)||n.backgroundImage.length,o=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],i=xJ(_a(n.backgroundClip,0),A.curves),r||n.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),Ii(n.backgroundColor)||(this.ctx.fillStyle=OA(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:p.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(g){h.ctx.save();var B=Ff(A.curves),y=g.inset?0:FJ,b=gJ(B,-y+(g.inset?1:-1)*g.spread.number,(g.inset?1:-1)*g.spread.number,g.spread.number*(g.inset?-2:2),g.spread.number*(g.inset?-2:2));g.inset?(h.path(B),h.ctx.clip(),h.mask(b)):(h.mask(B),h.ctx.clip(),h.path(b)),h.ctx.shadowOffsetX=g.offsetX.number+y,h.ctx.shadowOffsetY=g.offsetY.number,h.ctx.shadowColor=OA(g.color),h.ctx.shadowBlur=g.blur.number,h.ctx.fillStyle=g.inset?OA(g.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),p.label=2;case 2:a=0,l=0,u=o,p.label=3;case 3:return l<u.length?(f=u[l],f.style!==0&&!Ii(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,a,A.curves,2)]:[3,11]):[3,13];case 4:return p.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,a,A.curves,3)];case 6:return p.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,a,A.curves)];case 8:return p.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,a,A.curves)];case 10:p.sent(),p.label=11;case 11:a++,p.label=12;case 12:return l++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(A,n,r,o,i){return dn(this,void 0,void 0,function(){var a,l,u,f,h,p,g,B,y,b,w,v,S,F,I,Q,I,Q;return ZA(this,function(x){return this.ctx.save(),a=CJ(o,r),l=XS(o,r),i===2&&(this.path(l),this.ctx.clip()),or(l[0])?(u=l[0].start.x,f=l[0].start.y):(u=l[0].x,f=l[0].y),or(l[1])?(h=l[1].end.x,p=l[1].end.y):(h=l[1].x,p=l[1].y),r===0||r===2?g=Math.abs(u-h):g=Math.abs(f-p),this.ctx.beginPath(),i===3?this.formatPath(a):this.formatPath(l.slice(0,2)),B=n<3?n*3:n*2,y=n<3?n*2:n,i===3&&(B=n,y=n),b=!0,g<=B*2?b=!1:g<=B*2+y?(w=g/(2*B+y),B*=w,y*=w):(v=Math.floor((g+y)/(B+y)),S=(g-v*B)/(v-1),F=(g-(v+1)*B)/v,y=F<=0||Math.abs(y-S)<Math.abs(y-F)?S:F),b&&(i===3?this.ctx.setLineDash([0,B+y]):this.ctx.setLineDash([B,y])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=OA(A),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(or(l[0])&&(I=l[3],Q=l[0],this.ctx.beginPath(),this.formatPath([new Te(I.end.x,I.end.y),new Te(Q.start.x,Q.start.y)]),this.ctx.stroke()),or(l[1])&&(I=l[1],Q=l[2],this.ctx.beginPath(),this.formatPath([new Te(I.end.x,I.end.y),new Te(Q.start.x,Q.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(A){return dn(this,void 0,void 0,function(){var n;return ZA(this,function(r){switch(r.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=OA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=BJ(A),[4,this.renderStack(n)];case 1:return r.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(ZS),IJ=function(t){return t instanceof vS||t instanceof bS?!0:t instanceof yB&&t.type!==bf&&t.type!==Cf},xJ=function(t,e){switch(t){case 0:return Ff(e);case 2:return dJ(e);case 1:default:return Uf(e)}},TJ=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},_J=["-apple-system","system-ui"],DJ=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return _J.indexOf(e)===-1}):t},LJ=(function(t){Fr(e,t);function e(A,n){var r=t.call(this,A,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),r}return e.prototype.render=function(A){return dn(this,void 0,void 0,function(){var n,r;return ZA(this,function(o){switch(o.label){case 0:return n=mB(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,OJ(n)];case 1:return r=o.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=OA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(r,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(ZS),OJ=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},MJ=(function(){function t(e){var A=e.id,n=e.enabled;this.id=A,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Rd([this.id,this.getTime()+"ms"],e))},t.prototype.warn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Rd([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},t.instances={},t})(),NJ=(function(){function t(e,A){var n;this.windowBounds=A,this.instanceName="#"+t.instanceCount++,this.logger=new MJ({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new rJ(this,e)}return t.instanceCount=1,t})(),HJ=function(t,e){return e===void 0&&(e={}),RJ(t,e)};typeof window<"u"&&KS.setContext(window);var RJ=function(t,e){return dn(void 0,void 0,void 0,function(){var A,n,r,o,i,a,l,u,f,h,p,g,B,y,b,w,v,S,F,I,x,Q,x,M,O,P,ie,ae,ue,H,G,$,te,ee,K,ce,j,Qe,R,J;return ZA(this,function(Ae){switch(Ae.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(A=t.ownerDocument,!A)throw new Error("Element is not attached to a Document");if(n=A.defaultView,!n)throw new Error("Document is not attached to a Window");return r={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(O=e.imageTimeout)!==null&&O!==void 0?O:15e3,proxy:e.proxy,useCORS:(P=e.useCORS)!==null&&P!==void 0?P:!1},o=Lg({logging:(ie=e.logging)!==null&&ie!==void 0?ie:!0,cache:e.cache},r),i={windowWidth:(ae=e.windowWidth)!==null&&ae!==void 0?ae:n.innerWidth,windowHeight:(ue=e.windowHeight)!==null&&ue!==void 0?ue:n.innerHeight,scrollX:(H=e.scrollX)!==null&&H!==void 0?H:n.pageXOffset,scrollY:(G=e.scrollY)!==null&&G!==void 0?G:n.pageYOffset},a=new To(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),l=new NJ(o,a),u=($=e.foreignObjectRendering)!==null&&$!==void 0?$:!1,f={allowTaint:(te=e.allowTaint)!==null&&te!==void 0?te:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:u,copyStyles:u},l.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),h=new VS(l,t,f),p=h.clonedReferenceElement,p?[4,h.toIFrame(A,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=Ae.sent(),B=CB(p)||P6(p)?g5(p.ownerDocument):Pd(l,p),y=B.width,b=B.height,w=B.left,v=B.top,S=PJ(l,p,e.backgroundColor),F={canvas:e.canvas,backgroundColor:S,scale:(K=(ee=e.scale)!==null&&ee!==void 0?ee:n.devicePixelRatio)!==null&&K!==void 0?K:1,x:((ce=e.x)!==null&&ce!==void 0?ce:0)+w,y:((j=e.y)!==null&&j!==void 0?j:0)+v,width:(Qe=e.width)!==null&&Qe!==void 0?Qe:Math.ceil(y),height:(R=e.height)!==null&&R!==void 0?R:Math.ceil(b)},u?(l.logger.debug("Document cloned, using foreign object rendering"),x=new LJ(l,F),[4,x.render(p)]):[3,3];case 2:return I=Ae.sent(),[3,5];case 3:return l.logger.debug("Document cloned, element located at "+w+","+v+" with size "+y+"x"+b+" using computed rendering"),l.logger.debug("Starting DOM parsing"),Q=SS(l,p),S===Q.styles.backgroundColor&&(Q.styles.backgroundColor=Do.TRANSPARENT),l.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),x=new UJ(l,F),[4,x.render(Q)];case 4:I=Ae.sent(),Ae.label=5;case 5:return(!((J=e.removeContainer)!==null&&J!==void 0)||J)&&(VS.destroy(g)||l.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),l.logger.debug("Finished rendering"),[2,I]}})})},PJ=function(t,e,A){var n=e.ownerDocument,r=n.documentElement?gc(t,getComputedStyle(n.documentElement).backgroundColor):Do.TRANSPARENT,o=n.body?gc(t,getComputedStyle(n.body).backgroundColor):Do.TRANSPARENT,i=typeof A=="string"?gc(t,A):A===null?Do.TRANSPARENT:4294967295;return e===n.documentElement?Ii(r)?Ii(o)?i:o:r:i};const VJ=s.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},debug:{type:Boolean,default:!1}},emits:["update:modelValue","update:pending"],setup(t,{emit:e}){const A=t,n=e,r=s.ref(),o=s.ref(""),i=s.ref();async function a(){if(r.value){n("update:pending",!0);const u=r.value,f=u.firstElementChild,h=f.offsetWidth,p=f.offsetHeight,B=(await HJ(u.firstElementChild,{backgroundColor:"rgba(0, 0, 0, 0)",scale:1,width:h,height:p,...A.options})).toDataURL();if(n("update:modelValue",B),n("update:pending",!1),A.debug){const y=new Image;y.src=B,document.body.appendChild(y)}return B}return""}const l=$1.debounce(async()=>{o.value=await a()},300,{trailing:!0,leading:!1});return s.onMounted(()=>{const u=r.value;A.renderUpdates&&(i.value=new MutationObserver(async f=>{l()}),i.value.observe(u,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),setTimeout(()=>{l()},500)}),(u,f)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["dom-renderer",{"off-screen":!t.debug}]),ref_key:"renderer",ref:r,style:s.normalizeStyle(t.fixedWidth>0?{width:`${t.fixedWidth}px`}:{})},[s.renderSlot(u.$slots,"default")],6))}}),$J=["id","popover"],xB=s.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:e}){const A=t,n=e,r=s.ref(),o=s.ref(),i=s.ref(!1),a=s.computed(()=>"ontouchstart"in window||navigator.maxTouchPoints>0);function l(){clearTimeout(o.value),A.hover&&r.value?.showPopover()}function u(){i.value=!0,clearTimeout(o.value),l()}function f(){i.value=!1,(A.hover||A.closeTimeout)&&(o.value=setTimeout(()=>{r.value?.hidePopover()},A.closeTimeout||A.hoverDelay))}s.watch(()=>A.modelValue,(p,g)=>{p&&!g?r.value?.matches(":popover-open")||r.value?.showPopover():!p&&g&&r.value?.matches(":popover-open")&&r.value?.hidePopover()});function h(p){p.newState==="open"?(A.closeTimeout&&!i.value&&(clearTimeout(o.value),o.value=setTimeout(()=>{i.value||r.value?.hidePopover()},A.closeTimeout)),A.modelValue||n("update:modelValue",!0)):p.newState==="closed"&&(i.value=!1,A.modelValue&&n("update:modelValue",!1))}return s.onMounted(()=>{if(r.value?.addEventListener("toggle",h),A.modelValue&&r.value?.showPopover(),!a.value){r.value?.addEventListener("mouseenter",u),r.value?.addEventListener("mouseleave",f);const p=document.querySelector(`[popovertarget="${A.id}"]`);p&&(p.addEventListener("mouseenter",u),p.addEventListener("mouseleave",f))}}),s.onBeforeUnmount(()=>{if(clearTimeout(o.value),r.value?.removeEventListener("toggle",h),!a.value){r.value?.removeEventListener("mouseenter",u),r.value?.removeEventListener("mouseleave",f);const p=document.querySelector(`[popovertarget="${A.id}"]`);p&&(p.removeEventListener("mouseenter",u),p.removeEventListener("mouseleave",f))}}),(p,g)=>(s.openBlock(),s.createElementBlock("span",{class:"popover-dialog",id:t.id,popover:t.type,ref_key:"popover",ref:r},[s.renderSlot(p.$slots,"default",{},()=>[g[0]||(g[0]=s.createTextVNode(" Popover content goes here. ",-1))])],8,$J))}});var KJ=Object.defineProperty,GJ=Object.defineProperties,WJ=Object.getOwnPropertyDescriptors,eQ=Object.getOwnPropertySymbols,zJ=Object.prototype.hasOwnProperty,YJ=Object.prototype.propertyIsEnumerable,tQ=(t,e,A)=>e in t?KJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,MA=(t,e)=>{for(var A in e||(e={}))zJ.call(e,A)&&tQ(t,A,e[A]);if(eQ)for(var A of eQ(e))YJ.call(e,A)&&tQ(t,A,e[A]);return t},kn=(t,e)=>GJ(t,WJ(e)),Vt=(t,e,A)=>new Promise((n,r)=>{var o=l=>{try{a(A.next(l))}catch(u){r(u)}},i=l=>{try{a(A.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,i);a((A=A.apply(t,e)).next())});const TB=Math.min,Da=Math.max,Df=Math.round,Lf=Math.floor,Ao=t=>({x:t,y:t});function JJ(t,e){return typeof t=="function"?t(e):t}function XJ(t){return MA({top:0,right:0,bottom:0,left:0},t)}function jJ(t){return typeof t!="number"?XJ(t):{top:t,right:t,bottom:t,left:t}}function Of(t){const{x:e,y:A,width:n,height:r}=t;return{width:n,height:r,top:A,left:e,right:e+n,bottom:A+r,x:e,y:A}}function qJ(t,e){return Vt(this,null,function*(){var A;e===void 0&&(e={});const{x:n,y:r,platform:o,rects:i,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=JJ(e,t),B=jJ(g),y=a[p?h==="floating"?"reference":"floating":h],b=Of(yield o.getClippingRect({element:(A=yield o.isElement==null?void 0:o.isElement(y))==null||A?y:y.contextElement||(yield o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:n,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=yield o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating),S=(yield o.isElement==null?void 0:o.isElement(v))?(yield o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},F=Of(o.convertOffsetParentRelativeRectToViewportRelativeRect?yield o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:l}):w);return{top:(b.top-F.top+B.top)/S.y,bottom:(F.bottom-b.bottom+B.bottom)/S.y,left:(b.left-F.left+B.left)/S.x,right:(F.right-b.right+B.right)/S.x}})}function Mf(){return typeof window<"u"}function La(t){return AQ(t)?(t.nodeName||"").toLowerCase():"#document"}function Hn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function no(t){var e;return(e=(AQ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function AQ(t){return Mf()?t instanceof Node||t instanceof Hn(t).Node:!1}function Ir(t){return Mf()?t instanceof Element||t instanceof Hn(t).Element:!1}function ro(t){return Mf()?t instanceof HTMLElement||t instanceof Hn(t).HTMLElement:!1}function nQ(t){return!Mf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Hn(t).ShadowRoot}function Ec(t){const{overflow:e,overflowX:A,overflowY:n,display:r}=xr(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+A)&&!["inline","contents"].includes(r)}function ZJ(t){return["table","td","th"].includes(La(t))}function Nf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function _B(t){const e=DB(),A=Ir(t)?xr(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>A[n]?A[n]!=="none":!1)||(A.containerType?A.containerType!=="normal":!1)||!e&&(A.backdropFilter?A.backdropFilter!=="none":!1)||!e&&(A.filter?A.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(A.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(A.contain||"").includes(n))}function eX(t){let e=Di(t);for(;ro(e)&&!Oa(e);){if(_B(e))return e;if(Nf(e))return null;e=Di(e)}return null}function DB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oa(t){return["html","body","#document"].includes(La(t))}function xr(t){return Hn(t).getComputedStyle(t)}function Hf(t){return Ir(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Di(t){if(La(t)==="html")return t;const e=t.assignedSlot||t.parentNode||nQ(t)&&t.host||no(t);return nQ(e)?e.host:e}function rQ(t){const e=Di(t);return Oa(e)?t.ownerDocument?t.ownerDocument.body:t.body:ro(e)&&Ec(e)?e:rQ(e)}function kc(t,e,A){var n;e===void 0&&(e=[]),A===void 0&&(A=!0);const r=rQ(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Hn(r);if(o){const a=LB(i);return e.concat(i,i.visualViewport||[],Ec(r)?r:[],a&&A?kc(a):[])}return e.concat(r,kc(r,[],A))}function LB(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function oQ(t){const e=xr(t);let A=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const r=ro(t),o=r?t.offsetWidth:A,i=r?t.offsetHeight:n,a=Df(A)!==o||Df(n)!==i;return a&&(A=o,n=i),{width:A,height:n,$:a}}function OB(t){return Ir(t)?t:t.contextElement}function Ma(t){const e=OB(t);if(!ro(e))return Ao(1);const A=e.getBoundingClientRect(),{width:n,height:r,$:o}=oQ(e);let i=(o?Df(A.width):A.width)/n,a=(o?Df(A.height):A.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const tX=Ao(0);function iQ(t){const e=Hn(t);return!DB()||!e.visualViewport?tX:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function AX(t,e,A){return e===void 0&&(e=!1),!A||e&&A!==Hn(t)?!1:e}function Ss(t,e,A,n){e===void 0&&(e=!1),A===void 0&&(A=!1);const r=t.getBoundingClientRect(),o=OB(t);let i=Ao(1);e&&(n?Ir(n)&&(i=Ma(n)):i=Ma(t));const a=AX(o,A,n)?iQ(o):Ao(0);let l=(r.left+a.x)/i.x,u=(r.top+a.y)/i.y,f=r.width/i.x,h=r.height/i.y;if(o){const p=Hn(o),g=n&&Ir(n)?Hn(n):n;let B=p,y=LB(B);for(;y&&n&&g!==B;){const b=Ma(y),w=y.getBoundingClientRect(),v=xr(y),S=w.left+(y.clientLeft+parseFloat(v.paddingLeft))*b.x,F=w.top+(y.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,u*=b.y,f*=b.x,h*=b.y,l+=S,u+=F,B=Hn(y),y=LB(B)}}return Of({width:f,height:h,x:l,y:u})}function MB(t,e){const A=Hf(t).scrollLeft;return e?e.left+A:Ss(no(t)).left+A}function sQ(t,e,A){A===void 0&&(A=!1);const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-(A?0:MB(t,n)),o=n.top+e.scrollTop;return{x:r,y:o}}function nX(t){let{elements:e,rect:A,offsetParent:n,strategy:r}=t;const o=r==="fixed",i=no(n),a=e?Nf(e.floating):!1;if(n===i||a&&o)return A;let l={scrollLeft:0,scrollTop:0},u=Ao(1);const f=Ao(0),h=ro(n);if((h||!h&&!o)&&((La(n)!=="body"||Ec(i))&&(l=Hf(n)),ro(n))){const g=Ss(n);u=Ma(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const p=i&&!h&&!o?sQ(i,l,!0):Ao(0);return{width:A.width*u.x,height:A.height*u.y,x:A.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:A.y*u.y-l.scrollTop*u.y+f.y+p.y}}function rX(t){return Array.from(t.getClientRects())}function oX(t){const e=no(t),A=Hf(t),n=t.ownerDocument.body,r=Da(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Da(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-A.scrollLeft+MB(t);const a=-A.scrollTop;return xr(n).direction==="rtl"&&(i+=Da(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:a}}function iX(t,e){const A=Hn(t),n=no(t),r=A.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(r){o=r.width,i=r.height;const u=DB();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:i,x:a,y:l}}function sX(t,e){const A=Ss(t,!0,e==="fixed"),n=A.top+t.clientTop,r=A.left+t.clientLeft,o=ro(t)?Ma(t):Ao(1),i=t.clientWidth*o.x,a=t.clientHeight*o.y,l=r*o.x,u=n*o.y;return{width:i,height:a,x:l,y:u}}function aQ(t,e,A){let n;if(e==="viewport")n=iX(t,A);else if(e==="document")n=oX(no(t));else if(Ir(e))n=sX(e,A);else{const r=iQ(t);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Of(n)}function lQ(t,e){const A=Di(t);return A===e||!Ir(A)||Oa(A)?!1:xr(A).position==="fixed"||lQ(A,e)}function aX(t,e){const A=e.get(t);if(A)return A;let n=kc(t,[],!1).filter(a=>Ir(a)&&La(a)!=="body"),r=null;const o=xr(t).position==="fixed";let i=o?Di(t):t;for(;Ir(i)&&!Oa(i);){const a=xr(i),l=_B(i);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&r&&["absolute","fixed"].includes(r.position)||Ec(i)&&!l&&lQ(t,i))?n=n.filter(u=>u!==i):r=a,i=Di(i)}return e.set(t,n),n}function lX(t){let{element:e,boundary:A,rootBoundary:n,strategy:r}=t;const o=[...A==="clippingAncestors"?Nf(e)?[]:aX(e,this._c):[].concat(A),n],i=o[0],a=o.reduce((l,u)=>{const f=aQ(e,u,r);return l.top=Da(f.top,l.top),l.right=TB(f.right,l.right),l.bottom=TB(f.bottom,l.bottom),l.left=Da(f.left,l.left),l},aQ(e,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function cX(t){const{width:e,height:A}=oQ(t);return{width:e,height:A}}function uX(t,e,A){const n=ro(e),r=no(e),o=A==="fixed",i=Ss(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ao(0);function u(){l.x=MB(r)}if(n||!n&&!o)if((La(e)!=="body"||Ec(r))&&(a=Hf(e)),n){const g=Ss(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else r&&u();o&&!n&&r&&u();const f=r&&!n&&!o?sQ(r,a):Ao(0),h=i.left+a.scrollLeft-l.x-f.x,p=i.top+a.scrollTop-l.y-f.y;return{x:h,y:p,width:i.width,height:i.height}}function NB(t){return xr(t).position==="static"}function cQ(t,e){if(!ro(t)||xr(t).position==="fixed")return null;if(e)return e(t);let A=t.offsetParent;return no(t)===A&&(A=A.ownerDocument.body),A}function uQ(t,e){const A=Hn(t);if(Nf(t))return A;if(!ro(t)){let r=Di(t);for(;r&&!Oa(r);){if(Ir(r)&&!NB(r))return r;r=Di(r)}return A}let n=cQ(t,e);for(;n&&ZJ(n)&&NB(n);)n=cQ(n,e);return n&&Oa(n)&&NB(n)&&!_B(n)?A:n||eX(t)||A}const dX=function(t){return Vt(this,null,function*(){const e=this.getOffsetParent||uQ,A=this.getDimensions,n=yield A(t.floating);return{reference:uX(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function fX(t){return xr(t).direction==="rtl"}const Rn={convertOffsetParentRelativeRectToViewportRelativeRect:nX,getDocumentElement:no,getClippingRect:lX,getOffsetParent:uQ,getElementRects:dX,getClientRects:rX,getDimensions:cX,getScale:Ma,isElement:Ir,isRTL:fX};function dQ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function hX(t,e){let A=null,n;const r=no(t);function o(){var a;clearTimeout(n),(a=A)==null||a.disconnect(),A=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:f,top:h,width:p,height:g}=u;if(a||e(),!p||!g)return;const B=Lf(h),y=Lf(r.clientWidth-(f+p)),b=Lf(r.clientHeight-(h+g)),w=Lf(f),v={rootMargin:-B+"px "+-y+"px "+-b+"px "+-w+"px",threshold:Da(0,TB(1,l))||1};let S=!0;function F(I){const Q=I[0].intersectionRatio;if(Q!==l){if(!S)return i();Q?i(!1,Q):n=setTimeout(()=>{i(!1,1e-7)},1e3)}Q===1&&!dQ(u,t.getBoundingClientRect())&&i(),S=!1}try{A=new IntersectionObserver(F,kn(MA({},v),{root:r.ownerDocument}))}catch{A=new IntersectionObserver(F,v)}A.observe(t)}return i(!0),o}function HB(t,e,A,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=OB(t),f=r||o?[...u?kc(u):[],...kc(e)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",A,{passive:!0}),o&&w.addEventListener("resize",A)});const h=u&&a?hX(u,A):null;let p=-1,g=null;i&&(g=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(e)})),A()}),u&&!l&&g.observe(u),g.observe(e));let B,y=l?Ss(t):null;l&&b();function b(){const w=Ss(t);y&&!dQ(y,w)&&A(),y=w,B=requestAnimationFrame(b)}return A(),()=>{var w;f.forEach(v=>{r&&v.removeEventListener("scroll",A),o&&v.removeEventListener("resize",A)}),h?.(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(B)}}const pX=qJ,{hasOwnProperty:RB}=Object.prototype,Sc=function(){};function fQ(t){return typeof t=="function"?t:Sc}function hQ(t,e){return function(A,n,r){A.type===e&&t.call(this,A,n,r)}}function mX(t,e){const A=e.structure,n=[];for(const r in A){if(RB.call(A,r)===!1)continue;let o=A[r];const i={name:r,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(const a of o)a===null?i.nullable=!0:typeof a=="string"?i.type="node":Array.isArray(a)&&(i.type="list");i.type&&n.push(i)}return n.length?{context:e.walkContext,fields:n}:null}function gX(t){const e={};for(const A in t.node)if(RB.call(t.node,A)){const n=t.node[A];if(!n.structure)throw new Error("Missed `structure` field in `"+A+"` node type definition");e[A]=mX(A,n)}return e}function pQ(t,e){const A=t.fields.slice(),n=t.context,r=typeof n=="string";return e&&A.reverse(),function(o,i,a,l){let u;r&&(u=i[n],i[n]=o);for(const f of A){const h=o[f.name];if(!f.nullable||h){if(f.type==="list"){if(e?h.reduceRight(l,!1):h.reduce(l,!1))return!0}else if(a(h))return!0}}r&&(i[n]=u)}}function mQ({StyleSheet:t,Atrule:e,Rule:A,Block:n,DeclarationList:r}){return{Atrule:{StyleSheet:t,Atrule:e,Rule:A,Block:n},Rule:{StyleSheet:t,Atrule:e,Rule:A,Block:n},Declaration:{StyleSheet:t,Atrule:e,Rule:A,Block:n,DeclarationList:r}}}function BX(t){const e=gX(t),A={},n={},r=Symbol("break-walk"),o=Symbol("skip-node");for(const u in e)RB.call(e,u)&&e[u]!==null&&(A[u]=pQ(e[u],!1),n[u]=pQ(e[u],!0));const i=mQ(A),a=mQ(n),l=function(u,f){function h(w,v,S){const F=p.call(b,w,v,S);return F===r?!0:F===o?!1:!!(B.hasOwnProperty(w.type)&&B[w.type](w,b,h,y)||g.call(b,w,v,S)===r)}let p=Sc,g=Sc,B=A,y=(w,v,S,F)=>w||h(v,S,F);const b={break:r,skip:o,root:u,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof f=="function")p=f;else if(f&&(p=fQ(f.enter),g=fQ(f.leave),f.reverse&&(B=n),f.visit)){if(i.hasOwnProperty(f.visit))B=f.reverse?a[f.visit]:i[f.visit];else if(!e.hasOwnProperty(f.visit))throw new Error("Bad value `"+f.visit+"` for `visit` option (should be: "+Object.keys(e).sort().join(", ")+")");p=hQ(p,f.visit),g=hQ(g,f.visit)}if(p===Sc&&g===Sc)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(u)};return l.break=r,l.skip=o,l.find=function(u,f){let h=null;return l(u,function(p,g,B){if(f.call(this,p,g,B))return h=p,r}),h},l.findLast=function(u,f){let h=null;return l(u,{reverse:!0,enter(p,g,B){if(f.call(this,p,g,B))return h=p,r}}),h},l.findAll=function(u,f){const h=[];return l(u,function(p,g,B){f.call(this,p,g,B)&&h.push(p)}),h},l}const Li=0,_e=1,mt=2,EA=3,qt=4,Oo=5,yX=6,fn=7,Tr=8,It=9,at=10,pA=11,bt=12,bA=13,Rf=14,Pn=15,hn=16,Sn=17,_r=18,Na=19,Qc=20,$t=21,rt=22,Dr=23,Ha=24,pn=25,wX=0;function Vn(t){return t>=48&&t<=57}function Ra(t){return Vn(t)||t>=65&&t<=70||t>=97&&t<=102}function PB(t){return t>=65&&t<=90}function CX(t){return t>=97&&t<=122}function bX(t){return PB(t)||CX(t)}function vX(t){return t>=128}function Pf(t){return bX(t)||vX(t)||t===95}function gQ(t){return Pf(t)||Vn(t)||t===45}function EX(t){return t>=0&&t<=8||t===11||t>=14&&t<=31||t===127}function Vf(t){return t===10||t===13||t===12}function Qs(t){return Vf(t)||t===32||t===9}function oo(t,e){return!(t!==92||Vf(e)||e===wX)}function VB(t,e,A){return t===45?Pf(e)||e===45||oo(e,A):Pf(t)?!0:t===92?oo(t,e):!1}function $B(t,e,A){return t===43||t===45?Vn(e)?2:e===46&&Vn(A)?3:0:t===46?Vn(e)?2:0:Vn(t)?1:0}function BQ(t){return t===65279||t===65534?1:0}const KB=new Array(128),kX=128,$f=130,yQ=131,GB=132,wQ=133;for(let t=0;t<KB.length;t++)KB[t]=Qs(t)&&$f||Vn(t)&&yQ||Pf(t)&&GB||EX(t)&&wQ||t||kX;function WB(t){return t<128?KB[t]:GB}function Pa(t,e){return e<t.length?t.charCodeAt(e):0}function zB(t,e,A){return A===13&&Pa(t,e+1)===10?2:1}function CQ(t,e,A){let n=t.charCodeAt(e);return PB(n)&&(n=n|32),n===A}function Kf(t,e,A,n){if(A-e!==n.length||e<0||A>t.length)return!1;for(let r=e;r<A;r++){const o=n.charCodeAt(r-e);let i=t.charCodeAt(r);if(PB(i)&&(i=i|32),i!==o)return!1}return!0}function SX(t,e){for(;e>=0&&Qs(t.charCodeAt(e));e--);return e+1}function Gf(t,e){for(;e<t.length&&Qs(t.charCodeAt(e));e++);return e}function YB(t,e){for(;e<t.length&&Vn(t.charCodeAt(e));e++);return e}function Va(t,e){if(e+=2,Ra(Pa(t,e-1))){for(const n=Math.min(t.length,e+5);e<n&&Ra(Pa(t,e));e++);const A=Pa(t,e);Qs(A)&&(e+=zB(t,e,A))}return e}function Wf(t,e){for(;e<t.length;e++){const A=t.charCodeAt(e);if(!gQ(A)){if(oo(A,Pa(t,e+1))){e=Va(t,e)-1;continue}break}}return e}function bQ(t,e){let A=t.charCodeAt(e);if((A===43||A===45)&&(A=t.charCodeAt(e+=1)),Vn(A)&&(e=YB(t,e+1),A=t.charCodeAt(e)),A===46&&Vn(t.charCodeAt(e+1))&&(e+=2,e=YB(t,e)),CQ(t,e,101)){let n=0;A=t.charCodeAt(e+1),(A===45||A===43)&&(n=1,A=t.charCodeAt(e+2)),Vn(A)&&(e=YB(t,e+1+n+1))}return e}function JB(t,e){for(;e<t.length;e++){const A=t.charCodeAt(e);if(A===41){e++;break}oo(A,Pa(t,e+1))&&(e=Va(t,e))}return e}function vQ(t){if(t.length===1&&!Ra(t.charCodeAt(0)))return t[0];let e=parseInt(t,16);return(e===0||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}const EQ=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"],QX=16*1024;function zf(t=null,e){return t===null||t.length<e?new Uint32Array(Math.max(e+1024,QX)):t}const kQ=10,FX=12,SQ=13;function QQ(t){const e=t.source,A=e.length,n=e.length>0?BQ(e.charCodeAt(0)):0,r=zf(t.lines,A),o=zf(t.columns,A);let i=t.startLine,a=t.startColumn;for(let l=n;l<A;l++){const u=e.charCodeAt(l);r[l]=i,o[l]=a++,(u===kQ||u===SQ||u===FX)&&(u===SQ&&l+1<A&&e.charCodeAt(l+1)===kQ&&(l++,r[l]=i,o[l]=a),i++,a=1)}r[A]=i,o[A]=a,t.lines=r,t.columns=o,t.computed=!0}class UX{constructor(e,A,n,r){this.setSource(e,A,n,r),this.lines=null,this.columns=null}setSource(e="",A=0,n=1,r=1){this.source=e,this.startOffset=A,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,A){return this.computed||QQ(this),{source:A,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,A,n){return this.computed||QQ(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+A,line:this.lines[A],column:this.columns[A]}}}}const io=16777215,so=24,Fs=new Uint8Array(32);Fs[mt]=rt,Fs[$t]=rt,Fs[Na]=Qc,Fs[Dr]=Ha;function FQ(t){return Fs[t]!==0}class IX{constructor(e,A){this.setSource(e,A)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",A=()=>{}){e=String(e||"");const n=e.length,r=zf(this.offsetAndType,e.length+1),o=zf(this.balance,e.length+1);let i=0,a=-1,l=0,u=e.length;this.offsetAndType=null,this.balance=null,o.fill(0),A(e,(f,h,p)=>{const g=i++;if(r[g]=f<<so|p,a===-1&&(a=h),o[g]=u,f===l){const B=o[u];o[u]=g,u=B,l=Fs[r[B]>>so]}else FQ(f)&&(u=g,l=Fs[f])}),r[i]=Li<<so|n,o[i]=i;for(let f=0;f<i;f++){const h=o[f];if(h<=f){const p=o[h];p!==f&&(o[f]=p)}else h>i&&(o[f]=i)}this.source=e,this.firstCharOffset=a===-1?0:a,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>so:Li}lookupTypeNonSC(e){for(let A=this.tokenIndex;A<this.tokenCount;A++){const n=this.offsetAndType[A]>>so;if(n!==bA&&n!==pn&&e--===0)return n}return Li}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&io:this.source.length}lookupOffsetNonSC(e){for(let A=this.tokenIndex;A<this.tokenCount;A++){const n=this.offsetAndType[A]>>so;if(n!==bA&&n!==pn&&e--===0)return A-this.tokenIndex}return Li}lookupValue(e,A){return e+=this.tokenIndex,e<this.tokenCount?Kf(this.source,this.offsetAndType[e-1]&io,this.offsetAndType[e]&io,A):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&io:this.offsetAndType[this.tokenCount]&io:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,A){return A?this.lookupType(A)===It&&this.source.charCodeAt(this.lookupOffset(A))===e:this.tokenType===It&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let A=this.tokenIndex+e;A<this.tokenCount?(this.tokenIndex=A,this.tokenStart=this.offsetAndType[A-1]&io,A=this.offsetAndType[A],this.tokenType=A>>so,this.tokenEnd=A&io):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>so,this.tokenEnd=e&io):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=Li,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===bA||this.tokenType===pn;)this.next()}skipUntilBalanced(e,A){let n=e,r=0,o=0;e:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break e;switch(o=n>0?this.offsetAndType[n-1]&io:this.firstCharOffset,A(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:FQ(this.offsetAndType[n]>>so)&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let A=0,n=this.firstCharOffset;A<this.tokenCount;A++){const r=n,o=this.offsetAndType[A],i=o&io,a=o>>so;n=i,e(a,r,i,A)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((A,n,r,o)=>{e[o]={idx:o,type:EQ[A],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}}function UQ(t,e){function A(h){return h<a?t.charCodeAt(h):0}function n(){if(u=bQ(t,u),VB(A(u),A(u+1),A(u+2))){f=bt,u=Wf(t,u);return}if(A(u)===37){f=pA,u++;return}f=at}function r(){const h=u;if(u=Wf(t,u),Kf(t,h,u,"url")&&A(u)===40){if(u=Gf(t,u+1),A(u)===34||A(u)===39){f=mt,u=h+4;return}i();return}if(A(u)===40){f=mt,u++;return}f=_e}function o(h){for(h||(h=A(u++)),f=Oo;u<t.length;u++){const p=t.charCodeAt(u);switch(WB(p)){case h:u++;return;case $f:if(Vf(p)){u+=zB(t,u,p),f=yX;return}break;case 92:if(u===t.length-1)break;const g=A(u+1);Vf(g)?u+=zB(t,u+1,g):oo(p,g)&&(u=Va(t,u)-1);break}}}function i(){for(f=fn,u=Gf(t,u);u<t.length;u++){const h=t.charCodeAt(u);switch(WB(h)){case 41:u++;return;case $f:if(u=Gf(t,u),A(u)===41||u>=t.length){u<t.length&&u++;return}u=JB(t,u),f=Tr;return;case 34:case 39:case 40:case wQ:u=JB(t,u),f=Tr;return;case 92:if(oo(h,A(u+1))){u=Va(t,u)-1;break}u=JB(t,u),f=Tr;return}}}t=String(t||"");const a=t.length;let l=BQ(A(0)),u=l,f;for(;u<a;){const h=t.charCodeAt(u);switch(WB(h)){case $f:f=bA,u=Gf(t,u+1);break;case 34:o();break;case 35:gQ(A(u+1))||oo(A(u+1),A(u+2))?(f=qt,u=Wf(t,u+1)):(f=It,u++);break;case 39:o();break;case 40:f=$t,u++;break;case 41:f=rt,u++;break;case 43:$B(h,A(u+1),A(u+2))?n():(f=It,u++);break;case 44:f=_r,u++;break;case 45:$B(h,A(u+1),A(u+2))?n():A(u+1)===45&&A(u+2)===62?(f=Pn,u=u+3):VB(h,A(u+1),A(u+2))?r():(f=It,u++);break;case 46:$B(h,A(u+1),A(u+2))?n():(f=It,u++);break;case 47:A(u+1)===42?(f=pn,u=t.indexOf("*/",u+2),u=u===-1?t.length:u+2):(f=It,u++);break;case 58:f=hn,u++;break;case 59:f=Sn,u++;break;case 60:A(u+1)===33&&A(u+2)===45&&A(u+3)===45?(f=Rf,u=u+4):(f=It,u++);break;case 64:VB(A(u+1),A(u+2),A(u+3))?(f=EA,u=Wf(t,u+1)):(f=It,u++);break;case 91:f=Na,u++;break;case 92:oo(h,A(u+1))?r():(f=It,u++);break;case 93:f=Qc,u++;break;case 123:f=Dr,u++;break;case 125:f=Ha,u++;break;case yQ:n();break;case GB:r();break;default:f=It,u++}e(f,l,l=u)}}const ao=43,$n=45,Yf=110,Us=!0,xX=!1;function Jf(t,e){let A=this.tokenStart+t;const n=this.charCodeAt(A);for((n===ao||n===$n)&&(e&&this.error("Number sign is not allowed"),A++);A<this.tokenEnd;A++)Vn(this.charCodeAt(A))||this.error("Integer is expected",A)}function $a(t){return Jf.call(this,0,t)}function Oi(t,e){if(!this.cmpChar(this.tokenStart+t,e)){let A="";switch(e){case Yf:A="N is expected";break;case $n:A="HyphenMinus is expected";break}this.error(A,this.tokenStart+t)}}function XB(){let t=0,e=0,A=this.tokenType;for(;A===bA||A===pn;)A=this.lookupType(++t);if(A!==at)if(this.isDelim(ao,t)||this.isDelim($n,t)){e=this.isDelim(ao,t)?ao:$n;do A=this.lookupType(++t);while(A===bA||A===pn);A!==at&&(this.skip(t),$a.call(this,Us))}else return null;return t>0&&this.skip(t),e===0&&(A=this.charCodeAt(this.tokenStart),A!==ao&&A!==$n&&this.error("Number sign is expected")),$a.call(this,e!==0),e===$n?"-"+this.consume(at):this.consume(at)}const TX="AnPlusB",_X={a:[String,null],b:[String,null]};function IQ(){const t=this.tokenStart;let e=null,A=null;if(this.tokenType===at)$a.call(this,xX),A=this.consume(at);else if(this.tokenType===_e&&this.cmpChar(this.tokenStart,$n))switch(e="-1",Oi.call(this,1,Yf),this.tokenEnd-this.tokenStart){case 2:this.next(),A=XB.call(this);break;case 3:Oi.call(this,2,$n),this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at);break;default:Oi.call(this,2,$n),Jf.call(this,3,Us),this.next(),A=this.substrToCursor(t+2)}else if(this.tokenType===_e||this.isDelim(ao)&&this.lookupType(1)===_e){let n=0;switch(e="1",this.isDelim(ao)&&(n=1,this.next()),Oi.call(this,0,Yf),this.tokenEnd-this.tokenStart){case 1:this.next(),A=XB.call(this);break;case 2:Oi.call(this,1,$n),this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at);break;default:Oi.call(this,1,$n),Jf.call(this,2,Us),this.next(),A=this.substrToCursor(t+n+1)}}else if(this.tokenType===bt){const n=this.charCodeAt(this.tokenStart),r=n===ao||n===$n;let o=this.tokenStart+r;for(;o<this.tokenEnd&&Vn(this.charCodeAt(o));o++);o===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),Oi.call(this,o-this.tokenStart,Yf),e=this.substring(t,o),o+1===this.tokenEnd?(this.next(),A=XB.call(this)):(Oi.call(this,o-this.tokenStart+1,$n),o+2===this.tokenEnd?(this.next(),this.skipSC(),$a.call(this,Us),A="-"+this.consume(at)):(Jf.call(this,o-this.tokenStart+2,Us),this.next(),A=this.substrToCursor(o+1)))}else this.error();return e!==null&&e.charCodeAt(0)===ao&&(e=e.substr(1)),A!==null&&A.charCodeAt(0)===ao&&(A=A.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.tokenStart),a:e,b:A}}function xQ(t){if(t.a){const e=t.a==="+1"&&"n"||t.a==="1"&&"n"||t.a==="-1"&&"-n"||t.a+"n";if(t.b){const A=t.b[0]==="-"||t.b[0]==="+"?t.b:"+"+t.b;this.tokenize(e+A)}else this.tokenize(e)}else this.tokenize(t.b)}const DX=Object.freeze(Object.defineProperty({__proto__:null,generate:xQ,name:TX,parse:IQ,structure:_X},Symbol.toStringTag,{value:"Module"}));function TQ(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function LX(){for(let t=1,e;e=this.lookupType(t);t++){if(e===Ha)return!0;if(e===Dr||e===EA)return!1}return!1}const OX="Atrule",MX="atrule",NX={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function _Q(t=!1){const e=this.tokenStart;let A,n,r=null,o=null;switch(this.eat(EA),A=this.substrToCursor(e+1),n=A.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==Dr&&this.tokenType!==Sn&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,A,t),TQ):r=TQ.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Sn:this.next();break;case Dr:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?o=this.atrule[n].block.call(this,t):o=this.Block(LX.call(this));break}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:A,prelude:r,block:o}}function DQ(t){this.token(EA,"@"+t.name),t.prelude!==null&&this.node(t.prelude),t.block?this.node(t.block):this.token(Sn,";")}const HX=Object.freeze(Object.defineProperty({__proto__:null,generate:DQ,name:OX,parse:_Q,structure:NX,walkContext:MX},Symbol.toStringTag,{value:"Module"})),RX="AtrulePrelude",PX="atrulePrelude",VX={children:[[]]};function LQ(t){let e=null;return t!==null&&(t=t.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,t)&&typeof this.atrule[t].prelude=="function"?e=this.atrule[t].prelude.call(this):e=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==Dr&&this.tokenType!==Sn&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}}function OQ(t){this.children(t)}const $X=Object.freeze(Object.defineProperty({__proto__:null,generate:OQ,name:RX,parse:LQ,structure:VX,walkContext:PX},Symbol.toStringTag,{value:"Module"})),KX=36,MQ=42,Xf=61,GX=94,jB=124,WX=126;function zX(){this.eof&&this.error("Unexpected end of input");const t=this.tokenStart;let e=!1;return this.isDelim(MQ)?(e=!0,this.next()):this.isDelim(jB)||this.eat(_e),this.isDelim(jB)?this.charCodeAt(this.tokenStart+1)!==Xf?(this.next(),this.eat(_e)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function YX(){const t=this.tokenStart,e=this.charCodeAt(t);return e!==Xf&&e!==WX&&e!==GX&&e!==KX&&e!==MQ&&e!==jB&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),e!==Xf&&(this.isDelim(Xf)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(t)}const JX="AttributeSelector",XX={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function NQ(){const t=this.tokenStart;let e,A=null,n=null,r=null;return this.eat(Na),this.skipSC(),e=zX.call(this),this.skipSC(),this.tokenType!==Qc&&(this.tokenType!==_e&&(A=YX.call(this),this.skipSC(),n=this.tokenType===Oo?this.String():this.Identifier(),this.skipSC()),this.tokenType===_e&&(r=this.consume(_e),this.skipSC())),this.eat(Qc),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:A,value:n,flags:r}}function HQ(t){this.token(It,"["),this.node(t.name),t.matcher!==null&&(this.tokenize(t.matcher),this.node(t.value)),t.flags!==null&&this.token(_e,t.flags),this.token(It,"]")}const jX=Object.freeze(Object.defineProperty({__proto__:null,generate:HQ,name:JX,parse:NQ,structure:XX},Symbol.toStringTag,{value:"Module"})),qX=38;function RQ(){return this.Raw(null,!0)}function PQ(){return this.parseWithFallback(this.Rule,RQ)}function VQ(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function ZX(){if(this.tokenType===Sn)return VQ.call(this,this.tokenIndex);const t=this.parseWithFallback(this.Declaration,VQ);return this.tokenType===Sn&&this.next(),t}const ej="Block",tj="block",Aj={children:[["Atrule","Rule","Declaration"]]};function $Q(t){const e=t?ZX:PQ,A=this.tokenStart;let n=this.createList();this.eat(Dr);e:for(;!this.eof;)switch(this.tokenType){case Ha:break e;case bA:case pn:this.next();break;case EA:n.push(this.parseWithFallback(this.Atrule.bind(this,t),RQ));break;default:t&&this.isDelim(qX)?n.push(PQ.call(this)):n.push(e.call(this))}return this.eof||this.eat(Ha),{type:"Block",loc:this.getLocation(A,this.tokenStart),children:n}}function KQ(t){this.token(Dr,"{"),this.children(t,e=>{e.type==="Declaration"&&this.token(Sn,";")}),this.token(Ha,"}")}const nj=Object.freeze(Object.defineProperty({__proto__:null,generate:KQ,name:ej,parse:$Q,structure:Aj,walkContext:tj},Symbol.toStringTag,{value:"Module"})),rj="Brackets",oj={children:[[]]};function GQ(t,e){const A=this.tokenStart;let n=null;return this.eat(Na),n=t.call(this,e),this.eof||this.eat(Qc),{type:"Brackets",loc:this.getLocation(A,this.tokenStart),children:n}}function WQ(t){this.token(It,"["),this.children(t),this.token(It,"]")}const ij=Object.freeze(Object.defineProperty({__proto__:null,generate:WQ,name:rj,parse:GQ,structure:oj},Symbol.toStringTag,{value:"Module"})),sj="CDC",aj=[];function zQ(){const t=this.tokenStart;return this.eat(Pn),{type:"CDC",loc:this.getLocation(t,this.tokenStart)}}function YQ(){this.token(Pn,"-->")}const lj=Object.freeze(Object.defineProperty({__proto__:null,generate:YQ,name:sj,parse:zQ,structure:aj},Symbol.toStringTag,{value:"Module"})),cj="CDO",uj=[];function JQ(){const t=this.tokenStart;return this.eat(Rf),{type:"CDO",loc:this.getLocation(t,this.tokenStart)}}function XQ(){this.token(Rf,"<!--")}const dj=Object.freeze(Object.defineProperty({__proto__:null,generate:XQ,name:cj,parse:JQ,structure:uj},Symbol.toStringTag,{value:"Module"})),fj=46,hj="ClassSelector",pj={name:String};function jQ(){return this.eatDelim(fj),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(_e)}}function qQ(t){this.token(It,"."),this.token(_e,t.name)}const mj=Object.freeze(Object.defineProperty({__proto__:null,generate:qQ,name:hj,parse:jQ,structure:pj},Symbol.toStringTag,{value:"Module"})),gj=43,ZQ=47,Bj=62,yj=126,wj="Combinator",Cj={name:String};function eF(){const t=this.tokenStart;let e;switch(this.tokenType){case bA:e=" ";break;case It:switch(this.charCodeAt(this.tokenStart)){case Bj:case gj:case yj:this.next();break;case ZQ:this.next(),this.eatIdent("deep"),this.eatDelim(ZQ);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t);break}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function tF(t){this.tokenize(t.name)}const bj=Object.freeze(Object.defineProperty({__proto__:null,generate:tF,name:wj,parse:eF,structure:Cj},Symbol.toStringTag,{value:"Module"})),vj=42,Ej=47,kj="Comment",Sj={value:String};function AF(){const t=this.tokenStart;let e=this.tokenEnd;return this.eat(pn),e-t+2>=2&&this.charCodeAt(e-2)===vj&&this.charCodeAt(e-1)===Ej&&(e-=2),{type:"Comment",loc:this.getLocation(t,this.tokenStart),value:this.substring(t+2,e)}}function nF(t){this.token(pn,"/*"+t.value+"*/")}const Qj=Object.freeze(Object.defineProperty({__proto__:null,generate:nF,name:kj,parse:AF,structure:Sj},Symbol.toStringTag,{value:"Module"})),Fj=new Set([hn,rt,Li]),Uj="Condition",Ij={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function rF(t){return this.lookupTypeNonSC(1)===_e&&Fj.has(this.lookupTypeNonSC(2))?this.Feature(t):this.FeatureRange(t)}const xj={media:rF,container:rF,supports(){return this.SupportsDeclaration()}};function oF(t="media"){const e=this.createList();e:for(;!this.eof;)switch(this.tokenType){case pn:case bA:this.next();continue;case _e:e.push(this.Identifier());break;case $t:{let A=this.parseWithFallback(()=>xj[t].call(this,t),()=>null);A||(A=this.parseWithFallback(()=>{this.eat($t);const n=this.Condition(t);return this.eat(rt),n},()=>this.GeneralEnclosed(t))),e.push(A);break}case mt:{let A=this.parseWithFallback(()=>this.FeatureFunction(t),()=>null);A||(A=this.GeneralEnclosed(t)),e.push(A);break}default:break e}return e.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(e),kind:t,children:e}}function iF(t){t.children.forEach(e=>{e.type==="Condition"?(this.token($t,"("),this.node(e),this.token(rt,")")):this.node(e)})}const Tj=Object.freeze(Object.defineProperty({__proto__:null,generate:iF,name:Uj,parse:oF,structure:Ij},Symbol.toStringTag,{value:"Module"})),sF=45;function _j(t,e){return e=e||0,t.length-e>=2&&t.charCodeAt(e)===sF&&t.charCodeAt(e+1)===sF}const aF=33,Dj=35,Lj=36,Oj=38,Mj=42,Nj=43,lF=47;function Hj(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Rj(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Pj(){const t=this.tokenIndex,e=this.Value();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==Sn&&this.isDelim(aF)===!1&&this.isBalanceEdge(t)===!1&&this.error(),e}const Vj="Declaration",$j="declaration",Kj={important:[Boolean,String],property:String,value:["Value","Raw"]};function cF(){const t=this.tokenStart,e=this.tokenIndex,A=Gj.call(this),n=_j(A),r=n?this.parseCustomProperty:this.parseValue,o=n?Rj:Hj;let i=!1,a;this.skipSC(),this.eat(hn);const l=this.tokenIndex;if(n||this.skipSC(),r?a=this.parseWithFallback(Pj,o):a=o.call(this,this.tokenIndex),n&&a.type==="Value"&&a.children.isEmpty){for(let u=l-this.tokenIndex;u<=0;u++)if(this.lookupType(u)===bA){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(aF)&&(i=Wj.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==Sn&&this.isBalanceEdge(e)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.tokenStart),important:i,property:A,value:a}}function uF(t){this.token(_e,t.property),this.token(hn,":"),this.node(t.value),t.important&&(this.token(It,"!"),this.token(_e,t.important===!0?"important":t.important))}function Gj(){const t=this.tokenStart;if(this.tokenType===It)switch(this.charCodeAt(this.tokenStart)){case Mj:case Lj:case Nj:case Dj:case Oj:this.next();break;case lF:this.next(),this.isDelim(lF)&&this.next();break}return this.tokenType===qt?this.eat(qt):this.eat(_e),this.substrToCursor(t)}function Wj(){this.eat(It),this.skipSC();const t=this.consume(_e);return t==="important"?!0:t}const zj=Object.freeze(Object.defineProperty({__proto__:null,generate:uF,name:Vj,parse:cF,structure:Kj,walkContext:$j},Symbol.toStringTag,{value:"Module"})),Yj=38;function qB(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const Jj="DeclarationList",Xj={children:[["Declaration","Atrule","Rule"]]};function dF(){const t=this.createList();for(;!this.eof;)switch(this.tokenType){case bA:case pn:case Sn:this.next();break;case EA:t.push(this.parseWithFallback(this.Atrule.bind(this,!0),qB));break;default:this.isDelim(Yj)?t.push(this.parseWithFallback(this.Rule,qB)):t.push(this.parseWithFallback(this.Declaration,qB))}return{type:"DeclarationList",loc:this.getLocationFromList(t),children:t}}function fF(t){this.children(t,e=>{e.type==="Declaration"&&this.token(Sn,";")})}const jj=Object.freeze(Object.defineProperty({__proto__:null,generate:fF,name:Jj,parse:dF,structure:Xj},Symbol.toStringTag,{value:"Module"})),qj="Dimension",Zj={value:String,unit:String};function hF(){const t=this.tokenStart,e=this.consumeNumber(bt);return{type:"Dimension",loc:this.getLocation(t,this.tokenStart),value:e,unit:this.substring(t+e.length,this.tokenStart)}}function pF(t){this.token(bt,t.value+t.unit)}const e7=Object.freeze(Object.defineProperty({__proto__:null,generate:pF,name:qj,parse:hF,structure:Zj},Symbol.toStringTag,{value:"Module"})),t7=47,A7="Feature",n7={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function mF(t){const e=this.tokenStart;let A,n=null;if(this.eat($t),this.skipSC(),A=this.consume(_e),this.skipSC(),this.tokenType!==rt){switch(this.eat(hn),this.skipSC(),this.tokenType){case at:this.lookupNonWSType(1)===It?n=this.Ratio():n=this.Number();break;case bt:n=this.Dimension();break;case _e:n=this.Identifier();break;case mt:n=this.parseWithFallback(()=>{const r=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(t7)&&this.error(),r},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(rt),{type:"Feature",loc:this.getLocation(e,this.tokenStart),kind:t,name:A,value:n}}function gF(t){this.token($t,"("),this.token(_e,t.name),t.value!==null&&(this.token(hn,":"),this.node(t.value)),this.token(rt,")")}const r7=Object.freeze(Object.defineProperty({__proto__:null,generate:gF,name:A7,parse:mF,structure:n7},Symbol.toStringTag,{value:"Module"})),o7="FeatureFunction",i7={kind:String,feature:String,value:["Declaration","Selector"]};function s7(t,e){const A=(this.features[t]||{})[e];return typeof A!="function"&&this.error(`Unknown feature ${e}()`),A}function BF(t="unknown"){const e=this.tokenStart,A=this.consumeFunctionName(),n=s7.call(this,t,A.toLowerCase());this.skipSC();const r=this.parseWithFallback(()=>{const o=this.tokenIndex,i=n.call(this);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>this.Raw(null,!1));return this.eof||this.eat(rt),{type:"FeatureFunction",loc:this.getLocation(e,this.tokenStart),kind:t,feature:A,value:r}}function yF(t){this.token(mt,t.feature+"("),this.node(t.value),this.token(rt,")")}const a7=Object.freeze(Object.defineProperty({__proto__:null,generate:yF,name:o7,parse:BF,structure:i7},Symbol.toStringTag,{value:"Module"})),wF=47,l7=60,CF=61,c7=62,u7="FeatureRange",d7={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function ZB(){switch(this.skipSC(),this.tokenType){case at:return this.isDelim(wF,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case bt:return this.Dimension();case _e:return this.Identifier();case mt:return this.parseWithFallback(()=>{const t=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(wF)&&this.error(),t},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function bF(t){if(this.skipSC(),this.isDelim(l7)||this.isDelim(c7)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(CF)?(this.next(),e+"="):e}if(this.isDelim(CF))return"=";this.error(`Expected ${t?'":", ':""}"<", ">", "=" or ")"`)}function vF(t="unknown"){const e=this.tokenStart;this.skipSC(),this.eat($t);const A=ZB.call(this),n=bF.call(this,A.type==="Identifier"),r=ZB.call(this);let o=null,i=null;return this.lookupNonWSType(0)!==rt&&(o=bF.call(this),i=ZB.call(this)),this.skipSC(),this.eat(rt),{type:"FeatureRange",loc:this.getLocation(e,this.tokenStart),kind:t,left:A,leftComparison:n,middle:r,rightComparison:o,right:i}}function EF(t){this.token($t,"("),this.node(t.left),this.tokenize(t.leftComparison),this.node(t.middle),t.right&&(this.tokenize(t.rightComparison),this.node(t.right)),this.token(rt,")")}const f7=Object.freeze(Object.defineProperty({__proto__:null,generate:EF,name:u7,parse:vF,structure:d7},Symbol.toStringTag,{value:"Module"})),h7="Function",p7="function",m7={name:String,children:[[]]};function kF(t,e){const A=this.tokenStart,n=this.consumeFunctionName(),r=n.toLowerCase();let o;return o=e.hasOwnProperty(r)?e[r].call(this,e):t.call(this,e),this.eof||this.eat(rt),{type:"Function",loc:this.getLocation(A,this.tokenStart),name:n,children:o}}function SF(t){this.token(mt,t.name+"("),this.children(t),this.token(rt,")")}const g7=Object.freeze(Object.defineProperty({__proto__:null,generate:SF,name:h7,parse:kF,structure:m7,walkContext:p7},Symbol.toStringTag,{value:"Module"})),B7="GeneralEnclosed",y7={kind:String,function:[String,null],children:[[]]};function QF(t){const e=this.tokenStart;let A=null;this.tokenType===mt?A=this.consumeFunctionName():this.eat($t);const n=this.parseWithFallback(()=>{const r=this.tokenIndex,o=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(r)===!1&&this.error(),o},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(rt),{type:"GeneralEnclosed",loc:this.getLocation(e,this.tokenStart),kind:t,function:A,children:n}}function FF(t){t.function?this.token(mt,t.function+"("):this.token($t,"("),this.children(t),this.token(rt,")")}const w7=Object.freeze(Object.defineProperty({__proto__:null,generate:FF,name:B7,parse:QF,structure:y7},Symbol.toStringTag,{value:"Module"})),C7="XXX",b7="Hash",v7={value:String};function UF(){const t=this.tokenStart;return this.eat(qt),{type:"Hash",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t+1)}}function IF(t){this.token(qt,"#"+t.value)}const E7=Object.freeze(Object.defineProperty({__proto__:null,generate:IF,name:b7,parse:UF,structure:v7,xxx:C7},Symbol.toStringTag,{value:"Module"})),k7="Identifier",S7={name:String};function xF(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(_e)}}function TF(t){this.token(_e,t.name)}const Q7=Object.freeze(Object.defineProperty({__proto__:null,generate:TF,name:k7,parse:xF,structure:S7},Symbol.toStringTag,{value:"Module"})),F7="IdSelector",U7={name:String};function _F(){const t=this.tokenStart;return this.eat(qt),{type:"IdSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t+1)}}function DF(t){this.token(It,"#"+t.name)}const I7=Object.freeze(Object.defineProperty({__proto__:null,generate:DF,name:F7,parse:_F,structure:U7},Symbol.toStringTag,{value:"Module"})),x7=46,T7="Layer",_7={name:String};function LF(){let t=this.tokenStart,e=this.consume(_e);for(;this.isDelim(x7);)this.eat(It),e+="."+this.consume(_e);return{type:"Layer",loc:this.getLocation(t,this.tokenStart),name:e}}function OF(t){this.tokenize(t.name)}const D7=Object.freeze(Object.defineProperty({__proto__:null,generate:OF,name:T7,parse:LF,structure:_7},Symbol.toStringTag,{value:"Module"})),L7="LayerList",O7={children:[["Layer"]]};function MF(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.Layer()),this.lookupTypeNonSC(0)===_r);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(t),children:t}}function NF(t){this.children(t,()=>this.token(_r,","))}const M7=Object.freeze(Object.defineProperty({__proto__:null,generate:NF,name:L7,parse:MF,structure:O7},Symbol.toStringTag,{value:"Module"})),N7="MediaQuery",H7={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function HF(){const t=this.tokenStart;let e=null,A=null,n=null;if(this.skipSC(),this.tokenType===_e&&this.lookupTypeNonSC(1)!==$t){const r=this.consume(_e),o=r.toLowerCase();switch(o==="not"||o==="only"?(this.skipSC(),e=o,A=this.consume(_e)):A=r,this.lookupTypeNonSC(0)){case _e:{this.skipSC(),this.eatIdent("and"),n=this.Condition("media");break}case Dr:case Sn:case _r:case Li:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case _e:case $t:case mt:{n=this.Condition("media");break}case Dr:case Sn:case Li:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(t,this.tokenStart),modifier:e,mediaType:A,condition:n}}function RF(t){t.mediaType?(t.modifier&&this.token(_e,t.modifier),this.token(_e,t.mediaType),t.condition&&(this.token(_e,"and"),this.node(t.condition))):t.condition&&this.node(t.condition)}const R7=Object.freeze(Object.defineProperty({__proto__:null,generate:RF,name:N7,parse:HF,structure:H7},Symbol.toStringTag,{value:"Module"})),P7="MediaQueryList",V7={children:[["MediaQuery"]]};function PF(){const t=this.createList();for(this.skipSC();!this.eof&&(t.push(this.MediaQuery()),this.tokenType===_r);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(t),children:t}}function VF(t){this.children(t,()=>this.token(_r,","))}const $7=Object.freeze(Object.defineProperty({__proto__:null,generate:VF,name:P7,parse:PF,structure:V7},Symbol.toStringTag,{value:"Module"})),K7=38,G7="NestingSelector",W7={};function $F(){const t=this.tokenStart;return this.eatDelim(K7),{type:"NestingSelector",loc:this.getLocation(t,this.tokenStart)}}function KF(){this.token(It,"&")}const z7=Object.freeze(Object.defineProperty({__proto__:null,generate:KF,name:G7,parse:$F,structure:W7},Symbol.toStringTag,{value:"Module"})),Y7="Nth",J7={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function GF(){this.skipSC();const t=this.tokenStart;let e=t,A=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),e=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),A=this.SelectorList(),e=this.tokenStart),{type:"Nth",loc:this.getLocation(t,e),nth:n,selector:A}}function WF(t){this.node(t.nth),t.selector!==null&&(this.token(_e,"of"),this.node(t.selector))}const X7=Object.freeze(Object.defineProperty({__proto__:null,generate:WF,name:Y7,parse:GF,structure:J7},Symbol.toStringTag,{value:"Module"})),j7="Number",q7={value:String};function zF(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(at)}}function YF(t){this.token(at,t.value)}const Z7=Object.freeze(Object.defineProperty({__proto__:null,generate:YF,name:j7,parse:zF,structure:q7},Symbol.toStringTag,{value:"Module"})),eq="Operator",tq={value:String};function JF(){const t=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function XF(t){this.tokenize(t.value)}const Aq=Object.freeze(Object.defineProperty({__proto__:null,generate:XF,name:eq,parse:JF,structure:tq},Symbol.toStringTag,{value:"Module"})),nq="Parentheses",rq={children:[[]]};function jF(t,e){const A=this.tokenStart;let n=null;return this.eat($t),n=t.call(this,e),this.eof||this.eat(rt),{type:"Parentheses",loc:this.getLocation(A,this.tokenStart),children:n}}function qF(t){this.token($t,"("),this.children(t),this.token(rt,")")}const oq=Object.freeze(Object.defineProperty({__proto__:null,generate:qF,name:nq,parse:jF,structure:rq},Symbol.toStringTag,{value:"Module"})),iq="Percentage",sq={value:String};function ZF(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(pA)}}function eU(t){this.token(pA,t.value+"%")}const aq=Object.freeze(Object.defineProperty({__proto__:null,generate:eU,name:iq,parse:ZF,structure:sq},Symbol.toStringTag,{value:"Module"})),lq="PseudoClassSelector",cq="function",uq={name:String,children:[["Raw"],null]};function tU(){const t=this.tokenStart;let e=null,A,n;return this.eat(hn),this.tokenType===mt?(A=this.consumeFunctionName(),n=A.toLowerCase(),this.lookupNonWSType(0)==rt?e=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),e=this.pseudo[n].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(rt)):A=this.consume(_e),{type:"PseudoClassSelector",loc:this.getLocation(t,this.tokenStart),name:A,children:e}}function AU(t){this.token(hn,":"),t.children===null?this.token(_e,t.name):(this.token(mt,t.name+"("),this.children(t),this.token(rt,")"))}const dq=Object.freeze(Object.defineProperty({__proto__:null,generate:AU,name:lq,parse:tU,structure:uq,walkContext:cq},Symbol.toStringTag,{value:"Module"})),fq="PseudoElementSelector",hq="function",pq={name:String,children:[["Raw"],null]};function nU(){const t=this.tokenStart;let e=null,A,n;return this.eat(hn),this.eat(hn),this.tokenType===mt?(A=this.consumeFunctionName(),n=A.toLowerCase(),this.lookupNonWSType(0)==rt?e=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),e=this.pseudo[n].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(null,!1))),this.eat(rt)):A=this.consume(_e),{type:"PseudoElementSelector",loc:this.getLocation(t,this.tokenStart),name:A,children:e}}function rU(t){this.token(hn,":"),this.token(hn,":"),t.children===null?this.token(_e,t.name):(this.token(mt,t.name+"("),this.children(t),this.token(rt,")"))}const mq=Object.freeze(Object.defineProperty({__proto__:null,generate:rU,name:fq,parse:nU,structure:pq,walkContext:hq},Symbol.toStringTag,{value:"Module"})),oU=47;function iU(){switch(this.skipSC(),this.tokenType){case at:return this.Number();case mt:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const gq="Ratio",Bq={left:["Number","Function"],right:["Number","Function",null]};function sU(){const t=this.tokenStart,e=iU.call(this);let A=null;return this.skipSC(),this.isDelim(oU)&&(this.eatDelim(oU),A=iU.call(this)),{type:"Ratio",loc:this.getLocation(t,this.tokenStart),left:e,right:A}}function aU(t){this.node(t.left),this.token(It,"/"),t.right?this.node(t.right):this.node(at,1)}const yq=Object.freeze(Object.defineProperty({__proto__:null,generate:aU,name:gq,parse:sU,structure:Bq},Symbol.toStringTag,{value:"Module"}));function wq(){return this.tokenIndex>0&&this.lookupType(-1)===bA?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Cq="Raw",bq={value:String};function lU(t,e){const A=this.getTokenStart(this.tokenIndex);let n;return this.skipUntilBalanced(this.tokenIndex,t||this.consumeUntilBalanceEnd),e&&this.tokenStart>A?n=wq.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(A,n),value:this.substring(A,n)}}function cU(t){this.tokenize(t.value)}const vq=Object.freeze(Object.defineProperty({__proto__:null,generate:cU,name:Cq,parse:lU,structure:bq},Symbol.toStringTag,{value:"Module"}));function uU(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Eq(){const t=this.SelectorList();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==Dr&&this.error(),t}const kq="Rule",Sq="rule",Qq={prelude:["SelectorList","Raw"],block:["Block"]};function dU(){const t=this.tokenIndex,e=this.tokenStart;let A,n;return this.parseRulePrelude?A=this.parseWithFallback(Eq,uU):A=uU.call(this,t),n=this.Block(!0),{type:"Rule",loc:this.getLocation(e,this.tokenStart),prelude:A,block:n}}function fU(t){this.node(t.prelude),this.node(t.block)}const Fq=Object.freeze(Object.defineProperty({__proto__:null,generate:fU,name:kq,parse:dU,structure:Qq,walkContext:Sq},Symbol.toStringTag,{value:"Module"})),Uq="Scope",Iq={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function hU(){let t=null,e=null;this.skipSC();const A=this.tokenStart;return this.tokenType===$t&&(this.next(),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(rt)),this.lookupNonWSType(0)===_e&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat($t),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(rt)),{type:"Scope",loc:this.getLocation(A,this.tokenStart),root:t,limit:e}}function pU(t){t.root&&(this.token($t,"("),this.node(t.root),this.token(rt,")")),t.limit&&(this.token(_e,"to"),this.token($t,"("),this.node(t.limit),this.token(rt,")"))}const xq=Object.freeze(Object.defineProperty({__proto__:null,generate:pU,name:Uq,parse:hU,structure:Iq},Symbol.toStringTag,{value:"Module"})),Tq="Selector",_q={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function mU(){const t=this.readSequence(this.scope.Selector);return this.getFirstListNode(t)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(t),children:t}}function gU(t){this.children(t)}const Dq=Object.freeze(Object.defineProperty({__proto__:null,generate:gU,name:Tq,parse:mU,structure:_q},Symbol.toStringTag,{value:"Module"})),Lq="SelectorList",Oq="selector",Mq={children:[["Selector","Raw"]]};function BU(){const t=this.createList();for(;!this.eof;){if(t.push(this.Selector()),this.tokenType===_r){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(t),children:t}}function yU(t){this.children(t,()=>this.token(_r,","))}const Nq=Object.freeze(Object.defineProperty({__proto__:null,generate:yU,name:Lq,parse:BU,structure:Mq,walkContext:Oq},Symbol.toStringTag,{value:"Module"})),ey=92,wU=34,Hq=39;function CU(t){const e=t.length,A=t.charCodeAt(0),n=A===wU||A===Hq?1:0,r=n===1&&e>1&&t.charCodeAt(e-1)===A?e-2:e-1;let o="";for(let i=n;i<=r;i++){let a=t.charCodeAt(i);if(a===ey){if(i===r){i!==e-1&&(o=t.substr(i+1));break}if(a=t.charCodeAt(++i),oo(ey,a)){const l=i-1,u=Va(t,l);i=u-1,o+=vQ(t.substring(l+1,u))}else a===13&&t.charCodeAt(i+1)===10&&i++}else o+=t[i]}return o}function Rq(t,e){const n=wU;let r="",o=!1;for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);if(a===0){r+="�";continue}if(a<=31||a===127){r+="\\"+a.toString(16),o=!0;continue}a===n||a===ey?(r+="\\"+t.charAt(i),o=!1):(o&&(Ra(a)||Qs(a))&&(r+=" "),r+=t.charAt(i),o=!1)}return'"'+r+'"'}const Pq="String",Vq={value:String};function bU(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:CU(this.consume(Oo))}}function vU(t){this.token(Oo,Rq(t.value))}const $q=Object.freeze(Object.defineProperty({__proto__:null,generate:vU,name:Pq,parse:bU,structure:Vq},Symbol.toStringTag,{value:"Module"})),Kq=33;function EU(){return this.Raw(null,!1)}const Gq="StyleSheet",Wq="stylesheet",zq={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function kU(){const t=this.tokenStart,e=this.createList();let A;for(;!this.eof;){switch(this.tokenType){case bA:this.next();continue;case pn:if(this.charCodeAt(this.tokenStart+2)!==Kq){this.next();continue}A=this.Comment();break;case Rf:A=this.CDO();break;case Pn:A=this.CDC();break;case EA:A=this.parseWithFallback(this.Atrule,EU);break;default:A=this.parseWithFallback(this.Rule,EU)}e.push(A)}return{type:"StyleSheet",loc:this.getLocation(t,this.tokenStart),children:e}}function SU(t){this.children(t)}const Yq=Object.freeze(Object.defineProperty({__proto__:null,generate:SU,name:Gq,parse:kU,structure:zq,walkContext:Wq},Symbol.toStringTag,{value:"Module"})),Jq="SupportsDeclaration",Xq={declaration:"Declaration"};function QU(){const t=this.tokenStart;this.eat($t),this.skipSC();const e=this.Declaration();return this.eof||this.eat(rt),{type:"SupportsDeclaration",loc:this.getLocation(t,this.tokenStart),declaration:e}}function FU(t){this.token($t,"("),this.node(t.declaration),this.token(rt,")")}const jq=Object.freeze(Object.defineProperty({__proto__:null,generate:FU,name:Jq,parse:QU,structure:Xq},Symbol.toStringTag,{value:"Module"})),qq=42,UU=124;function ty(){this.tokenType!==_e&&this.isDelim(qq)===!1&&this.error("Identifier or asterisk is expected"),this.next()}const Zq="TypeSelector",e9={name:String};function IU(){const t=this.tokenStart;return this.isDelim(UU)?(this.next(),ty.call(this)):(ty.call(this),this.isDelim(UU)&&(this.next(),ty.call(this))),{type:"TypeSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function xU(t){this.tokenize(t.name)}const t9=Object.freeze(Object.defineProperty({__proto__:null,generate:xU,name:Zq,parse:IU,structure:e9},Symbol.toStringTag,{value:"Module"})),TU=43,_U=45,Ay=63;function Fc(t,e){let A=0;for(let n=this.tokenStart+t;n<this.tokenEnd;n++){const r=this.charCodeAt(n);if(r===_U&&e&&A!==0)return Fc.call(this,t+A+1,!1),-1;Ra(r)||this.error(e&&A!==0?"Hyphen minus"+(A<6?" or hex digit":"")+" is expected":A<6?"Hex digit is expected":"Unexpected input",n),++A>6&&this.error("Too many hex digits",n)}return this.next(),A}function jf(t){let e=0;for(;this.isDelim(Ay);)++e>t&&this.error("Too many question marks"),this.next()}function A9(t){this.charCodeAt(this.tokenStart)!==t&&this.error((t===TU?"Plus sign":"Hyphen minus")+" is expected")}function n9(){let t=0;switch(this.tokenType){case at:if(t=Fc.call(this,1,!0),this.isDelim(Ay)){jf.call(this,6-t);break}if(this.tokenType===bt||this.tokenType===at){A9.call(this,_U),Fc.call(this,1,!1);break}break;case bt:t=Fc.call(this,1,!0),t>0&&jf.call(this,6-t);break;default:if(this.eatDelim(TU),this.tokenType===_e){t=Fc.call(this,0,!0),t>0&&jf.call(this,6-t);break}if(this.isDelim(Ay)){this.next(),jf.call(this,5);break}this.error("Hex digit or question mark is expected")}}const r9="UnicodeRange",o9={value:String};function DU(){const t=this.tokenStart;return this.eatIdent("u"),n9.call(this),{type:"UnicodeRange",loc:this.getLocation(t,this.tokenStart),value:this.substrToCursor(t)}}function LU(t){this.tokenize(t.value)}const i9=Object.freeze(Object.defineProperty({__proto__:null,generate:LU,name:r9,parse:DU,structure:o9},Symbol.toStringTag,{value:"Module"})),s9=32,ny=92,a9=34,l9=39,c9=40,OU=41;function u9(t){const e=t.length;let A=4,n=t.charCodeAt(e-1)===OU?e-2:e-1,r="";for(;A<n&&Qs(t.charCodeAt(A));)A++;for(;A<n&&Qs(t.charCodeAt(n));)n--;for(let o=A;o<=n;o++){let i=t.charCodeAt(o);if(i===ny){if(o===n){o!==e-1&&(r=t.substr(o+1));break}if(i=t.charCodeAt(++o),oo(ny,i)){const a=o-1,l=Va(t,a);o=l-1,r+=vQ(t.substring(a+1,l))}else i===13&&t.charCodeAt(o+1)===10&&o++}else r+=t[o]}return r}function d9(t){let e="",A=!1;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(r===0){e+="�";continue}if(r<=31||r===127){e+="\\"+r.toString(16),A=!0;continue}r===s9||r===ny||r===a9||r===l9||r===c9||r===OU?(e+="\\"+t.charAt(n),A=!1):(A&&Ra(r)&&(e+=" "),e+=t.charAt(n),A=!1)}return"url("+e+")"}const f9="Url",h9={value:String};function MU(){const t=this.tokenStart;let e;switch(this.tokenType){case fn:e=u9(this.consume(fn));break;case mt:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(mt),this.skipSC(),e=CU(this.consume(Oo)),this.skipSC(),this.eof||this.eat(rt);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(t,this.tokenStart),value:e}}function NU(t){this.token(fn,d9(t.value))}const p9=Object.freeze(Object.defineProperty({__proto__:null,generate:NU,name:f9,parse:MU,structure:h9},Symbol.toStringTag,{value:"Module"})),m9="Value",g9={children:[[]]};function HU(){const t=this.tokenStart,e=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(t,this.tokenStart),children:e}}function RU(t){this.children(t)}const B9=Object.freeze(Object.defineProperty({__proto__:null,generate:RU,name:m9,parse:HU,structure:g9},Symbol.toStringTag,{value:"Module"})),y9=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),w9="WhiteSpace",C9={value:String};function PU(){return this.eat(bA),y9}function VU(t){this.token(bA,t.value)}const b9=Object.freeze(Object.defineProperty({__proto__:null,generate:VU,name:w9,parse:PU,structure:C9},Symbol.toStringTag,{value:"Module"})),v9=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:DX,Atrule:HX,AtrulePrelude:$X,AttributeSelector:jX,Block:nj,Brackets:ij,CDC:lj,CDO:dj,ClassSelector:mj,Combinator:bj,Comment:Qj,Condition:Tj,Declaration:zj,DeclarationList:jj,Dimension:e7,Feature:r7,FeatureFunction:a7,FeatureRange:f7,Function:g7,GeneralEnclosed:w7,Hash:E7,IdSelector:I7,Identifier:Q7,Layer:D7,LayerList:M7,MediaQuery:R7,MediaQueryList:$7,NestingSelector:z7,Nth:X7,Number:Z7,Operator:Aq,Parentheses:oq,Percentage:aq,PseudoClassSelector:dq,PseudoElementSelector:mq,Ratio:yq,Raw:vq,Rule:Fq,Scope:xq,Selector:Dq,SelectorList:Nq,String:$q,StyleSheet:Yq,SupportsDeclaration:jq,TypeSelector:t9,UnicodeRange:i9,Url:p9,Value:B9,WhiteSpace:b9},Symbol.toStringTag,{value:"Module"})),E9={node:v9},Mi=BX(E9),ry=["left","right","top","bottom","inset-block-start","inset-block-end","inset-inline-start","inset-inline-end","inset-block","inset-inline","inset"];function Uc(t){return ry.includes(t)}const oy=["margin-block-start","margin-block-end","margin-block","margin-inline-start","margin-inline-end","margin-inline","margin-bottom","margin-left","margin-right","margin-top","margin"];function k9(t){return oy.includes(t)}const iy=["width","height","min-width","min-height","max-width","max-height","block-size","inline-size","min-block-size","min-inline-size","max-block-size","max-inline-size"];function $U(t){return iy.includes(t)}const KU=["justify-self","align-self","place-self"];function S9(t){return KU.includes(t)}const GU=[...ry,...oy,...iy,...KU,"position-anchor","position-area"],Q9=[...iy,...ry,...oy];function WU(t){return Q9.includes(t)}const F9=["top","left","right","bottom","start","end","self-start","self-end","center","inside","outside"];function zU(t){return F9.includes(t)}const U9=["width","height","block","inline","self-block","self-inline"];function I9(t){return U9.includes(t)}const YU=new Set(["Atrule","Selector","Declaration"]);function x9(t){const e=new SourceMapGenerator,A={line:1,column:0},n={line:0,column:0},r={line:1,column:0},o={generated:r};let i=1,a=0,l=!1;const u=t.node;t.node=function(p){if(p.loc&&p.loc.start&&YU.has(p.type)){const g=p.loc.start.line,B=p.loc.start.column-1;(n.line!==g||n.column!==B)&&(n.line=g,n.column=B,A.line=i,A.column=a,l&&(l=!1,(A.line!==r.line||A.column!==r.column)&&e.addMapping(o)),l=!0,e.addMapping({source:p.loc.source,original:n,generated:A}))}u.call(this,p),l&&YU.has(p.type)&&(r.line=i,r.column=a)};const f=t.emit;t.emit=function(p,g,B){for(let y=0;y<p.length;y++)p.charCodeAt(y)===10?(i++,a=0):a++;f(p,g,B)};const h=t.result;return t.result=function(){return l&&e.addMapping(o),{css:h(),map:e}},t}const T9=43,_9=45,sy=(t,e)=>{if(t===It&&(t=e),typeof t=="string"){const A=t.charCodeAt(0);return A>127?32768:A<<8}return t},JU=[[_e,_e],[_e,mt],[_e,fn],[_e,Tr],[_e,"-"],[_e,at],[_e,pA],[_e,bt],[_e,Pn],[_e,$t],[EA,_e],[EA,mt],[EA,fn],[EA,Tr],[EA,"-"],[EA,at],[EA,pA],[EA,bt],[EA,Pn],[qt,_e],[qt,mt],[qt,fn],[qt,Tr],[qt,"-"],[qt,at],[qt,pA],[qt,bt],[qt,Pn],[bt,_e],[bt,mt],[bt,fn],[bt,Tr],[bt,"-"],[bt,at],[bt,pA],[bt,bt],[bt,Pn],["#",_e],["#",mt],["#",fn],["#",Tr],["#","-"],["#",at],["#",pA],["#",bt],["#",Pn],["-",_e],["-",mt],["-",fn],["-",Tr],["-","-"],["-",at],["-",pA],["-",bt],["-",Pn],[at,_e],[at,mt],[at,fn],[at,Tr],[at,at],[at,pA],[at,bt],[at,"%"],[at,Pn],["@",_e],["@",mt],["@",fn],["@",Tr],["@","-"],["@",Pn],[".",at],[".",pA],[".",bt],["+",at],["+",pA],["+",bt],["/","*"]],D9=JU.concat([[_e,qt],[bt,qt],[qt,qt],[EA,$t],[EA,Oo],[EA,hn],[pA,pA],[pA,bt],[pA,mt],[pA,"-"],[rt,_e],[rt,mt],[rt,pA],[rt,bt],[rt,qt],[rt,"-"]]);function XU(t){const e=new Set(t.map(([A,n])=>sy(A)<<16|sy(n)));return function(A,n,r){const o=sy(n,r),i=r.charCodeAt(0);return(i===_9&&n!==_e&&n!==mt&&n!==Pn||i===T9?e.has(A<<16|i<<8):e.has(A<<16|o))&&this.emit(" ",bA,!0),o}}const L9=XU(JU),jU=XU(D9),qU=Object.freeze(Object.defineProperty({__proto__:null,safe:jU,spec:L9},Symbol.toStringTag,{value:"Module"})),O9=92;function M9(t,e){if(typeof e=="function"){let A=null;t.children.forEach(n=>{A!==null&&e.call(this,A),this.node(n),A=n});return}t.children.forEach(this.node,this)}function N9(t){UQ(t,(e,A,n)=>{this.token(e,t.slice(A,n))})}function H9(t){const e=new Map;for(let[A,n]of Object.entries(t.node))typeof(n.generate||n)=="function"&&e.set(A,n.generate||n);return function(A,n){let r="",o=0,i={node(l){if(e.has(l.type))e.get(l.type).call(a,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:jU,token(l,u){o=this.tokenBefore(o,l,u),this.emit(u,l,!1),l===It&&u.charCodeAt(0)===O9&&this.emit(`
165
165
  `,bA,!0)},emit(l){r+=l},result(){return r}};n&&(typeof n.decorator=="function"&&(i=n.decorator(i)),n.sourceMap&&(i=x9(i)),n.mode in qU&&(i.tokenBefore=qU[n.mode]));const a={node:l=>i.node(l),children:M9,token:(l,u)=>i.token(l,u),tokenize:N9};return i.node(A),i.result()}}const R9=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:xQ,Atrule:DQ,AtrulePrelude:OQ,AttributeSelector:HQ,Block:KQ,Brackets:WQ,CDC:YQ,CDO:XQ,ClassSelector:qQ,Combinator:tF,Comment:nF,Condition:iF,Declaration:uF,DeclarationList:fF,Dimension:pF,Feature:gF,FeatureFunction:yF,FeatureRange:EF,Function:SF,GeneralEnclosed:FF,Hash:IF,IdSelector:DF,Identifier:TF,Layer:OF,LayerList:NF,MediaQuery:RF,MediaQueryList:VF,NestingSelector:KF,Nth:WF,Number:YF,Operator:XF,Parentheses:qF,Percentage:eU,PseudoClassSelector:AU,PseudoElementSelector:rU,Ratio:aU,Raw:cU,Rule:fU,Scope:pU,Selector:gU,SelectorList:yU,String:vU,StyleSheet:SU,SupportsDeclaration:FU,TypeSelector:xU,UnicodeRange:LU,Url:NU,Value:RU,WhiteSpace:VU},Symbol.toStringTag,{value:"Module"})),P9={node:R9},V9=H9(P9);let Ka=null;class mn{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return mn.createItem(e)}allocateCursor(e,A){let n;return Ka!==null?(n=Ka,Ka=Ka.cursor,n.prev=e,n.next=A,n.cursor=this.cursor):n={prev:e,next:A,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=Ka,Ka=e}updateCursors(e,A,n,r){let{cursor:o}=this;for(;o!==null;)o.prev===e&&(o.prev=A),o.next===n&&(o.next=r),o=o.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let A=this.head;A!==null;A=A.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let A=null;this.head=null;for(let n of e){const r=mn.createItem(n);A!==null?A.next=r:this.head=r,r.prev=A,A=r}return this.tail=A,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,A=this){const n=this.allocateCursor(null,this.head);for(;n.next!==null;){const r=n.next;n.next=r.next,e.call(A,r.data,r,this)}this.releaseCursor()}forEachRight(e,A=this){const n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){const r=n.prev;n.prev=r.prev,e.call(A,r.data,r,this)}this.releaseCursor()}reduce(e,A,n=this){let r=this.allocateCursor(null,this.head),o=A,i;for(;r.next!==null;)i=r.next,r.next=i.next,o=e.call(n,o,i.data,i,this);return this.releaseCursor(),o}reduceRight(e,A,n=this){let r=this.allocateCursor(this.tail,null),o=A,i;for(;r.prev!==null;)i=r.prev,r.prev=i.prev,o=e.call(n,o,i.data,i,this);return this.releaseCursor(),o}some(e,A=this){for(let n=this.head;n!==null;n=n.next)if(e.call(A,n.data,n,this))return!0;return!1}map(e,A=this){const n=new mn;for(let r=this.head;r!==null;r=r.next)n.appendData(e.call(A,r.data,r,this));return n}filter(e,A=this){const n=new mn;for(let r=this.head;r!==null;r=r.next)e.call(A,r.data,r,this)&&n.appendData(r.data);return n}nextUntil(e,A,n=this){if(e===null)return;const r=this.allocateCursor(null,e);for(;r.next!==null;){const o=r.next;if(r.next=o.next,A.call(n,o.data,o,this))break}this.releaseCursor()}prevUntil(e,A,n=this){if(e===null)return;const r=this.allocateCursor(e,null);for(;r.prev!==null;){const o=r.prev;if(r.prev=o.prev,A.call(n,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new mn;for(let A of this)e.appendData(A);return e}prepend(e){return this.updateCursors(null,e,this.head,e),this.head!==null?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(mn.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(mn.createItem(e))}insert(e,A=null){if(A!==null)if(this.updateCursors(A.prev,e,A,e),A.prev===null){if(this.head!==A)throw new Error("before doesn't belong to list");this.head=e,A.prev=e,e.next=A,this.updateCursors(null,e)}else A.prev.next=e,e.prev=A.prev,A.prev=e,e.next=A;else this.updateCursors(this.tail,e,null,e),this.tail!==null?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,A){return this.insert(mn.createItem(e),A)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(mn.createItem(e))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(e){this.prepend(mn.createItem(e))}shift(){return this.head!==null?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,A){return e.head===null?this:(A!=null?(this.updateCursors(A.prev,e.tail,A,e.head),A.prev!==null?(A.prev.next=e.head,e.head.prev=A.prev):this.head=e.head,A.prev=e.tail,e.tail.next=A):(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null,this)}replace(e,A){"head"in A?this.insertList(A,e):this.insert(A,e),this.remove(e)}}function $9(t,e){const A=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(A,{name:t,message:e,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${t}: ${e}
166
166
  `)}})}const ay=100,ZU=60,eI=" ";function tI({source:t,line:e,column:A,baseLine:n,baseColumn:r},o){function i(B,y){return u.slice(B,y).map((b,w)=>String(B+w+1).padStart(p)+" |"+b).join(`
167
167
  `)}const a=`
168
168
  `.repeat(Math.max(n-1,0)),l=" ".repeat(Math.max(r-1,0)),u=(a+l+t).split(/\r\n?|\n|\f/),f=Math.max(1,e-o)-1,h=Math.min(e+o,u.length+1),p=Math.max(4,String(h).length)+1;let g=0;A+=(eI.length-1)*(u[e-1].substr(0,A-1).match(/\t/g)||[]).length,A>ay&&(g=A-ZU+3,A=ZU-2);for(let B=f;B<=h;B++)B>=0&&B<u.length&&(u[B]=u[B].replace(/\t/g,eI),u[B]=(g>0&&u[B].length>g?"…":"")+u[B].substr(g,ay-2)+(u[B].length>g+ay-1?"…":""));return[i(f,e),new Array(A+p+2).join("-")+"^",i(e,h)].filter(Boolean).join(`
169
169
  `).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function AI(t,e,A,n,r,o=1,i=1){return Object.assign($9("SyntaxError",t),{source:e,offset:A,line:n,column:r,sourceFragment(a){return tI({source:e,line:n,column:r,baseLine:o,baseColumn:i},isNaN(a)?0:a)},get formattedMessage(){return`Parse error: ${t}
170
- `+tI({source:e,line:n,column:r,baseLine:o,baseColumn:i},2)}})}function K9(t){const e=this.createList();let A=!1;const n={recognizer:t};for(;!this.eof;){switch(this.tokenType){case pn:this.next();continue;case bA:A=!0,this.next();continue}let r=t.getNode.call(this,n);if(r===void 0)break;A&&(t.onWhiteSpace&&t.onWhiteSpace.call(this,r,e,n),A=!1),e.push(r)}return A&&t.onWhiteSpace&&t.onWhiteSpace.call(this,null,e,n),e}const nI=()=>{},G9=33,W9=35,ly=59,rI=123,oI=0;function z9(t){return function(){return this[t]()}}function cy(t){const e=Object.create(null);for(const A of Object.keys(t)){const n=t[A],r=n.parse||n;r&&(e[A]=r)}return e}function Y9(t){const e={context:Object.create(null),features:Object.assign(Object.create(null),t.features),scope:Object.assign(Object.create(null),t.scope),atrule:cy(t.atrule),pseudo:cy(t.pseudo),node:cy(t.node)};for(const[A,n]of Object.entries(t.parseContext))switch(typeof n){case"function":e.context[A]=n;break;case"string":e.context[A]=z9(n);break}return MA(MA({config:e},e),e.node)}function J9(t){let e="",A="<unknown>",n=!1,r=nI,o=!1;const i=new UX,a=Object.assign(new IX,Y9(t||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:K9,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===rI?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===rI||l===ly?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===G9||l===ly?1:0},consumeUntilSemicolonIncluded(l){return l===ly?2:0},createList(){return new mn},createSingleNodeList(l){return new mn().appendData(l)},getFirstListNode(l){return l&&l.first},getLastListNode(l){return l&&l.last},parseWithFallback(l,u){const f=this.tokenIndex;try{return l.call(this)}catch(h){if(o)throw h;this.skip(f-this.tokenIndex);const p=u.call(this);return o=!0,r(h,p),o=!1,p}},lookupNonWSType(l){let u;do if(u=this.lookupType(l++),u!==bA&&u!==pn)return u;while(u!==oI);return oI},charCodeAt(l){return l>=0&&l<e.length?e.charCodeAt(l):0},substring(l,u){return e.substring(l,u)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,u){return CQ(e,l,u)},cmpStr(l,u,f){return Kf(e,l,u,f)},consume(l){const u=this.tokenStart;return this.eat(l),this.substrToCursor(u)},consumeFunctionName(){const l=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(mt),l},consumeNumber(l){const u=e.substring(this.tokenStart,bQ(e,this.tokenStart));return this.eat(l),u},eat(l){if(this.tokenType!==l){const u=EQ[l].slice(0,-6).replace(/-/g," ").replace(/^./,p=>p.toUpperCase());let f=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,h=this.tokenStart;switch(l){case _e:this.tokenType===mt||this.tokenType===fn?(h=this.tokenEnd-1,f="Identifier is expected but function found"):f="Identifier is expected";break;case jt:this.isDelim(W9)&&(this.next(),h++,f="Name is expected");break;case pA:this.tokenType===at&&(h=this.tokenEnd,f="Percent sign is expected");break}this.error(f,h)}this.next()},eatIdent(l){(this.tokenType!==_e||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,u){return n?i.getLocationRange(l,u,A):null},getLocationFromList(l){if(n){const u=this.getFirstListNode(l),f=this.getLastListNode(l);return i.getLocationRange(u!==null?u.loc.start.offset-i.startOffset:this.tokenStart,f!==null?f.loc.end.offset-i.startOffset:this.tokenStart,A)}return null},error(l,u){const f=typeof u<"u"&&u<e.length?i.getLocation(u):this.eof?i.getLocation(SX(e,e.length-1)):i.getLocation(this.tokenStart);throw new AI(l||"Unexpected input",e,f.offset,f.line,f.column,i.startLine,i.startColumn)}});return Object.assign(function(l,u){e=l,u=u||{},a.setSource(e,UQ),i.setSource(e,u.offset,u.line,u.column),A=u.filename||"<unknown>",n=!!u.positions,r=typeof u.onParseError=="function"?u.onParseError:nI,o=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:f="default",onComment:h}=u;if(!(f in a.context))throw new Error("Unknown context `"+f+"`");typeof h=="function"&&a.forEachToken((g,B,y)=>{if(g===pn){const b=a.getLocation(B,y),w=Kf(e,y-2,y,"*/")?e.slice(B+2,y-2):e.slice(B+2,y);h(w,b)}});const p=a.context[f].call(a,u);return a.eof||a.error(),p},{SyntaxError:AI,config:a.config})}const X9=35,j9=42,iI=43,q9=45,Z9=47,eZ=117;function sI(t){switch(this.tokenType){case jt:return this.Hash();case _r:return this.Operator();case $t:return this.Parentheses(this.readSequence,t.recognizer);case Na:return this.Brackets(this.readSequence,t.recognizer);case Oo:return this.String();case bt:return this.Dimension();case pA:return this.Percentage();case at:return this.Number();case mt:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,t.recognizer);case fn:return this.Url();case _e:return this.cmpChar(this.tokenStart,eZ)&&this.cmpChar(this.tokenStart+1,iI)?this.UnicodeRange():this.Identifier();case It:{const e=this.charCodeAt(this.tokenStart);if(e===Z9||e===j9||e===iI||e===q9)return this.Operator();e===X9&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const tZ={getNode:sI},AZ=35,nZ=38,rZ=42,oZ=43,iZ=47,aI=46,sZ=62,aZ=124,lZ=126;function cZ(t,e){e.last!==null&&e.last.type!=="Combinator"&&t!==null&&t.type!=="Combinator"&&e.push({type:"Combinator",loc:null,name:" "})}function uZ(){switch(this.tokenType){case Na:return this.AttributeSelector();case jt:return this.IdSelector();case hn:return this.lookupType(1)===hn?this.PseudoElementSelector():this.PseudoClassSelector();case _e:return this.TypeSelector();case at:case pA:return this.Percentage();case bt:this.charCodeAt(this.tokenStart)===aI&&this.error("Identifier is expected",this.tokenStart+1);break;case It:{switch(this.charCodeAt(this.tokenStart)){case oZ:case sZ:case lZ:case iZ:return this.Combinator();case aI:return this.ClassSelector();case rZ:case aZ:return this.TypeSelector();case AZ:return this.IdSelector();case nZ:return this.NestingSelector()}break}}}const dZ={onWhiteSpace:cZ,getNode:uZ};function fZ(){return this.createSingleNodeList(this.Raw(null,!1))}function hZ(){const t=this.createList();if(this.skipSC(),t.push(this.Identifier()),this.skipSC(),this.tokenType===_r){t.push(this.Operator());const e=this.tokenIndex,A=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(A.type==="Value"&&A.children.isEmpty){for(let n=e-this.tokenIndex;n<=0;n++)if(this.lookupType(n)===bA){A.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}t.push(A)}return t}function lI(t){return t!==null&&t.type==="Operator"&&(t.value[t.value.length-1]==="-"||t.value[t.value.length-1]==="+")}const pZ={getNode:sI,onWhiteSpace(t,e){lI(t)&&(t.value=" "+t.value),lI(e.last)&&(e.last.value+=" ")},expression:fZ,var:hZ},mZ=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:tZ,Selector:dZ,Value:pZ},Symbol.toStringTag,{value:"Module"})),gZ=new Set(["none","and","not","or"]),BZ={parse:{prelude(){const t=this.createList();if(this.tokenType===_e){const e=this.substring(this.tokenStart,this.tokenEnd);gZ.has(e.toLowerCase())||t.push(this.Identifier())}return t.push(this.Condition("container")),t},block(t=!1){return this.Block(t)}}},yZ={parse:{prelude:null,block(){return this.Block(!0)}}};function uy(t,e){return this.parseWithFallback(()=>{try{return t.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==rt&&this.error()}},e||(()=>this.Raw(null,!0)))}const cI={layer(){this.skipSC();const t=this.createList(),e=uy.call(this,this.Layer);return(e.type!=="Raw"||e.value!=="")&&t.push(e),t},supports(){this.skipSC();const t=this.createList(),e=uy.call(this,this.Declaration,()=>uy.call(this,()=>this.Condition("supports")));return(e.type!=="Raw"||e.value!=="")&&t.push(e),t}},wZ={parse:{prelude(){const t=this.createList();switch(this.tokenType){case Oo:t.push(this.String());break;case fn:case mt:t.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===_e&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?t.push(this.Identifier()):this.tokenType===mt&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&t.push(this.Function(null,cI)),this.skipSC(),this.tokenType===mt&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&t.push(this.Function(null,cI)),(this.lookupNonWSType(0)===_e||this.lookupNonWSType(0)===$t)&&t.push(this.MediaQueryList()),t},block:null}},CZ={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},bZ={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(t=!1){return this.Block(t)}}},vZ={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},EZ={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},kZ={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(t=!1){return this.Block(t)}}},SZ={parse:{prelude:null,block(t=!1){return this.Block(t)}}},QZ={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(t=!1){return this.Block(t)}}},FZ={container:BZ,"font-face":yZ,import:wZ,layer:CZ,media:bZ,nest:vZ,page:EZ,scope:kZ,"starting-style":SZ,supports:QZ};function UZ(){const t=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case _e:t.push(this.Identifier());break;case Oo:t.push(this.String());break;case _r:t.push(this.Operator());break;case rt:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return t}const Is={parse(){return this.createSingleNodeList(this.SelectorList())}},dy={parse(){return this.createSingleNodeList(this.Selector())}},IZ={parse(){return this.createSingleNodeList(this.Identifier())}},xZ={parse:UZ},qf={parse(){return this.createSingleNodeList(this.Nth())}},TZ={dir:IZ,has:Is,lang:xZ,matches:Is,is:Is,"-moz-any":Is,"-webkit-any":Is,where:Is,not:Is,"nth-child":qf,"nth-last-child":qf,"nth-last-of-type":qf,"nth-of-type":qf,slotted:dy,host:dy,"host-context":dy},_Z=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:IQ,Atrule:_Q,AtrulePrelude:LQ,AttributeSelector:NQ,Block:$Q,Brackets:GQ,CDC:zQ,CDO:JQ,ClassSelector:jQ,Combinator:eF,Comment:AF,Condition:oF,Declaration:cF,DeclarationList:dF,Dimension:hF,Feature:mF,FeatureFunction:BF,FeatureRange:vF,Function:kF,GeneralEnclosed:QF,Hash:UF,IdSelector:_F,Identifier:xF,Layer:LF,LayerList:MF,MediaQuery:HF,MediaQueryList:PF,NestingSelector:$F,Nth:GF,Number:zF,Operator:JF,Parentheses:jF,Percentage:ZF,PseudoClassSelector:tU,PseudoElementSelector:nU,Ratio:sU,Raw:lU,Rule:dU,Scope:hU,Selector:mU,SelectorList:BU,String:bU,StyleSheet:kU,SupportsDeclaration:QU,TypeSelector:IU,UnicodeRange:DU,Url:MU,Value:HU,WhiteSpace:PU},Symbol.toStringTag,{value:"Module"})),DZ={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(t){return this.AtrulePrelude(t.atrule?String(t.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(t){return this.Condition(t.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:mZ,atrule:FZ,pseudo:TZ,node:_Z},LZ=J9(DZ);function Zf(t){const e={};for(const A of Object.keys(t)){let n=t[A];n&&(Array.isArray(n)||n instanceof mn?n=n.map(Zf):n.constructor===Object&&(n=Zf(n))),e[A]=n}return e}let OZ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Lr=(t=21)=>{let e="",A=t|0;for(;A--;)e+=OZ[Math.random()*64|0];return e};const uI=Lr(),Ic=new Set;function eh(t){return!!(t&&t.type==="Function"&&t.name==="anchor")}function Ni(t,e=!1){return LZ(t,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:A=>{e&&Ic.add(A)}})}function Qn(t){return V9(t,{mode:"spec"})}function MZ(t){return t.type==="Declaration"}function NZ(t){return t.toArray().reduce((e,A)=>A.type==="Operator"&&A.value===","?(e.push([]),e):(A.type==="Identifier"&&e[e.length-1].push(A),e),[[]])}function fy(t){return t?t.children.map(e=>{var A;let n;((A=e.children.last)==null?void 0:A.type)==="PseudoElementSelector"&&(e=Zf(e),n=Qn(e.children.last),e.children.pop());const r=Qn(e);return{selector:r+(n??""),elementPart:r,pseudoElementPart:n}}).toArray():[]}function HZ(){Ic.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${Ic.size===1?"a CSS parse error":"CSS parse errors"}.`),Ic.forEach(t=>{console.warn(t.formattedMessage)}),console.groupEnd())}function RZ(){Ic.clear()}const hy=[...GU,"anchor-scope","anchor-name"].reduce((t,e)=>(t[e]=`--${e}-${uI}`,t),{});function PZ(t,e){return MZ(t)&&hy[t.property]&&e?(e.children.appendData(kn(MA({},t),{property:hy[t.property]})),{updated:!0}):{}}function VZ(t){for(const e of t){let A=!1;const n=Ni(e.css,!0);Mi(n,{visit:"Declaration",enter(r){var o;const i=(o=this.rule)==null?void 0:o.block,{updated:a}=PZ(r,i);a&&(A=!0)}}),A&&(e.css=Qn(n),e.changed=!0)}return t.some(e=>e.changed===!0)}var dI=(t=>(t.All="all",t.None="none",t))(dI||{});function sr(t,e){var A;return e=(A=hy[e])!=null?A:e,(t instanceof HTMLElement?getComputedStyle(t):t.computedStyle).getPropertyValue(e).trim()}function Ga(t,e,A){return sr(t,e)===A}function $Z(t,{selector:e,pseudoElementPart:A}){const n=getComputedStyle(t,A),r=document.createElement("div"),o=document.createElement("style");r.id=`fake-pseudo-element-${Lr()}`;for(const a of Array.from(n)){const l=n.getPropertyValue(a);r.style.setProperty(a,l)}o.textContent+=`#${r.id}${A} { content: ${n.content}; }`,o.textContent+=`${e} { display: none !important; }`,document.head.append(o);const i=A==="::before"?"afterbegin":"beforeend";return t.insertAdjacentElement(i,r),{fakePseudoElement:r,sheet:o,computedStyle:n}}function KZ(t){let e=t;for(;e;){if(Ga(e,"overflow","scroll"))return e;e=e.parentElement}return e}function GZ(t){let e=KZ(t);return e===document.documentElement&&(e=null),e??{scrollTop:0,scrollLeft:0}}function WZ(t){const{elementPart:e,pseudoElementPart:A}=t,n=[];if(A&&!(A==="::before"||A==="::after"))return n;const r=Array.from(document.querySelectorAll(e));if(!A)return n.push(...r),n;for(const o of r){const{fakePseudoElement:i,sheet:a,computedStyle:l}=$Z(o,t),u=i.getBoundingClientRect(),{scrollY:f,scrollX:h}=globalThis,p=GZ(o);n.push({fakePseudoElement:i,computedStyle:l,removeFakePseudoElement(){i.remove(),a.remove()},contextElement:o,getBoundingClientRect(){const{scrollY:g,scrollX:B}=globalThis,{scrollTop:y,scrollLeft:b}=p;return DOMRect.fromRect({y:u.y+(f-g)+(p.scrollTop-y),x:u.x+(h-B)+(p.scrollLeft-b),width:u.width,height:u.height})}})}return n}function zZ(t,e){const A=sr(t,"anchor-name");return e?A.split(",").map(n=>n.trim()).includes(e):!A}function YZ(t,e){const A=sr(t,"anchor-scope");return A===e||A==="all"}const py=t=>Vt(null,null,function*(){var e,A,n;let r=yield(e=Rn.getOffsetParent)==null?void 0:e.call(Rn,t);return(yield(A=Rn.isElement)==null?void 0:A.call(Rn,r))||(r=(yield(n=Rn.getDocumentElement)==null?void 0:n.call(Rn,t))||window.document.documentElement),r}),fI="InvalidMimeType";function JZ(t){return!!((t.type==="text/css"||t.rel==="stylesheet")&&t.href)}function XZ(t){const e=new URL(t.href,document.baseURI);if(JZ(t)&&e.origin===location.origin)return e}function jZ(t){return Vt(this,null,function*(){return(yield Promise.all(t.map(e=>Vt(null,null,function*(){var A;if(!e.url)return e;if((A=e.el)!=null&&A.disabled)return null;try{const n=yield fetch(e.url.toString()),r=n.headers.get("content-type");if(!(r!=null&&r.startsWith("text/css"))){const i=new Error(`Error loading ${e.url}: expected content-type "text/css", got "${r}".`);throw i.name=fI,i}const o=yield n.text();return kn(MA({},e),{css:o})}catch(n){if(n instanceof Error&&n.name===fI)return console.warn(n),null;throw n}})))).filter(e=>e!==null)})}const hI='[style*="anchor"]',pI='[style*="position-area"]';function qZ(t){const e=t?t.filter(n=>n instanceof HTMLElement&&(n.matches(hI)||n.matches(pI))):Array.from(document.querySelectorAll([hI,pI].join(","))),A=[];return e.filter(n=>n instanceof HTMLElement).forEach(n=>{const r=Lr(12),o="data-has-inline-styles";n.setAttribute(o,r);const i=n.getAttribute("style"),a=`[${o}="${r}"] { ${i} }`;A.push({el:n,css:a})}),A}function ZZ(t,e){return Vt(this,null,function*(){const A=t??Array.from(document.querySelectorAll("link, style")),n=[];A.filter(i=>i instanceof HTMLElement).forEach(i=>{if(i.tagName.toLowerCase()==="link"){const a=XZ(i);a&&n.push({el:i,url:a})}i.tagName.toLowerCase()==="style"&&n.push({el:i,css:i.innerHTML})});const r=e?t??[]:void 0,o=qZ(r);return yield jZ([...n,...o])})}const eee="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let mI=(t=21)=>{let e="",A=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=eee[A[t]&63];return e};const gI="--pa-cascade-property",BI="data-anchor-position-wrapper",yI="data-pa-wrapper-for-",wI="POLYFILL-POSITION-AREA",tee=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","block-start","block-end","span-block-start","span-block-end","inline-start","inline-end","span-inline-start","span-inline-end","self-block-start","self-block-end","span-self-block-start","span-self-block-end","self-inline-start","self-inline-end","span-self-inline-start","span-self-inline-end","start","end","span-start","span-end","self-start","self-end","span-self-start","span-self-end"];function CI(t){return tee.includes(t)}const bI={left:[0,1,"Irrelevant"],center:[1,2,"Irrelevant"],right:[2,3,"Irrelevant"],"span-left":[0,2,"Irrelevant"],"span-right":[1,3,"Irrelevant"],"x-start":[0,1,"Physical"],"x-end":[2,3,"Physical"],"span-x-start":[0,2,"Physical"],"span-x-end":[1,3,"Physical"],"x-self-start":[0,1,"PhysicalSelf"],"x-self-end":[2,3,"PhysicalSelf"],"span-x-self-start":[0,2,"PhysicalSelf"],"span-x-self-end":[1,3,"PhysicalSelf"],"span-all":[0,3,"Irrelevant"],top:[0,1,"Irrelevant"],bottom:[2,3,"Irrelevant"],"span-top":[0,2,"Irrelevant"],"span-bottom":[1,3,"Irrelevant"],"y-start":[0,1,"Physical"],"y-end":[2,3,"Physical"],"span-y-start":[0,2,"Physical"],"span-y-end":[1,3,"Physical"],"y-self-start":[0,1,"PhysicalSelf"],"y-self-end":[2,3,"PhysicalSelf"],"span-y-self-start":[0,2,"PhysicalSelf"],"span-y-self-end":[1,3,"PhysicalSelf"],"block-start":[0,1,"Logical"],"block-end":[2,3,"Logical"],"span-block-start":[0,2,"Logical"],"span-block-end":[1,3,"Logical"],"inline-start":[0,1,"Logical"],"inline-end":[2,3,"Logical"],"span-inline-start":[0,2,"Logical"],"span-inline-end":[1,3,"Logical"],"self-block-start":[0,1,"LogicalSelf"],"self-block-end":[2,3,"LogicalSelf"],"span-self-block-start":[0,2,"LogicalSelf"],"span-self-block-end":[1,3,"LogicalSelf"],"self-inline-start":[0,1,"LogicalSelf"],"self-inline-end":[2,3,"LogicalSelf"],"span-self-inline-start":[0,2,"LogicalSelf"],"span-self-inline-end":[1,3,"LogicalSelf"],start:[0,1,"Logical"],end:[2,3,"Logical"],"span-start":[0,2,"Logical"],"span-end":[1,3,"Logical"],"self-start":[0,1,"LogicalSelf"],"self-end":[2,3,"LogicalSelf"],"span-self-start":[0,2,"LogicalSelf"],"span-self-end":[1,3,"LogicalSelf"]},Aee=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all"],nee=["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","span-all"],ree=["block-start","center","block-end","span-block-start","span-block-end","span-all"],oee=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],iee=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],see=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],vI=["start","center","end","span-start","span-end","span-all"],EI=["self-start","center","self-end","span-self-start","span-self-end","span-all"],aee=["block","top","bottom","y"],lee=["inline","left","right","x"];function my(t){const e=t.split("-");for(const A of e){if(aee.includes(A))return"block";if(lee.includes(A))return"inline"}return"ambiguous"}function cee(t,e){return e[0].includes(t[0])&&e[1].includes(t[1])||e[0].includes(t[1])&&e[1].includes(t[0])}const uee=[[Aee,nee],[ree,oee],[iee,see],[vI,vI],[EI,EI]];function dee(t){for(const e of uee)if(cee(t,e))return!0;return!1}const kI=t=>{const e=getComputedStyle(t);return{writingMode:e.writingMode,direction:e.direction}},fee=(t,e)=>Vt(null,null,function*(){const A=yield py(t);switch(e){case"Logical":case"Physical":return kI(A);case"LogicalSelf":case"PhysicalSelf":return kI(t);default:return null}}),gy=t=>t.reverse().map(e=>3-e),SI=(t,e)=>t==="Irrelevant"?e:t,hee=(t,e)=>Vt(null,[t,e],function*({block:A,inline:n},r){const o=SI(A[2],n[2]),i=yield fee(r,o),a={block:[A[0],A[1]],inline:[n[0],n[1]]};if(i){if(i.direction==="rtl"&&(a.inline=gy(a.inline)),i.writingMode.startsWith("vertical")){const l=a.block;a.block=a.inline,a.inline=l}if(i.writingMode.startsWith("sideways")){const l=a.block;a.block=a.inline,a.inline=l,i.writingMode.endsWith("lr")&&(a.block=gy(a.block))}i.writingMode.endsWith("rl")&&(a.inline=gy(a.inline))}return a}),pee=({block:t,inline:e})=>{const A=[0,"top","bottom",0],n=[0,"left","right",0];return{block:[A[t[0]],A[t[1]]],inline:[n[e[0]],n[e[1]]]}};function QI([t,e]){return t===0&&e===3?"center":t===0?"end":e===3?"start":"center"}function mee(t){return t.type==="Declaration"&&t.property==="position-area"}function gee(t){const e=t.value.children.toArray().map(({name:A})=>A);return e.length===1&&(my(e[0])==="ambiguous"?e.push(e[0]):e.push("span-all")),e}function Bee(t){if(!mee(t))return;const e=gee(t);if(!dee(e))return;const A={};switch(my(e[0])){case"block":A.block=e[0],A.inline=e[1];break;case"inline":A.inline=e[0],A.block=e[1];break;case"ambiguous":my(e[1])=="block"?(A.block=e[1],A.inline=e[0]):(A.inline=e[1],A.block=e[0]);break}const n={block:bI[A.block],inline:bI[A.inline]},r=`--pa-declaration-${mI(12)}`;return{values:A,grid:n,selectorUUID:r}}function yee(t,e){["justify-self","align-self"].forEach(A=>{e.children.appendData({type:"Declaration",property:A,value:{type:"Raw",value:`var(--pa-value-${A})`},important:!1})}),e.children.appendData({type:"Declaration",property:gI,value:{type:"Raw",value:t.selectorUUID},important:!1})}function wee(t,e){var A,n;let r;if(((A=t.parentElement)==null?void 0:A.tagName)===wI)r=t.parentElement;else{r=document.createElement(wI),r.style.display="grid",r.style.position="absolute";const o=getComputedStyle(t).pointerEvents;r.style.pointerEvents="none",t.style.pointerEvents=o,["top","left","right","bottom"].forEach(i=>{r.style.setProperty(i,`var(--pa-value-${i})`)}),(n=t.parentElement)==null||n.insertBefore(r,t),r.appendChild(t)}return r.setAttribute(`${yI}${e}`,""),r}function Cee(t,e,A){return Vt(this,null,function*(){const n=`--pa-target-${mI(12)}`,r=yield hee(e.grid,t),o=pee(r),i=SI(e.grid.block[2],e.grid.inline[2]),a=["LogicalSelf","PhysicalSelf"].includes(i)?r:e.grid,l={block:QI([a.block[0],a.block[1]]),inline:QI([a.inline[0],a.inline[1]])};return{insets:o,alignments:l,targetUUID:n,targetEl:t,anchorEl:A,wrapperEl:wee(t,n),values:e.values,grid:e.grid,selectorUUID:e.selectorUUID}})}function bee(t,e){return`
170
+ `+tI({source:e,line:n,column:r,baseLine:o,baseColumn:i},2)}})}function K9(t){const e=this.createList();let A=!1;const n={recognizer:t};for(;!this.eof;){switch(this.tokenType){case pn:this.next();continue;case bA:A=!0,this.next();continue}let r=t.getNode.call(this,n);if(r===void 0)break;A&&(t.onWhiteSpace&&t.onWhiteSpace.call(this,r,e,n),A=!1),e.push(r)}return A&&t.onWhiteSpace&&t.onWhiteSpace.call(this,null,e,n),e}const nI=()=>{},G9=33,W9=35,ly=59,rI=123,oI=0;function z9(t){return function(){return this[t]()}}function cy(t){const e=Object.create(null);for(const A of Object.keys(t)){const n=t[A],r=n.parse||n;r&&(e[A]=r)}return e}function Y9(t){const e={context:Object.create(null),features:Object.assign(Object.create(null),t.features),scope:Object.assign(Object.create(null),t.scope),atrule:cy(t.atrule),pseudo:cy(t.pseudo),node:cy(t.node)};for(const[A,n]of Object.entries(t.parseContext))switch(typeof n){case"function":e.context[A]=n;break;case"string":e.context[A]=z9(n);break}return MA(MA({config:e},e),e.node)}function J9(t){let e="",A="<unknown>",n=!1,r=nI,o=!1;const i=new UX,a=Object.assign(new IX,Y9(t||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:K9,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===rI?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===rI||l===ly?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===G9||l===ly?1:0},consumeUntilSemicolonIncluded(l){return l===ly?2:0},createList(){return new mn},createSingleNodeList(l){return new mn().appendData(l)},getFirstListNode(l){return l&&l.first},getLastListNode(l){return l&&l.last},parseWithFallback(l,u){const f=this.tokenIndex;try{return l.call(this)}catch(h){if(o)throw h;this.skip(f-this.tokenIndex);const p=u.call(this);return o=!0,r(h,p),o=!1,p}},lookupNonWSType(l){let u;do if(u=this.lookupType(l++),u!==bA&&u!==pn)return u;while(u!==oI);return oI},charCodeAt(l){return l>=0&&l<e.length?e.charCodeAt(l):0},substring(l,u){return e.substring(l,u)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,u){return CQ(e,l,u)},cmpStr(l,u,f){return Kf(e,l,u,f)},consume(l){const u=this.tokenStart;return this.eat(l),this.substrToCursor(u)},consumeFunctionName(){const l=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(mt),l},consumeNumber(l){const u=e.substring(this.tokenStart,bQ(e,this.tokenStart));return this.eat(l),u},eat(l){if(this.tokenType!==l){const u=EQ[l].slice(0,-6).replace(/-/g," ").replace(/^./,p=>p.toUpperCase());let f=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,h=this.tokenStart;switch(l){case _e:this.tokenType===mt||this.tokenType===fn?(h=this.tokenEnd-1,f="Identifier is expected but function found"):f="Identifier is expected";break;case qt:this.isDelim(W9)&&(this.next(),h++,f="Name is expected");break;case pA:this.tokenType===at&&(h=this.tokenEnd,f="Percent sign is expected");break}this.error(f,h)}this.next()},eatIdent(l){(this.tokenType!==_e||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,u){return n?i.getLocationRange(l,u,A):null},getLocationFromList(l){if(n){const u=this.getFirstListNode(l),f=this.getLastListNode(l);return i.getLocationRange(u!==null?u.loc.start.offset-i.startOffset:this.tokenStart,f!==null?f.loc.end.offset-i.startOffset:this.tokenStart,A)}return null},error(l,u){const f=typeof u<"u"&&u<e.length?i.getLocation(u):this.eof?i.getLocation(SX(e,e.length-1)):i.getLocation(this.tokenStart);throw new AI(l||"Unexpected input",e,f.offset,f.line,f.column,i.startLine,i.startColumn)}});return Object.assign(function(l,u){e=l,u=u||{},a.setSource(e,UQ),i.setSource(e,u.offset,u.line,u.column),A=u.filename||"<unknown>",n=!!u.positions,r=typeof u.onParseError=="function"?u.onParseError:nI,o=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:f="default",onComment:h}=u;if(!(f in a.context))throw new Error("Unknown context `"+f+"`");typeof h=="function"&&a.forEachToken((g,B,y)=>{if(g===pn){const b=a.getLocation(B,y),w=Kf(e,y-2,y,"*/")?e.slice(B+2,y-2):e.slice(B+2,y);h(w,b)}});const p=a.context[f].call(a,u);return a.eof||a.error(),p},{SyntaxError:AI,config:a.config})}const X9=35,j9=42,iI=43,q9=45,Z9=47,eZ=117;function sI(t){switch(this.tokenType){case qt:return this.Hash();case _r:return this.Operator();case $t:return this.Parentheses(this.readSequence,t.recognizer);case Na:return this.Brackets(this.readSequence,t.recognizer);case Oo:return this.String();case bt:return this.Dimension();case pA:return this.Percentage();case at:return this.Number();case mt:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,t.recognizer);case fn:return this.Url();case _e:return this.cmpChar(this.tokenStart,eZ)&&this.cmpChar(this.tokenStart+1,iI)?this.UnicodeRange():this.Identifier();case It:{const e=this.charCodeAt(this.tokenStart);if(e===Z9||e===j9||e===iI||e===q9)return this.Operator();e===X9&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const tZ={getNode:sI},AZ=35,nZ=38,rZ=42,oZ=43,iZ=47,aI=46,sZ=62,aZ=124,lZ=126;function cZ(t,e){e.last!==null&&e.last.type!=="Combinator"&&t!==null&&t.type!=="Combinator"&&e.push({type:"Combinator",loc:null,name:" "})}function uZ(){switch(this.tokenType){case Na:return this.AttributeSelector();case qt:return this.IdSelector();case hn:return this.lookupType(1)===hn?this.PseudoElementSelector():this.PseudoClassSelector();case _e:return this.TypeSelector();case at:case pA:return this.Percentage();case bt:this.charCodeAt(this.tokenStart)===aI&&this.error("Identifier is expected",this.tokenStart+1);break;case It:{switch(this.charCodeAt(this.tokenStart)){case oZ:case sZ:case lZ:case iZ:return this.Combinator();case aI:return this.ClassSelector();case rZ:case aZ:return this.TypeSelector();case AZ:return this.IdSelector();case nZ:return this.NestingSelector()}break}}}const dZ={onWhiteSpace:cZ,getNode:uZ};function fZ(){return this.createSingleNodeList(this.Raw(null,!1))}function hZ(){const t=this.createList();if(this.skipSC(),t.push(this.Identifier()),this.skipSC(),this.tokenType===_r){t.push(this.Operator());const e=this.tokenIndex,A=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(A.type==="Value"&&A.children.isEmpty){for(let n=e-this.tokenIndex;n<=0;n++)if(this.lookupType(n)===bA){A.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}t.push(A)}return t}function lI(t){return t!==null&&t.type==="Operator"&&(t.value[t.value.length-1]==="-"||t.value[t.value.length-1]==="+")}const pZ={getNode:sI,onWhiteSpace(t,e){lI(t)&&(t.value=" "+t.value),lI(e.last)&&(e.last.value+=" ")},expression:fZ,var:hZ},mZ=Object.freeze(Object.defineProperty({__proto__:null,AtrulePrelude:tZ,Selector:dZ,Value:pZ},Symbol.toStringTag,{value:"Module"})),gZ=new Set(["none","and","not","or"]),BZ={parse:{prelude(){const t=this.createList();if(this.tokenType===_e){const e=this.substring(this.tokenStart,this.tokenEnd);gZ.has(e.toLowerCase())||t.push(this.Identifier())}return t.push(this.Condition("container")),t},block(t=!1){return this.Block(t)}}},yZ={parse:{prelude:null,block(){return this.Block(!0)}}};function uy(t,e){return this.parseWithFallback(()=>{try{return t.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==rt&&this.error()}},e||(()=>this.Raw(null,!0)))}const cI={layer(){this.skipSC();const t=this.createList(),e=uy.call(this,this.Layer);return(e.type!=="Raw"||e.value!=="")&&t.push(e),t},supports(){this.skipSC();const t=this.createList(),e=uy.call(this,this.Declaration,()=>uy.call(this,()=>this.Condition("supports")));return(e.type!=="Raw"||e.value!=="")&&t.push(e),t}},wZ={parse:{prelude(){const t=this.createList();switch(this.tokenType){case Oo:t.push(this.String());break;case fn:case mt:t.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===_e&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?t.push(this.Identifier()):this.tokenType===mt&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&t.push(this.Function(null,cI)),this.skipSC(),this.tokenType===mt&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&t.push(this.Function(null,cI)),(this.lookupNonWSType(0)===_e||this.lookupNonWSType(0)===$t)&&t.push(this.MediaQueryList()),t},block:null}},CZ={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},bZ={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(t=!1){return this.Block(t)}}},vZ={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},EZ={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},kZ={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(t=!1){return this.Block(t)}}},SZ={parse:{prelude:null,block(t=!1){return this.Block(t)}}},QZ={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(t=!1){return this.Block(t)}}},FZ={container:BZ,"font-face":yZ,import:wZ,layer:CZ,media:bZ,nest:vZ,page:EZ,scope:kZ,"starting-style":SZ,supports:QZ};function UZ(){const t=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case _e:t.push(this.Identifier());break;case Oo:t.push(this.String());break;case _r:t.push(this.Operator());break;case rt:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return t}const Is={parse(){return this.createSingleNodeList(this.SelectorList())}},dy={parse(){return this.createSingleNodeList(this.Selector())}},IZ={parse(){return this.createSingleNodeList(this.Identifier())}},xZ={parse:UZ},qf={parse(){return this.createSingleNodeList(this.Nth())}},TZ={dir:IZ,has:Is,lang:xZ,matches:Is,is:Is,"-moz-any":Is,"-webkit-any":Is,where:Is,not:Is,"nth-child":qf,"nth-last-child":qf,"nth-last-of-type":qf,"nth-of-type":qf,slotted:dy,host:dy,"host-context":dy},_Z=Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:IQ,Atrule:_Q,AtrulePrelude:LQ,AttributeSelector:NQ,Block:$Q,Brackets:GQ,CDC:zQ,CDO:JQ,ClassSelector:jQ,Combinator:eF,Comment:AF,Condition:oF,Declaration:cF,DeclarationList:dF,Dimension:hF,Feature:mF,FeatureFunction:BF,FeatureRange:vF,Function:kF,GeneralEnclosed:QF,Hash:UF,IdSelector:_F,Identifier:xF,Layer:LF,LayerList:MF,MediaQuery:HF,MediaQueryList:PF,NestingSelector:$F,Nth:GF,Number:zF,Operator:JF,Parentheses:jF,Percentage:ZF,PseudoClassSelector:tU,PseudoElementSelector:nU,Ratio:sU,Raw:lU,Rule:dU,Scope:hU,Selector:mU,SelectorList:BU,String:bU,StyleSheet:kU,SupportsDeclaration:QU,TypeSelector:IU,UnicodeRange:DU,Url:MU,Value:HU,WhiteSpace:PU},Symbol.toStringTag,{value:"Module"})),DZ={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(t){return this.AtrulePrelude(t.atrule?String(t.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(t){return this.Condition(t.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:mZ,atrule:FZ,pseudo:TZ,node:_Z},LZ=J9(DZ);function Zf(t){const e={};for(const A of Object.keys(t)){let n=t[A];n&&(Array.isArray(n)||n instanceof mn?n=n.map(Zf):n.constructor===Object&&(n=Zf(n))),e[A]=n}return e}let OZ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Lr=(t=21)=>{let e="",A=t|0;for(;A--;)e+=OZ[Math.random()*64|0];return e};const uI=Lr(),Ic=new Set;function eh(t){return!!(t&&t.type==="Function"&&t.name==="anchor")}function Ni(t,e=!1){return LZ(t,{parseAtrulePrelude:!1,parseCustomProperty:!0,onParseError:A=>{e&&Ic.add(A)}})}function Qn(t){return V9(t,{mode:"spec"})}function MZ(t){return t.type==="Declaration"}function NZ(t){return t.toArray().reduce((e,A)=>A.type==="Operator"&&A.value===","?(e.push([]),e):(A.type==="Identifier"&&e[e.length-1].push(A),e),[[]])}function fy(t){return t?t.children.map(e=>{var A;let n;((A=e.children.last)==null?void 0:A.type)==="PseudoElementSelector"&&(e=Zf(e),n=Qn(e.children.last),e.children.pop());const r=Qn(e);return{selector:r+(n??""),elementPart:r,pseudoElementPart:n}}).toArray():[]}function HZ(){Ic.size>0&&(console.group(`The CSS anchor positioning polyfill was not applied due to ${Ic.size===1?"a CSS parse error":"CSS parse errors"}.`),Ic.forEach(t=>{console.warn(t.formattedMessage)}),console.groupEnd())}function RZ(){Ic.clear()}const hy=[...GU,"anchor-scope","anchor-name"].reduce((t,e)=>(t[e]=`--${e}-${uI}`,t),{});function PZ(t,e){return MZ(t)&&hy[t.property]&&e?(e.children.appendData(kn(MA({},t),{property:hy[t.property]})),{updated:!0}):{}}function VZ(t){for(const e of t){let A=!1;const n=Ni(e.css,!0);Mi(n,{visit:"Declaration",enter(r){var o;const i=(o=this.rule)==null?void 0:o.block,{updated:a}=PZ(r,i);a&&(A=!0)}}),A&&(e.css=Qn(n),e.changed=!0)}return t.some(e=>e.changed===!0)}var dI=(t=>(t.All="all",t.None="none",t))(dI||{});function sr(t,e){var A;return e=(A=hy[e])!=null?A:e,(t instanceof HTMLElement?getComputedStyle(t):t.computedStyle).getPropertyValue(e).trim()}function Ga(t,e,A){return sr(t,e)===A}function $Z(t,{selector:e,pseudoElementPart:A}){const n=getComputedStyle(t,A),r=document.createElement("div"),o=document.createElement("style");r.id=`fake-pseudo-element-${Lr()}`;for(const a of Array.from(n)){const l=n.getPropertyValue(a);r.style.setProperty(a,l)}o.textContent+=`#${r.id}${A} { content: ${n.content}; }`,o.textContent+=`${e} { display: none !important; }`,document.head.append(o);const i=A==="::before"?"afterbegin":"beforeend";return t.insertAdjacentElement(i,r),{fakePseudoElement:r,sheet:o,computedStyle:n}}function KZ(t){let e=t;for(;e;){if(Ga(e,"overflow","scroll"))return e;e=e.parentElement}return e}function GZ(t){let e=KZ(t);return e===document.documentElement&&(e=null),e??{scrollTop:0,scrollLeft:0}}function WZ(t){const{elementPart:e,pseudoElementPart:A}=t,n=[];if(A&&!(A==="::before"||A==="::after"))return n;const r=Array.from(document.querySelectorAll(e));if(!A)return n.push(...r),n;for(const o of r){const{fakePseudoElement:i,sheet:a,computedStyle:l}=$Z(o,t),u=i.getBoundingClientRect(),{scrollY:f,scrollX:h}=globalThis,p=GZ(o);n.push({fakePseudoElement:i,computedStyle:l,removeFakePseudoElement(){i.remove(),a.remove()},contextElement:o,getBoundingClientRect(){const{scrollY:g,scrollX:B}=globalThis,{scrollTop:y,scrollLeft:b}=p;return DOMRect.fromRect({y:u.y+(f-g)+(p.scrollTop-y),x:u.x+(h-B)+(p.scrollLeft-b),width:u.width,height:u.height})}})}return n}function zZ(t,e){const A=sr(t,"anchor-name");return e?A.split(",").map(n=>n.trim()).includes(e):!A}function YZ(t,e){const A=sr(t,"anchor-scope");return A===e||A==="all"}const py=t=>Vt(null,null,function*(){var e,A,n;let r=yield(e=Rn.getOffsetParent)==null?void 0:e.call(Rn,t);return(yield(A=Rn.isElement)==null?void 0:A.call(Rn,r))||(r=(yield(n=Rn.getDocumentElement)==null?void 0:n.call(Rn,t))||window.document.documentElement),r}),fI="InvalidMimeType";function JZ(t){return!!((t.type==="text/css"||t.rel==="stylesheet")&&t.href)}function XZ(t){const e=new URL(t.href,document.baseURI);if(JZ(t)&&e.origin===location.origin)return e}function jZ(t){return Vt(this,null,function*(){return(yield Promise.all(t.map(e=>Vt(null,null,function*(){var A;if(!e.url)return e;if((A=e.el)!=null&&A.disabled)return null;try{const n=yield fetch(e.url.toString()),r=n.headers.get("content-type");if(!(r!=null&&r.startsWith("text/css"))){const i=new Error(`Error loading ${e.url}: expected content-type "text/css", got "${r}".`);throw i.name=fI,i}const o=yield n.text();return kn(MA({},e),{css:o})}catch(n){if(n instanceof Error&&n.name===fI)return console.warn(n),null;throw n}})))).filter(e=>e!==null)})}const hI='[style*="anchor"]',pI='[style*="position-area"]';function qZ(t){const e=t?t.filter(n=>n instanceof HTMLElement&&(n.matches(hI)||n.matches(pI))):Array.from(document.querySelectorAll([hI,pI].join(","))),A=[];return e.filter(n=>n instanceof HTMLElement).forEach(n=>{const r=Lr(12),o="data-has-inline-styles";n.setAttribute(o,r);const i=n.getAttribute("style"),a=`[${o}="${r}"] { ${i} }`;A.push({el:n,css:a})}),A}function ZZ(t,e){return Vt(this,null,function*(){const A=t??Array.from(document.querySelectorAll("link, style")),n=[];A.filter(i=>i instanceof HTMLElement).forEach(i=>{if(i.tagName.toLowerCase()==="link"){const a=XZ(i);a&&n.push({el:i,url:a})}i.tagName.toLowerCase()==="style"&&n.push({el:i,css:i.innerHTML})});const r=e?t??[]:void 0,o=qZ(r);return yield jZ([...n,...o])})}const eee="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let mI=(t=21)=>{let e="",A=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=eee[A[t]&63];return e};const gI="--pa-cascade-property",BI="data-anchor-position-wrapper",yI="data-pa-wrapper-for-",wI="POLYFILL-POSITION-AREA",tee=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all","top","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","block-start","block-end","span-block-start","span-block-end","inline-start","inline-end","span-inline-start","span-inline-end","self-block-start","self-block-end","span-self-block-start","span-self-block-end","self-inline-start","self-inline-end","span-self-inline-start","span-self-inline-end","start","end","span-start","span-end","self-start","self-end","span-self-start","span-self-end"];function CI(t){return tee.includes(t)}const bI={left:[0,1,"Irrelevant"],center:[1,2,"Irrelevant"],right:[2,3,"Irrelevant"],"span-left":[0,2,"Irrelevant"],"span-right":[1,3,"Irrelevant"],"x-start":[0,1,"Physical"],"x-end":[2,3,"Physical"],"span-x-start":[0,2,"Physical"],"span-x-end":[1,3,"Physical"],"x-self-start":[0,1,"PhysicalSelf"],"x-self-end":[2,3,"PhysicalSelf"],"span-x-self-start":[0,2,"PhysicalSelf"],"span-x-self-end":[1,3,"PhysicalSelf"],"span-all":[0,3,"Irrelevant"],top:[0,1,"Irrelevant"],bottom:[2,3,"Irrelevant"],"span-top":[0,2,"Irrelevant"],"span-bottom":[1,3,"Irrelevant"],"y-start":[0,1,"Physical"],"y-end":[2,3,"Physical"],"span-y-start":[0,2,"Physical"],"span-y-end":[1,3,"Physical"],"y-self-start":[0,1,"PhysicalSelf"],"y-self-end":[2,3,"PhysicalSelf"],"span-y-self-start":[0,2,"PhysicalSelf"],"span-y-self-end":[1,3,"PhysicalSelf"],"block-start":[0,1,"Logical"],"block-end":[2,3,"Logical"],"span-block-start":[0,2,"Logical"],"span-block-end":[1,3,"Logical"],"inline-start":[0,1,"Logical"],"inline-end":[2,3,"Logical"],"span-inline-start":[0,2,"Logical"],"span-inline-end":[1,3,"Logical"],"self-block-start":[0,1,"LogicalSelf"],"self-block-end":[2,3,"LogicalSelf"],"span-self-block-start":[0,2,"LogicalSelf"],"span-self-block-end":[1,3,"LogicalSelf"],"self-inline-start":[0,1,"LogicalSelf"],"self-inline-end":[2,3,"LogicalSelf"],"span-self-inline-start":[0,2,"LogicalSelf"],"span-self-inline-end":[1,3,"LogicalSelf"],start:[0,1,"Logical"],end:[2,3,"Logical"],"span-start":[0,2,"Logical"],"span-end":[1,3,"Logical"],"self-start":[0,1,"LogicalSelf"],"self-end":[2,3,"LogicalSelf"],"span-self-start":[0,2,"LogicalSelf"],"span-self-end":[1,3,"LogicalSelf"]},Aee=["left","center","right","span-left","span-right","x-start","x-end","span-x-start","span-x-end","x-self-start","x-self-end","span-x-self-start","span-x-self-end","span-all"],nee=["top","center","bottom","span-top","span-bottom","y-start","y-end","span-y-start","span-y-end","y-self-start","y-self-end","span-y-self-start","span-y-self-end","span-all"],ree=["block-start","center","block-end","span-block-start","span-block-end","span-all"],oee=["inline-start","center","inline-end","span-inline-start","span-inline-end","span-all"],iee=["self-block-start","center","self-block-end","span-self-block-start","span-self-block-end","span-all"],see=["self-inline-start","center","self-inline-end","span-self-inline-start","span-self-inline-end","span-all"],vI=["start","center","end","span-start","span-end","span-all"],EI=["self-start","center","self-end","span-self-start","span-self-end","span-all"],aee=["block","top","bottom","y"],lee=["inline","left","right","x"];function my(t){const e=t.split("-");for(const A of e){if(aee.includes(A))return"block";if(lee.includes(A))return"inline"}return"ambiguous"}function cee(t,e){return e[0].includes(t[0])&&e[1].includes(t[1])||e[0].includes(t[1])&&e[1].includes(t[0])}const uee=[[Aee,nee],[ree,oee],[iee,see],[vI,vI],[EI,EI]];function dee(t){for(const e of uee)if(cee(t,e))return!0;return!1}const kI=t=>{const e=getComputedStyle(t);return{writingMode:e.writingMode,direction:e.direction}},fee=(t,e)=>Vt(null,null,function*(){const A=yield py(t);switch(e){case"Logical":case"Physical":return kI(A);case"LogicalSelf":case"PhysicalSelf":return kI(t);default:return null}}),gy=t=>t.reverse().map(e=>3-e),SI=(t,e)=>t==="Irrelevant"?e:t,hee=(t,e)=>Vt(null,[t,e],function*({block:A,inline:n},r){const o=SI(A[2],n[2]),i=yield fee(r,o),a={block:[A[0],A[1]],inline:[n[0],n[1]]};if(i){if(i.direction==="rtl"&&(a.inline=gy(a.inline)),i.writingMode.startsWith("vertical")){const l=a.block;a.block=a.inline,a.inline=l}if(i.writingMode.startsWith("sideways")){const l=a.block;a.block=a.inline,a.inline=l,i.writingMode.endsWith("lr")&&(a.block=gy(a.block))}i.writingMode.endsWith("rl")&&(a.inline=gy(a.inline))}return a}),pee=({block:t,inline:e})=>{const A=[0,"top","bottom",0],n=[0,"left","right",0];return{block:[A[t[0]],A[t[1]]],inline:[n[e[0]],n[e[1]]]}};function QI([t,e]){return t===0&&e===3?"center":t===0?"end":e===3?"start":"center"}function mee(t){return t.type==="Declaration"&&t.property==="position-area"}function gee(t){const e=t.value.children.toArray().map(({name:A})=>A);return e.length===1&&(my(e[0])==="ambiguous"?e.push(e[0]):e.push("span-all")),e}function Bee(t){if(!mee(t))return;const e=gee(t);if(!dee(e))return;const A={};switch(my(e[0])){case"block":A.block=e[0],A.inline=e[1];break;case"inline":A.inline=e[0],A.block=e[1];break;case"ambiguous":my(e[1])=="block"?(A.block=e[1],A.inline=e[0]):(A.inline=e[1],A.block=e[0]);break}const n={block:bI[A.block],inline:bI[A.inline]},r=`--pa-declaration-${mI(12)}`;return{values:A,grid:n,selectorUUID:r}}function yee(t,e){["justify-self","align-self"].forEach(A=>{e.children.appendData({type:"Declaration",property:A,value:{type:"Raw",value:`var(--pa-value-${A})`},important:!1})}),e.children.appendData({type:"Declaration",property:gI,value:{type:"Raw",value:t.selectorUUID},important:!1})}function wee(t,e){var A,n;let r;if(((A=t.parentElement)==null?void 0:A.tagName)===wI)r=t.parentElement;else{r=document.createElement(wI),r.style.display="grid",r.style.position="absolute";const o=getComputedStyle(t).pointerEvents;r.style.pointerEvents="none",t.style.pointerEvents=o,["top","left","right","bottom"].forEach(i=>{r.style.setProperty(i,`var(--pa-value-${i})`)}),(n=t.parentElement)==null||n.insertBefore(r,t),r.appendChild(t)}return r.setAttribute(`${yI}${e}`,""),r}function Cee(t,e,A){return Vt(this,null,function*(){const n=`--pa-target-${mI(12)}`,r=yield hee(e.grid,t),o=pee(r),i=SI(e.grid.block[2],e.grid.inline[2]),a=["LogicalSelf","PhysicalSelf"].includes(i)?r:e.grid,l={block:QI([a.block[0],a.block[1]]),inline:QI([a.inline[0],a.inline[1]])};return{insets:o,alignments:l,targetUUID:n,targetEl:t,anchorEl:A,wrapperEl:wee(t,n),values:e.values,grid:e.grid,selectorUUID:e.selectorUUID}})}function bee(t,e){return`
171
171
  [${BI}="${e}"][${yI}${t}] {
172
172
  --pa-value-top: var(${t}-top);
173
173
  --pa-value-left: var(${t}-left);