@pksep/yui 0.1.260 → 0.1.262

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.
@@ -612,7 +612,9 @@
612
612
  <rect width="14" height="12" fill="white" transform="translate(5 6)"/>
613
613
  </clipPath>
614
614
  </defs>
615
- `},remains:lO,reports:Hx,reset:_x,rightBig:v4,rightSmall:j4,search:U4,searchNormal:Q4,settings:x4,settingsDark:O4,shadedArrowDown:Kx,shadedArrowLeft:Fx,shadedArrowRight:kx,shadedArrowUp:zx,shippingTasks:px,shopping:Wx,sidebar:cO,slashCircle:iO,smile:sO,star:Jx,stepArrowDown:w4,stepArrowUp:G4,strikethrough:{name:"strikethrough",style:"solid",fill:"none",viewbox:"0 0 20 20",path:`
615
+ `},remains:lO,reports:Hx,reset:_x,rightBig:v4,rightSmall:j4,search:U4,searchNormal:Q4,settings:x4,settingsDark:O4,shadedArrowDown:Kx,shadedArrowLeft:Fx,shadedArrowRight:kx,shadedArrowUp:zx,shippingTasks:px,shopping:Wx,sidebar:cO,slashCircle:iO,smile:sO,star:Jx,stepArrowDown:w4,stepArrowUp:G4,storage:{name:"storage",style:"solid",path:`
616
+ <path d="M1 3.75V11H11V3.75L6 1L1 3.75Z" stroke="currentColor" stroke-width="0.75"/>
617
+ <path d="M6 11H3.5C3.22386 11 3 10.7761 3 10.5V8.5C3 8.22386 3.22386 8 3.5 8H6M6 11V8M6 11H8.5C8.77614 11 9 10.7761 9 10.5V8.5C9 8.22386 8.77614 8 8.5 8H6M7.5 5.5V7.5C7.5 7.77614 7.27614 8 7 8H5C4.72386 8 4.5 7.77614 4.5 7.5V5.5C4.5 5.22386 4.72386 5 5 5H7C7.27614 5 7.5 5.22386 7.5 5.5Z" stroke="currentColor" stroke-width="0.75"/>`,fill:"none",viewbox:"0 0 12 12"},strikethrough:{name:"strikethrough",style:"solid",fill:"none",viewbox:"0 0 20 20",path:`
616
618
  <path d="M13.6086 4.76597C12.6041 4.14353 11.4486 3.79293 10.2602 3.75C8.40078 3.75 6.68906 5.23729 6.68906 6.72458C6.68906 8.28521 7.87969 9.51889 10.2602 10.4982C13.0133 11.6226 13.9063 12.6019 13.9063 14.2718C13.9063 16.3748 11.6742 17.5 9.73984 17.5C8.4375 17.5 7.17188 17.1372 6.09375 16.4115M3.75 10.625H10H16.25" stroke="currentColor" stroke-width="1.5625" stroke-miterlimit="10" stroke-linecap="square" stroke-linejoin="round"/>
617
619
  `},supplierDatabase:hx,support:{name:"support",style:"line",fill:"none",path:`
618
620
  <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.6"/>
@@ -651,25 +653,25 @@
651
653
  <path d="M7.5 3.875V6.87499L9.5 7.87499" stroke="currentColor" stroke-width="0.999998" stroke-linecap="round" stroke-linejoin="round"/>
652
654
  `,viewbox:"0 0 15 15"},trash:tx,trashSmall:ix,underline:{name:"underline",style:"solid",fill:"none",viewbox:"0 0 20 20",path:`
653
655
  <path d="M15.625 18.748H4.375V17.498H15.625V18.748ZM6.6416 3.91797V11.8223C6.64171 13.6849 7.86387 15.0352 10 15.0352C12.1361 15.0351 13.3583 13.6849 13.3584 11.8223V3.91797H14.8965V11.9248C14.8964 14.5565 13.059 16.4531 10 16.4531C6.94102 16.4531 5.10363 14.5565 5.10352 11.9248V3.91797H6.6416Z" fill="currentColor"/>
654
- `},uploadCloud:nx,usersGroup:Xx,warehouse:Bx,wastes:Nx,writeDowns:Mx,zoomMinus:YO,zoomPlus:VO},Symbol.toStringTag,{value:"Module"})),NO=["data-testid","fill","viewBox"],MO=["innerHTML"],fO=o.defineComponent({__name:"Icon",props:{height:{},width:{},name:{},color:{},dataTestid:{default:"Icon"}},setup(e){const g=e,I=o.computed(()=>({color:g.color,width:`${g.width}px`,height:`${g.height}px`})),C=i=>i.replace(/-./g,A=>A[1].toUpperCase()),t=o.computed(()=>jy[C(g.name)]);return(i,A)=>{var n,l,s;return o.openBlock(),o.createElementBlock("svg",{class:"icon-yui-kit","data-testid":g.dataTestid,style:o.normalizeStyle(I.value),fill:(n=o.unref(jy)[C(g.name)])==null?void 0:n.fill,viewBox:((l=o.unref(jy)[C(g.name)])==null?void 0:l.viewbox)||"0 0 24 24"},[o.createElementVNode("g",{innerHTML:(s=t.value)==null?void 0:s.path},null,8,MO)],12,NO)}}}),Tg=(e,g)=>{const I=e.__vccOpts||e;for(const[C,t]of g)I[C]=t;return I},Mg=Tg(fO,[["__scopeId","data-v-938d45fe"]]),RO=["data-testid"],XO=["data-testid"],HO=o.defineComponent({__name:"Badges",props:{text:{},type:{default:zI.default},choosed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestid:{default:"Badges"}},emits:["choose","remove"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.reactive({choosed:C.choosed}),A=o.ref(null),n=()=>!!(A.value&&A.value.scrollWidth>A.value.clientWidth),l=o.ref(n()),s=o.computed(()=>({"base-yui-kit":!0,"default-yui-kit":C.type===zI.default,"blue-yui-kit":C.type===zI.blue,"light-blue-yui-kit":C.type===zI.lightBlue,"contrast-blue-yui-kit":C.type===zI.contrastBlue,"green-yui-kit":C.type===zI.green,"orange-yui-kit":C.type===zI.orange,"red-yui-kit":C.type===zI.red,"pink-yui-kit":C.type===zI.pink,"violet-yui-kit":C.type===zI.violet,"yellow-yui-kit":C.type===zI.yellow,"choosed-yui-kit":C.choosed||i.choosed,"disabled-yui-kit":C.type===zI.disabled})),a=()=>{t("choose",i.choosed,C.text),C.disabled||(i.choosed=!i.choosed)},d=()=>{t("remove",C.text)},m=new ResizeObserver(()=>{l.value=n()});return g({isSpanOverflow:l}),o.onMounted(()=>{A.value&&m.observe(A.value)}),(u,h)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(s.value),onClick:a,"data-testid":C.dataTestid},[o.createElementVNode("span",{ref_key:"spanRef",ref:A,class:"badges-text","data-testid":`${C.dataTestid}-BadgesText`},o.toDisplayString(C.text),9,XO),o.createVNode(Mg,{class:"close-icon",width:10,height:10,"data-testid":`${C.dataTestid}-Icon`,name:o.unref(ug).closeTag,color:"var(--text-neutral-color)",onClick:d},null,8,["data-testid","name"])],10,RO))}}),ot=Tg(HO,[["__scopeId","data-v-8043ecdc"]]),DO=["data-testid"],SO=["data-testid"],KO=["data-testid"],kO=["data-testid"],FO=["data-testid"],zO=["data-testid"],JO=["title","onClick","data-testid"],LO=["data-testid"],TO=["onClick","data-testid"],vO=["data-testid"],xy=25,Oy=Tg(o.defineComponent({__name:"BreadCrumbs",props:{items:{},dataTestid:{default:"BreadCrumbs"}},emits:["click"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({items:[],crumbs:o.computed(()=>{const d=I.items.length<4?I.items.length-1:3;let m=[I.items[0],...I.items.slice(-d)];return I.items.length===1&&(m=[I.items[0]]),m.map(u=>(u.isSub=!1,u))}),subCrumbs:o.computed(()=>I.items.slice(1,-3).map(d=>(d.isSub=!0,d))),getClassesLink:o.computed(()=>(d,m=!1)=>({"bread-crumbs-yui-kit__link":!0,"disabled-yui-kit":!d.path,active:m})),getClassesSpan:o.computed(()=>d=>({"checked-yui-kit":d===t.crumbs.length-1})),fullTitle:o.computed(()=>d=>d.title.length>xy),isShowList:!1}),i=o.computed(()=>({crumbs:{"bread-crumbs-yui-kit__item":!0},subcrumbs:{"bread-subcrumbs-yui-kit__item":!0}})),A=o.computed(()=>({crumbs:{"bread-subcrumbs-yui-kit":!0,"scroll-yui-kit":!0,"active-yui-kit":t.isShowList}})),n=(d,m)=>{m!==t.items.length-1&&(d.isSub&&l(),I.items.forEach(({path:u},h)=>{u===d.path&&C("click",{title:d.title,path:d.path,inx:h+1})}))},l=()=>t.isShowList=!t.isShowList,s=d=>d.title.length>xy?d.title.slice(0,xy).trim()+"...":d.title,a=d=>t.items.length>=5&&d===1;return o.onMounted(()=>t.items=t.crumbs.concat(t.subCrumbs)),(d,m)=>(o.openBlock(),o.createElementBlock("ul",{class:"bread-crumbs-yui-kit","data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.items,(u,h)=>(o.openBlock(),o.createElementBlock("li",{class:o.normalizeClass(i.value.crumbs),key:u.path,"data-testid":`${I.dataTestid}-Crumbs${h}`},[a(h)?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${I.dataTestid}-ShowSubList${h}`},[o.createElementVNode("span",{class:"bread-crumbs-yui-kit--closed",onClick:l,"data-testid":`${I.dataTestid}-Closed${h}`},"...",8,kO),o.createElementVNode("ul",{class:o.normalizeClass(A.value.crumbs),"data-testid":`${I.dataTestid}-Crumbs${h}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.subCrumbs,(Z,G)=>(o.openBlock(),o.createElementBlock("li",{key:Z.path,class:o.normalizeClass(i.value.subcrumbs),"data-testid":`${I.dataTestid}-SubCrumbs${G}`},[o.createElementVNode("span",{title:Z.title,onClick:w=>n(Z,G),class:o.normalizeClass({"disabled-yui-kit":!Z.path}),"data-testid":`${I.dataTestid}-SubCrumbs-Title${G}`},o.toDisplayString(s(Z)),11,JO)],10,zO))),128))],10,FO)],8,KO)):o.createCommentVNode("",!0),u.isSub?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.getClassesLink(u,h===t.crumbs.length-1)),"data-testid":`${I.dataTestid}-Classes${h}`},[o.createElementVNode("span",{class:o.normalizeClass(t.getClassesSpan(h)),onClick:Z=>n(u,h),"data-testid":`${I.dataTestid}-Checked${h}`},[o.createTextVNode(o.toDisplayString(h!==t.crumbs.length-1?s(u):u.title),1),t.fullTitle(u)&&h!==t.crumbs.length-1?(o.openBlock(),o.createElementBlock("span",{key:0,"data-testid":`${I.dataTestid}-FullName`,class:"fullName-yui-kit"},o.toDisplayString(u.title),9,vO)):o.createCommentVNode("",!0)],10,TO),h!==t.crumbs.length-1?(o.openBlock(),o.createBlock(Mg,{key:0,name:o.unref(ug).rightSmall,"data-testid":`${I.dataTestid}-Icon`},null,8,["name","data-testid"])):o.createCommentVNode("",!0)],10,LO))],10,SO))),128))],8,DO))}}),[["__scopeId","data-v-6c2ef4f4"]]);var Le=(e=>(e.small="small",e.medium="medium",e.large="large",e.little="little",e))(Le||{}),NI=(e=>(e.primary="primary",e.outline="outline",e.ghost="ghost",e.secondary="secondary",e.reject="reject",e.minor="minor",e))(NI||{});const jO=["disabled","data-testid"],xO=["data-testid"],OO=["data-testid"],QO=o.defineComponent({__name:"Button",props:{disabled:{type:Boolean,default:!1},size:{default:Le.medium},type:{default:NI.primary},pill:{type:Boolean,default:!1},backgroundColor:{},color:{default:""},dataTestid:{default:"Button"}},emits:["click"],setup(e,{emit:g}){const I=e,C=g,t=o.computed(()=>({"button-yui-kit":!0,[I.size]:!0,"disabled-yui-kit":I.disabled,"pill-yui-kit":I.pill,"primary-yui-kit":I.type===NI.primary,"secondary-yui-kit":I.type===NI.secondary,"outline-yui-kit":I.type===NI.outline,"reject-yui-kit":I.type===NI.reject,"ghost-yui-kit":I.type===NI.ghost,"minor-yui-kit":I.type===NI.minor})),i=o.computed(()=>({backgroundColor:I.backgroundColor})),A=o.computed(()=>({color:I.color==="primary"||I.color==="secondary"?"black":I.color})),n=l=>C("click",l);return(l,s)=>(o.openBlock(),o.createElementBlock("button",{class:o.normalizeClass(t.value),disabled:I.disabled,tabindex:"0",style:o.normalizeStyle(i.value),"data-testid":I.dataTestid,onClick:n,onKeyup:o.withKeys(n,["enter"])},[l.$slots["left-icon"]?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(A.value),"data-testid":`${I.dataTestid}-LeftIcon`},[o.renderSlot(l.$slots,"left-icon",{},void 0,!0)],12,xO)):o.createCommentVNode("",!0),o.renderSlot(l.$slots,"default",{},void 0,!0),l.$slots["right-icon"]?(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle(A.value),"data-testid":`${I.dataTestid}-RightIcon`},[o.renderSlot(l.$slots,"right-icon",{},void 0,!0)],12,OO)):o.createCommentVNode("",!0)],46,jO))}}),JI=Tg(QO,[["__scopeId","data-v-4529c65c"]]),UO=["data-testid"],EO=["data-testid","onClick"],bw=Tg(o.defineComponent({__name:"Switch",props:{items:{},defaultValue:{},isIcons:{type:Boolean},disabled:{type:Boolean},theme:{default:"default"},dataTestid:{default:"Switch"}},emits:["change"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({activeIndex:0}),i=o.computed(()=>[{"switch-yui-kit-list_default":I.theme==="default","switch-yui-kit-list_contrast":I.theme==="contrast","switch-yui-kit-list_disabled":I.disabled}]),A=a=>({"switch-yui-kit-item":!0,"switch-yui-kit-active":t.activeIndex===a,"switch-yui-kit-active_disabled":t.activeIndex===a&&I.disabled,"switch-yui-kit-item_disabled":I.disabled}),n=a=>typeof a=="string"?a:a.label,l=a=>typeof a=="string"?a:a.value,s=a=>{t.activeIndex!==a&&(t.activeIndex=a,C("change",{index:a,value:l(I.items[a])}))};return o.watch(()=>I.defaultValue,()=>{t.activeIndex=I.defaultValue?I.items.findIndex(a=>l(a)===I.defaultValue)??0:0}),o.onMounted(()=>{if(I.defaultValue){const a=I.items.findIndex(d=>l(d)===I.defaultValue);a!==-1&&(t.activeIndex=a)}}),(a,d)=>(o.openBlock(),o.createElementBlock("ul",{class:o.normalizeClass(["switch-yui-kit-list",i.value]),"data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.items,(m,u)=>(o.openBlock(),o.createElementBlock("li",{key:u,class:o.normalizeClass(A(u)),"data-testid":`${I.dataTestid}-Item${u}`,onClick:h=>s(u)},[I.isIcons?(o.openBlock(),o.createBlock(Mg,{key:0,name:m,"data-testid":`${I.dataTestid}-Item-Icon${u}`},null,8,["name","data-testid"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[m.icon?(o.openBlock(),o.createBlock(Mg,{key:0,class:"switch-yui-kit-item-icon",name:m.icon,"data-testid":`${I.dataTestid}-Item-Icon${u}`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(n(m)),1)],64))],10,EO))),128))],10,UO))}}),[["__scopeId","data-v-0f7dea38"]]);function hC(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function Hg(e){return typeof e=="function"?e():o.unref(e)}const gn={mounted:"mounted",updated:"updated",unmounted:"unmounted"},In=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zw=e=>e!=null,PO=Object.prototype.toString,qR=e=>PO.call(e)==="[object Object]",Gw=()=>+Date.now(),Qy=(e,g,I)=>Math.min(I,Math.max(g,e)),me=()=>{},ww=_O();function _O(){var e,g;return In&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((g=window==null?void 0:window.navigator)==null?void 0:g.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fh(e,g){function I(...C){return new Promise((t,i)=>{Promise.resolve(e(()=>g.apply(this,C),{fn:g,thisArg:this,args:C})).then(t).catch(i)})}return I}const Uy=e=>e();function $O(e,g={}){let I,C,t=me;const i=n=>{clearTimeout(n),t(),t=me};return n=>{const l=Hg(e),s=Hg(g.maxWait);return I&&i(I),l<=0||s!==void 0&&s<=0?(C&&(i(C),C=null),Promise.resolve(n())):new Promise((a,d)=>{t=g.rejectOnCancel?d:a,s&&!C&&(C=setTimeout(()=>{I&&i(I),C=null,a(n())},s)),I=setTimeout(()=>{C&&i(C),C=null,a(n())},l)})}}function gX(...e){let g=0,I,C=!0,t=me,i,A,n,l,s;!o.isRef(e[0])&&typeof e[0]=="object"?{delay:A,trailing:n=!0,leading:l=!0,rejectOnCancel:s=!1}=e[0]:[A,n=!0,l=!0,s=!1]=e;const a=()=>{I&&(clearTimeout(I),I=void 0,t(),t=me)};return m=>{const u=Hg(A),h=Date.now()-g,Z=()=>i=m();return a(),u<=0?(g=Date.now(),Z()):(h>u&&(l||!C)?(g=Date.now(),Z()):n&&(i=new Promise((G,w)=>{t=s?w:G,I=setTimeout(()=>{g=Date.now(),C=!0,G(Z()),a()},Math.max(0,u-h))})),!l&&!I&&(I=setTimeout(()=>C=!0,u)),C=!1,i)}}function qO(e=Uy){const g=o.ref(!0);function I(){g.value=!1}function C(){g.value=!0}const t=(...i)=>{g.value&&e(...i)};return{isActive:o.readonly(g),pause:I,resume:C,eventFilter:t}}function Ey(e,g=!1,I="Timeout"){return new Promise((C,t)=>{setTimeout(g?()=>t(I):C,e)})}function gQ(e){let g;function I(){return g||(g=e()),g}return I.reset=async()=>{const C=g;g=void 0,C&&await C},I}function IQ(e,g,I=!1){return g.reduce((C,t)=>(t in e&&(!I||e[t]!==void 0)&&(C[t]=e[t]),C),{})}function eQ(e){return Object.entries(e)}function IX(e){return o.getCurrentInstance()}function Ww(...e){if(e.length!==1)return o.toRef(...e);const g=e[0];return typeof g=="function"?o.readonly(o.customRef(()=>({get:g,set:me}))):o.ref(g)}function eX(e,g=200,I={}){return Fh($O(g,I),e)}function CQ(e,g=200,I=!1,C=!0,t=!1){return Fh(gX(g,I,C,t),e)}function tQ(e,g,I={}){const{eventFilter:C=Uy,...t}=I;return o.watch(e,Fh(C,g),t)}function pw(e,g,I={}){const{eventFilter:C,...t}=I,{eventFilter:i,pause:A,resume:n,isActive:l}=qO(C);return{stop:tQ(e,g,{...t,eventFilter:i}),pause:A,resume:n,isActive:l}}function CX(e,g,...[I]){const{flush:C="sync",deep:t=!1,immediate:i=!0,direction:A="both",transform:n={}}=I||{},l=[],s="ltr"in n&&n.ltr||(m=>m),a="rtl"in n&&n.rtl||(m=>m);return(A==="both"||A==="ltr")&&l.push(pw(e,m=>{l.forEach(u=>u.pause()),g.value=s(m),l.forEach(u=>u.resume())},{flush:C,deep:t,immediate:i})),(A==="both"||A==="rtl")&&l.push(pw(g,m=>{l.forEach(u=>u.pause()),e.value=a(m),l.forEach(u=>u.resume())},{flush:C,deep:t,immediate:i})),()=>{l.forEach(m=>m.stop())}}function tX(e,g={}){if(!o.isRef(e))return o.toRefs(e);const I=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const C in e.value)I[C]=o.customRef(()=>({get(){return e.value[C]},set(t){var i;if((i=Hg(g.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const n=[...e.value];n[C]=t,e.value=n}else{const n={...e.value,[C]:t};Object.setPrototypeOf(n,Object.getPrototypeOf(e.value)),e.value=n}else e.value[C]=t}}));return I}function Jl(e,g=!0,I){IX()?o.onMounted(e,I):g?e():o.nextTick(e)}function iQ(e,g){IX()&&o.onUnmounted(e,g)}function Py(e,g=!1){function I(d,{flush:m="sync",deep:u=!1,timeout:h,throwOnTimeout:Z}={}){let G=null;const p=[new Promise(B=>{G=o.watch(e,y=>{d(y)!==g&&(G?G():o.nextTick(()=>G==null?void 0:G()),B(y))},{flush:m,deep:u,immediate:!0})})];return h!=null&&p.push(Ey(h,Z).then(()=>Hg(e)).finally(()=>G==null?void 0:G())),Promise.race(p)}function C(d,m){if(!o.isRef(d))return I(y=>y===d,m);const{flush:u="sync",deep:h=!1,timeout:Z,throwOnTimeout:G}=m??{};let w=null;const B=[new Promise(y=>{w=o.watch([e,d],([Y,f])=>{g!==(Y===f)&&(w?w():o.nextTick(()=>w==null?void 0:w()),y(Y))},{flush:u,deep:h,immediate:!0})})];return Z!=null&&B.push(Ey(Z,G).then(()=>Hg(e)).finally(()=>(w==null||w(),Hg(e)))),Promise.race(B)}function t(d){return I(m=>!!m,d)}function i(d){return C(null,d)}function A(d){return C(void 0,d)}function n(d){return I(Number.isNaN,d)}function l(d,m){return I(u=>{const h=Array.from(u);return h.includes(d)||h.includes(Hg(d))},m)}function s(d){return a(1,d)}function a(d=1,m){let u=-1;return I(()=>(u+=1,u>=d),m)}return Array.isArray(Hg(e))?{toMatch:I,toContains:l,changed:s,changedTimes:a,get not(){return Py(e,!g)}}:{toMatch:I,toBe:C,toBeTruthy:t,toBeNull:i,toBeNaN:n,toBeUndefined:A,changed:s,changedTimes:a,get not(){return Py(e,!g)}}}function _y(e){return Py(e)}function iX(e,g=1e3,I={}){const{immediate:C=!0,immediateCallback:t=!1}=I;let i=null;const A=o.ref(!1);function n(){i&&(clearInterval(i),i=null)}function l(){A.value=!1,n()}function s(){const a=Hg(g);a<=0||(A.value=!0,t&&e(),n(),i=setInterval(e,a))}if(C&&In&&s(),o.isRef(g)||typeof g=="function"){const a=o.watch(g,()=>{A.value&&In&&s()});hC(a)}return hC(l),{isActive:A,pause:l,resume:s}}function AQ(e,g,I={}){const{immediate:C=!0}=I,t=o.ref(!1);let i=null;function A(){i&&(clearTimeout(i),i=null)}function n(){t.value=!1,A()}function l(...s){A(),t.value=!0,i=setTimeout(()=>{t.value=!1,i=null,e(...s)},Hg(g))}return C&&(t.value=!0,In&&l()),hC(n),{isPending:o.readonly(t),start:l,stop:n}}function nQ(e=!1,g={}){const{truthyValue:I=!0,falsyValue:C=!1}=g,t=o.isRef(e),i=o.ref(e);function A(n){if(arguments.length)return i.value=n,i.value;{const l=Hg(I);return i.value=i.value===l?Hg(C):l,i.value}}return t?A:[i,A]}const OI=In?window:void 0,$y=In?window.document:void 0,zh=In?window.navigator:void 0;function Ve(e){var g;const I=Hg(e);return(g=I==null?void 0:I.$el)!=null?g:I}function _g(...e){let g,I,C,t;if(typeof e[0]=="string"||Array.isArray(e[0])?([I,C,t]=e,g=OI):[g,I,C,t]=e,!g)return me;Array.isArray(I)||(I=[I]),Array.isArray(C)||(C=[C]);const i=[],A=()=>{i.forEach(a=>a()),i.length=0},n=(a,d,m,u)=>(a.addEventListener(d,m,u),()=>a.removeEventListener(d,m,u)),l=o.watch(()=>[Ve(g),Hg(t)],([a,d])=>{if(A(),!a)return;const m=qR(d)?{...d}:d;i.push(...I.flatMap(u=>C.map(h=>n(a,u,h,m))))},{immediate:!0,flush:"post"}),s=()=>{l(),A()};return hC(s),s}let AX=!1;function lQ(e,g,I={}){const{window:C=OI,ignore:t=[],capture:i=!0,detectIframe:A=!1}=I;if(!C)return me;ww&&!AX&&(AX=!0,Array.from(C.document.body.children).forEach(u=>u.addEventListener("click",me)),C.document.documentElement.addEventListener("click",me));let n=!0;const l=u=>Hg(t).some(h=>{if(typeof h=="string")return Array.from(C.document.querySelectorAll(h)).some(Z=>Z===u.target||u.composedPath().includes(Z));{const Z=Ve(h);return Z&&(u.target===Z||u.composedPath().includes(Z))}}),s=u=>{const h=Ve(e);if(!(!h||h===u.target||u.composedPath().includes(h))){if(u.detail===0&&(n=!l(u)),!n){n=!0;return}g(u)}};let a=!1;const d=[_g(C,"click",u=>{a||(a=!0,setTimeout(()=>{a=!1},0),s(u))},{passive:!0,capture:i}),_g(C,"pointerdown",u=>{const h=Ve(e);n=!l(u)&&!!(h&&!u.composedPath().includes(h))},{passive:!0}),A&&_g(C,"blur",u=>{setTimeout(()=>{var h;const Z=Ve(e);((h=C.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(Z!=null&&Z.contains(C.document.activeElement))&&g(u)},0)})].filter(Boolean);return()=>d.forEach(u=>u())}function oQ(){const e=o.ref(!1),g=o.getCurrentInstance();return g&&o.onMounted(()=>{e.value=!0},g),e}function ii(e){const g=oQ();return o.computed(()=>(g.value,!!e()))}function nX(e,g,I={}){const{window:C=OI,...t}=I;let i;const A=ii(()=>C&&"MutationObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const m=Hg(e),u=(Array.isArray(m)?m:[m]).map(Ve).filter(Zw);return new Set(u)}),s=o.watch(()=>l.value,m=>{n(),A.value&&m.size&&(i=new MutationObserver(g),m.forEach(u=>i.observe(u,t)))},{immediate:!0,flush:"post"}),a=()=>i==null?void 0:i.takeRecords(),d=()=>{s(),n()};return hC(d),{isSupported:A,stop:d,takeRecords:a}}function sQ(e={}){var g;const{window:I=OI,deep:C=!0,triggerOnRemoval:t=!1}=e,i=(g=e.document)!=null?g:I==null?void 0:I.document,A=()=>{var s;let a=i==null?void 0:i.activeElement;if(C)for(;a!=null&&a.shadowRoot;)a=(s=a==null?void 0:a.shadowRoot)==null?void 0:s.activeElement;return a},n=o.ref(),l=()=>{n.value=A()};return I&&(_g(I,"blur",s=>{s.relatedTarget===null&&l()},!0),_g(I,"focus",l,!0)),t&&nX(i,s=>{s.filter(a=>a.removedNodes.length).map(a=>Array.from(a.removedNodes)).flat().forEach(a=>{a===n.value&&l()})},{childList:!0,subtree:!0}),l(),n}function lX(e,g={}){const{immediate:I=!0,fpsLimit:C=void 0,window:t=OI}=g,i=o.ref(!1),A=C?1e3/C:null;let n=0,l=null;function s(m){if(!i.value||!t)return;n||(n=m);const u=m-n;if(A&&u<A){l=t.requestAnimationFrame(s);return}n=m,e({delta:u,timestamp:m}),l=t.requestAnimationFrame(s)}function a(){!i.value&&t&&(i.value=!0,n=0,l=t.requestAnimationFrame(s))}function d(){i.value=!1,l!=null&&t&&(t.cancelAnimationFrame(l),l=null)}return I&&a(),hC(d),{isActive:o.readonly(i),pause:d,resume:a}}function aQ(e={}){const{navigator:g=zh}=e,I=["chargingchange","chargingtimechange","dischargingtimechange","levelchange"],C=ii(()=>g&&"getBattery"in g&&typeof g.getBattery=="function"),t=o.ref(!1),i=o.ref(0),A=o.ref(0),n=o.ref(1);let l;function s(){t.value=this.charging,i.value=this.chargingTime||0,A.value=this.dischargingTime||0,n.value=this.level}return C.value&&g.getBattery().then(a=>{l=a,s.call(l),_g(l,I,s,{passive:!0})}),{isSupported:C,charging:t,chargingTime:i,dischargingTime:A,level:n}}function ds(e,g={}){const{window:I=OI}=g,C=ii(()=>I&&"matchMedia"in I&&typeof I.matchMedia=="function");let t;const i=o.ref(!1),A=s=>{i.value=s.matches},n=()=>{t&&("removeEventListener"in t?t.removeEventListener("change",A):t.removeListener(A))},l=o.watchEffect(()=>{C.value&&(n(),t=I.matchMedia(Hg(e)),"addEventListener"in t?t.addEventListener("change",A):t.addListener(A),i.value=t.matches)});return hC(()=>{l(),n(),t=void 0}),i}const oX=["hash","host","hostname","href","pathname","port","protocol","search"];function dQ(e={}){const{window:g=OI}=e,I=Object.fromEntries(oX.map(i=>[i,o.ref()]));for(const[i,A]of eQ(I))o.watch(A,n=>{!(g!=null&&g.location)||g.location[i]===n||(g.location[i]=n)});const C=i=>{var A;const{state:n,length:l}=(g==null?void 0:g.history)||{},{origin:s}=(g==null?void 0:g.location)||{};for(const a of oX)I[a].value=(A=g==null?void 0:g.location)==null?void 0:A[a];return o.reactive({trigger:i,state:n,length:l,origin:s,...I})},t=o.ref(C("load"));return g&&(_g(g,"popstate",()=>t.value=C("popstate"),{passive:!0}),_g(g,"hashchange",()=>t.value=C("hashchange"),{passive:!0})),t}function qy(e,g={}){const{controls:I=!1,navigator:C=zh}=g,t=ii(()=>C&&"permissions"in C),i=o.shallowRef(),A=typeof e=="string"?{name:e}:e,n=o.shallowRef(),l=()=>{var a,d;n.value=(d=(a=i.value)==null?void 0:a.state)!=null?d:"prompt"};_g(i,"change",l);const s=gQ(async()=>{if(t.value){if(!i.value)try{i.value=await C.permissions.query(A)}catch{i.value=void 0}finally{l()}if(I)return o.toRaw(i.value)}});return s(),I?{state:n,isSupported:t,query:s}:n}function cQ(e={}){const{navigator:g=zh,read:I=!1,source:C,copiedDuring:t=1500,legacy:i=!1}=e,A=ii(()=>g&&"clipboard"in g),n=qy("clipboard-read"),l=qy("clipboard-write"),s=o.computed(()=>A.value||i),a=o.ref(""),d=o.ref(!1),m=AQ(()=>d.value=!1,t);function u(){A.value&&w(n.value)?g.clipboard.readText().then(p=>{a.value=p}):a.value=G()}s.value&&I&&_g(["copy","cut"],u);async function h(p=Hg(C)){s.value&&p!=null&&(A.value&&w(l.value)?await g.clipboard.writeText(p):Z(p),a.value=p,d.value=!0,m.start())}function Z(p){const B=document.createElement("textarea");B.value=p??"",B.style.position="absolute",B.style.opacity="0",document.body.appendChild(B),B.select(),document.execCommand("copy"),B.remove()}function G(){var p,B,y;return(y=(B=(p=document==null?void 0:document.getSelection)==null?void 0:p.call(document))==null?void 0:B.toString())!=null?y:""}function w(p){return p==="granted"||p==="prompt"}return{isSupported:s,text:a,copied:d,copy:h}}const Bw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yw="__vueuse_ssr_handlers__",rQ=mQ();function mQ(){return yw in Bw||(Bw[yw]=Bw[yw]||{}),Bw[yw]}function sX(e,g){return rQ[e]||g}function gY(e){return ds("(prefers-color-scheme: dark)",e)}function uQ(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const hQ={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},aX="vueuse-storage";function dX(e,g,I,C={}){var t;const{flush:i="pre",deep:A=!0,listenToStorageChanges:n=!0,writeDefaults:l=!0,mergeDefaults:s=!1,shallow:a,window:d=OI,eventFilter:m,onError:u=X=>{console.error(X)},initOnMounted:h}=C,Z=(a?o.shallowRef:o.ref)(typeof g=="function"?g():g);if(!I)try{I=sX("getDefaultStorage",()=>{var X;return(X=OI)==null?void 0:X.localStorage})()}catch(X){u(X)}if(!I)return Z;const G=Hg(g),w=uQ(G),p=(t=C.serializer)!=null?t:hQ[w],{pause:B,resume:y}=pw(Z,()=>f(Z.value),{flush:i,deep:A,eventFilter:m});d&&n&&Jl(()=>{I instanceof Storage?_g(d,"storage",K):_g(d,aX,F),h&&K()}),h||K();function Y(X,z){if(d){const L={key:e,oldValue:X,newValue:z,storageArea:I};d.dispatchEvent(I instanceof Storage?new StorageEvent("storage",L):new CustomEvent(aX,{detail:L}))}}function f(X){try{const z=I.getItem(e);if(X==null)Y(z,null),I.removeItem(e);else{const L=p.write(X);z!==L&&(I.setItem(e,L),Y(z,L))}}catch(z){u(z)}}function M(X){const z=X?X.newValue:I.getItem(e);if(z==null)return l&&G!=null&&I.setItem(e,p.write(G)),G;if(!X&&s){const L=p.read(z);return typeof s=="function"?s(L,G):w==="object"&&!Array.isArray(L)?{...G,...L}:L}else return typeof z!="string"?z:p.read(z)}function K(X){if(!(X&&X.storageArea!==I)){if(X&&X.key==null){Z.value=G;return}if(!(X&&X.key!==e)){B();try{(X==null?void 0:X.newValue)!==p.write(Z.value)&&(Z.value=M(X))}catch(z){u(z)}finally{X?o.nextTick(y):y()}}}}function F(X){K(X.detail)}return Z}const bQ="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function ZQ(e={}){const{selector:g="html",attribute:I="class",initialValue:C="auto",window:t=OI,storage:i,storageKey:A="vueuse-color-scheme",listenToStorageChanges:n=!0,storageRef:l,emitAuto:s,disableTransition:a=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},m=gY({window:t}),u=o.computed(()=>m.value?"dark":"light"),h=l||(A==null?Ww(C):dX(A,C,i,{window:t,listenToStorageChanges:n})),Z=o.computed(()=>h.value==="auto"?u.value:h.value),G=sX("updateHTMLAttrs",(y,Y,f)=>{const M=typeof y=="string"?t==null?void 0:t.document.querySelector(y):Ve(y);if(!M)return;const K=new Set,F=new Set;let X=null;if(Y==="class"){const L=f.split(/\s/g);Object.values(d).flatMap(O=>(O||"").split(/\s/g)).filter(Boolean).forEach(O=>{L.includes(O)?K.add(O):F.add(O)})}else X={key:Y,value:f};if(K.size===0&&F.size===0&&X===null)return;let z;a&&(z=t.document.createElement("style"),z.appendChild(document.createTextNode(bQ)),t.document.head.appendChild(z));for(const L of K)M.classList.add(L);for(const L of F)M.classList.remove(L);X&&M.setAttribute(X.key,X.value),a&&(t.getComputedStyle(z).opacity,document.head.removeChild(z))});function w(y){var Y;G(g,I,(Y=d[y])!=null?Y:y)}function p(y){e.onChanged?e.onChanged(y,w):w(y)}o.watch(Z,p,{flush:"post",immediate:!0}),Jl(()=>p(Z.value));const B=o.computed({get(){return s?h.value:Z.value},set(y){h.value=y}});try{return Object.assign(B,{store:h,system:u,state:Z})}catch{return B}}function GQ(e={}){const{valueDark:g="dark",valueLight:I="",window:C=OI}=e,t=ZQ({...e,onChanged:(n,l)=>{var s;e.onChanged?(s=e.onChanged)==null||s.call(e,n==="dark",l,n):l(n)},modes:{dark:g,light:I}}),i=o.computed(()=>t.system?t.system.value:gY({window:C}).value?"dark":"light");return o.computed({get(){return t.value==="dark"},set(n){const l=n?"dark":"light";i.value===l?t.value="auto":t.value=l}})}function wQ(e={}){const{window:g=OI,eventFilter:I=Uy}=e,C=o.ref({x:null,y:null,z:null}),t=o.ref({alpha:null,beta:null,gamma:null}),i=o.ref(0),A=o.ref({x:null,y:null,z:null});if(g){const n=Fh(I,l=>{C.value=l.acceleration,A.value=l.accelerationIncludingGravity,t.value=l.rotationRate,i.value=l.interval});_g(g,"devicemotion",n)}return{acceleration:C,accelerationIncludingGravity:A,rotationRate:t,interval:i}}function WQ(e={}){const{window:g=OI}=e,I=ii(()=>g&&"DeviceOrientationEvent"in g),C=o.ref(!1),t=o.ref(null),i=o.ref(null),A=o.ref(null);return g&&I.value&&_g(g,"deviceorientation",n=>{C.value=n.absolute,t.value=n.alpha,i.value=n.beta,A.value=n.gamma}),{isSupported:I,isAbsolute:C,alpha:t,beta:i,gamma:A}}function pQ(e={}){const{window:g=OI}=e,I=o.ref(1);if(g){let C=function(){I.value=g.devicePixelRatio,t(),i=g.matchMedia(`(resolution: ${I.value}dppx)`),i.addEventListener("change",C,{once:!0})},t=function(){i==null||i.removeEventListener("change",C)},i;C(),hC(t)}return{pixelRatio:I}}function BQ(e={}){const{navigator:g=zh,requestPermissions:I=!1,constraints:C={audio:!0,video:!0},onUpdated:t}=e,i=o.ref([]),A=o.computed(()=>i.value.filter(h=>h.kind==="videoinput")),n=o.computed(()=>i.value.filter(h=>h.kind==="audioinput")),l=o.computed(()=>i.value.filter(h=>h.kind==="audiooutput")),s=ii(()=>g&&g.mediaDevices&&g.mediaDevices.enumerateDevices),a=o.ref(!1);let d;async function m(){s.value&&(i.value=await g.mediaDevices.enumerateDevices(),t==null||t(i.value),d&&(d.getTracks().forEach(h=>h.stop()),d=null))}async function u(){if(!s.value)return!1;if(a.value)return!0;const{state:h,query:Z}=qy("camera",{controls:!0});return await Z(),h.value!=="granted"&&(d=await g.mediaDevices.getUserMedia(C),m()),a.value=!0,a.value}return s.value&&(I&&u(),_g(g.mediaDevices,"devicechange",m),m()),{devices:i,ensurePermissions:u,permissionGranted:a,videoInputs:A,audioInputs:n,audioOutputs:l,isSupported:s}}function yQ(e={}){const{document:g=$y}=e;if(!g)return o.ref("visible");const I=o.ref(g.visibilityState);return _g(g,"visibilitychange",()=>{I.value=g.visibilityState}),I}function YQ(e,g={}){var I,C;const{pointerTypes:t,preventDefault:i,stopPropagation:A,exact:n,onMove:l,onEnd:s,onStart:a,initialValue:d,axis:m="both",draggingElement:u=OI,containerElement:h,handle:Z=e,buttons:G=[0]}=g,w=o.ref((I=Hg(d))!=null?I:{x:0,y:0}),p=o.ref(),B=K=>t?t.includes(K.pointerType):!0,y=K=>{Hg(i)&&K.preventDefault(),Hg(A)&&K.stopPropagation()},Y=K=>{var F;if(!Hg(G).includes(K.button)||Hg(g.disabled)||!B(K)||Hg(n)&&K.target!==Hg(e))return;const X=Hg(h),z=(F=X==null?void 0:X.getBoundingClientRect)==null?void 0:F.call(X),L=Hg(e).getBoundingClientRect(),O={x:K.clientX-(X?L.left-z.left+X.scrollLeft:L.left),y:K.clientY-(X?L.top-z.top+X.scrollTop:L.top)};(a==null?void 0:a(O,K))!==!1&&(p.value=O,y(K))},f=K=>{if(Hg(g.disabled)||!B(K)||!p.value)return;const F=Hg(h),X=Hg(e).getBoundingClientRect();let{x:z,y:L}=w.value;(m==="x"||m==="both")&&(z=K.clientX-p.value.x,F&&(z=Math.min(Math.max(0,z),F.scrollWidth-X.width))),(m==="y"||m==="both")&&(L=K.clientY-p.value.y,F&&(L=Math.min(Math.max(0,L),F.scrollHeight-X.height))),w.value={x:z,y:L},l==null||l(w.value,K),y(K)},M=K=>{Hg(g.disabled)||!B(K)||p.value&&(p.value=void 0,s==null||s(w.value,K),y(K))};if(In){const K={capture:(C=g.capture)!=null?C:!0};_g(Z,"pointerdown",Y,K),_g(u,"pointermove",f,K),_g(u,"pointerup",M,K)}return{...tX(w),position:w,isDragging:o.computed(()=>!!p.value),style:o.computed(()=>`left:${w.value.x}px;top:${w.value.y}px;`)}}function cX(e,g,I={}){const{window:C=OI,...t}=I;let i;const A=ii(()=>C&&"ResizeObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const d=Hg(e);return Array.isArray(d)?d.map(m=>Ve(m)):[Ve(d)]}),s=o.watch(l,d=>{if(n(),A.value&&C){i=new ResizeObserver(g);for(const m of d)m&&i.observe(m,t)}},{immediate:!0,flush:"post"}),a=()=>{n(),s()};return hC(a),{isSupported:A,stop:a}}function VQ(e,g={}){const{reset:I=!0,windowResize:C=!0,windowScroll:t=!0,immediate:i=!0,updateTiming:A="sync"}=g,n=o.ref(0),l=o.ref(0),s=o.ref(0),a=o.ref(0),d=o.ref(0),m=o.ref(0),u=o.ref(0),h=o.ref(0);function Z(){const w=Ve(e);if(!w){I&&(n.value=0,l.value=0,s.value=0,a.value=0,d.value=0,m.value=0,u.value=0,h.value=0);return}const p=w.getBoundingClientRect();n.value=p.height,l.value=p.bottom,s.value=p.left,a.value=p.right,d.value=p.top,m.value=p.width,u.value=p.x,h.value=p.y}function G(){A==="sync"?Z():A==="next-frame"&&requestAnimationFrame(()=>Z())}return cX(e,G),o.watch(()=>Ve(e),w=>!w&&G()),nX(e,G,{attributeFilter:["style","class"]}),t&&_g("scroll",G,{capture:!0,passive:!0}),C&&_g("resize",G,{passive:!0}),Jl(()=>{i&&G()}),{height:n,bottom:l,left:s,right:a,top:d,width:m,x:u,y:h,update:G}}function rX(e,g={width:0,height:0},I={}){const{window:C=OI,box:t="content-box"}=I,i=o.computed(()=>{var d,m;return(m=(d=Ve(e))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),A=o.ref(g.width),n=o.ref(g.height),{stop:l}=cX(e,([d])=>{const m=t==="border-box"?d.borderBoxSize:t==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(C&&i.value){const u=Ve(e);if(u){const h=u.getBoundingClientRect();A.value=h.width,n.value=h.height}}else if(m){const u=Array.isArray(m)?m:[m];A.value=u.reduce((h,{inlineSize:Z})=>h+Z,0),n.value=u.reduce((h,{blockSize:Z})=>h+Z,0)}else A.value=d.contentRect.width,n.value=d.contentRect.height},I);Jl(()=>{const d=Ve(e);d&&(A.value="offsetWidth"in d?d.offsetWidth:g.width,n.value="offsetHeight"in d?d.offsetHeight:g.height)});const s=o.watch(()=>Ve(e),d=>{A.value=d?g.width:0,n.value=d?g.height:0});function a(){l(),s()}return{width:A,height:n,stop:a}}function NQ(e,g,I={}){const{root:C,rootMargin:t="0px",threshold:i=0,window:A=OI,immediate:n=!0}=I,l=ii(()=>A&&"IntersectionObserver"in A),s=o.computed(()=>{const h=Hg(e);return(Array.isArray(h)?h:[h]).map(Ve).filter(Zw)});let a=me;const d=o.ref(n),m=l.value?o.watch(()=>[s.value,Ve(C),d.value],([h,Z])=>{if(a(),!d.value||!h.length)return;const G=new IntersectionObserver(g,{root:Ve(Z),rootMargin:t,threshold:i});h.forEach(w=>w&&G.observe(w)),a=()=>{G.disconnect(),a=me}},{immediate:n,flush:"post"}):me,u=()=>{a(),m(),d.value=!1};return hC(u),{isSupported:l,isActive:d,pause(){a(),d.value=!1},resume(){d.value=!0},stop:u}}function MQ(e,g={}){const{window:I=OI,scrollTarget:C,threshold:t=0}=g,i=o.ref(!1);return NQ(e,A=>{let n=i.value,l=0;for(const s of A)s.time>=l&&(l=s.time,n=s.isIntersecting);i.value=n},{root:C,window:I,threshold:t}),i}function fQ(e={}){const{initialValue:g=""}=e,I=ii(()=>typeof window<"u"&&"EyeDropper"in window),C=o.ref(g);async function t(i){if(!I.value)return;const n=await new window.EyeDropper().open(i);return C.value=n.sRGBHex,n}return{isSupported:I,sRGBHex:C,open:t}}const mX=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function RQ(e,g={}){const{document:I=$y,autoExit:C=!1}=g,t=o.computed(()=>{var w;return(w=Ve(e))!=null?w:I==null?void 0:I.querySelector("html")}),i=o.ref(!1),A=o.computed(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(w=>I&&w in I||t.value&&w in t.value)),n=o.computed(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(w=>I&&w in I||t.value&&w in t.value)),l=o.computed(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(w=>I&&w in I||t.value&&w in t.value)),s=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(w=>I&&w in I),a=ii(()=>t.value&&I&&A.value!==void 0&&n.value!==void 0&&l.value!==void 0),d=()=>s?(I==null?void 0:I[s])===t.value:!1,m=()=>{if(l.value){if(I&&I[l.value]!=null)return I[l.value];{const w=t.value;if((w==null?void 0:w[l.value])!=null)return!!w[l.value]}}return!1};async function u(){if(!(!a.value||!i.value)){if(n.value)if((I==null?void 0:I[n.value])!=null)await I[n.value]();else{const w=t.value;(w==null?void 0:w[n.value])!=null&&await w[n.value]()}i.value=!1}}async function h(){if(!a.value||i.value)return;m()&&await u();const w=t.value;A.value&&(w==null?void 0:w[A.value])!=null&&(await w[A.value](),i.value=!0)}async function Z(){await(i.value?u():h())}const G=()=>{const w=m();(!w||w&&d())&&(i.value=w)};return _g(I,mX,G,!1),_g(()=>Ve(t),mX,G,!1),C&&hC(u),{isSupported:a,isFullscreen:i,enter:h,exit:u,toggle:Z}}function XQ(e={}){const{enableHighAccuracy:g=!0,maximumAge:I=3e4,timeout:C=27e3,navigator:t=zh,immediate:i=!0}=e,A=ii(()=>t&&"geolocation"in t),n=o.ref(null),l=o.shallowRef(null),s=o.ref({accuracy:0,latitude:Number.POSITIVE_INFINITY,longitude:Number.POSITIVE_INFINITY,altitude:null,altitudeAccuracy:null,heading:null,speed:null});function a(h){n.value=h.timestamp,s.value=h.coords,l.value=null}let d;function m(){A.value&&(d=t.geolocation.watchPosition(a,h=>l.value=h,{enableHighAccuracy:g,maximumAge:I,timeout:C}))}i&&m();function u(){d&&t&&t.geolocation.clearWatch(d)}return hC(()=>{u()}),{isSupported:A,coords:s,locatedAt:n,error:l,resume:m,pause:u}}const HQ=["mousemove","mousedown","resize","keydown","touchstart","wheel"],DQ=6e4;function SQ(e=DQ,g={}){const{initialState:I=!1,listenForVisibilityChange:C=!0,events:t=HQ,window:i=OI,eventFilter:A=gX(50)}=g,n=o.ref(I),l=o.ref(Gw());let s;const a=()=>{n.value=!1,clearTimeout(s),s=setTimeout(()=>n.value=!0,e)},d=Fh(A,()=>{l.value=Gw(),a()});if(i){const m=i.document;for(const u of t)_g(i,u,d,{passive:!0});C&&_g(m,"visibilitychange",()=>{m.hidden||d()}),a()}return{idle:n,lastActive:l,reset:a}}const KQ={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function uX(e={}){const{type:g="page",touch:I=!0,resetOnTouchEnds:C=!1,initialValue:t={x:0,y:0},window:i=OI,target:A=i,scroll:n=!0,eventFilter:l}=e;let s=null;const a=o.ref(t.x),d=o.ref(t.y),m=o.ref(null),u=typeof g=="function"?g:KQ[g],h=Y=>{const f=u(Y);s=Y,f&&([a.value,d.value]=f,m.value="mouse")},Z=Y=>{if(Y.touches.length>0){const f=u(Y.touches[0]);f&&([a.value,d.value]=f,m.value="touch")}},G=()=>{if(!s||!i)return;const Y=u(s);s instanceof MouseEvent&&Y&&(a.value=Y[0]+i.scrollX,d.value=Y[1]+i.scrollY)},w=()=>{a.value=t.x,d.value=t.y},p=l?Y=>l(()=>h(Y),{}):Y=>h(Y),B=l?Y=>l(()=>Z(Y),{}):Y=>Z(Y),y=l?()=>l(()=>G(),{}):()=>G();if(A){const Y={passive:!0};_g(A,["mousemove","dragover"],p,Y),I&&g!=="movement"&&(_g(A,["touchstart","touchmove"],B,Y),C&&_g(A,"touchend",w,Y)),n&&g==="page"&&_g(i,"scroll",y,{passive:!0})}return{x:a,y:d,sourceType:m}}function kQ(e,g={}){const{handleOutside:I=!0,window:C=OI}=g,t=g.type||"page",{x:i,y:A,sourceType:n}=uX(g),l=o.ref(e??(C==null?void 0:C.document.body)),s=o.ref(0),a=o.ref(0),d=o.ref(0),m=o.ref(0),u=o.ref(0),h=o.ref(0),Z=o.ref(!0);let G=()=>{};return C&&(G=o.watch([l,i,A],()=>{const w=Ve(l);if(!w||!(w instanceof Element))return;const{left:p,top:B,width:y,height:Y}=w.getBoundingClientRect();d.value=p+(t==="page"?C.pageXOffset:0),m.value=B+(t==="page"?C.pageYOffset:0),u.value=Y,h.value=y;const f=i.value-d.value,M=A.value-m.value;Z.value=y===0||Y===0||f<0||M<0||f>y||M>Y,(I||!Z.value)&&(s.value=f,a.value=M)},{immediate:!0}),_g(document,"mouseleave",()=>{Z.value=!0})),{x:i,y:A,sourceType:n,elementX:s,elementY:a,elementPositionX:d,elementPositionY:m,elementHeight:u,elementWidth:h,isOutside:Z,stop:G}}function FQ(e={}){const{touch:g=!0,drag:I=!0,capture:C=!1,initialValue:t=!1,window:i=OI}=e,A=o.ref(t),n=o.ref(null);if(!i)return{pressed:A,sourceType:n};const l=d=>()=>{A.value=!0,n.value=d},s=()=>{A.value=!1,n.value=null},a=o.computed(()=>Ve(e.target)||i);return _g(a,"mousedown",l("mouse"),{passive:!0,capture:C}),_g(i,"mouseleave",s,{passive:!0,capture:C}),_g(i,"mouseup",s,{passive:!0,capture:C}),I&&(_g(a,"dragstart",l("mouse"),{passive:!0,capture:C}),_g(i,"drop",s,{passive:!0,capture:C}),_g(i,"dragend",s,{passive:!0,capture:C})),g&&(_g(a,"touchstart",l("touch"),{passive:!0,capture:C}),_g(i,"touchend",s,{passive:!0,capture:C}),_g(i,"touchcancel",s,{passive:!0,capture:C})),{pressed:A,sourceType:n}}function hX(e={}){const{window:g=OI}=e,I=g==null?void 0:g.navigator,C=ii(()=>I&&"connection"in I),t=o.ref(!0),i=o.ref(!1),A=o.ref(void 0),n=o.ref(void 0),l=o.ref(void 0),s=o.ref(void 0),a=o.ref(void 0),d=o.ref(void 0),m=o.ref("unknown"),u=C.value&&I.connection;function h(){I&&(t.value=I.onLine,A.value=t.value?void 0:Date.now(),n.value=t.value?Date.now():void 0,u&&(l.value=u.downlink,s.value=u.downlinkMax,d.value=u.effectiveType,a.value=u.rtt,i.value=u.saveData,m.value=u.type))}return g&&(_g(g,"offline",()=>{t.value=!1,A.value=Date.now()}),_g(g,"online",()=>{t.value=!0,n.value=Date.now()})),u&&_g(u,"change",h,!1),h(),{isSupported:o.readonly(C),isOnline:o.readonly(t),saveData:o.readonly(i),offlineAt:o.readonly(A),onlineAt:o.readonly(n),downlink:o.readonly(l),downlinkMax:o.readonly(s),effectiveType:o.readonly(d),rtt:o.readonly(a),type:o.readonly(m)}}function bX(e={}){const{controls:g=!1,interval:I="requestAnimationFrame"}=e,C=o.ref(new Date),t=()=>C.value=new Date,i=I==="requestAnimationFrame"?lX(t,{immediate:!0}):iX(t,I,{immediate:!0});return g?{now:C,...i}:C}function zQ(e){const g=o.ref(),I=()=>{g.value&&URL.revokeObjectURL(g.value),g.value=void 0};return o.watch(()=>Hg(e),C=>{I(),C&&(g.value=URL.createObjectURL(C))},{immediate:!0}),hC(I),o.readonly(g)}function ZX(e,g,I){if(typeof e=="function"||o.isReadonly(e))return o.computed(()=>Qy(Hg(e),Hg(g),Hg(I)));const C=o.ref(e);return o.computed({get(){return C.value=Qy(C.value,Hg(g),Hg(I))},set(t){C.value=Qy(t,Hg(g),Hg(I))}})}function JQ(e){const{total:g=Number.POSITIVE_INFINITY,pageSize:I=10,page:C=1,onPageChange:t=me,onPageSizeChange:i=me,onPageCountChange:A=me}=e,n=ZX(I,1,Number.POSITIVE_INFINITY),l=o.computed(()=>Math.max(1,Math.ceil(Hg(g)/Hg(n)))),s=ZX(C,1,l),a=o.computed(()=>s.value===1),d=o.computed(()=>s.value===l.value);o.isRef(C)&&CX(C,s,{direction:o.isReadonly(C)?"ltr":"both"}),o.isRef(I)&&CX(I,n,{direction:o.isReadonly(I)?"ltr":"both"});function m(){s.value--}function u(){s.value++}const h={currentPage:s,currentPageSize:n,pageCount:l,isFirstPage:a,isLastPage:d,prev:m,next:u};return o.watch(s,()=>{t(o.reactive(h))}),o.watch(n,()=>{i(o.reactive(h))}),o.watch(l,()=>{A(o.reactive(h))}),h}function LQ(e={}){const{isOnline:g}=hX(e);return g}function TQ(e={}){const{window:g=OI}=e,I=o.ref(!1),C=t=>{if(!g)return;t=t||g.event;const i=t.relatedTarget||t.toElement;I.value=!i};return g&&(_g(g,"mouseout",C,{passive:!0}),_g(g.document,"mouseleave",C,{passive:!0}),_g(g.document,"mouseenter",C,{passive:!0})),I}const GX={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},vQ=Object.keys(GX);function jQ(e={}){const{target:g=OI}=e,I=o.ref(!1),C=o.ref(e.initialValue||{});Object.assign(C.value,GX,C.value);const t=i=>{I.value=!0,!(e.pointerTypes&&!e.pointerTypes.includes(i.pointerType))&&(C.value=IQ(i,vQ,!1))};if(g){const i={passive:!0};_g(g,["pointerdown","pointermove","pointerup"],t,i),_g(g,"pointerleave",()=>I.value=!1,i)}return{...tX(C),isInside:I}}function xQ(e,g={}){const{document:I=$y}=g,C=ii(()=>I&&"pointerLockElement"in I),t=o.ref(),i=o.ref();let A;C.value&&(_g(I,"pointerlockchange",()=>{var s;const a=(s=I.pointerLockElement)!=null?s:t.value;A&&a===A&&(t.value=I.pointerLockElement,t.value||(A=i.value=null))}),_g(I,"pointerlockerror",()=>{var s;const a=(s=I.pointerLockElement)!=null?s:t.value;if(A&&a===A){const d=I.pointerLockElement?"release":"acquire";throw new Error(`Failed to ${d} pointer lock.`)}}));async function n(s){var a;if(!C.value)throw new Error("Pointer Lock API is not supported by your browser.");if(i.value=s instanceof Event?s.currentTarget:null,A=s instanceof Event?(a=Ve(e))!=null?a:i.value:Ve(s),!A)throw new Error("Target element undefined.");return A.requestPointerLock(),await _y(t).toBe(A)}async function l(){return t.value?(I.exitPointerLock(),await _y(t).toBeNull(),!0):!1}return{isSupported:C,element:t,triggerElement:i,lock:n,unlock:l}}function OQ(e){const g=ds("(prefers-color-scheme: light)",e),I=ds("(prefers-color-scheme: dark)",e);return o.computed(()=>I.value?"dark":g.value?"light":"no-preference")}function QQ(e){const g=ds("(prefers-contrast: more)",e),I=ds("(prefers-contrast: less)",e),C=ds("(prefers-contrast: custom)",e);return o.computed(()=>g.value?"more":I.value?"less":C.value?"custom":"no-preference")}function UQ(e={}){const{window:g=OI}=e;if(!g)return o.ref(["en"]);const I=g.navigator,C=o.ref(I.languages);return _g(g,"languagechange",()=>{C.value=I.languages}),C}function EQ(e){const g=ds("(prefers-reduced-motion: reduce)",e);return o.computed(()=>g.value?"reduce":"no-preference")}const PQ=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],_Q={justNow:"just now",past:e=>e.match(/\d/)?`${e} ago`:e,future:e=>e.match(/\d/)?`in ${e}`:e,month:(e,g)=>e===1?g?"last month":"next month":`${e} month${e>1?"s":""}`,year:(e,g)=>e===1?g?"last year":"next year":`${e} year${e>1?"s":""}`,day:(e,g)=>e===1?g?"yesterday":"tomorrow":`${e} day${e>1?"s":""}`,week:(e,g)=>e===1?g?"last week":"next week":`${e} week${e>1?"s":""}`,hour:e=>`${e} hour${e>1?"s":""}`,minute:e=>`${e} minute${e>1?"s":""}`,second:e=>`${e} second${e>1?"s":""}`,invalid:""};function $Q(e){return e.toISOString().slice(0,10)}function qQ(e,g={}){const{controls:I=!1,updateInterval:C=3e4}=g,{now:t,...i}=bX({interval:C,controls:!0}),A=o.computed(()=>gU(new Date(Hg(e)),g,Hg(t)));return I?{timeAgo:A,...i}:A}function gU(e,g={},I=Date.now()){var C;const{max:t,messages:i=_Q,fullDateFormatter:A=$Q,units:n=PQ,showSecond:l=!1,rounding:s="round"}=g,a=typeof s=="number"?G=>+G.toFixed(s):Math[s],d=+I-+e,m=Math.abs(d);function u(G,w){return a(Math.abs(G)/w.value)}function h(G,w){const p=u(G,w),B=G>0,y=Z(w.name,p,B);return Z(B?"past":"future",y,B)}function Z(G,w,p){const B=i[G];return typeof B=="function"?B(w,p):B.replace("{0}",w.toString())}if(m<6e4&&!l)return i.justNow;if(typeof t=="number"&&m>t)return A(new Date(e));if(typeof t=="string"){const G=(C=n.find(w=>w.name===t))==null?void 0:C.max;if(G&&m>G)return A(new Date(e))}for(const[G,w]of n.entries()){if(u(d,w)<=0&&n[G-1])return h(d,n[G-1]);if(m<w.max)return h(d,w)}return i.invalid}function IU(e={}){const{controls:g=!1,offset:I=0,immediate:C=!0,interval:t="requestAnimationFrame",callback:i}=e,A=o.ref(Gw()+I),n=()=>A.value=Gw()+I,l=i?()=>{n(),i(A.value)}:n,s=t==="requestAnimationFrame"?lX(l,{immediate:C}):iX(l,t,{immediate:C});return g?{timestamp:A,...s}:A}function eU(e,g){const{containerStyle:I,wrapperProps:C,scrollTo:t,calculateRange:i,currentList:A,containerRef:n}="itemHeight"in g?iU(g,e):tU(g,e);return{list:A,scrollTo:t,containerProps:{ref:n,onScroll:()=>{i()},style:I},wrapperProps:C}}function wX(e){const g=o.ref(null),I=rX(g),C=o.ref([]),t=o.shallowRef(e);return{state:o.ref({start:0,end:10}),source:t,currentList:C,size:I,containerRef:g}}function WX(e,g,I){return C=>{if(typeof I=="number")return Math.ceil(C/I);const{start:t=0}=e.value;let i=0,A=0;for(let n=t;n<g.value.length;n++){const l=I(n);if(i+=l,A=n,i>C)break}return A-t}}function pX(e,g){return I=>{if(typeof g=="number")return Math.floor(I/g)+1;let C=0,t=0;for(let i=0;i<e.value.length;i++){const A=g(i);if(C+=A,C>=I){t=i;break}}return t+1}}function BX(e,g,I,C,{containerRef:t,state:i,currentList:A,source:n}){return()=>{const l=t.value;if(l){const s=I(e==="vertical"?l.scrollTop:l.scrollLeft),a=C(e==="vertical"?l.clientHeight:l.clientWidth),d=s-g,m=s+a+g;i.value={start:d<0?0:d,end:m>n.value.length?n.value.length:m},A.value=n.value.slice(i.value.start,i.value.end).map((u,h)=>({data:u,index:h+i.value.start}))}}}function yX(e,g){return I=>typeof e=="number"?I*e:g.value.slice(0,I).reduce((t,i,A)=>t+e(A),0)}function YX(e,g,I,C){o.watch([e.width,e.height,g,I],()=>{C()})}function VX(e,g){return o.computed(()=>typeof e=="number"?g.value.length*e:g.value.reduce((I,C,t)=>I+e(t),0))}const CU={horizontal:"scrollLeft",vertical:"scrollTop"};function NX(e,g,I,C){return t=>{C.value&&(C.value[CU[e]]=I(t),g())}}function tU(e,g){const I=wX(g),{state:C,source:t,currentList:i,size:A,containerRef:n}=I,l={overflowX:"auto"},{itemWidth:s,overscan:a=5}=e,d=WX(C,t,s),m=pX(t,s),u=BX("horizontal",a,m,d,I),h=yX(s,t),Z=o.computed(()=>h(C.value.start)),G=VX(s,t);YX(A,g,n,u);const w=NX("horizontal",u,h,n),p=o.computed(()=>({style:{height:"100%",width:`${G.value-Z.value}px`,marginLeft:`${Z.value}px`,display:"flex"}}));return{scrollTo:w,calculateRange:u,wrapperProps:p,containerStyle:l,currentList:i,containerRef:n}}function iU(e,g){const I=wX(g),{state:C,source:t,currentList:i,size:A,containerRef:n}=I,l={overflowY:"auto"},{itemHeight:s,overscan:a=5}=e,d=WX(C,t,s),m=pX(t,s),u=BX("vertical",a,m,d,I),h=yX(s,t),Z=o.computed(()=>h(C.value.start)),G=VX(s,t);YX(A,g,n,u);const w=NX("vertical",u,h,n),p=o.computed(()=>({style:{width:"100%",height:`${G.value-Z.value}px`,marginTop:`${Z.value}px`}}));return{calculateRange:u,scrollTo:w,containerStyle:l,wrapperProps:p,currentList:i,containerRef:n}}function AU(e={}){const{window:g=OI}=e;if(!g)return o.ref(!1);const I=o.ref(g.document.hasFocus());return _g(g,"blur",()=>{I.value=!1}),_g(g,"focus",()=>{I.value=!0}),I}function nU(e={}){const{window:g=OI,initialWidth:I=Number.POSITIVE_INFINITY,initialHeight:C=Number.POSITIVE_INFINITY,listenOrientation:t=!0,includeScrollbar:i=!0,type:A="inner"}=e,n=o.ref(I),l=o.ref(C),s=()=>{g&&(A==="outer"?(n.value=g.outerWidth,l.value=g.outerHeight):i?(n.value=g.innerWidth,l.value=g.innerHeight):(n.value=g.document.documentElement.clientWidth,l.value=g.document.documentElement.clientHeight))};if(s(),Jl(s),_g("resize",s,{passive:!0}),t){const a=ds("(orientation: portrait)");o.watch(a,()=>s())}return{width:n,height:l}}const lU=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:g,emit:I}){const C=o.ref();return lQ(C,t=>{I("trigger",t)},e.options),()=>{if(g.default)return o.h(e.as||"div",{ref:C},g.default())}}}),st=In?window:void 0;function bC(e){var g;const I=Hg(e);return(g=I==null?void 0:I.$el)!=null?g:I}function Mt(...e){let g,I,C,t;if(typeof e[0]=="string"||Array.isArray(e[0])?([I,C,t]=e,g=st):[g,I,C,t]=e,!g)return me;Array.isArray(I)||(I=[I]),Array.isArray(C)||(C=[C]);const i=[],A=()=>{i.forEach(a=>a()),i.length=0},n=(a,d,m,u)=>(a.addEventListener(d,m,u),()=>a.removeEventListener(d,m,u)),l=o.watch(()=>[bC(g),Hg(t)],([a,d])=>{if(A(),!a)return;const m=qR(d)?{...d}:d;i.push(...I.flatMap(u=>C.map(h=>n(a,u,h,m))))},{immediate:!0,flush:"post"}),s=()=>{l(),A()};return hC(s),s}let MX=!1;function fX(e,g,I={}){const{window:C=st,ignore:t=[],capture:i=!0,detectIframe:A=!1}=I;if(!C)return me;ww&&!MX&&(MX=!0,Array.from(C.document.body.children).forEach(u=>u.addEventListener("click",me)),C.document.documentElement.addEventListener("click",me));let n=!0;const l=u=>Hg(t).some(h=>{if(typeof h=="string")return Array.from(C.document.querySelectorAll(h)).some(Z=>Z===u.target||u.composedPath().includes(Z));{const Z=bC(h);return Z&&(u.target===Z||u.composedPath().includes(Z))}}),s=u=>{const h=bC(e);if(!(!h||h===u.target||u.composedPath().includes(h))){if(u.detail===0&&(n=!l(u)),!n){n=!0;return}g(u)}};let a=!1;const d=[Mt(C,"click",u=>{a||(a=!0,setTimeout(()=>{a=!1},0),s(u))},{passive:!0,capture:i}),Mt(C,"pointerdown",u=>{const h=bC(e);n=!l(u)&&!!(h&&!u.composedPath().includes(h))},{passive:!0}),A&&Mt(C,"blur",u=>{setTimeout(()=>{var h;const Z=bC(e);((h=C.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(Z!=null&&Z.contains(C.document.activeElement))&&g(u)},0)})].filter(Boolean);return()=>d.forEach(u=>u())}const Cd={[gn.mounted](e,g){const I=!g.modifiers.bubble;if(typeof g.value=="function")e.__onClickOutside_stop=fX(e,g.value,{capture:I});else{const[C,t]=g.value;e.__onClickOutside_stop=fX(e,C,Object.assign({capture:I},t))}},[gn.unmounted](e){e.__onClickOutside_stop()}};function oU(e){return typeof e=="function"?e:typeof e=="string"?g=>g.key===e:Array.isArray(e)?g=>e.includes(g.key):()=>!0}function RX(...e){let g,I,C={};e.length===3?(g=e[0],I=e[1],C=e[2]):e.length===2?typeof e[1]=="object"?(g=!0,I=e[0],C=e[1]):(g=e[0],I=e[1]):(g=!0,I=e[0]);const{target:t=st,eventName:i="keydown",passive:A=!1,dedupe:n=!1}=C,l=oU(g);return Mt(t,i,a=>{a.repeat&&Hg(n)||l(a)&&I(a)},A)}const sU={[gn.mounted](e,g){var I,C;const t=(C=(I=g.arg)==null?void 0:I.split(","))!=null?C:!0;if(typeof g.value=="function")RX(t,g.value,{target:e});else{const[i,A]=g.value;RX(t,i,{target:e,...A})}}},aU=500,dU=10;function IY(e,g,I){var C,t;const i=o.computed(()=>bC(e));let A,n,l,s=!1;function a(){A&&(clearTimeout(A),A=void 0),n=void 0,l=void 0,s=!1}function d(w){var p,B,y;const[Y,f,M]=[l,n,s];if(a(),!(I!=null&&I.onMouseUp)||!f||!Y||(p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value)return;(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation();const K=w.x-f.x,F=w.y-f.y,X=Math.sqrt(K*K+F*F);I.onMouseUp(w.timeStamp-Y,X,M)}function m(w){var p,B,y,Y;(p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value||(a(),(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation(),n={x:w.x,y:w.y},l=w.timeStamp,A=setTimeout(()=>{s=!0,g(w)},(Y=I==null?void 0:I.delay)!=null?Y:aU))}function u(w){var p,B,y,Y;if((p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value||!n||(I==null?void 0:I.distanceThreshold)===!1)return;(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation();const f=w.x-n.x,M=w.y-n.y;Math.sqrt(f*f+M*M)>=((Y=I==null?void 0:I.distanceThreshold)!=null?Y:dU)&&a()}const h={capture:(C=I==null?void 0:I.modifiers)==null?void 0:C.capture,once:(t=I==null?void 0:I.modifiers)==null?void 0:t.once},Z=[Mt(i,"pointerdown",m,h),Mt(i,"pointermove",u,h),Mt(i,["pointerup","pointerleave"],d,h)];return()=>Z.forEach(w=>w())}const cU=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:g,emit:I}){const C=o.ref();return IY(C,t=>{I("trigger",t)},e.options),()=>{if(g.default)return o.h(e.as||"div",{ref:C},g.default())}}}),XX={[gn.mounted](e,g){typeof g.value=="function"?IY(e,g.value,{modifiers:g.modifiers}):IY(e,...g.value)}},rU=o.defineComponent({name:"UseActiveElement",setup(e,{slots:g}){const I=o.reactive({element:sQ()});return()=>{if(g.default)return g.default(I)}}}),mU=o.defineComponent({name:"UseBattery",setup(e,{slots:g}){const I=o.reactive(aQ(e));return()=>{if(g.default)return g.default(I)}}}),uU=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:g}){const I=o.reactive(dQ());return()=>{if(g.default)return g.default(I)}}}),hU=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:g}){const I=o.reactive(cQ(e));return()=>{var C;return(C=g.default)==null?void 0:C.call(g,I)}}}),Yw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vw="__vueuse_ssr_handlers__",bU=ZU();function ZU(){return Vw in Yw||(Yw[Vw]=Yw[Vw]||{}),Yw[Vw]}function HX(e,g){return bU[e]||g}function GU(){const e=o.ref(!1),g=o.getCurrentInstance();return g&&o.onMounted(()=>{e.value=!0},g),e}function Nw(e){const g=GU();return o.computed(()=>(g.value,!!e()))}function wU(e,g={}){const{window:I=st}=g,C=Nw(()=>I&&"matchMedia"in I&&typeof I.matchMedia=="function");let t;const i=o.ref(!1),A=s=>{i.value=s.matches},n=()=>{t&&("removeEventListener"in t?t.removeEventListener("change",A):t.removeListener(A))},l=o.watchEffect(()=>{C.value&&(n(),t=I.matchMedia(Hg(e)),"addEventListener"in t?t.addEventListener("change",A):t.addListener(A),i.value=t.matches)});return hC(()=>{l(),n(),t=void 0}),i}function WU(e){return wU("(prefers-color-scheme: dark)",e)}function pU(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const BU={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},DX="vueuse-storage";function yU(e,g,I,C={}){var t;const{flush:i="pre",deep:A=!0,listenToStorageChanges:n=!0,writeDefaults:l=!0,mergeDefaults:s=!1,shallow:a,window:d=st,eventFilter:m,onError:u=X=>{console.error(X)},initOnMounted:h}=C,Z=(a?o.shallowRef:o.ref)(typeof g=="function"?g():g);if(!I)try{I=HX("getDefaultStorage",()=>{var X;return(X=st)==null?void 0:X.localStorage})()}catch(X){u(X)}if(!I)return Z;const G=Hg(g),w=pU(G),p=(t=C.serializer)!=null?t:BU[w],{pause:B,resume:y}=pw(Z,()=>f(Z.value),{flush:i,deep:A,eventFilter:m});d&&n&&Jl(()=>{I instanceof Storage?Mt(d,"storage",K):Mt(d,DX,F),h&&K()}),h||K();function Y(X,z){if(d){const L={key:e,oldValue:X,newValue:z,storageArea:I};d.dispatchEvent(I instanceof Storage?new StorageEvent("storage",L):new CustomEvent(DX,{detail:L}))}}function f(X){try{const z=I.getItem(e);if(X==null)Y(z,null),I.removeItem(e);else{const L=p.write(X);z!==L&&(I.setItem(e,L),Y(z,L))}}catch(z){u(z)}}function M(X){const z=X?X.newValue:I.getItem(e);if(z==null)return l&&G!=null&&I.setItem(e,p.write(G)),G;if(!X&&s){const L=p.read(z);return typeof s=="function"?s(L,G):w==="object"&&!Array.isArray(L)?{...G,...L}:L}else return typeof z!="string"?z:p.read(z)}function K(X){if(!(X&&X.storageArea!==I)){if(X&&X.key==null){Z.value=G;return}if(!(X&&X.key!==e)){B();try{(X==null?void 0:X.newValue)!==p.write(Z.value)&&(Z.value=M(X))}catch(z){u(z)}finally{X?o.nextTick(y):y()}}}}function F(X){K(X.detail)}return Z}const YU="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function VU(e={}){const{selector:g="html",attribute:I="class",initialValue:C="auto",window:t=st,storage:i,storageKey:A="vueuse-color-scheme",listenToStorageChanges:n=!0,storageRef:l,emitAuto:s,disableTransition:a=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},m=WU({window:t}),u=o.computed(()=>m.value?"dark":"light"),h=l||(A==null?Ww(C):yU(A,C,i,{window:t,listenToStorageChanges:n})),Z=o.computed(()=>h.value==="auto"?u.value:h.value),G=HX("updateHTMLAttrs",(y,Y,f)=>{const M=typeof y=="string"?t==null?void 0:t.document.querySelector(y):bC(y);if(!M)return;const K=new Set,F=new Set;let X=null;if(Y==="class"){const L=f.split(/\s/g);Object.values(d).flatMap(O=>(O||"").split(/\s/g)).filter(Boolean).forEach(O=>{L.includes(O)?K.add(O):F.add(O)})}else X={key:Y,value:f};if(K.size===0&&F.size===0&&X===null)return;let z;a&&(z=t.document.createElement("style"),z.appendChild(document.createTextNode(YU)),t.document.head.appendChild(z));for(const L of K)M.classList.add(L);for(const L of F)M.classList.remove(L);X&&M.setAttribute(X.key,X.value),a&&(t.getComputedStyle(z).opacity,document.head.removeChild(z))});function w(y){var Y;G(g,I,(Y=d[y])!=null?Y:y)}function p(y){e.onChanged?e.onChanged(y,w):w(y)}o.watch(Z,p,{flush:"post",immediate:!0}),Jl(()=>p(Z.value));const B=o.computed({get(){return s?h.value:Z.value},set(y){h.value=y}});try{return Object.assign(B,{store:h,system:u,state:Z})}catch{return B}}const NU=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:g}){const I=VU(e),C=o.reactive({mode:I,system:I.system,store:I.store});return()=>{if(g.default)return g.default(C)}}}),MU=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:g}){const I=GQ(e),C=o.reactive({isDark:I,toggleDark:nQ(I)});return()=>{if(g.default)return g.default(C)}}}),fU=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:g}){const I=o.reactive(wQ());return()=>{if(g.default)return g.default(I)}}}),RU=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:g}){const I=o.reactive(WQ());return()=>{if(g.default)return g.default(I)}}}),XU=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:g}){const I=o.reactive({pixelRatio:pQ()});return()=>{if(g.default)return g.default(I)}}}),HU=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:g}){const I=o.reactive(BQ(e));return()=>{if(g.default)return g.default(I)}}}),DU=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:g}){const I=o.reactive({visibility:yQ()});return()=>{if(g.default)return g.default(I)}}}),SU=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:g}){const I=o.ref(),C=o.computed(()=>{var a;return(a=e.handle)!=null?a:I.value}),t=o.computed(()=>{var a;return(a=e.containerElement)!=null?a:void 0}),i=o.computed(()=>!!e.disabled),A=e.storageKey&&dX(e.storageKey,Hg(e.initialValue)||{x:0,y:0},In?e.storageType==="session"?sessionStorage:localStorage:void 0),n=A||e.initialValue||{x:0,y:0},l=(a,d)=>{var m;(m=e.onEnd)==null||m.call(e,a,d),A&&(A.value.x=a.x,A.value.y=a.y)},s=o.reactive(YQ(I,{...e,handle:C,initialValue:n,onEnd:l,disabled:i,containerElement:t}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I,style:`touch-action:none;${s.style}`},g.default(s))}}}),KU=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(VQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function SX(e,g={}){const{delayEnter:I=0,delayLeave:C=0,window:t=st}=g,i=o.ref(!1);let A;const n=l=>{const s=l?I:C;A&&(clearTimeout(A),A=void 0),s?A=setTimeout(()=>i.value=l,s):i.value=l};return t&&(Mt(e,"mouseenter",()=>n(!0),{passive:!0}),Mt(e,"mouseleave",()=>n(!1),{passive:!0})),i}const kU={[gn.mounted](e,g){const I=g.value;if(typeof I=="function"){const C=SX(e);o.watch(C,t=>I(t))}else{const[C,t]=I,i=SX(e,t);o.watch(i,A=>C(A))}}},FU=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(rX(I,{width:e.width,height:e.height},{box:e.box}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function eY(e,g,I={}){const{window:C=st,...t}=I;let i;const A=Nw(()=>C&&"ResizeObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const d=Hg(e);return Array.isArray(d)?d.map(m=>bC(m)):[bC(d)]}),s=o.watch(l,d=>{if(n(),A.value&&C){i=new ResizeObserver(g);for(const m of d)m&&i.observe(m,t)}},{immediate:!0,flush:"post"}),a=()=>{n(),s()};return hC(a),{isSupported:A,stop:a}}function zU(e,g={width:0,height:0},I={}){const{window:C=st,box:t="content-box"}=I,i=o.computed(()=>{var d,m;return(m=(d=bC(e))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),A=o.ref(g.width),n=o.ref(g.height),{stop:l}=eY(e,([d])=>{const m=t==="border-box"?d.borderBoxSize:t==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(C&&i.value){const u=bC(e);if(u){const h=u.getBoundingClientRect();A.value=h.width,n.value=h.height}}else if(m){const u=Array.isArray(m)?m:[m];A.value=u.reduce((h,{inlineSize:Z})=>h+Z,0),n.value=u.reduce((h,{blockSize:Z})=>h+Z,0)}else A.value=d.contentRect.width,n.value=d.contentRect.height},I);Jl(()=>{const d=bC(e);d&&(A.value="offsetWidth"in d?d.offsetWidth:g.width,n.value="offsetHeight"in d?d.offsetHeight:g.height)});const s=o.watch(()=>bC(e),d=>{A.value=d?g.width:0,n.value=d?g.height:0});function a(){l(),s()}return{width:A,height:n,stop:a}}const JU={[gn.mounted](e,g){var I;const C=typeof g.value=="function"?g.value:(I=g.value)==null?void 0:I[0],t=typeof g.value=="function"?[]:g.value.slice(1),{width:i,height:A}=zU(e,...t);o.watch([i,A],([n,l])=>C({width:n,height:l}))}},LU=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive({isVisible:MQ(I)});return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function CY(e,g,I={}){const{root:C,rootMargin:t="0px",threshold:i=0,window:A=st,immediate:n=!0}=I,l=Nw(()=>A&&"IntersectionObserver"in A),s=o.computed(()=>{const h=Hg(e);return(Array.isArray(h)?h:[h]).map(bC).filter(Zw)});let a=me;const d=o.ref(n),m=l.value?o.watch(()=>[s.value,bC(C),d.value],([h,Z])=>{if(a(),!d.value||!h.length)return;const G=new IntersectionObserver(g,{root:bC(Z),rootMargin:t,threshold:i});h.forEach(w=>w&&G.observe(w)),a=()=>{G.disconnect(),a=me}},{immediate:n,flush:"post"}):me,u=()=>{a(),m(),d.value=!1};return hC(u),{isSupported:l,isActive:d,pause(){a(),d.value=!1},resume(){d.value=!0},stop:u}}function tY(e,g={}){const{window:I=st,scrollTarget:C,threshold:t=0}=g,i=o.ref(!1);return CY(e,A=>{let n=i.value,l=0;for(const s of A)s.time>=l&&(l=s.time,n=s.isIntersecting);i.value=n},{root:C,window:I,threshold:t}),i}const TU={[gn.mounted](e,g){if(typeof g.value=="function"){const I=g.value,C=tY(e);o.watch(C,t=>I(t),{immediate:!0})}else{const[I,C]=g.value,t=tY(e,C);o.watch(t,i=>I(i),{immediate:!0})}}},vU=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:g}){const I=o.reactive(fQ());return()=>{if(g.default)return g.default(I)}}}),jU=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(RQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),xU=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:g}){const I=o.reactive(XQ(e));return()=>{if(g.default)return g.default(I)}}}),OU=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:g}){const I=o.reactive(SQ(e.timeout,e));return()=>{if(g.default)return g.default(I)}}});function QU(e,g,I){const{immediate:C=!0,delay:t=0,onError:i=me,onSuccess:A=me,resetOnExecute:n=!0,shallow:l=!0,throwError:s}=I??{},a=l?o.shallowRef(g):o.ref(g),d=o.ref(!1),m=o.ref(!1),u=o.shallowRef(void 0);async function h(w=0,...p){n&&(a.value=g),u.value=void 0,d.value=!1,m.value=!0,w>0&&await Ey(w);const B=typeof e=="function"?e(...p):e;try{const y=await B;a.value=y,d.value=!0,A(y)}catch(y){if(u.value=y,i(y),s)throw y}finally{m.value=!1}return a.value}C&&h(t);const Z={state:a,isReady:d,isLoading:m,error:u,execute:h};function G(){return new Promise((w,p)=>{_y(m).toBe(!1).then(()=>w(Z)).catch(p)})}return{...Z,then(w,p){return G().then(w,p)}}}async function UU(e){return new Promise((g,I)=>{const C=new Image,{src:t,srcset:i,sizes:A,class:n,loading:l,crossorigin:s,referrerPolicy:a}=e;C.src=t,i&&(C.srcset=i),A&&(C.sizes=A),n&&(C.className=n),l&&(C.loading=l),s&&(C.crossOrigin=s),a&&(C.referrerPolicy=a),C.onload=()=>g(C),C.onerror=I})}function EU(e,g={}){const I=QU(()=>UU(Hg(e)),void 0,{resetOnExecute:!0,...g});return o.watch(()=>Hg(e),()=>I.execute(g.delay),{deep:!0}),I}const PU=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:g}){const I=o.reactive(EU(e));return()=>I.isLoading&&g.loading?g.loading(I):I.error&&g.error?g.error(I.error):g.default?g.default(I):o.h(e.as||"img",e)}});function Mw(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const KX=1;function iY(e,g={}){const{throttle:I=0,idle:C=200,onStop:t=me,onScroll:i=me,offset:A={left:0,right:0,top:0,bottom:0},eventListenerOptions:n={capture:!1,passive:!0},behavior:l="auto",window:s=st,onError:a=M=>{console.error(M)}}=g,d=o.ref(0),m=o.ref(0),u=o.computed({get(){return d.value},set(M){Z(M,void 0)}}),h=o.computed({get(){return m.value},set(M){Z(void 0,M)}});function Z(M,K){var F,X,z,L;if(!s)return;const O=Hg(e);if(!O)return;(z=O instanceof Document?s.document.body:O)==null||z.scrollTo({top:(F=Hg(K))!=null?F:h.value,left:(X=Hg(M))!=null?X:u.value,behavior:Hg(l)});const Ig=((L=O==null?void 0:O.document)==null?void 0:L.documentElement)||(O==null?void 0:O.documentElement)||O;u!=null&&(d.value=Ig.scrollLeft),h!=null&&(m.value=Ig.scrollTop)}const G=o.ref(!1),w=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),p=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),B=M=>{G.value&&(G.value=!1,p.left=!1,p.right=!1,p.top=!1,p.bottom=!1,t(M))},y=eX(B,I+C),Y=M=>{var K;if(!s)return;const F=((K=M==null?void 0:M.document)==null?void 0:K.documentElement)||(M==null?void 0:M.documentElement)||bC(M),{display:X,flexDirection:z}=getComputedStyle(F),L=F.scrollLeft;p.left=L<d.value,p.right=L>d.value;const O=Math.abs(L)<=(A.left||0),Ig=Math.abs(L)+F.clientWidth>=F.scrollWidth-(A.right||0)-KX;X==="flex"&&z==="row-reverse"?(w.left=Ig,w.right=O):(w.left=O,w.right=Ig),d.value=L;let Ag=F.scrollTop;M===s.document&&!Ag&&(Ag=s.document.body.scrollTop),p.top=Ag<m.value,p.bottom=Ag>m.value;const Q=Math.abs(Ag)<=(A.top||0),$=Math.abs(Ag)+F.clientHeight>=F.scrollHeight-(A.bottom||0)-KX;X==="flex"&&z==="column-reverse"?(w.top=$,w.bottom=Q):(w.top=Q,w.bottom=$),m.value=Ag},f=M=>{var K;if(!s)return;const F=(K=M.target.documentElement)!=null?K:M.target;Y(F),G.value=!0,y(M),i(M)};return Mt(e,"scroll",I?CQ(f,I,!0,!1):f,n),Jl(()=>{try{const M=Hg(e);if(!M)return;Y(M)}catch(M){a(M)}}),Mt(e,"scrollend",B,n),{x:u,y:h,isScrolling:G,arrivedState:w,directions:p,measure(){const M=Hg(e);s&&M&&Y(M)}}}function kX(e,g,I={}){var C;const{direction:t="bottom",interval:i=100,canLoadMore:A=()=>!0}=I,n=o.reactive(iY(e,{...I,offset:{[t]:(C=I.distance)!=null?C:0,...I.offset}})),l=o.ref(),s=o.computed(()=>!!l.value),a=o.computed(()=>Mw(Hg(e))),d=tY(a);function m(){if(n.measure(),!a.value||!d.value||!A(a.value))return;const{scrollHeight:h,clientHeight:Z,scrollWidth:G,clientWidth:w}=a.value,p=t==="bottom"||t==="top"?h<=Z:G<=w;(n.arrivedState[t]||p)&&(l.value||(l.value=Promise.all([g(n),new Promise(B=>setTimeout(B,i))]).finally(()=>{l.value=null,o.nextTick(()=>m())})))}const u=o.watch(()=>[n.arrivedState[t],d.value],m,{immediate:!0});return iQ(u),{isLoading:s,reset(){o.nextTick(()=>m())}}}const _U={[gn.mounted](e,g){typeof g.value=="function"?kX(e,g.value):kX(e,...g.value)}},$U={[gn.mounted](e,g){typeof g.value=="function"?CY(e,g.value):CY(e,...g.value)}},qU=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:g}){const I=o.reactive(uX(e));return()=>{if(g.default)return g.default(I)}}}),gE=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(kQ(I,e));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),IE=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(FQ({...e,target:I}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),eE=o.defineComponent({name:"UseNetwork",setup(e,{slots:g}){const I=o.reactive(hX());return()=>{if(g.default)return g.default(I)}}}),CE=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:g}){const I=o.reactive(bX({...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),tE=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:g}){const I=Ww(e,"object"),C=zQ(I);return()=>{if(g.default&&C.value)return g.default(C)}}}),iE=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:g,emit:I}){const C=o.reactive(JQ({...e,onPageChange(...t){var i;(i=e.onPageChange)==null||i.call(e,...t),I("page-change",...t)},onPageSizeChange(...t){var i;(i=e.onPageSizeChange)==null||i.call(e,...t),I("page-size-change",...t)},onPageCountChange(...t){var i;(i=e.onPageCountChange)==null||i.call(e,...t),I("page-count-change",...t)}}));return()=>{if(g.default)return g.default(C)}}}),AE=o.defineComponent({name:"UseOnline",setup(e,{slots:g}){const I=o.reactive({isOnline:LQ()});return()=>{if(g.default)return g.default(I)}}}),nE=o.defineComponent({name:"UsePageLeave",setup(e,{slots:g}){const I=o.reactive({isLeft:TQ()});return()=>{if(g.default)return g.default(I)}}}),lE=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:g}){const I=o.ref(null),C=o.reactive(jQ({...e,target:e.target==="self"?I:st}));return()=>{if(g.default)return g.default(C,{ref:I})}}}),oE=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(xQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),sE=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:g}){const I=o.reactive({colorScheme:OQ()});return()=>{if(g.default)return g.default(I)}}}),aE=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:g}){const I=o.reactive({contrast:QQ()});return()=>{if(g.default)return g.default(I)}}}),dE=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:g}){const I=o.reactive({prefersDark:gY()});return()=>{if(g.default)return g.default(I)}}}),cE=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:g}){const I=o.reactive({languages:UQ()});return()=>{if(g.default)return g.default(I)}}}),rE=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:g}){const I=o.reactive({motion:EQ()});return()=>{if(g.default)return g.default(I)}}}),mE={[gn.mounted](e,g){typeof g.value=="function"?eY(e,g.value):eY(e,...g.value)}};function uE(e,g,I={}){const{window:C=st,...t}=I;let i;const A=Nw(()=>C&&"MutationObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const m=Hg(e),u=(Array.isArray(m)?m:[m]).map(bC).filter(Zw);return new Set(u)}),s=o.watch(()=>l.value,m=>{n(),A.value&&m.size&&(i=new MutationObserver(g),m.forEach(u=>i.observe(u,t)))},{immediate:!0,flush:"post"}),a=()=>i==null?void 0:i.takeRecords(),d=()=>{s(),n()};return hC(d),{isSupported:A,stop:d,takeRecords:a}}function fw(e,g,I={}){const{window:C=st,initialValue:t,observe:i=!1}=I,A=o.ref(t),n=o.computed(()=>{var s;return bC(g)||((s=C==null?void 0:C.document)==null?void 0:s.documentElement)});function l(){var s;const a=Hg(e),d=Hg(n);if(d&&C&&a){const m=(s=C.getComputedStyle(d).getPropertyValue(a))==null?void 0:s.trim();A.value=m||t}}return i&&uE(n,l,{attributeFilter:["style","class"],window:C}),o.watch([n,()=>Hg(e)],(s,a)=>{a[0]&&a[1]&&a[0].style.removeProperty(a[1]),l()},{immediate:!0}),o.watch(A,s=>{var a;const d=Hg(e);(a=n.value)!=null&&a.style&&d&&(s==null?n.value.style.removeProperty(d):n.value.style.setProperty(d,s))}),A}const FX="--vueuse-safe-area-top",zX="--vueuse-safe-area-right",JX="--vueuse-safe-area-bottom",LX="--vueuse-safe-area-left";function hE(){const e=o.ref(""),g=o.ref(""),I=o.ref(""),C=o.ref("");if(In){const i=fw(FX),A=fw(zX),n=fw(JX),l=fw(LX);i.value="env(safe-area-inset-top, 0px)",A.value="env(safe-area-inset-right, 0px)",n.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",t(),Mt("resize",eX(t))}function t(){e.value=Rw(FX),g.value=Rw(zX),I.value=Rw(JX),C.value=Rw(LX)}return{top:e,right:g,bottom:I,left:C,update:t}}function Rw(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const bE=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:g}){const{top:I,right:C,bottom:t,left:i}=hE();return()=>{if(g.default)return o.h("div",{style:{paddingTop:e.top?I.value:"",paddingRight:e.right?C.value:"",paddingBottom:e.bottom?t.value:"",paddingLeft:e.left?i.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},g.default())}}}),ZE={[gn.mounted](e,g){if(typeof g.value=="function"){const I=g.value,C=iY(e,{onScroll(){I(C)},onStop(){I(C)}})}else{const[I,C]=g.value,t=iY(e,{...C,onScroll(i){var A;(A=C.onScroll)==null||A.call(C,i),I(t)},onStop(i){var A;(A=C.onStop)==null||A.call(C,i),I(t)}})}}};function TX(e){const g=window.getComputedStyle(e);if(g.overflowX==="scroll"||g.overflowY==="scroll"||g.overflowX==="auto"&&e.clientWidth<e.scrollWidth||g.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const I=e.parentNode;return!I||I.tagName==="BODY"?!1:TX(I)}}function GE(e){const g=e||window.event,I=g.target;return TX(I)?!1:g.touches.length>1?!0:(g.preventDefault&&g.preventDefault(),!1)}const AY=new WeakMap;function wE(e,g=!1){const I=o.ref(g);let C=null,t="";o.watch(Ww(e),n=>{const l=Mw(Hg(n));if(l){const s=l;if(AY.get(s)||AY.set(s,s.style.overflow),s.style.overflow!=="hidden"&&(t=s.style.overflow),s.style.overflow==="hidden")return I.value=!0;if(I.value)return s.style.overflow="hidden"}},{immediate:!0});const i=()=>{const n=Mw(Hg(e));!n||I.value||(ww&&(C=Mt(n,"touchmove",l=>{GE(l)},{passive:!1})),n.style.overflow="hidden",I.value=!0)},A=()=>{const n=Mw(Hg(e));!n||!I.value||(ww&&(C==null||C()),n.style.overflow=t,AY.delete(n),I.value=!1)};return hC(A),o.computed({get(){return I.value},set(n){n?i():A()}})}function WE(){let e=!1;const g=o.ref(!1);return(I,C)=>{if(g.value=C.value,e)return;e=!0;const t=wE(I,C.value);o.watch(g,i=>t.value=i)}}const pE=WE(),BE=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:g}){const I=o.reactive(qQ(()=>e.time,{...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),yE=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:g}){const I=o.reactive(IU({...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),YE=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:g,expose:I}){const{list:C}=o.toRefs(e),{list:t,containerProps:i,wrapperProps:A,scrollTo:n}=eU(C,e.options);return I({scrollTo:n}),i.style&&typeof i.style=="object"&&!Array.isArray(i.style)&&(i.style.height=e.height||"300px"),()=>o.h("div",{...i},[o.h("div",{...A.value},t.value.map(l=>o.h("div",{style:{overflow:"hidden",height:l.height}},g.default?g.default(l):"Please set content!")))])}}),VE=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:g}){const I=o.reactive({focused:AU()});return()=>{if(g.default)return g.default(I)}}}),NE=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:g}){const I=o.reactive(nU(e));return()=>{if(g.default)return g.default(I)}}});function KI(e,g=document.documentElement){for(const[I,C]of Object.entries(e))g.style.setProperty(I,String(C))}const ME=["data-testid"],fE=["data-testid"],RE=["open","data-testid"],Dr=Tg(o.defineComponent({__name:"SelectList",props:{isOpened:{type:Boolean,default:!1},isUseAnchor:{type:Boolean,default:!1},disableOpen:{type:Boolean},headerClasses:{},optionsClasses:{},disabled:{type:Boolean},dataTestid:{default:"SelectList"}},emits:["change","focusout-options"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({isOpened:!1}),i=o.useId(),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.computed(()=>`--anchor-select-${i}`);o.watchEffect(()=>t.isOpened=I.isOpened);const a=()=>{I.disabled||I.disableOpen||(t.isOpened=!t.isOpened,C("change",t.isOpened))},d=()=>{t.isOpened=!1,C("focusout-options"),C("change",t.isOpened)},m=()=>{requestAnimationFrame(()=>{if(!n.value||!A.value||!t.isOpened)return;const h=n.value.getBoundingClientRect();if(!I.isUseAnchor)A.value.style.top=`${h.top+h.height}px`;else{KI({transform:"translateX(0) translateY(0)"},A.value);const Z=A.value.getBoundingClientRect();let G=0,w=0;Z.bottom>document.documentElement.scrollHeight&&(G=-Z.bottom+document.documentElement.scrollHeight-10,KI({transform:`translateY(${G}px)`},A.value)),Z.right>window.innerWidth&&(w=-Z.right+window.innerWidth-10,KI({transform:`translateX(${w}px) translateY(${G}px)`},A.value))}})};o.watch(()=>I.isOpened,()=>{t.isOpened=I.isOpened}),o.watch(()=>t.isOpened,m);const u=()=>{l.value&&KI({"anchor-name":`${s.value}`},l.value),A.value&&KI({"position-anchor":`${s.value}`},A.value)};return o.onMounted(()=>{I.isUseAnchor?u():window.addEventListener("scroll",m,!0),window.addEventListener("resize",m)}),o.onUnmounted(()=>{window.removeEventListener("scroll",m,!1),window.removeEventListener("resize",m)}),(h,Z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"selectRef",ref:l,class:"select-list-yui-kit","data-testid":I.dataTestid},[o.renderSlot(h.$slots,"body",{closeOpenList:a},()=>[o.createElementVNode("div",{ref_key:"currentRef",ref:n,class:o.normalizeClass(["select-list-yui-kit__current",{"active-yui-kit":t.isOpened},{"disabled-yui-kit":I.disabled},I==null?void 0:I.headerClasses]),tabindex:"0",onKeyup:o.withKeys(a,["enter"]),onClick:a,"data-testid":`${I.dataTestid}-Current`},[o.renderSlot(h.$slots,"header",{},void 0,!0)],42,fE)],!0),o.withDirectives(o.createElementVNode("ul",{ref_key:"dropdownRef",ref:A,class:o.normalizeClass(["select-list-yui-kit__list",I==null?void 0:I.optionsClasses]),open:t.isOpened,"data-testid":`${I.dataTestid}-OptionsList`},[o.renderSlot(h.$slots,"options",{},void 0,!0)],10,RE),[[o.vShow,t.isOpened]])],8,ME)),[[o.unref(Cd),d,void 0,{bubble:!0}]])}}),[["__scopeId","data-v-c213e68c"]]);function cs(e){return e!==null&&typeof e=="object"&&"key"in e}function vX(e){return e!==null&&Array.isArray(e)&&typeof e[0]=="object"&&"key"in e[0]}const nY=e=>e!==null&&typeof e=="object"&&"hint"in e,Jh=e=>e!==null&&Array.isArray(e)&&nY(e[0]),XE=["onClick","data-testid"],HE={class:"options__value truncate-yui-kit"},DE={key:0,class:"options__used"},lY=Tg(o.defineComponent({__name:"Options",props:{options:{},defaultOption:{},class:{},disabled:{type:Boolean},dataTestid:{default:"Options"}},emits:["change","disabled-click"],setup(e,{emit:g}){const I=e,C=o.reactive({choosedOption:I.defaultOption??(I.options[0]||""),lengthOption:0});o.watch(()=>I.defaultOption,()=>{I.defaultOption?C.choosedOption=I.defaultOption:C.choosedOption=""},{immediate:!0});const t=g,i=o.computed(()=>({"select-list-yui-kit__item":!0,"truncate-yui-kit":!0})),A=s=>{if(cs(s)&&s.disabled){t("disabled-click",s.key);return}C.choosedOption=s,cs(C.choosedOption)?t("change",C.choosedOption.key):t("change",C.choosedOption)},n=s=>{let a=!1;return cs(s)?cs(C.choosedOption)?s.value===C.choosedOption.value&&(a=!0):((s.key==="null"||s.key===null)&&C.choosedOption===""&&(a=!0),s.value===C.choosedOption&&(a=!0)):cs(C.choosedOption)?s===C.choosedOption.value&&(a=!0):s===C.choosedOption&&(a=!0),{active:a}},l=s=>nY(s)?s.hint:cs(s)?s.value:s;return(s,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.options,(d,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[o.createElementVNode("li",{class:o.normalizeClass([i.value,n(d),{"select-list-yui-kit__item_disabled":o.unref(cs)(d)?d.disabled:!1},I.class]),onClick:()=>A(d),"data-testid":`${I.dataTestid}-${m}`},[o.createElementVNode("div",{class:o.normalizeClass(["options__item",{options__item_disabled:o.unref(cs)(d)?d.disabled:!1}])},[o.createElementVNode("div",HE,o.toDisplayString(l(d)),1),typeof d=="object"&&(d!=null&&d.used)?(o.openBlock(),o.createElementBlock("div",DE)):o.createCommentVNode("",!0)],2),o.renderSlot(s.$slots,"option",{inx:m},void 0,!0)],10,XE),o.renderSlot(s.$slots,"default",{},void 0,!0)],64))),128))}}),[["__scopeId","data-v-0f0e283f"]]),SE=["data-testid"],oY=Tg(o.defineComponent({__name:"Dropdown",props:{options:{},defaultOption:{},class:{},disabled:{type:Boolean,default:!1},dataTestid:{default:"Dropdown"}},emits:["change"],setup(e,{emit:g}){const I=e,C=o.reactive({choosedOption:I.defaultOption||I.options[0]||"",isOpened:!1}),t=g,i=n=>{C.isOpened=n},A=n=>{let l;if(vX(I.options)){const s=I.options.find(a=>a.key===n);C.choosedOption=(s==null?void 0:s.value)||n,l=s==null?void 0:s.key}else C.choosedOption=n;C.isOpened=!1,t("change",l||n)};return o.watch(()=>I.defaultOption,()=>{I.defaultOption&&(C.choosedOption=I.defaultOption)}),o.onMounted(()=>{vX(I.options)&&(C.choosedOption=I.defaultOption||I.options[0].value)}),(n,l)=>(o.openBlock(),o.createBlock(Dr,{onChange:i,"is-opened":C.isOpened,class:o.normalizeClass([I.class,"dropdown-yui-kit"]),disabled:I.disabled,"data-testid":I.dataTestid},{header:o.withCtx(()=>[o.createElementVNode("span",{class:"truncate-yui-kit dropdown-yui-kit__text","data-testid":`${I.dataTestid}-SelectedText`},o.toDisplayString(C.choosedOption),9,SE),C.isOpened?(o.openBlock(),o.createBlock(Mg,{key:0,name:o.unref(ug).chevronUp,"data-testid":`${I.dataTestid}-ArrowUp`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),C.isOpened?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Mg,{key:1,name:o.unref(ug).chevronDown,"data-testid":`${I.dataTestid}-ArrowDown`},null,8,["name","data-testid"]))]),options:o.withCtx(()=>[o.createVNode(lY,{options:I.options,"default-option":I.defaultOption,onChange:A,"data-testid":`${I.dataTestid}-Options`},null,8,["options","default-option","data-testid"])]),_:1},8,["is-opened","class","disabled","data-testid"]))}}),[["__scopeId","data-v-08af0925"]]);/**
656
+ `},uploadCloud:nx,usersGroup:Xx,warehouse:Bx,wastes:Nx,writeDowns:Mx,zoomMinus:YO,zoomPlus:VO},Symbol.toStringTag,{value:"Module"})),NO=["data-testid","fill","viewBox"],MO=["innerHTML"],fO=o.defineComponent({__name:"Icon",props:{height:{},width:{},name:{},color:{},dataTestid:{default:"Icon"}},setup(e){const g=e,I=o.computed(()=>({color:g.color,width:`${g.width}px`,height:`${g.height}px`})),C=i=>i.replace(/-./g,A=>A[1].toUpperCase()),t=o.computed(()=>jy[C(g.name)]);return(i,A)=>{var n,l,s;return o.openBlock(),o.createElementBlock("svg",{class:"icon-yui-kit","data-testid":g.dataTestid,style:o.normalizeStyle(I.value),fill:(n=o.unref(jy)[C(g.name)])==null?void 0:n.fill,viewBox:((l=o.unref(jy)[C(g.name)])==null?void 0:l.viewbox)||"0 0 24 24"},[o.createElementVNode("g",{innerHTML:(s=t.value)==null?void 0:s.path},null,8,MO)],12,NO)}}}),Tg=(e,g)=>{const I=e.__vccOpts||e;for(const[C,t]of g)I[C]=t;return I},Mg=Tg(fO,[["__scopeId","data-v-938d45fe"]]),RO=["data-testid"],XO=["data-testid"],HO=o.defineComponent({__name:"Badges",props:{text:{},type:{default:zI.default},choosed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestid:{default:"Badges"}},emits:["choose","remove"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.reactive({choosed:C.choosed}),A=o.ref(null),n=()=>!!(A.value&&A.value.scrollWidth>A.value.clientWidth),l=o.ref(n()),s=o.computed(()=>({"base-yui-kit":!0,"default-yui-kit":C.type===zI.default,"blue-yui-kit":C.type===zI.blue,"light-blue-yui-kit":C.type===zI.lightBlue,"contrast-blue-yui-kit":C.type===zI.contrastBlue,"green-yui-kit":C.type===zI.green,"orange-yui-kit":C.type===zI.orange,"red-yui-kit":C.type===zI.red,"pink-yui-kit":C.type===zI.pink,"violet-yui-kit":C.type===zI.violet,"yellow-yui-kit":C.type===zI.yellow,"choosed-yui-kit":C.choosed||i.choosed,"disabled-yui-kit":C.type===zI.disabled})),a=()=>{t("choose",i.choosed,C.text),C.disabled||(i.choosed=!i.choosed)},d=()=>{t("remove",C.text)},m=new ResizeObserver(()=>{l.value=n()});return g({isSpanOverflow:l}),o.onMounted(()=>{A.value&&m.observe(A.value)}),(u,h)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(s.value),onClick:a,"data-testid":C.dataTestid},[o.createElementVNode("span",{ref_key:"spanRef",ref:A,class:"badges-text","data-testid":`${C.dataTestid}-BadgesText`},o.toDisplayString(C.text),9,XO),o.createVNode(Mg,{class:"close-icon",width:10,height:10,"data-testid":`${C.dataTestid}-Icon`,name:o.unref(ug).closeTag,color:"var(--text-neutral-color)",onClick:d},null,8,["data-testid","name"])],10,RO))}}),ot=Tg(HO,[["__scopeId","data-v-8043ecdc"]]),DO=["data-testid"],SO=["data-testid"],KO=["data-testid"],kO=["data-testid"],FO=["data-testid"],zO=["data-testid"],JO=["title","onClick","data-testid"],LO=["data-testid"],TO=["onClick","data-testid"],vO=["data-testid"],xy=25,Oy=Tg(o.defineComponent({__name:"BreadCrumbs",props:{items:{},dataTestid:{default:"BreadCrumbs"}},emits:["click"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({items:[],crumbs:o.computed(()=>{const d=I.items.length<4?I.items.length-1:3;let m=[I.items[0],...I.items.slice(-d)];return I.items.length===1&&(m=[I.items[0]]),m.map(u=>(u.isSub=!1,u))}),subCrumbs:o.computed(()=>I.items.slice(1,-3).map(d=>(d.isSub=!0,d))),getClassesLink:o.computed(()=>(d,m=!1)=>({"bread-crumbs-yui-kit__link":!0,"disabled-yui-kit":!d.path,active:m})),getClassesSpan:o.computed(()=>d=>({"checked-yui-kit":d===t.crumbs.length-1})),fullTitle:o.computed(()=>d=>d.title.length>xy),isShowList:!1}),i=o.computed(()=>({crumbs:{"bread-crumbs-yui-kit__item":!0},subcrumbs:{"bread-subcrumbs-yui-kit__item":!0}})),A=o.computed(()=>({crumbs:{"bread-subcrumbs-yui-kit":!0,"scroll-yui-kit":!0,"active-yui-kit":t.isShowList}})),n=(d,m)=>{m!==t.items.length-1&&(d.isSub&&l(),I.items.forEach(({path:u},h)=>{u===d.path&&C("click",{title:d.title,path:d.path,inx:h+1})}))},l=()=>t.isShowList=!t.isShowList,s=d=>d.title.length>xy?d.title.slice(0,xy).trim()+"...":d.title,a=d=>t.items.length>=5&&d===1;return o.onMounted(()=>t.items=t.crumbs.concat(t.subCrumbs)),(d,m)=>(o.openBlock(),o.createElementBlock("ul",{class:"bread-crumbs-yui-kit","data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.items,(u,h)=>(o.openBlock(),o.createElementBlock("li",{class:o.normalizeClass(i.value.crumbs),key:u.path,"data-testid":`${I.dataTestid}-Crumbs${h}`},[a(h)?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${I.dataTestid}-ShowSubList${h}`},[o.createElementVNode("span",{class:"bread-crumbs-yui-kit--closed",onClick:l,"data-testid":`${I.dataTestid}-Closed${h}`},"...",8,kO),o.createElementVNode("ul",{class:o.normalizeClass(A.value.crumbs),"data-testid":`${I.dataTestid}-Crumbs${h}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.subCrumbs,(Z,G)=>(o.openBlock(),o.createElementBlock("li",{key:Z.path,class:o.normalizeClass(i.value.subcrumbs),"data-testid":`${I.dataTestid}-SubCrumbs${G}`},[o.createElementVNode("span",{title:Z.title,onClick:w=>n(Z,G),class:o.normalizeClass({"disabled-yui-kit":!Z.path}),"data-testid":`${I.dataTestid}-SubCrumbs-Title${G}`},o.toDisplayString(s(Z)),11,JO)],10,zO))),128))],10,FO)],8,KO)):o.createCommentVNode("",!0),u.isSub?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.getClassesLink(u,h===t.crumbs.length-1)),"data-testid":`${I.dataTestid}-Classes${h}`},[o.createElementVNode("span",{class:o.normalizeClass(t.getClassesSpan(h)),onClick:Z=>n(u,h),"data-testid":`${I.dataTestid}-Checked${h}`},[o.createTextVNode(o.toDisplayString(h!==t.crumbs.length-1?s(u):u.title),1),t.fullTitle(u)&&h!==t.crumbs.length-1?(o.openBlock(),o.createElementBlock("span",{key:0,"data-testid":`${I.dataTestid}-FullName`,class:"fullName-yui-kit"},o.toDisplayString(u.title),9,vO)):o.createCommentVNode("",!0)],10,TO),h!==t.crumbs.length-1?(o.openBlock(),o.createBlock(Mg,{key:0,name:o.unref(ug).rightSmall,"data-testid":`${I.dataTestid}-Icon`},null,8,["name","data-testid"])):o.createCommentVNode("",!0)],10,LO))],10,SO))),128))],8,DO))}}),[["__scopeId","data-v-6c2ef4f4"]]);var Le=(e=>(e.small="small",e.medium="medium",e.large="large",e.little="little",e))(Le||{}),NI=(e=>(e.primary="primary",e.outline="outline",e.ghost="ghost",e.secondary="secondary",e.reject="reject",e.minor="minor",e))(NI||{});const jO=["disabled","data-testid"],xO=["data-testid"],OO=["data-testid"],QO=o.defineComponent({__name:"Button",props:{disabled:{type:Boolean,default:!1},size:{default:Le.medium},type:{default:NI.primary},pill:{type:Boolean,default:!1},backgroundColor:{},color:{default:""},dataTestid:{default:"Button"}},emits:["click"],setup(e,{emit:g}){const I=e,C=g,t=o.computed(()=>({"button-yui-kit":!0,[I.size]:!0,"disabled-yui-kit":I.disabled,"pill-yui-kit":I.pill,"primary-yui-kit":I.type===NI.primary,"secondary-yui-kit":I.type===NI.secondary,"outline-yui-kit":I.type===NI.outline,"reject-yui-kit":I.type===NI.reject,"ghost-yui-kit":I.type===NI.ghost,"minor-yui-kit":I.type===NI.minor})),i=o.computed(()=>({backgroundColor:I.backgroundColor})),A=o.computed(()=>({color:I.color==="primary"||I.color==="secondary"?"black":I.color})),n=l=>C("click",l);return(l,s)=>(o.openBlock(),o.createElementBlock("button",{class:o.normalizeClass(t.value),disabled:I.disabled,tabindex:"0",style:o.normalizeStyle(i.value),"data-testid":I.dataTestid,onClick:n,onKeyup:o.withKeys(n,["enter"])},[l.$slots["left-icon"]?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(A.value),"data-testid":`${I.dataTestid}-LeftIcon`},[o.renderSlot(l.$slots,"left-icon",{},void 0,!0)],12,xO)):o.createCommentVNode("",!0),o.renderSlot(l.$slots,"default",{},void 0,!0),l.$slots["right-icon"]?(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle(A.value),"data-testid":`${I.dataTestid}-RightIcon`},[o.renderSlot(l.$slots,"right-icon",{},void 0,!0)],12,OO)):o.createCommentVNode("",!0)],46,jO))}}),JI=Tg(QO,[["__scopeId","data-v-4529c65c"]]),UO=["data-testid"],EO=["data-testid","onClick"],bw=Tg(o.defineComponent({__name:"Switch",props:{items:{},defaultValue:{},isIcons:{type:Boolean},disabled:{type:Boolean},theme:{default:"default"},dataTestid:{default:"Switch"}},emits:["change"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({activeIndex:0}),i=o.computed(()=>[{"switch-yui-kit-list_default":I.theme==="default","switch-yui-kit-list_contrast":I.theme==="contrast","switch-yui-kit-list_disabled":I.disabled}]),A=a=>({"switch-yui-kit-item":!0,"switch-yui-kit-active":t.activeIndex===a,"switch-yui-kit-active_disabled":t.activeIndex===a&&I.disabled,"switch-yui-kit-item_disabled":I.disabled}),n=a=>typeof a=="string"?a:a.label,l=a=>typeof a=="string"?a:a.value,s=a=>{t.activeIndex!==a&&(t.activeIndex=a,C("change",{index:a,value:l(I.items[a])}))};return o.watch(()=>I.defaultValue,()=>{t.activeIndex=I.defaultValue?I.items.findIndex(a=>l(a)===I.defaultValue)??0:0}),o.onMounted(()=>{if(I.defaultValue){const a=I.items.findIndex(d=>l(d)===I.defaultValue);a!==-1&&(t.activeIndex=a)}}),(a,d)=>(o.openBlock(),o.createElementBlock("ul",{class:o.normalizeClass(["switch-yui-kit-list",i.value]),"data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.items,(m,u)=>(o.openBlock(),o.createElementBlock("li",{key:u,class:o.normalizeClass(A(u)),"data-testid":`${I.dataTestid}-Item${u}`,onClick:h=>s(u)},[I.isIcons?(o.openBlock(),o.createBlock(Mg,{key:0,name:m,"data-testid":`${I.dataTestid}-Item-Icon${u}`},null,8,["name","data-testid"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[m.icon?(o.openBlock(),o.createBlock(Mg,{key:0,class:"switch-yui-kit-item-icon",name:m.icon,"data-testid":`${I.dataTestid}-Item-Icon${u}`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(n(m)),1)],64))],10,EO))),128))],10,UO))}}),[["__scopeId","data-v-0f7dea38"]]);function hC(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function Hg(e){return typeof e=="function"?e():o.unref(e)}const gn={mounted:"mounted",updated:"updated",unmounted:"unmounted"},In=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zw=e=>e!=null,PO=Object.prototype.toString,qR=e=>PO.call(e)==="[object Object]",Gw=()=>+Date.now(),Qy=(e,g,I)=>Math.min(I,Math.max(g,e)),me=()=>{},ww=_O();function _O(){var e,g;return In&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((g=window==null?void 0:window.navigator)==null?void 0:g.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fh(e,g){function I(...C){return new Promise((t,i)=>{Promise.resolve(e(()=>g.apply(this,C),{fn:g,thisArg:this,args:C})).then(t).catch(i)})}return I}const Uy=e=>e();function $O(e,g={}){let I,C,t=me;const i=n=>{clearTimeout(n),t(),t=me};return n=>{const l=Hg(e),s=Hg(g.maxWait);return I&&i(I),l<=0||s!==void 0&&s<=0?(C&&(i(C),C=null),Promise.resolve(n())):new Promise((a,d)=>{t=g.rejectOnCancel?d:a,s&&!C&&(C=setTimeout(()=>{I&&i(I),C=null,a(n())},s)),I=setTimeout(()=>{C&&i(C),C=null,a(n())},l)})}}function gX(...e){let g=0,I,C=!0,t=me,i,A,n,l,s;!o.isRef(e[0])&&typeof e[0]=="object"?{delay:A,trailing:n=!0,leading:l=!0,rejectOnCancel:s=!1}=e[0]:[A,n=!0,l=!0,s=!1]=e;const a=()=>{I&&(clearTimeout(I),I=void 0,t(),t=me)};return m=>{const u=Hg(A),h=Date.now()-g,Z=()=>i=m();return a(),u<=0?(g=Date.now(),Z()):(h>u&&(l||!C)?(g=Date.now(),Z()):n&&(i=new Promise((G,w)=>{t=s?w:G,I=setTimeout(()=>{g=Date.now(),C=!0,G(Z()),a()},Math.max(0,u-h))})),!l&&!I&&(I=setTimeout(()=>C=!0,u)),C=!1,i)}}function qO(e=Uy){const g=o.ref(!0);function I(){g.value=!1}function C(){g.value=!0}const t=(...i)=>{g.value&&e(...i)};return{isActive:o.readonly(g),pause:I,resume:C,eventFilter:t}}function Ey(e,g=!1,I="Timeout"){return new Promise((C,t)=>{setTimeout(g?()=>t(I):C,e)})}function gQ(e){let g;function I(){return g||(g=e()),g}return I.reset=async()=>{const C=g;g=void 0,C&&await C},I}function IQ(e,g,I=!1){return g.reduce((C,t)=>(t in e&&(!I||e[t]!==void 0)&&(C[t]=e[t]),C),{})}function eQ(e){return Object.entries(e)}function IX(e){return o.getCurrentInstance()}function Ww(...e){if(e.length!==1)return o.toRef(...e);const g=e[0];return typeof g=="function"?o.readonly(o.customRef(()=>({get:g,set:me}))):o.ref(g)}function eX(e,g=200,I={}){return Fh($O(g,I),e)}function CQ(e,g=200,I=!1,C=!0,t=!1){return Fh(gX(g,I,C,t),e)}function tQ(e,g,I={}){const{eventFilter:C=Uy,...t}=I;return o.watch(e,Fh(C,g),t)}function pw(e,g,I={}){const{eventFilter:C,...t}=I,{eventFilter:i,pause:A,resume:n,isActive:l}=qO(C);return{stop:tQ(e,g,{...t,eventFilter:i}),pause:A,resume:n,isActive:l}}function CX(e,g,...[I]){const{flush:C="sync",deep:t=!1,immediate:i=!0,direction:A="both",transform:n={}}=I||{},l=[],s="ltr"in n&&n.ltr||(m=>m),a="rtl"in n&&n.rtl||(m=>m);return(A==="both"||A==="ltr")&&l.push(pw(e,m=>{l.forEach(u=>u.pause()),g.value=s(m),l.forEach(u=>u.resume())},{flush:C,deep:t,immediate:i})),(A==="both"||A==="rtl")&&l.push(pw(g,m=>{l.forEach(u=>u.pause()),e.value=a(m),l.forEach(u=>u.resume())},{flush:C,deep:t,immediate:i})),()=>{l.forEach(m=>m.stop())}}function tX(e,g={}){if(!o.isRef(e))return o.toRefs(e);const I=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const C in e.value)I[C]=o.customRef(()=>({get(){return e.value[C]},set(t){var i;if((i=Hg(g.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const n=[...e.value];n[C]=t,e.value=n}else{const n={...e.value,[C]:t};Object.setPrototypeOf(n,Object.getPrototypeOf(e.value)),e.value=n}else e.value[C]=t}}));return I}function Jl(e,g=!0,I){IX()?o.onMounted(e,I):g?e():o.nextTick(e)}function iQ(e,g){IX()&&o.onUnmounted(e,g)}function Py(e,g=!1){function I(d,{flush:m="sync",deep:u=!1,timeout:h,throwOnTimeout:Z}={}){let G=null;const p=[new Promise(B=>{G=o.watch(e,y=>{d(y)!==g&&(G?G():o.nextTick(()=>G==null?void 0:G()),B(y))},{flush:m,deep:u,immediate:!0})})];return h!=null&&p.push(Ey(h,Z).then(()=>Hg(e)).finally(()=>G==null?void 0:G())),Promise.race(p)}function C(d,m){if(!o.isRef(d))return I(y=>y===d,m);const{flush:u="sync",deep:h=!1,timeout:Z,throwOnTimeout:G}=m??{};let w=null;const B=[new Promise(y=>{w=o.watch([e,d],([Y,f])=>{g!==(Y===f)&&(w?w():o.nextTick(()=>w==null?void 0:w()),y(Y))},{flush:u,deep:h,immediate:!0})})];return Z!=null&&B.push(Ey(Z,G).then(()=>Hg(e)).finally(()=>(w==null||w(),Hg(e)))),Promise.race(B)}function t(d){return I(m=>!!m,d)}function i(d){return C(null,d)}function A(d){return C(void 0,d)}function n(d){return I(Number.isNaN,d)}function l(d,m){return I(u=>{const h=Array.from(u);return h.includes(d)||h.includes(Hg(d))},m)}function s(d){return a(1,d)}function a(d=1,m){let u=-1;return I(()=>(u+=1,u>=d),m)}return Array.isArray(Hg(e))?{toMatch:I,toContains:l,changed:s,changedTimes:a,get not(){return Py(e,!g)}}:{toMatch:I,toBe:C,toBeTruthy:t,toBeNull:i,toBeNaN:n,toBeUndefined:A,changed:s,changedTimes:a,get not(){return Py(e,!g)}}}function _y(e){return Py(e)}function iX(e,g=1e3,I={}){const{immediate:C=!0,immediateCallback:t=!1}=I;let i=null;const A=o.ref(!1);function n(){i&&(clearInterval(i),i=null)}function l(){A.value=!1,n()}function s(){const a=Hg(g);a<=0||(A.value=!0,t&&e(),n(),i=setInterval(e,a))}if(C&&In&&s(),o.isRef(g)||typeof g=="function"){const a=o.watch(g,()=>{A.value&&In&&s()});hC(a)}return hC(l),{isActive:A,pause:l,resume:s}}function AQ(e,g,I={}){const{immediate:C=!0}=I,t=o.ref(!1);let i=null;function A(){i&&(clearTimeout(i),i=null)}function n(){t.value=!1,A()}function l(...s){A(),t.value=!0,i=setTimeout(()=>{t.value=!1,i=null,e(...s)},Hg(g))}return C&&(t.value=!0,In&&l()),hC(n),{isPending:o.readonly(t),start:l,stop:n}}function nQ(e=!1,g={}){const{truthyValue:I=!0,falsyValue:C=!1}=g,t=o.isRef(e),i=o.ref(e);function A(n){if(arguments.length)return i.value=n,i.value;{const l=Hg(I);return i.value=i.value===l?Hg(C):l,i.value}}return t?A:[i,A]}const OI=In?window:void 0,$y=In?window.document:void 0,zh=In?window.navigator:void 0;function Ve(e){var g;const I=Hg(e);return(g=I==null?void 0:I.$el)!=null?g:I}function _g(...e){let g,I,C,t;if(typeof e[0]=="string"||Array.isArray(e[0])?([I,C,t]=e,g=OI):[g,I,C,t]=e,!g)return me;Array.isArray(I)||(I=[I]),Array.isArray(C)||(C=[C]);const i=[],A=()=>{i.forEach(a=>a()),i.length=0},n=(a,d,m,u)=>(a.addEventListener(d,m,u),()=>a.removeEventListener(d,m,u)),l=o.watch(()=>[Ve(g),Hg(t)],([a,d])=>{if(A(),!a)return;const m=qR(d)?{...d}:d;i.push(...I.flatMap(u=>C.map(h=>n(a,u,h,m))))},{immediate:!0,flush:"post"}),s=()=>{l(),A()};return hC(s),s}let AX=!1;function lQ(e,g,I={}){const{window:C=OI,ignore:t=[],capture:i=!0,detectIframe:A=!1}=I;if(!C)return me;ww&&!AX&&(AX=!0,Array.from(C.document.body.children).forEach(u=>u.addEventListener("click",me)),C.document.documentElement.addEventListener("click",me));let n=!0;const l=u=>Hg(t).some(h=>{if(typeof h=="string")return Array.from(C.document.querySelectorAll(h)).some(Z=>Z===u.target||u.composedPath().includes(Z));{const Z=Ve(h);return Z&&(u.target===Z||u.composedPath().includes(Z))}}),s=u=>{const h=Ve(e);if(!(!h||h===u.target||u.composedPath().includes(h))){if(u.detail===0&&(n=!l(u)),!n){n=!0;return}g(u)}};let a=!1;const d=[_g(C,"click",u=>{a||(a=!0,setTimeout(()=>{a=!1},0),s(u))},{passive:!0,capture:i}),_g(C,"pointerdown",u=>{const h=Ve(e);n=!l(u)&&!!(h&&!u.composedPath().includes(h))},{passive:!0}),A&&_g(C,"blur",u=>{setTimeout(()=>{var h;const Z=Ve(e);((h=C.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(Z!=null&&Z.contains(C.document.activeElement))&&g(u)},0)})].filter(Boolean);return()=>d.forEach(u=>u())}function oQ(){const e=o.ref(!1),g=o.getCurrentInstance();return g&&o.onMounted(()=>{e.value=!0},g),e}function ii(e){const g=oQ();return o.computed(()=>(g.value,!!e()))}function nX(e,g,I={}){const{window:C=OI,...t}=I;let i;const A=ii(()=>C&&"MutationObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const m=Hg(e),u=(Array.isArray(m)?m:[m]).map(Ve).filter(Zw);return new Set(u)}),s=o.watch(()=>l.value,m=>{n(),A.value&&m.size&&(i=new MutationObserver(g),m.forEach(u=>i.observe(u,t)))},{immediate:!0,flush:"post"}),a=()=>i==null?void 0:i.takeRecords(),d=()=>{s(),n()};return hC(d),{isSupported:A,stop:d,takeRecords:a}}function sQ(e={}){var g;const{window:I=OI,deep:C=!0,triggerOnRemoval:t=!1}=e,i=(g=e.document)!=null?g:I==null?void 0:I.document,A=()=>{var s;let a=i==null?void 0:i.activeElement;if(C)for(;a!=null&&a.shadowRoot;)a=(s=a==null?void 0:a.shadowRoot)==null?void 0:s.activeElement;return a},n=o.ref(),l=()=>{n.value=A()};return I&&(_g(I,"blur",s=>{s.relatedTarget===null&&l()},!0),_g(I,"focus",l,!0)),t&&nX(i,s=>{s.filter(a=>a.removedNodes.length).map(a=>Array.from(a.removedNodes)).flat().forEach(a=>{a===n.value&&l()})},{childList:!0,subtree:!0}),l(),n}function lX(e,g={}){const{immediate:I=!0,fpsLimit:C=void 0,window:t=OI}=g,i=o.ref(!1),A=C?1e3/C:null;let n=0,l=null;function s(m){if(!i.value||!t)return;n||(n=m);const u=m-n;if(A&&u<A){l=t.requestAnimationFrame(s);return}n=m,e({delta:u,timestamp:m}),l=t.requestAnimationFrame(s)}function a(){!i.value&&t&&(i.value=!0,n=0,l=t.requestAnimationFrame(s))}function d(){i.value=!1,l!=null&&t&&(t.cancelAnimationFrame(l),l=null)}return I&&a(),hC(d),{isActive:o.readonly(i),pause:d,resume:a}}function aQ(e={}){const{navigator:g=zh}=e,I=["chargingchange","chargingtimechange","dischargingtimechange","levelchange"],C=ii(()=>g&&"getBattery"in g&&typeof g.getBattery=="function"),t=o.ref(!1),i=o.ref(0),A=o.ref(0),n=o.ref(1);let l;function s(){t.value=this.charging,i.value=this.chargingTime||0,A.value=this.dischargingTime||0,n.value=this.level}return C.value&&g.getBattery().then(a=>{l=a,s.call(l),_g(l,I,s,{passive:!0})}),{isSupported:C,charging:t,chargingTime:i,dischargingTime:A,level:n}}function ds(e,g={}){const{window:I=OI}=g,C=ii(()=>I&&"matchMedia"in I&&typeof I.matchMedia=="function");let t;const i=o.ref(!1),A=s=>{i.value=s.matches},n=()=>{t&&("removeEventListener"in t?t.removeEventListener("change",A):t.removeListener(A))},l=o.watchEffect(()=>{C.value&&(n(),t=I.matchMedia(Hg(e)),"addEventListener"in t?t.addEventListener("change",A):t.addListener(A),i.value=t.matches)});return hC(()=>{l(),n(),t=void 0}),i}const oX=["hash","host","hostname","href","pathname","port","protocol","search"];function dQ(e={}){const{window:g=OI}=e,I=Object.fromEntries(oX.map(i=>[i,o.ref()]));for(const[i,A]of eQ(I))o.watch(A,n=>{!(g!=null&&g.location)||g.location[i]===n||(g.location[i]=n)});const C=i=>{var A;const{state:n,length:l}=(g==null?void 0:g.history)||{},{origin:s}=(g==null?void 0:g.location)||{};for(const a of oX)I[a].value=(A=g==null?void 0:g.location)==null?void 0:A[a];return o.reactive({trigger:i,state:n,length:l,origin:s,...I})},t=o.ref(C("load"));return g&&(_g(g,"popstate",()=>t.value=C("popstate"),{passive:!0}),_g(g,"hashchange",()=>t.value=C("hashchange"),{passive:!0})),t}function qy(e,g={}){const{controls:I=!1,navigator:C=zh}=g,t=ii(()=>C&&"permissions"in C),i=o.shallowRef(),A=typeof e=="string"?{name:e}:e,n=o.shallowRef(),l=()=>{var a,d;n.value=(d=(a=i.value)==null?void 0:a.state)!=null?d:"prompt"};_g(i,"change",l);const s=gQ(async()=>{if(t.value){if(!i.value)try{i.value=await C.permissions.query(A)}catch{i.value=void 0}finally{l()}if(I)return o.toRaw(i.value)}});return s(),I?{state:n,isSupported:t,query:s}:n}function cQ(e={}){const{navigator:g=zh,read:I=!1,source:C,copiedDuring:t=1500,legacy:i=!1}=e,A=ii(()=>g&&"clipboard"in g),n=qy("clipboard-read"),l=qy("clipboard-write"),s=o.computed(()=>A.value||i),a=o.ref(""),d=o.ref(!1),m=AQ(()=>d.value=!1,t);function u(){A.value&&w(n.value)?g.clipboard.readText().then(p=>{a.value=p}):a.value=G()}s.value&&I&&_g(["copy","cut"],u);async function h(p=Hg(C)){s.value&&p!=null&&(A.value&&w(l.value)?await g.clipboard.writeText(p):Z(p),a.value=p,d.value=!0,m.start())}function Z(p){const B=document.createElement("textarea");B.value=p??"",B.style.position="absolute",B.style.opacity="0",document.body.appendChild(B),B.select(),document.execCommand("copy"),B.remove()}function G(){var p,B,y;return(y=(B=(p=document==null?void 0:document.getSelection)==null?void 0:p.call(document))==null?void 0:B.toString())!=null?y:""}function w(p){return p==="granted"||p==="prompt"}return{isSupported:s,text:a,copied:d,copy:h}}const Bw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yw="__vueuse_ssr_handlers__",rQ=mQ();function mQ(){return yw in Bw||(Bw[yw]=Bw[yw]||{}),Bw[yw]}function sX(e,g){return rQ[e]||g}function gY(e){return ds("(prefers-color-scheme: dark)",e)}function uQ(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const hQ={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},aX="vueuse-storage";function dX(e,g,I,C={}){var t;const{flush:i="pre",deep:A=!0,listenToStorageChanges:n=!0,writeDefaults:l=!0,mergeDefaults:s=!1,shallow:a,window:d=OI,eventFilter:m,onError:u=X=>{console.error(X)},initOnMounted:h}=C,Z=(a?o.shallowRef:o.ref)(typeof g=="function"?g():g);if(!I)try{I=sX("getDefaultStorage",()=>{var X;return(X=OI)==null?void 0:X.localStorage})()}catch(X){u(X)}if(!I)return Z;const G=Hg(g),w=uQ(G),p=(t=C.serializer)!=null?t:hQ[w],{pause:B,resume:y}=pw(Z,()=>f(Z.value),{flush:i,deep:A,eventFilter:m});d&&n&&Jl(()=>{I instanceof Storage?_g(d,"storage",K):_g(d,aX,F),h&&K()}),h||K();function Y(X,z){if(d){const L={key:e,oldValue:X,newValue:z,storageArea:I};d.dispatchEvent(I instanceof Storage?new StorageEvent("storage",L):new CustomEvent(aX,{detail:L}))}}function f(X){try{const z=I.getItem(e);if(X==null)Y(z,null),I.removeItem(e);else{const L=p.write(X);z!==L&&(I.setItem(e,L),Y(z,L))}}catch(z){u(z)}}function M(X){const z=X?X.newValue:I.getItem(e);if(z==null)return l&&G!=null&&I.setItem(e,p.write(G)),G;if(!X&&s){const L=p.read(z);return typeof s=="function"?s(L,G):w==="object"&&!Array.isArray(L)?{...G,...L}:L}else return typeof z!="string"?z:p.read(z)}function K(X){if(!(X&&X.storageArea!==I)){if(X&&X.key==null){Z.value=G;return}if(!(X&&X.key!==e)){B();try{(X==null?void 0:X.newValue)!==p.write(Z.value)&&(Z.value=M(X))}catch(z){u(z)}finally{X?o.nextTick(y):y()}}}}function F(X){K(X.detail)}return Z}const bQ="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function ZQ(e={}){const{selector:g="html",attribute:I="class",initialValue:C="auto",window:t=OI,storage:i,storageKey:A="vueuse-color-scheme",listenToStorageChanges:n=!0,storageRef:l,emitAuto:s,disableTransition:a=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},m=gY({window:t}),u=o.computed(()=>m.value?"dark":"light"),h=l||(A==null?Ww(C):dX(A,C,i,{window:t,listenToStorageChanges:n})),Z=o.computed(()=>h.value==="auto"?u.value:h.value),G=sX("updateHTMLAttrs",(y,Y,f)=>{const M=typeof y=="string"?t==null?void 0:t.document.querySelector(y):Ve(y);if(!M)return;const K=new Set,F=new Set;let X=null;if(Y==="class"){const L=f.split(/\s/g);Object.values(d).flatMap(O=>(O||"").split(/\s/g)).filter(Boolean).forEach(O=>{L.includes(O)?K.add(O):F.add(O)})}else X={key:Y,value:f};if(K.size===0&&F.size===0&&X===null)return;let z;a&&(z=t.document.createElement("style"),z.appendChild(document.createTextNode(bQ)),t.document.head.appendChild(z));for(const L of K)M.classList.add(L);for(const L of F)M.classList.remove(L);X&&M.setAttribute(X.key,X.value),a&&(t.getComputedStyle(z).opacity,document.head.removeChild(z))});function w(y){var Y;G(g,I,(Y=d[y])!=null?Y:y)}function p(y){e.onChanged?e.onChanged(y,w):w(y)}o.watch(Z,p,{flush:"post",immediate:!0}),Jl(()=>p(Z.value));const B=o.computed({get(){return s?h.value:Z.value},set(y){h.value=y}});try{return Object.assign(B,{store:h,system:u,state:Z})}catch{return B}}function GQ(e={}){const{valueDark:g="dark",valueLight:I="",window:C=OI}=e,t=ZQ({...e,onChanged:(n,l)=>{var s;e.onChanged?(s=e.onChanged)==null||s.call(e,n==="dark",l,n):l(n)},modes:{dark:g,light:I}}),i=o.computed(()=>t.system?t.system.value:gY({window:C}).value?"dark":"light");return o.computed({get(){return t.value==="dark"},set(n){const l=n?"dark":"light";i.value===l?t.value="auto":t.value=l}})}function wQ(e={}){const{window:g=OI,eventFilter:I=Uy}=e,C=o.ref({x:null,y:null,z:null}),t=o.ref({alpha:null,beta:null,gamma:null}),i=o.ref(0),A=o.ref({x:null,y:null,z:null});if(g){const n=Fh(I,l=>{C.value=l.acceleration,A.value=l.accelerationIncludingGravity,t.value=l.rotationRate,i.value=l.interval});_g(g,"devicemotion",n)}return{acceleration:C,accelerationIncludingGravity:A,rotationRate:t,interval:i}}function WQ(e={}){const{window:g=OI}=e,I=ii(()=>g&&"DeviceOrientationEvent"in g),C=o.ref(!1),t=o.ref(null),i=o.ref(null),A=o.ref(null);return g&&I.value&&_g(g,"deviceorientation",n=>{C.value=n.absolute,t.value=n.alpha,i.value=n.beta,A.value=n.gamma}),{isSupported:I,isAbsolute:C,alpha:t,beta:i,gamma:A}}function pQ(e={}){const{window:g=OI}=e,I=o.ref(1);if(g){let C=function(){I.value=g.devicePixelRatio,t(),i=g.matchMedia(`(resolution: ${I.value}dppx)`),i.addEventListener("change",C,{once:!0})},t=function(){i==null||i.removeEventListener("change",C)},i;C(),hC(t)}return{pixelRatio:I}}function BQ(e={}){const{navigator:g=zh,requestPermissions:I=!1,constraints:C={audio:!0,video:!0},onUpdated:t}=e,i=o.ref([]),A=o.computed(()=>i.value.filter(h=>h.kind==="videoinput")),n=o.computed(()=>i.value.filter(h=>h.kind==="audioinput")),l=o.computed(()=>i.value.filter(h=>h.kind==="audiooutput")),s=ii(()=>g&&g.mediaDevices&&g.mediaDevices.enumerateDevices),a=o.ref(!1);let d;async function m(){s.value&&(i.value=await g.mediaDevices.enumerateDevices(),t==null||t(i.value),d&&(d.getTracks().forEach(h=>h.stop()),d=null))}async function u(){if(!s.value)return!1;if(a.value)return!0;const{state:h,query:Z}=qy("camera",{controls:!0});return await Z(),h.value!=="granted"&&(d=await g.mediaDevices.getUserMedia(C),m()),a.value=!0,a.value}return s.value&&(I&&u(),_g(g.mediaDevices,"devicechange",m),m()),{devices:i,ensurePermissions:u,permissionGranted:a,videoInputs:A,audioInputs:n,audioOutputs:l,isSupported:s}}function yQ(e={}){const{document:g=$y}=e;if(!g)return o.ref("visible");const I=o.ref(g.visibilityState);return _g(g,"visibilitychange",()=>{I.value=g.visibilityState}),I}function YQ(e,g={}){var I,C;const{pointerTypes:t,preventDefault:i,stopPropagation:A,exact:n,onMove:l,onEnd:s,onStart:a,initialValue:d,axis:m="both",draggingElement:u=OI,containerElement:h,handle:Z=e,buttons:G=[0]}=g,w=o.ref((I=Hg(d))!=null?I:{x:0,y:0}),p=o.ref(),B=K=>t?t.includes(K.pointerType):!0,y=K=>{Hg(i)&&K.preventDefault(),Hg(A)&&K.stopPropagation()},Y=K=>{var F;if(!Hg(G).includes(K.button)||Hg(g.disabled)||!B(K)||Hg(n)&&K.target!==Hg(e))return;const X=Hg(h),z=(F=X==null?void 0:X.getBoundingClientRect)==null?void 0:F.call(X),L=Hg(e).getBoundingClientRect(),O={x:K.clientX-(X?L.left-z.left+X.scrollLeft:L.left),y:K.clientY-(X?L.top-z.top+X.scrollTop:L.top)};(a==null?void 0:a(O,K))!==!1&&(p.value=O,y(K))},f=K=>{if(Hg(g.disabled)||!B(K)||!p.value)return;const F=Hg(h),X=Hg(e).getBoundingClientRect();let{x:z,y:L}=w.value;(m==="x"||m==="both")&&(z=K.clientX-p.value.x,F&&(z=Math.min(Math.max(0,z),F.scrollWidth-X.width))),(m==="y"||m==="both")&&(L=K.clientY-p.value.y,F&&(L=Math.min(Math.max(0,L),F.scrollHeight-X.height))),w.value={x:z,y:L},l==null||l(w.value,K),y(K)},M=K=>{Hg(g.disabled)||!B(K)||p.value&&(p.value=void 0,s==null||s(w.value,K),y(K))};if(In){const K={capture:(C=g.capture)!=null?C:!0};_g(Z,"pointerdown",Y,K),_g(u,"pointermove",f,K),_g(u,"pointerup",M,K)}return{...tX(w),position:w,isDragging:o.computed(()=>!!p.value),style:o.computed(()=>`left:${w.value.x}px;top:${w.value.y}px;`)}}function cX(e,g,I={}){const{window:C=OI,...t}=I;let i;const A=ii(()=>C&&"ResizeObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const d=Hg(e);return Array.isArray(d)?d.map(m=>Ve(m)):[Ve(d)]}),s=o.watch(l,d=>{if(n(),A.value&&C){i=new ResizeObserver(g);for(const m of d)m&&i.observe(m,t)}},{immediate:!0,flush:"post"}),a=()=>{n(),s()};return hC(a),{isSupported:A,stop:a}}function VQ(e,g={}){const{reset:I=!0,windowResize:C=!0,windowScroll:t=!0,immediate:i=!0,updateTiming:A="sync"}=g,n=o.ref(0),l=o.ref(0),s=o.ref(0),a=o.ref(0),d=o.ref(0),m=o.ref(0),u=o.ref(0),h=o.ref(0);function Z(){const w=Ve(e);if(!w){I&&(n.value=0,l.value=0,s.value=0,a.value=0,d.value=0,m.value=0,u.value=0,h.value=0);return}const p=w.getBoundingClientRect();n.value=p.height,l.value=p.bottom,s.value=p.left,a.value=p.right,d.value=p.top,m.value=p.width,u.value=p.x,h.value=p.y}function G(){A==="sync"?Z():A==="next-frame"&&requestAnimationFrame(()=>Z())}return cX(e,G),o.watch(()=>Ve(e),w=>!w&&G()),nX(e,G,{attributeFilter:["style","class"]}),t&&_g("scroll",G,{capture:!0,passive:!0}),C&&_g("resize",G,{passive:!0}),Jl(()=>{i&&G()}),{height:n,bottom:l,left:s,right:a,top:d,width:m,x:u,y:h,update:G}}function rX(e,g={width:0,height:0},I={}){const{window:C=OI,box:t="content-box"}=I,i=o.computed(()=>{var d,m;return(m=(d=Ve(e))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),A=o.ref(g.width),n=o.ref(g.height),{stop:l}=cX(e,([d])=>{const m=t==="border-box"?d.borderBoxSize:t==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(C&&i.value){const u=Ve(e);if(u){const h=u.getBoundingClientRect();A.value=h.width,n.value=h.height}}else if(m){const u=Array.isArray(m)?m:[m];A.value=u.reduce((h,{inlineSize:Z})=>h+Z,0),n.value=u.reduce((h,{blockSize:Z})=>h+Z,0)}else A.value=d.contentRect.width,n.value=d.contentRect.height},I);Jl(()=>{const d=Ve(e);d&&(A.value="offsetWidth"in d?d.offsetWidth:g.width,n.value="offsetHeight"in d?d.offsetHeight:g.height)});const s=o.watch(()=>Ve(e),d=>{A.value=d?g.width:0,n.value=d?g.height:0});function a(){l(),s()}return{width:A,height:n,stop:a}}function NQ(e,g,I={}){const{root:C,rootMargin:t="0px",threshold:i=0,window:A=OI,immediate:n=!0}=I,l=ii(()=>A&&"IntersectionObserver"in A),s=o.computed(()=>{const h=Hg(e);return(Array.isArray(h)?h:[h]).map(Ve).filter(Zw)});let a=me;const d=o.ref(n),m=l.value?o.watch(()=>[s.value,Ve(C),d.value],([h,Z])=>{if(a(),!d.value||!h.length)return;const G=new IntersectionObserver(g,{root:Ve(Z),rootMargin:t,threshold:i});h.forEach(w=>w&&G.observe(w)),a=()=>{G.disconnect(),a=me}},{immediate:n,flush:"post"}):me,u=()=>{a(),m(),d.value=!1};return hC(u),{isSupported:l,isActive:d,pause(){a(),d.value=!1},resume(){d.value=!0},stop:u}}function MQ(e,g={}){const{window:I=OI,scrollTarget:C,threshold:t=0}=g,i=o.ref(!1);return NQ(e,A=>{let n=i.value,l=0;for(const s of A)s.time>=l&&(l=s.time,n=s.isIntersecting);i.value=n},{root:C,window:I,threshold:t}),i}function fQ(e={}){const{initialValue:g=""}=e,I=ii(()=>typeof window<"u"&&"EyeDropper"in window),C=o.ref(g);async function t(i){if(!I.value)return;const n=await new window.EyeDropper().open(i);return C.value=n.sRGBHex,n}return{isSupported:I,sRGBHex:C,open:t}}const mX=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function RQ(e,g={}){const{document:I=$y,autoExit:C=!1}=g,t=o.computed(()=>{var w;return(w=Ve(e))!=null?w:I==null?void 0:I.querySelector("html")}),i=o.ref(!1),A=o.computed(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(w=>I&&w in I||t.value&&w in t.value)),n=o.computed(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(w=>I&&w in I||t.value&&w in t.value)),l=o.computed(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(w=>I&&w in I||t.value&&w in t.value)),s=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(w=>I&&w in I),a=ii(()=>t.value&&I&&A.value!==void 0&&n.value!==void 0&&l.value!==void 0),d=()=>s?(I==null?void 0:I[s])===t.value:!1,m=()=>{if(l.value){if(I&&I[l.value]!=null)return I[l.value];{const w=t.value;if((w==null?void 0:w[l.value])!=null)return!!w[l.value]}}return!1};async function u(){if(!(!a.value||!i.value)){if(n.value)if((I==null?void 0:I[n.value])!=null)await I[n.value]();else{const w=t.value;(w==null?void 0:w[n.value])!=null&&await w[n.value]()}i.value=!1}}async function h(){if(!a.value||i.value)return;m()&&await u();const w=t.value;A.value&&(w==null?void 0:w[A.value])!=null&&(await w[A.value](),i.value=!0)}async function Z(){await(i.value?u():h())}const G=()=>{const w=m();(!w||w&&d())&&(i.value=w)};return _g(I,mX,G,!1),_g(()=>Ve(t),mX,G,!1),C&&hC(u),{isSupported:a,isFullscreen:i,enter:h,exit:u,toggle:Z}}function XQ(e={}){const{enableHighAccuracy:g=!0,maximumAge:I=3e4,timeout:C=27e3,navigator:t=zh,immediate:i=!0}=e,A=ii(()=>t&&"geolocation"in t),n=o.ref(null),l=o.shallowRef(null),s=o.ref({accuracy:0,latitude:Number.POSITIVE_INFINITY,longitude:Number.POSITIVE_INFINITY,altitude:null,altitudeAccuracy:null,heading:null,speed:null});function a(h){n.value=h.timestamp,s.value=h.coords,l.value=null}let d;function m(){A.value&&(d=t.geolocation.watchPosition(a,h=>l.value=h,{enableHighAccuracy:g,maximumAge:I,timeout:C}))}i&&m();function u(){d&&t&&t.geolocation.clearWatch(d)}return hC(()=>{u()}),{isSupported:A,coords:s,locatedAt:n,error:l,resume:m,pause:u}}const HQ=["mousemove","mousedown","resize","keydown","touchstart","wheel"],DQ=6e4;function SQ(e=DQ,g={}){const{initialState:I=!1,listenForVisibilityChange:C=!0,events:t=HQ,window:i=OI,eventFilter:A=gX(50)}=g,n=o.ref(I),l=o.ref(Gw());let s;const a=()=>{n.value=!1,clearTimeout(s),s=setTimeout(()=>n.value=!0,e)},d=Fh(A,()=>{l.value=Gw(),a()});if(i){const m=i.document;for(const u of t)_g(i,u,d,{passive:!0});C&&_g(m,"visibilitychange",()=>{m.hidden||d()}),a()}return{idle:n,lastActive:l,reset:a}}const KQ={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function uX(e={}){const{type:g="page",touch:I=!0,resetOnTouchEnds:C=!1,initialValue:t={x:0,y:0},window:i=OI,target:A=i,scroll:n=!0,eventFilter:l}=e;let s=null;const a=o.ref(t.x),d=o.ref(t.y),m=o.ref(null),u=typeof g=="function"?g:KQ[g],h=Y=>{const f=u(Y);s=Y,f&&([a.value,d.value]=f,m.value="mouse")},Z=Y=>{if(Y.touches.length>0){const f=u(Y.touches[0]);f&&([a.value,d.value]=f,m.value="touch")}},G=()=>{if(!s||!i)return;const Y=u(s);s instanceof MouseEvent&&Y&&(a.value=Y[0]+i.scrollX,d.value=Y[1]+i.scrollY)},w=()=>{a.value=t.x,d.value=t.y},p=l?Y=>l(()=>h(Y),{}):Y=>h(Y),B=l?Y=>l(()=>Z(Y),{}):Y=>Z(Y),y=l?()=>l(()=>G(),{}):()=>G();if(A){const Y={passive:!0};_g(A,["mousemove","dragover"],p,Y),I&&g!=="movement"&&(_g(A,["touchstart","touchmove"],B,Y),C&&_g(A,"touchend",w,Y)),n&&g==="page"&&_g(i,"scroll",y,{passive:!0})}return{x:a,y:d,sourceType:m}}function kQ(e,g={}){const{handleOutside:I=!0,window:C=OI}=g,t=g.type||"page",{x:i,y:A,sourceType:n}=uX(g),l=o.ref(e??(C==null?void 0:C.document.body)),s=o.ref(0),a=o.ref(0),d=o.ref(0),m=o.ref(0),u=o.ref(0),h=o.ref(0),Z=o.ref(!0);let G=()=>{};return C&&(G=o.watch([l,i,A],()=>{const w=Ve(l);if(!w||!(w instanceof Element))return;const{left:p,top:B,width:y,height:Y}=w.getBoundingClientRect();d.value=p+(t==="page"?C.pageXOffset:0),m.value=B+(t==="page"?C.pageYOffset:0),u.value=Y,h.value=y;const f=i.value-d.value,M=A.value-m.value;Z.value=y===0||Y===0||f<0||M<0||f>y||M>Y,(I||!Z.value)&&(s.value=f,a.value=M)},{immediate:!0}),_g(document,"mouseleave",()=>{Z.value=!0})),{x:i,y:A,sourceType:n,elementX:s,elementY:a,elementPositionX:d,elementPositionY:m,elementHeight:u,elementWidth:h,isOutside:Z,stop:G}}function FQ(e={}){const{touch:g=!0,drag:I=!0,capture:C=!1,initialValue:t=!1,window:i=OI}=e,A=o.ref(t),n=o.ref(null);if(!i)return{pressed:A,sourceType:n};const l=d=>()=>{A.value=!0,n.value=d},s=()=>{A.value=!1,n.value=null},a=o.computed(()=>Ve(e.target)||i);return _g(a,"mousedown",l("mouse"),{passive:!0,capture:C}),_g(i,"mouseleave",s,{passive:!0,capture:C}),_g(i,"mouseup",s,{passive:!0,capture:C}),I&&(_g(a,"dragstart",l("mouse"),{passive:!0,capture:C}),_g(i,"drop",s,{passive:!0,capture:C}),_g(i,"dragend",s,{passive:!0,capture:C})),g&&(_g(a,"touchstart",l("touch"),{passive:!0,capture:C}),_g(i,"touchend",s,{passive:!0,capture:C}),_g(i,"touchcancel",s,{passive:!0,capture:C})),{pressed:A,sourceType:n}}function hX(e={}){const{window:g=OI}=e,I=g==null?void 0:g.navigator,C=ii(()=>I&&"connection"in I),t=o.ref(!0),i=o.ref(!1),A=o.ref(void 0),n=o.ref(void 0),l=o.ref(void 0),s=o.ref(void 0),a=o.ref(void 0),d=o.ref(void 0),m=o.ref("unknown"),u=C.value&&I.connection;function h(){I&&(t.value=I.onLine,A.value=t.value?void 0:Date.now(),n.value=t.value?Date.now():void 0,u&&(l.value=u.downlink,s.value=u.downlinkMax,d.value=u.effectiveType,a.value=u.rtt,i.value=u.saveData,m.value=u.type))}return g&&(_g(g,"offline",()=>{t.value=!1,A.value=Date.now()}),_g(g,"online",()=>{t.value=!0,n.value=Date.now()})),u&&_g(u,"change",h,!1),h(),{isSupported:o.readonly(C),isOnline:o.readonly(t),saveData:o.readonly(i),offlineAt:o.readonly(A),onlineAt:o.readonly(n),downlink:o.readonly(l),downlinkMax:o.readonly(s),effectiveType:o.readonly(d),rtt:o.readonly(a),type:o.readonly(m)}}function bX(e={}){const{controls:g=!1,interval:I="requestAnimationFrame"}=e,C=o.ref(new Date),t=()=>C.value=new Date,i=I==="requestAnimationFrame"?lX(t,{immediate:!0}):iX(t,I,{immediate:!0});return g?{now:C,...i}:C}function zQ(e){const g=o.ref(),I=()=>{g.value&&URL.revokeObjectURL(g.value),g.value=void 0};return o.watch(()=>Hg(e),C=>{I(),C&&(g.value=URL.createObjectURL(C))},{immediate:!0}),hC(I),o.readonly(g)}function ZX(e,g,I){if(typeof e=="function"||o.isReadonly(e))return o.computed(()=>Qy(Hg(e),Hg(g),Hg(I)));const C=o.ref(e);return o.computed({get(){return C.value=Qy(C.value,Hg(g),Hg(I))},set(t){C.value=Qy(t,Hg(g),Hg(I))}})}function JQ(e){const{total:g=Number.POSITIVE_INFINITY,pageSize:I=10,page:C=1,onPageChange:t=me,onPageSizeChange:i=me,onPageCountChange:A=me}=e,n=ZX(I,1,Number.POSITIVE_INFINITY),l=o.computed(()=>Math.max(1,Math.ceil(Hg(g)/Hg(n)))),s=ZX(C,1,l),a=o.computed(()=>s.value===1),d=o.computed(()=>s.value===l.value);o.isRef(C)&&CX(C,s,{direction:o.isReadonly(C)?"ltr":"both"}),o.isRef(I)&&CX(I,n,{direction:o.isReadonly(I)?"ltr":"both"});function m(){s.value--}function u(){s.value++}const h={currentPage:s,currentPageSize:n,pageCount:l,isFirstPage:a,isLastPage:d,prev:m,next:u};return o.watch(s,()=>{t(o.reactive(h))}),o.watch(n,()=>{i(o.reactive(h))}),o.watch(l,()=>{A(o.reactive(h))}),h}function LQ(e={}){const{isOnline:g}=hX(e);return g}function TQ(e={}){const{window:g=OI}=e,I=o.ref(!1),C=t=>{if(!g)return;t=t||g.event;const i=t.relatedTarget||t.toElement;I.value=!i};return g&&(_g(g,"mouseout",C,{passive:!0}),_g(g.document,"mouseleave",C,{passive:!0}),_g(g.document,"mouseenter",C,{passive:!0})),I}const GX={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},vQ=Object.keys(GX);function jQ(e={}){const{target:g=OI}=e,I=o.ref(!1),C=o.ref(e.initialValue||{});Object.assign(C.value,GX,C.value);const t=i=>{I.value=!0,!(e.pointerTypes&&!e.pointerTypes.includes(i.pointerType))&&(C.value=IQ(i,vQ,!1))};if(g){const i={passive:!0};_g(g,["pointerdown","pointermove","pointerup"],t,i),_g(g,"pointerleave",()=>I.value=!1,i)}return{...tX(C),isInside:I}}function xQ(e,g={}){const{document:I=$y}=g,C=ii(()=>I&&"pointerLockElement"in I),t=o.ref(),i=o.ref();let A;C.value&&(_g(I,"pointerlockchange",()=>{var s;const a=(s=I.pointerLockElement)!=null?s:t.value;A&&a===A&&(t.value=I.pointerLockElement,t.value||(A=i.value=null))}),_g(I,"pointerlockerror",()=>{var s;const a=(s=I.pointerLockElement)!=null?s:t.value;if(A&&a===A){const d=I.pointerLockElement?"release":"acquire";throw new Error(`Failed to ${d} pointer lock.`)}}));async function n(s){var a;if(!C.value)throw new Error("Pointer Lock API is not supported by your browser.");if(i.value=s instanceof Event?s.currentTarget:null,A=s instanceof Event?(a=Ve(e))!=null?a:i.value:Ve(s),!A)throw new Error("Target element undefined.");return A.requestPointerLock(),await _y(t).toBe(A)}async function l(){return t.value?(I.exitPointerLock(),await _y(t).toBeNull(),!0):!1}return{isSupported:C,element:t,triggerElement:i,lock:n,unlock:l}}function OQ(e){const g=ds("(prefers-color-scheme: light)",e),I=ds("(prefers-color-scheme: dark)",e);return o.computed(()=>I.value?"dark":g.value?"light":"no-preference")}function QQ(e){const g=ds("(prefers-contrast: more)",e),I=ds("(prefers-contrast: less)",e),C=ds("(prefers-contrast: custom)",e);return o.computed(()=>g.value?"more":I.value?"less":C.value?"custom":"no-preference")}function UQ(e={}){const{window:g=OI}=e;if(!g)return o.ref(["en"]);const I=g.navigator,C=o.ref(I.languages);return _g(g,"languagechange",()=>{C.value=I.languages}),C}function EQ(e){const g=ds("(prefers-reduced-motion: reduce)",e);return o.computed(()=>g.value?"reduce":"no-preference")}const PQ=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],_Q={justNow:"just now",past:e=>e.match(/\d/)?`${e} ago`:e,future:e=>e.match(/\d/)?`in ${e}`:e,month:(e,g)=>e===1?g?"last month":"next month":`${e} month${e>1?"s":""}`,year:(e,g)=>e===1?g?"last year":"next year":`${e} year${e>1?"s":""}`,day:(e,g)=>e===1?g?"yesterday":"tomorrow":`${e} day${e>1?"s":""}`,week:(e,g)=>e===1?g?"last week":"next week":`${e} week${e>1?"s":""}`,hour:e=>`${e} hour${e>1?"s":""}`,minute:e=>`${e} minute${e>1?"s":""}`,second:e=>`${e} second${e>1?"s":""}`,invalid:""};function $Q(e){return e.toISOString().slice(0,10)}function qQ(e,g={}){const{controls:I=!1,updateInterval:C=3e4}=g,{now:t,...i}=bX({interval:C,controls:!0}),A=o.computed(()=>gU(new Date(Hg(e)),g,Hg(t)));return I?{timeAgo:A,...i}:A}function gU(e,g={},I=Date.now()){var C;const{max:t,messages:i=_Q,fullDateFormatter:A=$Q,units:n=PQ,showSecond:l=!1,rounding:s="round"}=g,a=typeof s=="number"?G=>+G.toFixed(s):Math[s],d=+I-+e,m=Math.abs(d);function u(G,w){return a(Math.abs(G)/w.value)}function h(G,w){const p=u(G,w),B=G>0,y=Z(w.name,p,B);return Z(B?"past":"future",y,B)}function Z(G,w,p){const B=i[G];return typeof B=="function"?B(w,p):B.replace("{0}",w.toString())}if(m<6e4&&!l)return i.justNow;if(typeof t=="number"&&m>t)return A(new Date(e));if(typeof t=="string"){const G=(C=n.find(w=>w.name===t))==null?void 0:C.max;if(G&&m>G)return A(new Date(e))}for(const[G,w]of n.entries()){if(u(d,w)<=0&&n[G-1])return h(d,n[G-1]);if(m<w.max)return h(d,w)}return i.invalid}function IU(e={}){const{controls:g=!1,offset:I=0,immediate:C=!0,interval:t="requestAnimationFrame",callback:i}=e,A=o.ref(Gw()+I),n=()=>A.value=Gw()+I,l=i?()=>{n(),i(A.value)}:n,s=t==="requestAnimationFrame"?lX(l,{immediate:C}):iX(l,t,{immediate:C});return g?{timestamp:A,...s}:A}function eU(e,g){const{containerStyle:I,wrapperProps:C,scrollTo:t,calculateRange:i,currentList:A,containerRef:n}="itemHeight"in g?iU(g,e):tU(g,e);return{list:A,scrollTo:t,containerProps:{ref:n,onScroll:()=>{i()},style:I},wrapperProps:C}}function wX(e){const g=o.ref(null),I=rX(g),C=o.ref([]),t=o.shallowRef(e);return{state:o.ref({start:0,end:10}),source:t,currentList:C,size:I,containerRef:g}}function WX(e,g,I){return C=>{if(typeof I=="number")return Math.ceil(C/I);const{start:t=0}=e.value;let i=0,A=0;for(let n=t;n<g.value.length;n++){const l=I(n);if(i+=l,A=n,i>C)break}return A-t}}function pX(e,g){return I=>{if(typeof g=="number")return Math.floor(I/g)+1;let C=0,t=0;for(let i=0;i<e.value.length;i++){const A=g(i);if(C+=A,C>=I){t=i;break}}return t+1}}function BX(e,g,I,C,{containerRef:t,state:i,currentList:A,source:n}){return()=>{const l=t.value;if(l){const s=I(e==="vertical"?l.scrollTop:l.scrollLeft),a=C(e==="vertical"?l.clientHeight:l.clientWidth),d=s-g,m=s+a+g;i.value={start:d<0?0:d,end:m>n.value.length?n.value.length:m},A.value=n.value.slice(i.value.start,i.value.end).map((u,h)=>({data:u,index:h+i.value.start}))}}}function yX(e,g){return I=>typeof e=="number"?I*e:g.value.slice(0,I).reduce((t,i,A)=>t+e(A),0)}function YX(e,g,I,C){o.watch([e.width,e.height,g,I],()=>{C()})}function VX(e,g){return o.computed(()=>typeof e=="number"?g.value.length*e:g.value.reduce((I,C,t)=>I+e(t),0))}const CU={horizontal:"scrollLeft",vertical:"scrollTop"};function NX(e,g,I,C){return t=>{C.value&&(C.value[CU[e]]=I(t),g())}}function tU(e,g){const I=wX(g),{state:C,source:t,currentList:i,size:A,containerRef:n}=I,l={overflowX:"auto"},{itemWidth:s,overscan:a=5}=e,d=WX(C,t,s),m=pX(t,s),u=BX("horizontal",a,m,d,I),h=yX(s,t),Z=o.computed(()=>h(C.value.start)),G=VX(s,t);YX(A,g,n,u);const w=NX("horizontal",u,h,n),p=o.computed(()=>({style:{height:"100%",width:`${G.value-Z.value}px`,marginLeft:`${Z.value}px`,display:"flex"}}));return{scrollTo:w,calculateRange:u,wrapperProps:p,containerStyle:l,currentList:i,containerRef:n}}function iU(e,g){const I=wX(g),{state:C,source:t,currentList:i,size:A,containerRef:n}=I,l={overflowY:"auto"},{itemHeight:s,overscan:a=5}=e,d=WX(C,t,s),m=pX(t,s),u=BX("vertical",a,m,d,I),h=yX(s,t),Z=o.computed(()=>h(C.value.start)),G=VX(s,t);YX(A,g,n,u);const w=NX("vertical",u,h,n),p=o.computed(()=>({style:{width:"100%",height:`${G.value-Z.value}px`,marginTop:`${Z.value}px`}}));return{calculateRange:u,scrollTo:w,containerStyle:l,wrapperProps:p,currentList:i,containerRef:n}}function AU(e={}){const{window:g=OI}=e;if(!g)return o.ref(!1);const I=o.ref(g.document.hasFocus());return _g(g,"blur",()=>{I.value=!1}),_g(g,"focus",()=>{I.value=!0}),I}function nU(e={}){const{window:g=OI,initialWidth:I=Number.POSITIVE_INFINITY,initialHeight:C=Number.POSITIVE_INFINITY,listenOrientation:t=!0,includeScrollbar:i=!0,type:A="inner"}=e,n=o.ref(I),l=o.ref(C),s=()=>{g&&(A==="outer"?(n.value=g.outerWidth,l.value=g.outerHeight):i?(n.value=g.innerWidth,l.value=g.innerHeight):(n.value=g.document.documentElement.clientWidth,l.value=g.document.documentElement.clientHeight))};if(s(),Jl(s),_g("resize",s,{passive:!0}),t){const a=ds("(orientation: portrait)");o.watch(a,()=>s())}return{width:n,height:l}}const lU=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:g,emit:I}){const C=o.ref();return lQ(C,t=>{I("trigger",t)},e.options),()=>{if(g.default)return o.h(e.as||"div",{ref:C},g.default())}}}),st=In?window:void 0;function bC(e){var g;const I=Hg(e);return(g=I==null?void 0:I.$el)!=null?g:I}function Mt(...e){let g,I,C,t;if(typeof e[0]=="string"||Array.isArray(e[0])?([I,C,t]=e,g=st):[g,I,C,t]=e,!g)return me;Array.isArray(I)||(I=[I]),Array.isArray(C)||(C=[C]);const i=[],A=()=>{i.forEach(a=>a()),i.length=0},n=(a,d,m,u)=>(a.addEventListener(d,m,u),()=>a.removeEventListener(d,m,u)),l=o.watch(()=>[bC(g),Hg(t)],([a,d])=>{if(A(),!a)return;const m=qR(d)?{...d}:d;i.push(...I.flatMap(u=>C.map(h=>n(a,u,h,m))))},{immediate:!0,flush:"post"}),s=()=>{l(),A()};return hC(s),s}let MX=!1;function fX(e,g,I={}){const{window:C=st,ignore:t=[],capture:i=!0,detectIframe:A=!1}=I;if(!C)return me;ww&&!MX&&(MX=!0,Array.from(C.document.body.children).forEach(u=>u.addEventListener("click",me)),C.document.documentElement.addEventListener("click",me));let n=!0;const l=u=>Hg(t).some(h=>{if(typeof h=="string")return Array.from(C.document.querySelectorAll(h)).some(Z=>Z===u.target||u.composedPath().includes(Z));{const Z=bC(h);return Z&&(u.target===Z||u.composedPath().includes(Z))}}),s=u=>{const h=bC(e);if(!(!h||h===u.target||u.composedPath().includes(h))){if(u.detail===0&&(n=!l(u)),!n){n=!0;return}g(u)}};let a=!1;const d=[Mt(C,"click",u=>{a||(a=!0,setTimeout(()=>{a=!1},0),s(u))},{passive:!0,capture:i}),Mt(C,"pointerdown",u=>{const h=bC(e);n=!l(u)&&!!(h&&!u.composedPath().includes(h))},{passive:!0}),A&&Mt(C,"blur",u=>{setTimeout(()=>{var h;const Z=bC(e);((h=C.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(Z!=null&&Z.contains(C.document.activeElement))&&g(u)},0)})].filter(Boolean);return()=>d.forEach(u=>u())}const Cd={[gn.mounted](e,g){const I=!g.modifiers.bubble;if(typeof g.value=="function")e.__onClickOutside_stop=fX(e,g.value,{capture:I});else{const[C,t]=g.value;e.__onClickOutside_stop=fX(e,C,Object.assign({capture:I},t))}},[gn.unmounted](e){e.__onClickOutside_stop()}};function oU(e){return typeof e=="function"?e:typeof e=="string"?g=>g.key===e:Array.isArray(e)?g=>e.includes(g.key):()=>!0}function RX(...e){let g,I,C={};e.length===3?(g=e[0],I=e[1],C=e[2]):e.length===2?typeof e[1]=="object"?(g=!0,I=e[0],C=e[1]):(g=e[0],I=e[1]):(g=!0,I=e[0]);const{target:t=st,eventName:i="keydown",passive:A=!1,dedupe:n=!1}=C,l=oU(g);return Mt(t,i,a=>{a.repeat&&Hg(n)||l(a)&&I(a)},A)}const sU={[gn.mounted](e,g){var I,C;const t=(C=(I=g.arg)==null?void 0:I.split(","))!=null?C:!0;if(typeof g.value=="function")RX(t,g.value,{target:e});else{const[i,A]=g.value;RX(t,i,{target:e,...A})}}},aU=500,dU=10;function IY(e,g,I){var C,t;const i=o.computed(()=>bC(e));let A,n,l,s=!1;function a(){A&&(clearTimeout(A),A=void 0),n=void 0,l=void 0,s=!1}function d(w){var p,B,y;const[Y,f,M]=[l,n,s];if(a(),!(I!=null&&I.onMouseUp)||!f||!Y||(p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value)return;(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation();const K=w.x-f.x,F=w.y-f.y,X=Math.sqrt(K*K+F*F);I.onMouseUp(w.timeStamp-Y,X,M)}function m(w){var p,B,y,Y;(p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value||(a(),(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation(),n={x:w.x,y:w.y},l=w.timeStamp,A=setTimeout(()=>{s=!0,g(w)},(Y=I==null?void 0:I.delay)!=null?Y:aU))}function u(w){var p,B,y,Y;if((p=I==null?void 0:I.modifiers)!=null&&p.self&&w.target!==i.value||!n||(I==null?void 0:I.distanceThreshold)===!1)return;(B=I==null?void 0:I.modifiers)!=null&&B.prevent&&w.preventDefault(),(y=I==null?void 0:I.modifiers)!=null&&y.stop&&w.stopPropagation();const f=w.x-n.x,M=w.y-n.y;Math.sqrt(f*f+M*M)>=((Y=I==null?void 0:I.distanceThreshold)!=null?Y:dU)&&a()}const h={capture:(C=I==null?void 0:I.modifiers)==null?void 0:C.capture,once:(t=I==null?void 0:I.modifiers)==null?void 0:t.once},Z=[Mt(i,"pointerdown",m,h),Mt(i,"pointermove",u,h),Mt(i,["pointerup","pointerleave"],d,h)];return()=>Z.forEach(w=>w())}const cU=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:g,emit:I}){const C=o.ref();return IY(C,t=>{I("trigger",t)},e.options),()=>{if(g.default)return o.h(e.as||"div",{ref:C},g.default())}}}),XX={[gn.mounted](e,g){typeof g.value=="function"?IY(e,g.value,{modifiers:g.modifiers}):IY(e,...g.value)}},rU=o.defineComponent({name:"UseActiveElement",setup(e,{slots:g}){const I=o.reactive({element:sQ()});return()=>{if(g.default)return g.default(I)}}}),mU=o.defineComponent({name:"UseBattery",setup(e,{slots:g}){const I=o.reactive(aQ(e));return()=>{if(g.default)return g.default(I)}}}),uU=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:g}){const I=o.reactive(dQ());return()=>{if(g.default)return g.default(I)}}}),hU=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:g}){const I=o.reactive(cQ(e));return()=>{var C;return(C=g.default)==null?void 0:C.call(g,I)}}}),Yw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vw="__vueuse_ssr_handlers__",bU=ZU();function ZU(){return Vw in Yw||(Yw[Vw]=Yw[Vw]||{}),Yw[Vw]}function HX(e,g){return bU[e]||g}function GU(){const e=o.ref(!1),g=o.getCurrentInstance();return g&&o.onMounted(()=>{e.value=!0},g),e}function Nw(e){const g=GU();return o.computed(()=>(g.value,!!e()))}function wU(e,g={}){const{window:I=st}=g,C=Nw(()=>I&&"matchMedia"in I&&typeof I.matchMedia=="function");let t;const i=o.ref(!1),A=s=>{i.value=s.matches},n=()=>{t&&("removeEventListener"in t?t.removeEventListener("change",A):t.removeListener(A))},l=o.watchEffect(()=>{C.value&&(n(),t=I.matchMedia(Hg(e)),"addEventListener"in t?t.addEventListener("change",A):t.addListener(A),i.value=t.matches)});return hC(()=>{l(),n(),t=void 0}),i}function WU(e){return wU("(prefers-color-scheme: dark)",e)}function pU(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const BU={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},DX="vueuse-storage";function yU(e,g,I,C={}){var t;const{flush:i="pre",deep:A=!0,listenToStorageChanges:n=!0,writeDefaults:l=!0,mergeDefaults:s=!1,shallow:a,window:d=st,eventFilter:m,onError:u=X=>{console.error(X)},initOnMounted:h}=C,Z=(a?o.shallowRef:o.ref)(typeof g=="function"?g():g);if(!I)try{I=HX("getDefaultStorage",()=>{var X;return(X=st)==null?void 0:X.localStorage})()}catch(X){u(X)}if(!I)return Z;const G=Hg(g),w=pU(G),p=(t=C.serializer)!=null?t:BU[w],{pause:B,resume:y}=pw(Z,()=>f(Z.value),{flush:i,deep:A,eventFilter:m});d&&n&&Jl(()=>{I instanceof Storage?Mt(d,"storage",K):Mt(d,DX,F),h&&K()}),h||K();function Y(X,z){if(d){const L={key:e,oldValue:X,newValue:z,storageArea:I};d.dispatchEvent(I instanceof Storage?new StorageEvent("storage",L):new CustomEvent(DX,{detail:L}))}}function f(X){try{const z=I.getItem(e);if(X==null)Y(z,null),I.removeItem(e);else{const L=p.write(X);z!==L&&(I.setItem(e,L),Y(z,L))}}catch(z){u(z)}}function M(X){const z=X?X.newValue:I.getItem(e);if(z==null)return l&&G!=null&&I.setItem(e,p.write(G)),G;if(!X&&s){const L=p.read(z);return typeof s=="function"?s(L,G):w==="object"&&!Array.isArray(L)?{...G,...L}:L}else return typeof z!="string"?z:p.read(z)}function K(X){if(!(X&&X.storageArea!==I)){if(X&&X.key==null){Z.value=G;return}if(!(X&&X.key!==e)){B();try{(X==null?void 0:X.newValue)!==p.write(Z.value)&&(Z.value=M(X))}catch(z){u(z)}finally{X?o.nextTick(y):y()}}}}function F(X){K(X.detail)}return Z}const YU="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function VU(e={}){const{selector:g="html",attribute:I="class",initialValue:C="auto",window:t=st,storage:i,storageKey:A="vueuse-color-scheme",listenToStorageChanges:n=!0,storageRef:l,emitAuto:s,disableTransition:a=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},m=WU({window:t}),u=o.computed(()=>m.value?"dark":"light"),h=l||(A==null?Ww(C):yU(A,C,i,{window:t,listenToStorageChanges:n})),Z=o.computed(()=>h.value==="auto"?u.value:h.value),G=HX("updateHTMLAttrs",(y,Y,f)=>{const M=typeof y=="string"?t==null?void 0:t.document.querySelector(y):bC(y);if(!M)return;const K=new Set,F=new Set;let X=null;if(Y==="class"){const L=f.split(/\s/g);Object.values(d).flatMap(O=>(O||"").split(/\s/g)).filter(Boolean).forEach(O=>{L.includes(O)?K.add(O):F.add(O)})}else X={key:Y,value:f};if(K.size===0&&F.size===0&&X===null)return;let z;a&&(z=t.document.createElement("style"),z.appendChild(document.createTextNode(YU)),t.document.head.appendChild(z));for(const L of K)M.classList.add(L);for(const L of F)M.classList.remove(L);X&&M.setAttribute(X.key,X.value),a&&(t.getComputedStyle(z).opacity,document.head.removeChild(z))});function w(y){var Y;G(g,I,(Y=d[y])!=null?Y:y)}function p(y){e.onChanged?e.onChanged(y,w):w(y)}o.watch(Z,p,{flush:"post",immediate:!0}),Jl(()=>p(Z.value));const B=o.computed({get(){return s?h.value:Z.value},set(y){h.value=y}});try{return Object.assign(B,{store:h,system:u,state:Z})}catch{return B}}const NU=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:g}){const I=VU(e),C=o.reactive({mode:I,system:I.system,store:I.store});return()=>{if(g.default)return g.default(C)}}}),MU=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:g}){const I=GQ(e),C=o.reactive({isDark:I,toggleDark:nQ(I)});return()=>{if(g.default)return g.default(C)}}}),fU=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:g}){const I=o.reactive(wQ());return()=>{if(g.default)return g.default(I)}}}),RU=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:g}){const I=o.reactive(WQ());return()=>{if(g.default)return g.default(I)}}}),XU=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:g}){const I=o.reactive({pixelRatio:pQ()});return()=>{if(g.default)return g.default(I)}}}),HU=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:g}){const I=o.reactive(BQ(e));return()=>{if(g.default)return g.default(I)}}}),DU=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:g}){const I=o.reactive({visibility:yQ()});return()=>{if(g.default)return g.default(I)}}}),SU=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:g}){const I=o.ref(),C=o.computed(()=>{var a;return(a=e.handle)!=null?a:I.value}),t=o.computed(()=>{var a;return(a=e.containerElement)!=null?a:void 0}),i=o.computed(()=>!!e.disabled),A=e.storageKey&&dX(e.storageKey,Hg(e.initialValue)||{x:0,y:0},In?e.storageType==="session"?sessionStorage:localStorage:void 0),n=A||e.initialValue||{x:0,y:0},l=(a,d)=>{var m;(m=e.onEnd)==null||m.call(e,a,d),A&&(A.value.x=a.x,A.value.y=a.y)},s=o.reactive(YQ(I,{...e,handle:C,initialValue:n,onEnd:l,disabled:i,containerElement:t}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I,style:`touch-action:none;${s.style}`},g.default(s))}}}),KU=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(VQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function SX(e,g={}){const{delayEnter:I=0,delayLeave:C=0,window:t=st}=g,i=o.ref(!1);let A;const n=l=>{const s=l?I:C;A&&(clearTimeout(A),A=void 0),s?A=setTimeout(()=>i.value=l,s):i.value=l};return t&&(Mt(e,"mouseenter",()=>n(!0),{passive:!0}),Mt(e,"mouseleave",()=>n(!1),{passive:!0})),i}const kU={[gn.mounted](e,g){const I=g.value;if(typeof I=="function"){const C=SX(e);o.watch(C,t=>I(t))}else{const[C,t]=I,i=SX(e,t);o.watch(i,A=>C(A))}}},FU=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(rX(I,{width:e.width,height:e.height},{box:e.box}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function eY(e,g,I={}){const{window:C=st,...t}=I;let i;const A=Nw(()=>C&&"ResizeObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const d=Hg(e);return Array.isArray(d)?d.map(m=>bC(m)):[bC(d)]}),s=o.watch(l,d=>{if(n(),A.value&&C){i=new ResizeObserver(g);for(const m of d)m&&i.observe(m,t)}},{immediate:!0,flush:"post"}),a=()=>{n(),s()};return hC(a),{isSupported:A,stop:a}}function zU(e,g={width:0,height:0},I={}){const{window:C=st,box:t="content-box"}=I,i=o.computed(()=>{var d,m;return(m=(d=bC(e))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),A=o.ref(g.width),n=o.ref(g.height),{stop:l}=eY(e,([d])=>{const m=t==="border-box"?d.borderBoxSize:t==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(C&&i.value){const u=bC(e);if(u){const h=u.getBoundingClientRect();A.value=h.width,n.value=h.height}}else if(m){const u=Array.isArray(m)?m:[m];A.value=u.reduce((h,{inlineSize:Z})=>h+Z,0),n.value=u.reduce((h,{blockSize:Z})=>h+Z,0)}else A.value=d.contentRect.width,n.value=d.contentRect.height},I);Jl(()=>{const d=bC(e);d&&(A.value="offsetWidth"in d?d.offsetWidth:g.width,n.value="offsetHeight"in d?d.offsetHeight:g.height)});const s=o.watch(()=>bC(e),d=>{A.value=d?g.width:0,n.value=d?g.height:0});function a(){l(),s()}return{width:A,height:n,stop:a}}const JU={[gn.mounted](e,g){var I;const C=typeof g.value=="function"?g.value:(I=g.value)==null?void 0:I[0],t=typeof g.value=="function"?[]:g.value.slice(1),{width:i,height:A}=zU(e,...t);o.watch([i,A],([n,l])=>C({width:n,height:l}))}},LU=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive({isVisible:MQ(I)});return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}});function CY(e,g,I={}){const{root:C,rootMargin:t="0px",threshold:i=0,window:A=st,immediate:n=!0}=I,l=Nw(()=>A&&"IntersectionObserver"in A),s=o.computed(()=>{const h=Hg(e);return(Array.isArray(h)?h:[h]).map(bC).filter(Zw)});let a=me;const d=o.ref(n),m=l.value?o.watch(()=>[s.value,bC(C),d.value],([h,Z])=>{if(a(),!d.value||!h.length)return;const G=new IntersectionObserver(g,{root:bC(Z),rootMargin:t,threshold:i});h.forEach(w=>w&&G.observe(w)),a=()=>{G.disconnect(),a=me}},{immediate:n,flush:"post"}):me,u=()=>{a(),m(),d.value=!1};return hC(u),{isSupported:l,isActive:d,pause(){a(),d.value=!1},resume(){d.value=!0},stop:u}}function tY(e,g={}){const{window:I=st,scrollTarget:C,threshold:t=0}=g,i=o.ref(!1);return CY(e,A=>{let n=i.value,l=0;for(const s of A)s.time>=l&&(l=s.time,n=s.isIntersecting);i.value=n},{root:C,window:I,threshold:t}),i}const TU={[gn.mounted](e,g){if(typeof g.value=="function"){const I=g.value,C=tY(e);o.watch(C,t=>I(t),{immediate:!0})}else{const[I,C]=g.value,t=tY(e,C);o.watch(t,i=>I(i),{immediate:!0})}}},vU=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:g}){const I=o.reactive(fQ());return()=>{if(g.default)return g.default(I)}}}),jU=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(RQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),xU=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:g}){const I=o.reactive(XQ(e));return()=>{if(g.default)return g.default(I)}}}),OU=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:g}){const I=o.reactive(SQ(e.timeout,e));return()=>{if(g.default)return g.default(I)}}});function QU(e,g,I){const{immediate:C=!0,delay:t=0,onError:i=me,onSuccess:A=me,resetOnExecute:n=!0,shallow:l=!0,throwError:s}=I??{},a=l?o.shallowRef(g):o.ref(g),d=o.ref(!1),m=o.ref(!1),u=o.shallowRef(void 0);async function h(w=0,...p){n&&(a.value=g),u.value=void 0,d.value=!1,m.value=!0,w>0&&await Ey(w);const B=typeof e=="function"?e(...p):e;try{const y=await B;a.value=y,d.value=!0,A(y)}catch(y){if(u.value=y,i(y),s)throw y}finally{m.value=!1}return a.value}C&&h(t);const Z={state:a,isReady:d,isLoading:m,error:u,execute:h};function G(){return new Promise((w,p)=>{_y(m).toBe(!1).then(()=>w(Z)).catch(p)})}return{...Z,then(w,p){return G().then(w,p)}}}async function UU(e){return new Promise((g,I)=>{const C=new Image,{src:t,srcset:i,sizes:A,class:n,loading:l,crossorigin:s,referrerPolicy:a}=e;C.src=t,i&&(C.srcset=i),A&&(C.sizes=A),n&&(C.className=n),l&&(C.loading=l),s&&(C.crossOrigin=s),a&&(C.referrerPolicy=a),C.onload=()=>g(C),C.onerror=I})}function EU(e,g={}){const I=QU(()=>UU(Hg(e)),void 0,{resetOnExecute:!0,...g});return o.watch(()=>Hg(e),()=>I.execute(g.delay),{deep:!0}),I}const PU=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy"],setup(e,{slots:g}){const I=o.reactive(EU(e));return()=>I.isLoading&&g.loading?g.loading(I):I.error&&g.error?g.error(I.error):g.default?g.default(I):o.h(e.as||"img",e)}});function Mw(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const KX=1;function iY(e,g={}){const{throttle:I=0,idle:C=200,onStop:t=me,onScroll:i=me,offset:A={left:0,right:0,top:0,bottom:0},eventListenerOptions:n={capture:!1,passive:!0},behavior:l="auto",window:s=st,onError:a=M=>{console.error(M)}}=g,d=o.ref(0),m=o.ref(0),u=o.computed({get(){return d.value},set(M){Z(M,void 0)}}),h=o.computed({get(){return m.value},set(M){Z(void 0,M)}});function Z(M,K){var F,X,z,L;if(!s)return;const O=Hg(e);if(!O)return;(z=O instanceof Document?s.document.body:O)==null||z.scrollTo({top:(F=Hg(K))!=null?F:h.value,left:(X=Hg(M))!=null?X:u.value,behavior:Hg(l)});const Ig=((L=O==null?void 0:O.document)==null?void 0:L.documentElement)||(O==null?void 0:O.documentElement)||O;u!=null&&(d.value=Ig.scrollLeft),h!=null&&(m.value=Ig.scrollTop)}const G=o.ref(!1),w=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),p=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),B=M=>{G.value&&(G.value=!1,p.left=!1,p.right=!1,p.top=!1,p.bottom=!1,t(M))},y=eX(B,I+C),Y=M=>{var K;if(!s)return;const F=((K=M==null?void 0:M.document)==null?void 0:K.documentElement)||(M==null?void 0:M.documentElement)||bC(M),{display:X,flexDirection:z}=getComputedStyle(F),L=F.scrollLeft;p.left=L<d.value,p.right=L>d.value;const O=Math.abs(L)<=(A.left||0),Ig=Math.abs(L)+F.clientWidth>=F.scrollWidth-(A.right||0)-KX;X==="flex"&&z==="row-reverse"?(w.left=Ig,w.right=O):(w.left=O,w.right=Ig),d.value=L;let Ag=F.scrollTop;M===s.document&&!Ag&&(Ag=s.document.body.scrollTop),p.top=Ag<m.value,p.bottom=Ag>m.value;const Q=Math.abs(Ag)<=(A.top||0),$=Math.abs(Ag)+F.clientHeight>=F.scrollHeight-(A.bottom||0)-KX;X==="flex"&&z==="column-reverse"?(w.top=$,w.bottom=Q):(w.top=Q,w.bottom=$),m.value=Ag},f=M=>{var K;if(!s)return;const F=(K=M.target.documentElement)!=null?K:M.target;Y(F),G.value=!0,y(M),i(M)};return Mt(e,"scroll",I?CQ(f,I,!0,!1):f,n),Jl(()=>{try{const M=Hg(e);if(!M)return;Y(M)}catch(M){a(M)}}),Mt(e,"scrollend",B,n),{x:u,y:h,isScrolling:G,arrivedState:w,directions:p,measure(){const M=Hg(e);s&&M&&Y(M)}}}function kX(e,g,I={}){var C;const{direction:t="bottom",interval:i=100,canLoadMore:A=()=>!0}=I,n=o.reactive(iY(e,{...I,offset:{[t]:(C=I.distance)!=null?C:0,...I.offset}})),l=o.ref(),s=o.computed(()=>!!l.value),a=o.computed(()=>Mw(Hg(e))),d=tY(a);function m(){if(n.measure(),!a.value||!d.value||!A(a.value))return;const{scrollHeight:h,clientHeight:Z,scrollWidth:G,clientWidth:w}=a.value,p=t==="bottom"||t==="top"?h<=Z:G<=w;(n.arrivedState[t]||p)&&(l.value||(l.value=Promise.all([g(n),new Promise(B=>setTimeout(B,i))]).finally(()=>{l.value=null,o.nextTick(()=>m())})))}const u=o.watch(()=>[n.arrivedState[t],d.value],m,{immediate:!0});return iQ(u),{isLoading:s,reset(){o.nextTick(()=>m())}}}const _U={[gn.mounted](e,g){typeof g.value=="function"?kX(e,g.value):kX(e,...g.value)}},$U={[gn.mounted](e,g){typeof g.value=="function"?CY(e,g.value):CY(e,...g.value)}},qU=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:g}){const I=o.reactive(uX(e));return()=>{if(g.default)return g.default(I)}}}),g7=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(kQ(I,e));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),I7=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(FQ({...e,target:I}));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),e7=o.defineComponent({name:"UseNetwork",setup(e,{slots:g}){const I=o.reactive(hX());return()=>{if(g.default)return g.default(I)}}}),C7=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:g}){const I=o.reactive(bX({...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),t7=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:g}){const I=Ww(e,"object"),C=zQ(I);return()=>{if(g.default&&C.value)return g.default(C)}}}),i7=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:g,emit:I}){const C=o.reactive(JQ({...e,onPageChange(...t){var i;(i=e.onPageChange)==null||i.call(e,...t),I("page-change",...t)},onPageSizeChange(...t){var i;(i=e.onPageSizeChange)==null||i.call(e,...t),I("page-size-change",...t)},onPageCountChange(...t){var i;(i=e.onPageCountChange)==null||i.call(e,...t),I("page-count-change",...t)}}));return()=>{if(g.default)return g.default(C)}}}),A7=o.defineComponent({name:"UseOnline",setup(e,{slots:g}){const I=o.reactive({isOnline:LQ()});return()=>{if(g.default)return g.default(I)}}}),n7=o.defineComponent({name:"UsePageLeave",setup(e,{slots:g}){const I=o.reactive({isLeft:TQ()});return()=>{if(g.default)return g.default(I)}}}),l7=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:g}){const I=o.ref(null),C=o.reactive(jQ({...e,target:e.target==="self"?I:st}));return()=>{if(g.default)return g.default(C,{ref:I})}}}),o7=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:g}){const I=o.ref(),C=o.reactive(xQ(I));return()=>{if(g.default)return o.h(e.as||"div",{ref:I},g.default(C))}}}),s7=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:g}){const I=o.reactive({colorScheme:OQ()});return()=>{if(g.default)return g.default(I)}}}),a7=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:g}){const I=o.reactive({contrast:QQ()});return()=>{if(g.default)return g.default(I)}}}),d7=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:g}){const I=o.reactive({prefersDark:gY()});return()=>{if(g.default)return g.default(I)}}}),c7=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:g}){const I=o.reactive({languages:UQ()});return()=>{if(g.default)return g.default(I)}}}),r7=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:g}){const I=o.reactive({motion:EQ()});return()=>{if(g.default)return g.default(I)}}}),m7={[gn.mounted](e,g){typeof g.value=="function"?eY(e,g.value):eY(e,...g.value)}};function u7(e,g,I={}){const{window:C=st,...t}=I;let i;const A=Nw(()=>C&&"MutationObserver"in C),n=()=>{i&&(i.disconnect(),i=void 0)},l=o.computed(()=>{const m=Hg(e),u=(Array.isArray(m)?m:[m]).map(bC).filter(Zw);return new Set(u)}),s=o.watch(()=>l.value,m=>{n(),A.value&&m.size&&(i=new MutationObserver(g),m.forEach(u=>i.observe(u,t)))},{immediate:!0,flush:"post"}),a=()=>i==null?void 0:i.takeRecords(),d=()=>{s(),n()};return hC(d),{isSupported:A,stop:d,takeRecords:a}}function fw(e,g,I={}){const{window:C=st,initialValue:t,observe:i=!1}=I,A=o.ref(t),n=o.computed(()=>{var s;return bC(g)||((s=C==null?void 0:C.document)==null?void 0:s.documentElement)});function l(){var s;const a=Hg(e),d=Hg(n);if(d&&C&&a){const m=(s=C.getComputedStyle(d).getPropertyValue(a))==null?void 0:s.trim();A.value=m||t}}return i&&u7(n,l,{attributeFilter:["style","class"],window:C}),o.watch([n,()=>Hg(e)],(s,a)=>{a[0]&&a[1]&&a[0].style.removeProperty(a[1]),l()},{immediate:!0}),o.watch(A,s=>{var a;const d=Hg(e);(a=n.value)!=null&&a.style&&d&&(s==null?n.value.style.removeProperty(d):n.value.style.setProperty(d,s))}),A}const FX="--vueuse-safe-area-top",zX="--vueuse-safe-area-right",JX="--vueuse-safe-area-bottom",LX="--vueuse-safe-area-left";function h7(){const e=o.ref(""),g=o.ref(""),I=o.ref(""),C=o.ref("");if(In){const i=fw(FX),A=fw(zX),n=fw(JX),l=fw(LX);i.value="env(safe-area-inset-top, 0px)",A.value="env(safe-area-inset-right, 0px)",n.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",t(),Mt("resize",eX(t))}function t(){e.value=Rw(FX),g.value=Rw(zX),I.value=Rw(JX),C.value=Rw(LX)}return{top:e,right:g,bottom:I,left:C,update:t}}function Rw(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const b7=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:g}){const{top:I,right:C,bottom:t,left:i}=h7();return()=>{if(g.default)return o.h("div",{style:{paddingTop:e.top?I.value:"",paddingRight:e.right?C.value:"",paddingBottom:e.bottom?t.value:"",paddingLeft:e.left?i.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},g.default())}}}),Z7={[gn.mounted](e,g){if(typeof g.value=="function"){const I=g.value,C=iY(e,{onScroll(){I(C)},onStop(){I(C)}})}else{const[I,C]=g.value,t=iY(e,{...C,onScroll(i){var A;(A=C.onScroll)==null||A.call(C,i),I(t)},onStop(i){var A;(A=C.onStop)==null||A.call(C,i),I(t)}})}}};function TX(e){const g=window.getComputedStyle(e);if(g.overflowX==="scroll"||g.overflowY==="scroll"||g.overflowX==="auto"&&e.clientWidth<e.scrollWidth||g.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const I=e.parentNode;return!I||I.tagName==="BODY"?!1:TX(I)}}function G7(e){const g=e||window.event,I=g.target;return TX(I)?!1:g.touches.length>1?!0:(g.preventDefault&&g.preventDefault(),!1)}const AY=new WeakMap;function w7(e,g=!1){const I=o.ref(g);let C=null,t="";o.watch(Ww(e),n=>{const l=Mw(Hg(n));if(l){const s=l;if(AY.get(s)||AY.set(s,s.style.overflow),s.style.overflow!=="hidden"&&(t=s.style.overflow),s.style.overflow==="hidden")return I.value=!0;if(I.value)return s.style.overflow="hidden"}},{immediate:!0});const i=()=>{const n=Mw(Hg(e));!n||I.value||(ww&&(C=Mt(n,"touchmove",l=>{G7(l)},{passive:!1})),n.style.overflow="hidden",I.value=!0)},A=()=>{const n=Mw(Hg(e));!n||!I.value||(ww&&(C==null||C()),n.style.overflow=t,AY.delete(n),I.value=!1)};return hC(A),o.computed({get(){return I.value},set(n){n?i():A()}})}function W7(){let e=!1;const g=o.ref(!1);return(I,C)=>{if(g.value=C.value,e)return;e=!0;const t=w7(I,C.value);o.watch(g,i=>t.value=i)}}const p7=W7(),B7=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:g}){const I=o.reactive(qQ(()=>e.time,{...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),y7=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:g}){const I=o.reactive(IU({...e,controls:!0}));return()=>{if(g.default)return g.default(I)}}}),Y7=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:g,expose:I}){const{list:C}=o.toRefs(e),{list:t,containerProps:i,wrapperProps:A,scrollTo:n}=eU(C,e.options);return I({scrollTo:n}),i.style&&typeof i.style=="object"&&!Array.isArray(i.style)&&(i.style.height=e.height||"300px"),()=>o.h("div",{...i},[o.h("div",{...A.value},t.value.map(l=>o.h("div",{style:{overflow:"hidden",height:l.height}},g.default?g.default(l):"Please set content!")))])}}),V7=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:g}){const I=o.reactive({focused:AU()});return()=>{if(g.default)return g.default(I)}}}),N7=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:g}){const I=o.reactive(nU(e));return()=>{if(g.default)return g.default(I)}}});function KI(e,g=document.documentElement){for(const[I,C]of Object.entries(e))g.style.setProperty(I,String(C))}const M7=["data-testid"],f7=["data-testid"],R7=["open","data-testid"],Dr=Tg(o.defineComponent({__name:"SelectList",props:{isOpened:{type:Boolean,default:!1},isUseAnchor:{type:Boolean,default:!1},disableOpen:{type:Boolean},headerClasses:{},optionsClasses:{},disabled:{type:Boolean},dataTestid:{default:"SelectList"}},emits:["change","focusout-options"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({isOpened:!1}),i=o.useId(),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.computed(()=>`--anchor-select-${i}`);o.watchEffect(()=>t.isOpened=I.isOpened);const a=()=>{I.disabled||I.disableOpen||(t.isOpened=!t.isOpened,C("change",t.isOpened))},d=()=>{t.isOpened=!1,C("focusout-options"),C("change",t.isOpened)},m=()=>{requestAnimationFrame(()=>{if(!n.value||!A.value||!t.isOpened)return;const h=n.value.getBoundingClientRect();if(!I.isUseAnchor)A.value.style.top=`${h.top+h.height}px`;else{KI({transform:"translateX(0) translateY(0)"},A.value);const Z=A.value.getBoundingClientRect();let G=0,w=0;Z.bottom>document.documentElement.scrollHeight&&(G=-Z.bottom+document.documentElement.scrollHeight-10,KI({transform:`translateY(${G}px)`},A.value)),Z.right>window.innerWidth&&(w=-Z.right+window.innerWidth-10,KI({transform:`translateX(${w}px) translateY(${G}px)`},A.value))}})};o.watch(()=>I.isOpened,()=>{t.isOpened=I.isOpened}),o.watch(()=>t.isOpened,m);const u=()=>{l.value&&KI({"anchor-name":`${s.value}`},l.value),A.value&&KI({"position-anchor":`${s.value}`},A.value)};return o.onMounted(()=>{I.isUseAnchor?u():window.addEventListener("scroll",m,!0),window.addEventListener("resize",m)}),o.onUnmounted(()=>{window.removeEventListener("scroll",m,!1),window.removeEventListener("resize",m)}),(h,Z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"selectRef",ref:l,class:"select-list-yui-kit","data-testid":I.dataTestid},[o.renderSlot(h.$slots,"body",{closeOpenList:a},()=>[o.createElementVNode("div",{ref_key:"currentRef",ref:n,class:o.normalizeClass(["select-list-yui-kit__current",{"active-yui-kit":t.isOpened},{"disabled-yui-kit":I.disabled},I==null?void 0:I.headerClasses]),tabindex:"0",onKeyup:o.withKeys(a,["enter"]),onClick:a,"data-testid":`${I.dataTestid}-Current`},[o.renderSlot(h.$slots,"header",{},void 0,!0)],42,f7)],!0),o.withDirectives(o.createElementVNode("ul",{ref_key:"dropdownRef",ref:A,class:o.normalizeClass(["select-list-yui-kit__list",I==null?void 0:I.optionsClasses]),open:t.isOpened,"data-testid":`${I.dataTestid}-OptionsList`},[o.renderSlot(h.$slots,"options",{},void 0,!0)],10,R7),[[o.vShow,t.isOpened]])],8,M7)),[[o.unref(Cd),d,void 0,{bubble:!0}]])}}),[["__scopeId","data-v-c213e68c"]]);function cs(e){return e!==null&&typeof e=="object"&&"key"in e}function vX(e){return e!==null&&Array.isArray(e)&&typeof e[0]=="object"&&"key"in e[0]}const nY=e=>e!==null&&typeof e=="object"&&"hint"in e,Jh=e=>e!==null&&Array.isArray(e)&&nY(e[0]),X7=["onClick","data-testid"],H7={class:"options__value truncate-yui-kit"},D7={key:0,class:"options__used"},lY=Tg(o.defineComponent({__name:"Options",props:{options:{},defaultOption:{},class:{},disabled:{type:Boolean},dataTestid:{default:"Options"}},emits:["change","disabled-click"],setup(e,{emit:g}){const I=e,C=o.reactive({choosedOption:I.defaultOption??(I.options[0]||""),lengthOption:0});o.watch(()=>I.defaultOption,()=>{I.defaultOption?C.choosedOption=I.defaultOption:C.choosedOption=""},{immediate:!0});const t=g,i=o.computed(()=>({"select-list-yui-kit__item":!0,"truncate-yui-kit":!0})),A=s=>{if(cs(s)&&s.disabled){t("disabled-click",s.key);return}C.choosedOption=s,cs(C.choosedOption)?t("change",C.choosedOption.key):t("change",C.choosedOption)},n=s=>{let a=!1;return cs(s)?cs(C.choosedOption)?s.value===C.choosedOption.value&&(a=!0):((s.key==="null"||s.key===null)&&C.choosedOption===""&&(a=!0),s.value===C.choosedOption&&(a=!0)):cs(C.choosedOption)?s===C.choosedOption.value&&(a=!0):s===C.choosedOption&&(a=!0),{active:a}},l=s=>nY(s)?s.hint:cs(s)?s.value:s;return(s,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.options,(d,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[o.createElementVNode("li",{class:o.normalizeClass([i.value,n(d),{"select-list-yui-kit__item_disabled":o.unref(cs)(d)?d.disabled:!1},I.class]),onClick:()=>A(d),"data-testid":`${I.dataTestid}-${m}`},[o.createElementVNode("div",{class:o.normalizeClass(["options__item",{options__item_disabled:o.unref(cs)(d)?d.disabled:!1}])},[o.createElementVNode("div",H7,o.toDisplayString(l(d)),1),typeof d=="object"&&(d!=null&&d.used)?(o.openBlock(),o.createElementBlock("div",D7)):o.createCommentVNode("",!0)],2),o.renderSlot(s.$slots,"option",{inx:m},void 0,!0)],10,X7),o.renderSlot(s.$slots,"default",{},void 0,!0)],64))),128))}}),[["__scopeId","data-v-0f0e283f"]]),S7=["data-testid"],oY=Tg(o.defineComponent({__name:"Dropdown",props:{options:{},defaultOption:{},class:{},disabled:{type:Boolean,default:!1},dataTestid:{default:"Dropdown"}},emits:["change"],setup(e,{emit:g}){const I=e,C=o.reactive({choosedOption:I.defaultOption||I.options[0]||"",isOpened:!1}),t=g,i=n=>{C.isOpened=n},A=n=>{let l;if(vX(I.options)){const s=I.options.find(a=>a.key===n);C.choosedOption=(s==null?void 0:s.value)||n,l=s==null?void 0:s.key}else C.choosedOption=n;C.isOpened=!1,t("change",l||n)};return o.watch(()=>I.defaultOption,()=>{I.defaultOption&&(C.choosedOption=I.defaultOption)}),o.onMounted(()=>{vX(I.options)&&(C.choosedOption=I.defaultOption||I.options[0].value)}),(n,l)=>(o.openBlock(),o.createBlock(Dr,{onChange:i,"is-opened":C.isOpened,class:o.normalizeClass([I.class,"dropdown-yui-kit"]),disabled:I.disabled,"data-testid":I.dataTestid},{header:o.withCtx(()=>[o.createElementVNode("span",{class:"truncate-yui-kit dropdown-yui-kit__text","data-testid":`${I.dataTestid}-SelectedText`},o.toDisplayString(C.choosedOption),9,S7),C.isOpened?(o.openBlock(),o.createBlock(Mg,{key:0,name:o.unref(ug).chevronUp,"data-testid":`${I.dataTestid}-ArrowUp`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),C.isOpened?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Mg,{key:1,name:o.unref(ug).chevronDown,"data-testid":`${I.dataTestid}-ArrowDown`},null,8,["name","data-testid"]))]),options:o.withCtx(()=>[o.createVNode(lY,{options:I.options,"default-option":I.defaultOption,onChange:A,"data-testid":`${I.dataTestid}-Options`},null,8,["options","default-option","data-testid"])]),_:1},8,["is-opened","class","disabled","data-testid"]))}}),[["__scopeId","data-v-08af0925"]]);/**
655
657
  * @license
656
658
  * Copyright 2019 Google LLC
657
659
  * SPDX-License-Identifier: BSD-3-Clause
658
- */const Xw=globalThis,sY=Xw.ShadowRoot&&(Xw.ShadyCSS===void 0||Xw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,aY=Symbol(),jX=new WeakMap;let xX=class{constructor(e,g,I){if(this._$cssResult$=!0,I!==aY)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=g}get styleSheet(){let e=this.o;const g=this.t;if(sY&&e===void 0){const I=g!==void 0&&g.length===1;I&&(e=jX.get(g)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),I&&jX.set(g,e))}return e}toString(){return this.cssText}};const OX=e=>new xX(typeof e=="string"?e:e+"",void 0,aY),Hw=(e,...g)=>{const I=e.length===1?e[0]:g.reduce((C,t,i)=>C+(A=>{if(A._$cssResult$===!0)return A.cssText;if(typeof A=="number")return A;throw Error("Value passed to 'css' function must be a 'css' function result: "+A+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+e[i+1],e[0]);return new xX(I,e,aY)},KE=(e,g)=>{if(sY)e.adoptedStyleSheets=g.map(I=>I instanceof CSSStyleSheet?I:I.styleSheet);else for(const I of g){const C=document.createElement("style"),t=Xw.litNonce;t!==void 0&&C.setAttribute("nonce",t),C.textContent=I.cssText,e.appendChild(C)}},QX=sY?e=>e:e=>e instanceof CSSStyleSheet?(g=>{let I="";for(const C of g.cssRules)I+=C.cssText;return OX(I)})(e):e;/**
660
+ */const Xw=globalThis,sY=Xw.ShadowRoot&&(Xw.ShadyCSS===void 0||Xw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,aY=Symbol(),jX=new WeakMap;let xX=class{constructor(e,g,I){if(this._$cssResult$=!0,I!==aY)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=g}get styleSheet(){let e=this.o;const g=this.t;if(sY&&e===void 0){const I=g!==void 0&&g.length===1;I&&(e=jX.get(g)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),I&&jX.set(g,e))}return e}toString(){return this.cssText}};const OX=e=>new xX(typeof e=="string"?e:e+"",void 0,aY),Hw=(e,...g)=>{const I=e.length===1?e[0]:g.reduce((C,t,i)=>C+(A=>{if(A._$cssResult$===!0)return A.cssText;if(typeof A=="number")return A;throw Error("Value passed to 'css' function must be a 'css' function result: "+A+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+e[i+1],e[0]);return new xX(I,e,aY)},K7=(e,g)=>{if(sY)e.adoptedStyleSheets=g.map(I=>I instanceof CSSStyleSheet?I:I.styleSheet);else for(const I of g){const C=document.createElement("style"),t=Xw.litNonce;t!==void 0&&C.setAttribute("nonce",t),C.textContent=I.cssText,e.appendChild(C)}},QX=sY?e=>e:e=>e instanceof CSSStyleSheet?(g=>{let I="";for(const C of g.cssRules)I+=C.cssText;return OX(I)})(e):e;/**
659
661
  * @license
660
662
  * Copyright 2017 Google LLC
661
663
  * SPDX-License-Identifier: BSD-3-Clause
662
- */const{is:kE,defineProperty:FE,getOwnPropertyDescriptor:zE,getOwnPropertyNames:JE,getOwnPropertySymbols:LE,getPrototypeOf:TE}=Object,rs=globalThis,UX=rs.trustedTypes,vE=UX?UX.emptyScript:"",dY=rs.reactiveElementPolyfillSupport,Lh=(e,g)=>e,Dw={toAttribute(e,g){switch(g){case Boolean:e=e?vE:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,g){let I=e;switch(g){case Boolean:I=e!==null;break;case Number:I=e===null?null:Number(e);break;case Object:case Array:try{I=JSON.parse(e)}catch{I=null}}return I}},cY=(e,g)=>!kE(e,g),EX={attribute:!0,type:String,converter:Dw,reflect:!1,useDefault:!1,hasChanged:cY};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),rs.litPropertyMetadata??(rs.litPropertyMetadata=new WeakMap);let Sr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,g=EX){if(g.state&&(g.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((g=Object.create(g)).wrapped=!0),this.elementProperties.set(e,g),!g.noAccessor){const I=Symbol(),C=this.getPropertyDescriptor(e,I,g);C!==void 0&&FE(this.prototype,e,C)}}static getPropertyDescriptor(e,g,I){const{get:C,set:t}=zE(this.prototype,e)??{get(){return this[g]},set(i){this[g]=i}};return{get:C,set(i){const A=C==null?void 0:C.call(this);t==null||t.call(this,i),this.requestUpdate(e,A,I)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??EX}static _$Ei(){if(this.hasOwnProperty(Lh("elementProperties")))return;const e=TE(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Lh("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Lh("properties"))){const g=this.properties,I=[...JE(g),...LE(g)];for(const C of I)this.createProperty(C,g[C])}const e=this[Symbol.metadata];if(e!==null){const g=litPropertyMetadata.get(e);if(g!==void 0)for(const[I,C]of g)this.elementProperties.set(I,C)}this._$Eh=new Map;for(const[g,I]of this.elementProperties){const C=this._$Eu(g,I);C!==void 0&&this._$Eh.set(C,g)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const g=[];if(Array.isArray(e)){const I=new Set(e.flat(1/0).reverse());for(const C of I)g.unshift(QX(C))}else e!==void 0&&g.push(QX(e));return g}static _$Eu(e,g){const I=g.attribute;return I===!1?void 0:typeof I=="string"?I:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(g=>this.enableUpdating=g),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(g=>g(this))}addController(e){var g;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((g=e.hostConnected)==null||g.call(e))}removeController(e){var g;(g=this._$EO)==null||g.delete(e)}_$E_(){const e=new Map,g=this.constructor.elementProperties;for(const I of g.keys())this.hasOwnProperty(I)&&(e.set(I,this[I]),delete this[I]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return KE(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(g=>{var I;return(I=g.hostConnected)==null?void 0:I.call(g)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(g=>{var I;return(I=g.hostDisconnected)==null?void 0:I.call(g)})}attributeChangedCallback(e,g,I){this._$AK(e,I)}_$ET(e,g){var t;const I=this.constructor.elementProperties.get(e),C=this.constructor._$Eu(e,I);if(C!==void 0&&I.reflect===!0){const i=(((t=I.converter)==null?void 0:t.toAttribute)!==void 0?I.converter:Dw).toAttribute(g,I.type);this._$Em=e,i==null?this.removeAttribute(C):this.setAttribute(C,i),this._$Em=null}}_$AK(e,g){var t,i;const I=this.constructor,C=I._$Eh.get(e);if(C!==void 0&&this._$Em!==C){const A=I.getPropertyOptions(C),n=typeof A.converter=="function"?{fromAttribute:A.converter}:((t=A.converter)==null?void 0:t.fromAttribute)!==void 0?A.converter:Dw;this._$Em=C;const l=n.fromAttribute(g,A.type);this[C]=l??((i=this._$Ej)==null?void 0:i.get(C))??l,this._$Em=null}}requestUpdate(e,g,I){var C;if(e!==void 0){const t=this.constructor,i=this[e];if(I??(I=t.getPropertyOptions(e)),!((I.hasChanged??cY)(i,g)||I.useDefault&&I.reflect&&i===((C=this._$Ej)==null?void 0:C.get(e))&&!this.hasAttribute(t._$Eu(e,I))))return;this.C(e,g,I)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,g,{useDefault:I,reflect:C,wrapped:t},i){I&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,i??g??this[e]),t!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||I||(g=void 0),this._$AL.set(e,g)),C===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(g){Promise.reject(g)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var I;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,i]of this._$Ep)this[t]=i;this._$Ep=void 0}const C=this.constructor.elementProperties;if(C.size>0)for(const[t,i]of C){const{wrapped:A}=i,n=this[t];A!==!0||this._$AL.has(t)||n===void 0||this.C(t,void 0,i,n)}}let e=!1;const g=this._$AL;try{e=this.shouldUpdate(g),e?(this.willUpdate(g),(I=this._$EO)==null||I.forEach(C=>{var t;return(t=C.hostUpdate)==null?void 0:t.call(C)}),this.update(g)):this._$EM()}catch(C){throw e=!1,this._$EM(),C}e&&this._$AE(g)}willUpdate(e){}_$AE(e){var g;(g=this._$EO)==null||g.forEach(I=>{var C;return(C=I.hostUpdated)==null?void 0:C.call(I)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(g=>this._$ET(g,this[g]))),this._$EM()}updated(e){}firstUpdated(e){}};Sr.elementStyles=[],Sr.shadowRootOptions={mode:"open"},Sr[Lh("elementProperties")]=new Map,Sr[Lh("finalized")]=new Map,dY==null||dY({ReactiveElement:Sr}),(rs.reactiveElementVersions??(rs.reactiveElementVersions=[])).push("2.1.1");/**
664
+ */const{is:k7,defineProperty:F7,getOwnPropertyDescriptor:z7,getOwnPropertyNames:J7,getOwnPropertySymbols:L7,getPrototypeOf:T7}=Object,rs=globalThis,UX=rs.trustedTypes,v7=UX?UX.emptyScript:"",dY=rs.reactiveElementPolyfillSupport,Lh=(e,g)=>e,Dw={toAttribute(e,g){switch(g){case Boolean:e=e?v7:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,g){let I=e;switch(g){case Boolean:I=e!==null;break;case Number:I=e===null?null:Number(e);break;case Object:case Array:try{I=JSON.parse(e)}catch{I=null}}return I}},cY=(e,g)=>!k7(e,g),EX={attribute:!0,type:String,converter:Dw,reflect:!1,useDefault:!1,hasChanged:cY};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),rs.litPropertyMetadata??(rs.litPropertyMetadata=new WeakMap);let Sr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,g=EX){if(g.state&&(g.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((g=Object.create(g)).wrapped=!0),this.elementProperties.set(e,g),!g.noAccessor){const I=Symbol(),C=this.getPropertyDescriptor(e,I,g);C!==void 0&&F7(this.prototype,e,C)}}static getPropertyDescriptor(e,g,I){const{get:C,set:t}=z7(this.prototype,e)??{get(){return this[g]},set(i){this[g]=i}};return{get:C,set(i){const A=C==null?void 0:C.call(this);t==null||t.call(this,i),this.requestUpdate(e,A,I)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??EX}static _$Ei(){if(this.hasOwnProperty(Lh("elementProperties")))return;const e=T7(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Lh("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Lh("properties"))){const g=this.properties,I=[...J7(g),...L7(g)];for(const C of I)this.createProperty(C,g[C])}const e=this[Symbol.metadata];if(e!==null){const g=litPropertyMetadata.get(e);if(g!==void 0)for(const[I,C]of g)this.elementProperties.set(I,C)}this._$Eh=new Map;for(const[g,I]of this.elementProperties){const C=this._$Eu(g,I);C!==void 0&&this._$Eh.set(C,g)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const g=[];if(Array.isArray(e)){const I=new Set(e.flat(1/0).reverse());for(const C of I)g.unshift(QX(C))}else e!==void 0&&g.push(QX(e));return g}static _$Eu(e,g){const I=g.attribute;return I===!1?void 0:typeof I=="string"?I:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(g=>this.enableUpdating=g),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(g=>g(this))}addController(e){var g;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((g=e.hostConnected)==null||g.call(e))}removeController(e){var g;(g=this._$EO)==null||g.delete(e)}_$E_(){const e=new Map,g=this.constructor.elementProperties;for(const I of g.keys())this.hasOwnProperty(I)&&(e.set(I,this[I]),delete this[I]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return K7(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(g=>{var I;return(I=g.hostConnected)==null?void 0:I.call(g)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(g=>{var I;return(I=g.hostDisconnected)==null?void 0:I.call(g)})}attributeChangedCallback(e,g,I){this._$AK(e,I)}_$ET(e,g){var t;const I=this.constructor.elementProperties.get(e),C=this.constructor._$Eu(e,I);if(C!==void 0&&I.reflect===!0){const i=(((t=I.converter)==null?void 0:t.toAttribute)!==void 0?I.converter:Dw).toAttribute(g,I.type);this._$Em=e,i==null?this.removeAttribute(C):this.setAttribute(C,i),this._$Em=null}}_$AK(e,g){var t,i;const I=this.constructor,C=I._$Eh.get(e);if(C!==void 0&&this._$Em!==C){const A=I.getPropertyOptions(C),n=typeof A.converter=="function"?{fromAttribute:A.converter}:((t=A.converter)==null?void 0:t.fromAttribute)!==void 0?A.converter:Dw;this._$Em=C;const l=n.fromAttribute(g,A.type);this[C]=l??((i=this._$Ej)==null?void 0:i.get(C))??l,this._$Em=null}}requestUpdate(e,g,I){var C;if(e!==void 0){const t=this.constructor,i=this[e];if(I??(I=t.getPropertyOptions(e)),!((I.hasChanged??cY)(i,g)||I.useDefault&&I.reflect&&i===((C=this._$Ej)==null?void 0:C.get(e))&&!this.hasAttribute(t._$Eu(e,I))))return;this.C(e,g,I)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,g,{useDefault:I,reflect:C,wrapped:t},i){I&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,i??g??this[e]),t!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||I||(g=void 0),this._$AL.set(e,g)),C===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(g){Promise.reject(g)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var I;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,i]of this._$Ep)this[t]=i;this._$Ep=void 0}const C=this.constructor.elementProperties;if(C.size>0)for(const[t,i]of C){const{wrapped:A}=i,n=this[t];A!==!0||this._$AL.has(t)||n===void 0||this.C(t,void 0,i,n)}}let e=!1;const g=this._$AL;try{e=this.shouldUpdate(g),e?(this.willUpdate(g),(I=this._$EO)==null||I.forEach(C=>{var t;return(t=C.hostUpdate)==null?void 0:t.call(C)}),this.update(g)):this._$EM()}catch(C){throw e=!1,this._$EM(),C}e&&this._$AE(g)}willUpdate(e){}_$AE(e){var g;(g=this._$EO)==null||g.forEach(I=>{var C;return(C=I.hostUpdated)==null?void 0:C.call(I)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(g=>this._$ET(g,this[g]))),this._$EM()}updated(e){}firstUpdated(e){}};Sr.elementStyles=[],Sr.shadowRootOptions={mode:"open"},Sr[Lh("elementProperties")]=new Map,Sr[Lh("finalized")]=new Map,dY==null||dY({ReactiveElement:Sr}),(rs.reactiveElementVersions??(rs.reactiveElementVersions=[])).push("2.1.1");/**
663
665
  * @license
664
666
  * Copyright 2017 Google LLC
665
667
  * SPDX-License-Identifier: BSD-3-Clause
666
- */const Th=globalThis,Sw=Th.trustedTypes,PX=Sw?Sw.createPolicy("lit-html",{createHTML:e=>e}):void 0,_X="$lit$",ms=`lit$${Math.random().toFixed(9).slice(2)}$`,$X="?"+ms,jE=`<${$X}>`,td=document,vh=()=>td.createComment(""),jh=e=>e===null||typeof e!="object"&&typeof e!="function",rY=Array.isArray,xE=e=>rY(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",mY=`[
668
+ */const Th=globalThis,Sw=Th.trustedTypes,PX=Sw?Sw.createPolicy("lit-html",{createHTML:e=>e}):void 0,_X="$lit$",ms=`lit$${Math.random().toFixed(9).slice(2)}$`,$X="?"+ms,j7=`<${$X}>`,td=document,vh=()=>td.createComment(""),jh=e=>e===null||typeof e!="object"&&typeof e!="function",rY=Array.isArray,x7=e=>rY(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",mY=`[
667
669
  \f\r]`,xh=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qX=/-->/g,gH=/>/g,id=RegExp(`>|${mY}(?:([^\\s"'>=/]+)(${mY}*=${mY}*(?:[^
668
- \f\r"'\`<>=]|("|')|))|$)`,"g"),IH=/'/g,eH=/"/g,CH=/^(?:script|style|textarea|title)$/i,OE=e=>(g,...I)=>({_$litType$:e,strings:g,values:I}),rA=OE(1),Ad=Symbol.for("lit-noChange"),AC=Symbol.for("lit-nothing"),tH=new WeakMap,nd=td.createTreeWalker(td,129);function iH(e,g){if(!rY(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return PX!==void 0?PX.createHTML(g):g}const QE=(e,g)=>{const I=e.length-1,C=[];let t,i=g===2?"<svg>":g===3?"<math>":"",A=xh;for(let n=0;n<I;n++){const l=e[n];let s,a,d=-1,m=0;for(;m<l.length&&(A.lastIndex=m,a=A.exec(l),a!==null);)m=A.lastIndex,A===xh?a[1]==="!--"?A=qX:a[1]!==void 0?A=gH:a[2]!==void 0?(CH.test(a[2])&&(t=RegExp("</"+a[2],"g")),A=id):a[3]!==void 0&&(A=id):A===id?a[0]===">"?(A=t??xh,d=-1):a[1]===void 0?d=-2:(d=A.lastIndex-a[2].length,s=a[1],A=a[3]===void 0?id:a[3]==='"'?eH:IH):A===eH||A===IH?A=id:A===qX||A===gH?A=xh:(A=id,t=void 0);const u=A===id&&e[n+1].startsWith("/>")?" ":"";i+=A===xh?l+jE:d>=0?(C.push(s),l.slice(0,d)+_X+l.slice(d)+ms+u):l+ms+(d===-2?n:u)}return[iH(e,i+(e[I]||"<?>")+(g===2?"</svg>":g===3?"</math>":"")),C]};class Oh{constructor({strings:g,_$litType$:I},C){let t;this.parts=[];let i=0,A=0;const n=g.length-1,l=this.parts,[s,a]=QE(g,I);if(this.el=Oh.createElement(s,C),nd.currentNode=this.el.content,I===2||I===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(t=nd.nextNode())!==null&&l.length<n;){if(t.nodeType===1){if(t.hasAttributes())for(const d of t.getAttributeNames())if(d.endsWith(_X)){const m=a[A++],u=t.getAttribute(d).split(ms),h=/([.?@])?(.*)/.exec(m);l.push({type:1,index:i,name:h[2],strings:u,ctor:h[1]==="."?EE:h[1]==="?"?PE:h[1]==="@"?_E:Kw}),t.removeAttribute(d)}else d.startsWith(ms)&&(l.push({type:6,index:i}),t.removeAttribute(d));if(CH.test(t.tagName)){const d=t.textContent.split(ms),m=d.length-1;if(m>0){t.textContent=Sw?Sw.emptyScript:"";for(let u=0;u<m;u++)t.append(d[u],vh()),nd.nextNode(),l.push({type:2,index:++i});t.append(d[m],vh())}}}else if(t.nodeType===8)if(t.data===$X)l.push({type:2,index:i});else{let d=-1;for(;(d=t.data.indexOf(ms,d+1))!==-1;)l.push({type:7,index:i}),d+=ms.length-1}i++}}static createElement(g,I){const C=td.createElement("template");return C.innerHTML=g,C}}function Kr(e,g,I=e,C){var A,n;if(g===Ad)return g;let t=C!==void 0?(A=I._$Co)==null?void 0:A[C]:I._$Cl;const i=jh(g)?void 0:g._$litDirective$;return(t==null?void 0:t.constructor)!==i&&((n=t==null?void 0:t._$AO)==null||n.call(t,!1),i===void 0?t=void 0:(t=new i(e),t._$AT(e,I,C)),C!==void 0?(I._$Co??(I._$Co=[]))[C]=t:I._$Cl=t),t!==void 0&&(g=Kr(e,t._$AS(e,g.values),t,C)),g}class UE{constructor(g,I){this._$AV=[],this._$AN=void 0,this._$AD=g,this._$AM=I}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(g){const{el:{content:I},parts:C}=this._$AD,t=((g==null?void 0:g.creationScope)??td).importNode(I,!0);nd.currentNode=t;let i=nd.nextNode(),A=0,n=0,l=C[0];for(;l!==void 0;){if(A===l.index){let s;l.type===2?s=new Qh(i,i.nextSibling,this,g):l.type===1?s=new l.ctor(i,l.name,l.strings,this,g):l.type===6&&(s=new $E(i,this,g)),this._$AV.push(s),l=C[++n]}A!==(l==null?void 0:l.index)&&(i=nd.nextNode(),A++)}return nd.currentNode=td,t}p(g){let I=0;for(const C of this._$AV)C!==void 0&&(C.strings!==void 0?(C._$AI(g,C,I),I+=C.strings.length-2):C._$AI(g[I])),I++}}class Qh{get _$AU(){var g;return((g=this._$AM)==null?void 0:g._$AU)??this._$Cv}constructor(g,I,C,t){this.type=2,this._$AH=AC,this._$AN=void 0,this._$AA=g,this._$AB=I,this._$AM=C,this.options=t,this._$Cv=(t==null?void 0:t.isConnected)??!0}get parentNode(){let g=this._$AA.parentNode;const I=this._$AM;return I!==void 0&&(g==null?void 0:g.nodeType)===11&&(g=I.parentNode),g}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(g,I=this){g=Kr(this,g,I),jh(g)?g===AC||g==null||g===""?(this._$AH!==AC&&this._$AR(),this._$AH=AC):g!==this._$AH&&g!==Ad&&this._(g):g._$litType$!==void 0?this.$(g):g.nodeType!==void 0?this.T(g):xE(g)?this.k(g):this._(g)}O(g){return this._$AA.parentNode.insertBefore(g,this._$AB)}T(g){this._$AH!==g&&(this._$AR(),this._$AH=this.O(g))}_(g){this._$AH!==AC&&jh(this._$AH)?this._$AA.nextSibling.data=g:this.T(td.createTextNode(g)),this._$AH=g}$(g){var i;const{values:I,_$litType$:C}=g,t=typeof C=="number"?this._$AC(g):(C.el===void 0&&(C.el=Oh.createElement(iH(C.h,C.h[0]),this.options)),C);if(((i=this._$AH)==null?void 0:i._$AD)===t)this._$AH.p(I);else{const A=new UE(t,this),n=A.u(this.options);A.p(I),this.T(n),this._$AH=A}}_$AC(g){let I=tH.get(g.strings);return I===void 0&&tH.set(g.strings,I=new Oh(g)),I}k(g){rY(this._$AH)||(this._$AH=[],this._$AR());const I=this._$AH;let C,t=0;for(const i of g)t===I.length?I.push(C=new Qh(this.O(vh()),this.O(vh()),this,this.options)):C=I[t],C._$AI(i),t++;t<I.length&&(this._$AR(C&&C._$AB.nextSibling,t),I.length=t)}_$AR(g=this._$AA.nextSibling,I){var C;for((C=this._$AP)==null?void 0:C.call(this,!1,!0,I);g!==this._$AB;){const t=g.nextSibling;g.remove(),g=t}}setConnected(g){var I;this._$AM===void 0&&(this._$Cv=g,(I=this._$AP)==null||I.call(this,g))}}class Kw{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(g,I,C,t,i){this.type=1,this._$AH=AC,this._$AN=void 0,this.element=g,this.name=I,this._$AM=t,this.options=i,C.length>2||C[0]!==""||C[1]!==""?(this._$AH=Array(C.length-1).fill(new String),this.strings=C):this._$AH=AC}_$AI(g,I=this,C,t){const i=this.strings;let A=!1;if(i===void 0)g=Kr(this,g,I,0),A=!jh(g)||g!==this._$AH&&g!==Ad,A&&(this._$AH=g);else{const n=g;let l,s;for(g=i[0],l=0;l<i.length-1;l++)s=Kr(this,n[C+l],I,l),s===Ad&&(s=this._$AH[l]),A||(A=!jh(s)||s!==this._$AH[l]),s===AC?g=AC:g!==AC&&(g+=(s??"")+i[l+1]),this._$AH[l]=s}A&&!t&&this.j(g)}j(g){g===AC?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,g??"")}}class EE extends Kw{constructor(){super(...arguments),this.type=3}j(g){this.element[this.name]=g===AC?void 0:g}}class PE extends Kw{constructor(){super(...arguments),this.type=4}j(g){this.element.toggleAttribute(this.name,!!g&&g!==AC)}}class _E extends Kw{constructor(g,I,C,t,i){super(g,I,C,t,i),this.type=5}_$AI(g,I=this){if((g=Kr(this,g,I,0)??AC)===Ad)return;const C=this._$AH,t=g===AC&&C!==AC||g.capture!==C.capture||g.once!==C.once||g.passive!==C.passive,i=g!==AC&&(C===AC||t);t&&this.element.removeEventListener(this.name,this,C),i&&this.element.addEventListener(this.name,this,g),this._$AH=g}handleEvent(g){var I;typeof this._$AH=="function"?this._$AH.call(((I=this.options)==null?void 0:I.host)??this.element,g):this._$AH.handleEvent(g)}}class $E{constructor(g,I,C){this.element=g,this.type=6,this._$AN=void 0,this._$AM=I,this.options=C}get _$AU(){return this._$AM._$AU}_$AI(g){Kr(this,g)}}const uY=Th.litHtmlPolyfillSupport;uY==null||uY(Oh,Qh),(Th.litHtmlVersions??(Th.litHtmlVersions=[])).push("3.3.1");const qE=(e,g,I)=>{const C=(I==null?void 0:I.renderBefore)??g;let t=C._$litPart$;if(t===void 0){const i=(I==null?void 0:I.renderBefore)??null;C._$litPart$=t=new Qh(g.insertBefore(vh(),i),i,void 0,I??{})}return t._$AI(e),t};/**
670
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),IH=/'/g,eH=/"/g,CH=/^(?:script|style|textarea|title)$/i,O7=e=>(g,...I)=>({_$litType$:e,strings:g,values:I}),rA=O7(1),Ad=Symbol.for("lit-noChange"),AC=Symbol.for("lit-nothing"),tH=new WeakMap,nd=td.createTreeWalker(td,129);function iH(e,g){if(!rY(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return PX!==void 0?PX.createHTML(g):g}const Q7=(e,g)=>{const I=e.length-1,C=[];let t,i=g===2?"<svg>":g===3?"<math>":"",A=xh;for(let n=0;n<I;n++){const l=e[n];let s,a,d=-1,m=0;for(;m<l.length&&(A.lastIndex=m,a=A.exec(l),a!==null);)m=A.lastIndex,A===xh?a[1]==="!--"?A=qX:a[1]!==void 0?A=gH:a[2]!==void 0?(CH.test(a[2])&&(t=RegExp("</"+a[2],"g")),A=id):a[3]!==void 0&&(A=id):A===id?a[0]===">"?(A=t??xh,d=-1):a[1]===void 0?d=-2:(d=A.lastIndex-a[2].length,s=a[1],A=a[3]===void 0?id:a[3]==='"'?eH:IH):A===eH||A===IH?A=id:A===qX||A===gH?A=xh:(A=id,t=void 0);const u=A===id&&e[n+1].startsWith("/>")?" ":"";i+=A===xh?l+j7:d>=0?(C.push(s),l.slice(0,d)+_X+l.slice(d)+ms+u):l+ms+(d===-2?n:u)}return[iH(e,i+(e[I]||"<?>")+(g===2?"</svg>":g===3?"</math>":"")),C]};class Oh{constructor({strings:g,_$litType$:I},C){let t;this.parts=[];let i=0,A=0;const n=g.length-1,l=this.parts,[s,a]=Q7(g,I);if(this.el=Oh.createElement(s,C),nd.currentNode=this.el.content,I===2||I===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(t=nd.nextNode())!==null&&l.length<n;){if(t.nodeType===1){if(t.hasAttributes())for(const d of t.getAttributeNames())if(d.endsWith(_X)){const m=a[A++],u=t.getAttribute(d).split(ms),h=/([.?@])?(.*)/.exec(m);l.push({type:1,index:i,name:h[2],strings:u,ctor:h[1]==="."?E7:h[1]==="?"?P7:h[1]==="@"?_7:Kw}),t.removeAttribute(d)}else d.startsWith(ms)&&(l.push({type:6,index:i}),t.removeAttribute(d));if(CH.test(t.tagName)){const d=t.textContent.split(ms),m=d.length-1;if(m>0){t.textContent=Sw?Sw.emptyScript:"";for(let u=0;u<m;u++)t.append(d[u],vh()),nd.nextNode(),l.push({type:2,index:++i});t.append(d[m],vh())}}}else if(t.nodeType===8)if(t.data===$X)l.push({type:2,index:i});else{let d=-1;for(;(d=t.data.indexOf(ms,d+1))!==-1;)l.push({type:7,index:i}),d+=ms.length-1}i++}}static createElement(g,I){const C=td.createElement("template");return C.innerHTML=g,C}}function Kr(e,g,I=e,C){var A,n;if(g===Ad)return g;let t=C!==void 0?(A=I._$Co)==null?void 0:A[C]:I._$Cl;const i=jh(g)?void 0:g._$litDirective$;return(t==null?void 0:t.constructor)!==i&&((n=t==null?void 0:t._$AO)==null||n.call(t,!1),i===void 0?t=void 0:(t=new i(e),t._$AT(e,I,C)),C!==void 0?(I._$Co??(I._$Co=[]))[C]=t:I._$Cl=t),t!==void 0&&(g=Kr(e,t._$AS(e,g.values),t,C)),g}class U7{constructor(g,I){this._$AV=[],this._$AN=void 0,this._$AD=g,this._$AM=I}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(g){const{el:{content:I},parts:C}=this._$AD,t=((g==null?void 0:g.creationScope)??td).importNode(I,!0);nd.currentNode=t;let i=nd.nextNode(),A=0,n=0,l=C[0];for(;l!==void 0;){if(A===l.index){let s;l.type===2?s=new Qh(i,i.nextSibling,this,g):l.type===1?s=new l.ctor(i,l.name,l.strings,this,g):l.type===6&&(s=new $7(i,this,g)),this._$AV.push(s),l=C[++n]}A!==(l==null?void 0:l.index)&&(i=nd.nextNode(),A++)}return nd.currentNode=td,t}p(g){let I=0;for(const C of this._$AV)C!==void 0&&(C.strings!==void 0?(C._$AI(g,C,I),I+=C.strings.length-2):C._$AI(g[I])),I++}}class Qh{get _$AU(){var g;return((g=this._$AM)==null?void 0:g._$AU)??this._$Cv}constructor(g,I,C,t){this.type=2,this._$AH=AC,this._$AN=void 0,this._$AA=g,this._$AB=I,this._$AM=C,this.options=t,this._$Cv=(t==null?void 0:t.isConnected)??!0}get parentNode(){let g=this._$AA.parentNode;const I=this._$AM;return I!==void 0&&(g==null?void 0:g.nodeType)===11&&(g=I.parentNode),g}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(g,I=this){g=Kr(this,g,I),jh(g)?g===AC||g==null||g===""?(this._$AH!==AC&&this._$AR(),this._$AH=AC):g!==this._$AH&&g!==Ad&&this._(g):g._$litType$!==void 0?this.$(g):g.nodeType!==void 0?this.T(g):x7(g)?this.k(g):this._(g)}O(g){return this._$AA.parentNode.insertBefore(g,this._$AB)}T(g){this._$AH!==g&&(this._$AR(),this._$AH=this.O(g))}_(g){this._$AH!==AC&&jh(this._$AH)?this._$AA.nextSibling.data=g:this.T(td.createTextNode(g)),this._$AH=g}$(g){var i;const{values:I,_$litType$:C}=g,t=typeof C=="number"?this._$AC(g):(C.el===void 0&&(C.el=Oh.createElement(iH(C.h,C.h[0]),this.options)),C);if(((i=this._$AH)==null?void 0:i._$AD)===t)this._$AH.p(I);else{const A=new U7(t,this),n=A.u(this.options);A.p(I),this.T(n),this._$AH=A}}_$AC(g){let I=tH.get(g.strings);return I===void 0&&tH.set(g.strings,I=new Oh(g)),I}k(g){rY(this._$AH)||(this._$AH=[],this._$AR());const I=this._$AH;let C,t=0;for(const i of g)t===I.length?I.push(C=new Qh(this.O(vh()),this.O(vh()),this,this.options)):C=I[t],C._$AI(i),t++;t<I.length&&(this._$AR(C&&C._$AB.nextSibling,t),I.length=t)}_$AR(g=this._$AA.nextSibling,I){var C;for((C=this._$AP)==null?void 0:C.call(this,!1,!0,I);g!==this._$AB;){const t=g.nextSibling;g.remove(),g=t}}setConnected(g){var I;this._$AM===void 0&&(this._$Cv=g,(I=this._$AP)==null||I.call(this,g))}}class Kw{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(g,I,C,t,i){this.type=1,this._$AH=AC,this._$AN=void 0,this.element=g,this.name=I,this._$AM=t,this.options=i,C.length>2||C[0]!==""||C[1]!==""?(this._$AH=Array(C.length-1).fill(new String),this.strings=C):this._$AH=AC}_$AI(g,I=this,C,t){const i=this.strings;let A=!1;if(i===void 0)g=Kr(this,g,I,0),A=!jh(g)||g!==this._$AH&&g!==Ad,A&&(this._$AH=g);else{const n=g;let l,s;for(g=i[0],l=0;l<i.length-1;l++)s=Kr(this,n[C+l],I,l),s===Ad&&(s=this._$AH[l]),A||(A=!jh(s)||s!==this._$AH[l]),s===AC?g=AC:g!==AC&&(g+=(s??"")+i[l+1]),this._$AH[l]=s}A&&!t&&this.j(g)}j(g){g===AC?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,g??"")}}class E7 extends Kw{constructor(){super(...arguments),this.type=3}j(g){this.element[this.name]=g===AC?void 0:g}}class P7 extends Kw{constructor(){super(...arguments),this.type=4}j(g){this.element.toggleAttribute(this.name,!!g&&g!==AC)}}class _7 extends Kw{constructor(g,I,C,t,i){super(g,I,C,t,i),this.type=5}_$AI(g,I=this){if((g=Kr(this,g,I,0)??AC)===Ad)return;const C=this._$AH,t=g===AC&&C!==AC||g.capture!==C.capture||g.once!==C.once||g.passive!==C.passive,i=g!==AC&&(C===AC||t);t&&this.element.removeEventListener(this.name,this,C),i&&this.element.addEventListener(this.name,this,g),this._$AH=g}handleEvent(g){var I;typeof this._$AH=="function"?this._$AH.call(((I=this.options)==null?void 0:I.host)??this.element,g):this._$AH.handleEvent(g)}}class $7{constructor(g,I,C){this.element=g,this.type=6,this._$AN=void 0,this._$AM=I,this.options=C}get _$AU(){return this._$AM._$AU}_$AI(g){Kr(this,g)}}const uY=Th.litHtmlPolyfillSupport;uY==null||uY(Oh,Qh),(Th.litHtmlVersions??(Th.litHtmlVersions=[])).push("3.3.1");const q7=(e,g,I)=>{const C=(I==null?void 0:I.renderBefore)??g;let t=C._$litPart$;if(t===void 0){const i=(I==null?void 0:I.renderBefore)??null;C._$litPart$=t=new Qh(g.insertBefore(vh(),i),i,void 0,I??{})}return t._$AI(e),t};/**
669
671
  * @license
670
672
  * Copyright 2017 Google LLC
671
673
  * SPDX-License-Identifier: BSD-3-Clause
672
- */const ld=globalThis;let zn=class extends Sr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var g;const e=super.createRenderRoot();return(g=this.renderOptions).renderBefore??(g.renderBefore=e.firstChild),e}update(e){const g=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qE(g,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Ad}};zn._$litElement$=!0,zn.finalized=!0,($J=ld.litElementHydrateSupport)==null||$J.call(ld,{LitElement:zn});const hY=ld.litElementPolyfillSupport;hY==null||hY({LitElement:zn}),(ld.litElementVersions??(ld.litElementVersions=[])).push("4.2.1");/**
674
+ */const ld=globalThis;let zn=class extends Sr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var g;const e=super.createRenderRoot();return(g=this.renderOptions).renderBefore??(g.renderBefore=e.firstChild),e}update(e){const g=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=q7(g,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Ad}};zn._$litElement$=!0,zn.finalized=!0,($J=ld.litElementHydrateSupport)==null||$J.call(ld,{LitElement:zn});const hY=ld.litElementPolyfillSupport;hY==null||hY({LitElement:zn}),(ld.litElementVersions??(ld.litElementVersions=[])).push("4.2.1");/**
673
675
  * @license
674
676
  * Copyright 2017 Google LLC
675
677
  * SPDX-License-Identifier: BSD-3-Clause
@@ -677,7 +679,7 @@
677
679
  * @license
678
680
  * Copyright 2017 Google LLC
679
681
  * SPDX-License-Identifier: BSD-3-Clause
680
- */const g7={attribute:!0,type:String,converter:Dw,reflect:!1,hasChanged:cY},I7=(e=g7,g,I)=>{const{kind:C,metadata:t}=I;let i=globalThis.litPropertyMetadata.get(t);if(i===void 0&&globalThis.litPropertyMetadata.set(t,i=new Map),C==="setter"&&((e=Object.create(e)).wrapped=!0),i.set(I.name,e),C==="accessor"){const{name:A}=I;return{set(n){const l=g.get.call(this);g.set.call(this,n),this.requestUpdate(A,l,e)},init(n){return n!==void 0&&this.C(A,void 0,e,n),n}}}if(C==="setter"){const{name:A}=I;return function(n){const l=this[A];g.call(this,n),this.requestUpdate(A,l,e)}}throw Error("Unsupported decorator location: "+C)};function jg(e){return(g,I)=>typeof I=="object"?I7(e,g,I):((C,t,i)=>{const A=t.hasOwnProperty(i);return t.constructor.createProperty(i,C),A?Object.getOwnPropertyDescriptor(t,i):void 0})(e,g,I)}/**
682
+ */const gE={attribute:!0,type:String,converter:Dw,reflect:!1,hasChanged:cY},IE=(e=gE,g,I)=>{const{kind:C,metadata:t}=I;let i=globalThis.litPropertyMetadata.get(t);if(i===void 0&&globalThis.litPropertyMetadata.set(t,i=new Map),C==="setter"&&((e=Object.create(e)).wrapped=!0),i.set(I.name,e),C==="accessor"){const{name:A}=I;return{set(n){const l=g.get.call(this);g.set.call(this,n),this.requestUpdate(A,l,e)},init(n){return n!==void 0&&this.C(A,void 0,e,n),n}}}if(C==="setter"){const{name:A}=I;return function(n){const l=this[A];g.call(this,n),this.requestUpdate(A,l,e)}}throw Error("Unsupported decorator location: "+C)};function jg(e){return(g,I)=>typeof I=="object"?IE(e,g,I):((C,t,i)=>{const A=t.hasOwnProperty(i);return t.constructor.createProperty(i,C),A?Object.getOwnPropertyDescriptor(t,i):void 0})(e,g,I)}/**
681
683
  * @license
682
684
  * Copyright 2017 Google LLC
683
685
  * SPDX-License-Identifier: BSD-3-Clause
@@ -685,11 +687,11 @@
685
687
  * @license
686
688
  * Copyright 2017 Google LLC
687
689
  * SPDX-License-Identifier: BSD-3-Clause
688
- */const e7=(e,g,I)=>(I.configurable=!0,I.enumerable=!0,Reflect.decorate&&typeof g!="object"&&Object.defineProperty(e,g,I),I);/**
690
+ */const eE=(e,g,I)=>(I.configurable=!0,I.enumerable=!0,Reflect.decorate&&typeof g!="object"&&Object.defineProperty(e,g,I),I);/**
689
691
  * @license
690
692
  * Copyright 2017 Google LLC
691
693
  * SPDX-License-Identifier: BSD-3-Clause
692
- */function Uh(e,g){return(I,C,t)=>{const i=A=>{var n;return((n=A.renderRoot)==null?void 0:n.querySelector(e))??null};return e7(I,C,{get(){return i(this)}})}}var C7=class extends Event{constructor(){super("wa-reposition",{bubbles:!0,cancelable:!1,composed:!0})}};const bY=new Set,kr=new Map;let sd,ZY="ltr",GY="en";const AH=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(AH){const e=new MutationObserver(lH);ZY=document.documentElement.dir||"ltr",GY=document.documentElement.lang||navigator.language,e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function nH(...e){e.map(g=>{const I=g.$code.toLowerCase();kr.has(I)?kr.set(I,Object.assign(Object.assign({},kr.get(I)),g)):kr.set(I,g),sd||(sd=g)}),lH()}function lH(){AH&&(ZY=document.documentElement.dir||"ltr",GY=document.documentElement.lang||navigator.language),[...bY.keys()].map(e=>{typeof e.requestUpdate=="function"&&e.requestUpdate()})}let t7=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){bY.add(this.host)}hostDisconnected(){bY.delete(this.host)}dir(){return`${this.host.dir||ZY}`.toLowerCase()}lang(){return`${this.host.lang||GY}`.toLowerCase()}getTranslationData(e){var g,I;const C=new Intl.Locale(e.replace(/_/g,"-")),t=C==null?void 0:C.language.toLowerCase(),i=(I=(g=C==null?void 0:C.region)===null||g===void 0?void 0:g.toLowerCase())!==null&&I!==void 0?I:"",A=kr.get(`${t}-${i}`),n=kr.get(t);return{locale:C,language:t,region:i,primary:A,secondary:n}}exists(e,g){var I;const{primary:C,secondary:t}=this.getTranslationData((I=g.lang)!==null&&I!==void 0?I:this.lang());return g=Object.assign({includeFallback:!1},g),!!(C&&C[e]||t&&t[e]||g.includeFallback&&sd&&sd[e])}term(e,...g){const{primary:I,secondary:C}=this.getTranslationData(this.lang());let t;if(I&&I[e])t=I[e];else if(C&&C[e])t=C[e];else if(sd&&sd[e])t=sd[e];else return console.error(`No translation found for: ${String(e)}`),String(e);return typeof t=="function"?t(...g):t}date(e,g){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),g).format(e)}number(e,g){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),g).format(e)}relativeTime(e,g,I){return new Intl.RelativeTimeFormat(this.lang(),I).format(e,g)}};var oH={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,g)=>`Go to slide ${e} of ${g}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>e===0?"No options selected":e===1?"1 option selected":`${e} options selected`,pauseAnimation:"Pause animation",playAnimation:"Play animation",previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollableRegion:"Scrollable region",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format",zoomIn:"Zoom in",zoomOut:"Zoom out"};nH(oH);var i7=oH,A7=class extends t7{};nH(i7);var n7=Object.defineProperty,l7=Object.getOwnPropertyDescriptor,sH=e=>{throw TypeError(e)},dI=(e,g,I,C)=>{for(var t=C>1?void 0:C?l7(g,I):g,i=e.length-1,A;i>=0;i--)(A=e[i])&&(t=(C?A(g,I,t):A(t))||t);return C&&t&&n7(g,I,t),t},aH=(e,g,I)=>g.has(e)||sH("Cannot "+I),o7=(e,g,I)=>(aH(e,g,"read from private field"),g.get(e)),s7=(e,g,I)=>g.has(e)?sH("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(e):g.set(e,I),a7=(e,g,I,C)=>(aH(e,g,"write to private field"),g.set(e,I),I),d7=`:host {
694
+ */function Uh(e,g){return(I,C,t)=>{const i=A=>{var n;return((n=A.renderRoot)==null?void 0:n.querySelector(e))??null};return eE(I,C,{get(){return i(this)}})}}var CE=class extends Event{constructor(){super("wa-reposition",{bubbles:!0,cancelable:!1,composed:!0})}};const bY=new Set,kr=new Map;let sd,ZY="ltr",GY="en";const AH=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(AH){const e=new MutationObserver(lH);ZY=document.documentElement.dir||"ltr",GY=document.documentElement.lang||navigator.language,e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function nH(...e){e.map(g=>{const I=g.$code.toLowerCase();kr.has(I)?kr.set(I,Object.assign(Object.assign({},kr.get(I)),g)):kr.set(I,g),sd||(sd=g)}),lH()}function lH(){AH&&(ZY=document.documentElement.dir||"ltr",GY=document.documentElement.lang||navigator.language),[...bY.keys()].map(e=>{typeof e.requestUpdate=="function"&&e.requestUpdate()})}let tE=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){bY.add(this.host)}hostDisconnected(){bY.delete(this.host)}dir(){return`${this.host.dir||ZY}`.toLowerCase()}lang(){return`${this.host.lang||GY}`.toLowerCase()}getTranslationData(e){var g,I;const C=new Intl.Locale(e.replace(/_/g,"-")),t=C==null?void 0:C.language.toLowerCase(),i=(I=(g=C==null?void 0:C.region)===null||g===void 0?void 0:g.toLowerCase())!==null&&I!==void 0?I:"",A=kr.get(`${t}-${i}`),n=kr.get(t);return{locale:C,language:t,region:i,primary:A,secondary:n}}exists(e,g){var I;const{primary:C,secondary:t}=this.getTranslationData((I=g.lang)!==null&&I!==void 0?I:this.lang());return g=Object.assign({includeFallback:!1},g),!!(C&&C[e]||t&&t[e]||g.includeFallback&&sd&&sd[e])}term(e,...g){const{primary:I,secondary:C}=this.getTranslationData(this.lang());let t;if(I&&I[e])t=I[e];else if(C&&C[e])t=C[e];else if(sd&&sd[e])t=sd[e];else return console.error(`No translation found for: ${String(e)}`),String(e);return typeof t=="function"?t(...g):t}date(e,g){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),g).format(e)}number(e,g){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),g).format(e)}relativeTime(e,g,I){return new Intl.RelativeTimeFormat(this.lang(),I).format(e,g)}};var oH={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,g)=>`Go to slide ${e} of ${g}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>e===0?"No options selected":e===1?"1 option selected":`${e} options selected`,pauseAnimation:"Pause animation",playAnimation:"Play animation",previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollableRegion:"Scrollable region",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format",zoomIn:"Zoom in",zoomOut:"Zoom out"};nH(oH);var iE=oH,AE=class extends tE{};nH(iE);var nE=Object.defineProperty,lE=Object.getOwnPropertyDescriptor,sH=e=>{throw TypeError(e)},dI=(e,g,I,C)=>{for(var t=C>1?void 0:C?lE(g,I):g,i=e.length-1,A;i>=0;i--)(A=e[i])&&(t=(C?A(g,I,t):A(t))||t);return C&&t&&nE(g,I,t),t},aH=(e,g,I)=>g.has(e)||sH("Cannot "+I),oE=(e,g,I)=>(aH(e,g,"read from private field"),g.get(e)),sE=(e,g,I)=>g.has(e)?sH("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(e):g.set(e,I),aE=(e,g,I,C)=>(aH(e,g,"write to private field"),g.set(e,I),I),dE=`:host {
693
695
  box-sizing: border-box !important;
694
696
  }
695
697
 
@@ -702,7 +704,7 @@
702
704
  [hidden] {
703
705
  display: none !important;
704
706
  }
705
- `,Fw,Eh=class extends zn{constructor(){super(),s7(this,Fw,!1),this.initialReflectedProperties=new Map,this.didSSR=!!this.shadowRoot,this.customStates={set:(g,I)=>{var C;(C=this.internals)!=null&&C.states&&(I?this.internals.states.add(g):this.internals.states.delete(g))},has:g=>{var I;return(I=this.internals)!=null&&I.states?this.internals.states.has(g):!1}};try{this.internals=this.attachInternals()}catch{console.error("Element internals are not supported in your browser. Consider using a polyfill")}this.customStates.set("wa-defined",!0);let e=this.constructor;for(let[g,I]of e.elementProperties)I.default==="inherit"&&I.initial!==void 0&&typeof g=="string"&&this.customStates.set(`initial-${g}-${I.initial}`,!0)}static get styles(){const e=Array.isArray(this.css)?this.css:this.css?[this.css]:[];return[d7,...e].map(g=>typeof g=="string"?OX(g):g)}attributeChangedCallback(e,g,I){o7(this,Fw)||(this.constructor.elementProperties.forEach((C,t)=>{C.reflect&&this[t]!=null&&this.initialReflectedProperties.set(t,this[t])}),a7(this,Fw,!0)),super.attributeChangedCallback(e,g,I)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((g,I)=>{e.has(I)&&this[I]==null&&(this[I]=g)})}firstUpdated(e){var g;super.firstUpdated(e),this.didSSR&&((g=this.shadowRoot)==null||g.querySelectorAll("slot").forEach(I=>{I.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}update(e){try{super.update(e)}catch(g){if(this.didSSR&&!this.hasUpdated){const I=new Event("lit-hydration-error",{bubbles:!0,composed:!0,cancelable:!1});I.error=g,this.dispatchEvent(I)}throw g}}relayNativeEvent(e,g){e.stopImmediatePropagation(),this.dispatchEvent(new e.constructor(e.type,{...e,...g}))}};Fw=new WeakMap,dI([jg()],Eh.prototype,"dir",2),dI([jg()],Eh.prototype,"lang",2),dI([jg({type:Boolean,reflect:!0,attribute:"did-ssr"})],Eh.prototype,"didSSR",2);const us=Math.min,Ri=Math.max,zw=Math.round,Jw=Math.floor,Jn=e=>({x:e,y:e}),c7={left:"right",right:"left",bottom:"top",top:"bottom"},r7={start:"end",end:"start"};function wY(e,g,I){return Ri(e,us(g,I))}function Fr(e,g){return typeof e=="function"?e(g):e}function hs(e){return e.split("-")[0]}function zr(e){return e.split("-")[1]}function dH(e){return e==="x"?"y":"x"}function WY(e){return e==="y"?"height":"width"}const m7=new Set(["top","bottom"]);function Ll(e){return m7.has(hs(e))?"y":"x"}function pY(e){return dH(Ll(e))}function u7(e,g,I){I===void 0&&(I=!1);const C=zr(e),t=pY(e),i=WY(t);let A=t==="x"?C===(I?"end":"start")?"right":"left":C==="start"?"bottom":"top";return g.reference[i]>g.floating[i]&&(A=Lw(A)),[A,Lw(A)]}function h7(e){const g=Lw(e);return[BY(e),g,BY(g)]}function BY(e){return e.replace(/start|end/g,g=>r7[g])}const cH=["left","right"],rH=["right","left"],b7=["top","bottom"],Z7=["bottom","top"];function G7(e,g,I){switch(e){case"top":case"bottom":return I?g?rH:cH:g?cH:rH;case"left":case"right":return g?b7:Z7;default:return[]}}function w7(e,g,I,C){const t=zr(e);let i=G7(hs(e),I==="start",C);return t&&(i=i.map(A=>A+"-"+t),g&&(i=i.concat(i.map(BY)))),i}function Lw(e){return e.replace(/left|right|bottom|top/g,g=>c7[g])}function W7(e){return{top:0,right:0,bottom:0,left:0,...e}}function mH(e){return typeof e!="number"?W7(e):{top:e,right:e,bottom:e,left:e}}function Tw(e){const{x:g,y:I,width:C,height:t}=e;return{width:C,height:t,top:I,left:g,right:g+C,bottom:I+t,x:g,y:I}}function uH(e,g,I){let{reference:C,floating:t}=e;const i=Ll(g),A=pY(g),n=WY(A),l=hs(g),s=i==="y",a=C.x+C.width/2-t.width/2,d=C.y+C.height/2-t.height/2,m=C[n]/2-t[n]/2;let u;switch(l){case"top":u={x:a,y:C.y-t.height};break;case"bottom":u={x:a,y:C.y+C.height};break;case"right":u={x:C.x+C.width,y:d};break;case"left":u={x:C.x-t.width,y:d};break;default:u={x:C.x,y:C.y}}switch(zr(g)){case"start":u[A]-=m*(I&&s?-1:1);break;case"end":u[A]+=m*(I&&s?-1:1);break}return u}const p7=async(e,g,I)=>{const{placement:C="bottom",strategy:t="absolute",middleware:i=[],platform:A}=I,n=i.filter(Boolean),l=await(A.isRTL==null?void 0:A.isRTL(g));let s=await A.getElementRects({reference:e,floating:g,strategy:t}),{x:a,y:d}=uH(s,C,l),m=C,u={},h=0;for(let Z=0;Z<n.length;Z++){const{name:G,fn:w}=n[Z],{x:p,y:B,data:y,reset:Y}=await w({x:a,y:d,initialPlacement:C,placement:m,strategy:t,middlewareData:u,rects:s,platform:A,elements:{reference:e,floating:g}});a=p??a,d=B??d,u={...u,[G]:{...u[G],...y}},Y&&h<=50&&(h++,typeof Y=="object"&&(Y.placement&&(m=Y.placement),Y.rects&&(s=Y.rects===!0?await A.getElementRects({reference:e,floating:g,strategy:t}):Y.rects),{x:a,y:d}=uH(s,m,l)),Z=-1)}return{x:a,y:d,placement:m,strategy:t,middlewareData:u}};async function yY(e,g){var I;g===void 0&&(g={});const{x:C,y:t,platform:i,rects:A,elements:n,strategy:l}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:m=!1,padding:u=0}=Fr(g,e),h=mH(u),Z=n[m?d==="floating"?"reference":"floating":d],G=Tw(await i.getClippingRect({element:(I=await(i.isElement==null?void 0:i.isElement(Z)))==null||I?Z:Z.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(n.floating)),boundary:s,rootBoundary:a,strategy:l})),w=d==="floating"?{x:C,y:t,width:A.floating.width,height:A.floating.height}:A.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(n.floating)),B=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},y=Tw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:w,offsetParent:p,strategy:l}):w);return{top:(G.top-y.top+h.top)/B.y,bottom:(y.bottom-G.bottom+h.bottom)/B.y,left:(G.left-y.left+h.left)/B.x,right:(y.right-G.right+h.right)/B.x}}const B7=e=>({name:"arrow",options:e,async fn(g){const{x:I,y:C,placement:t,rects:i,platform:A,elements:n,middlewareData:l}=g,{element:s,padding:a=0}=Fr(e,g)||{};if(s==null)return{};const d=mH(a),m={x:I,y:C},u=pY(t),h=WY(u),Z=await A.getDimensions(s),G=u==="y",w=G?"top":"left",p=G?"bottom":"right",B=G?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[u]-m[u]-i.floating[h],Y=m[u]-i.reference[u],f=await(A.getOffsetParent==null?void 0:A.getOffsetParent(s));let M=f?f[B]:0;(!M||!await(A.isElement==null?void 0:A.isElement(f)))&&(M=n.floating[B]||i.floating[h]);const K=y/2-Y/2,F=M/2-Z[h]/2-1,X=us(d[w],F),z=us(d[p],F),L=X,O=M-Z[h]-z,Ig=M/2-Z[h]/2+K,Ag=wY(L,Ig,O),Q=!l.arrow&&zr(t)!=null&&Ig!==Ag&&i.reference[h]/2-(Ig<L?X:z)-Z[h]/2<0,$=Q?Ig<L?Ig-L:Ig-O:0;return{[u]:m[u]+$,data:{[u]:Ag,centerOffset:Ig-Ag-$,...Q&&{alignmentOffset:$}},reset:Q}}}),y7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(g){var I,C;const{placement:t,middlewareData:i,rects:A,initialPlacement:n,platform:l,elements:s}=g,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:Z=!0,...G}=Fr(e,g);if((I=i.arrow)!=null&&I.alignmentOffset)return{};const w=hs(t),p=Ll(n),B=hs(n)===n,y=await(l.isRTL==null?void 0:l.isRTL(s.floating)),Y=m||(B||!Z?[Lw(n)]:h7(n)),f=h!=="none";!m&&f&&Y.push(...w7(n,Z,h,y));const M=[n,...Y],K=await yY(g,G),F=[];let X=((C=i.flip)==null?void 0:C.overflows)||[];if(a&&F.push(K[w]),d){const Ig=u7(t,A,y);F.push(K[Ig[0]],K[Ig[1]])}if(X=[...X,{placement:t,overflows:F}],!F.every(Ig=>Ig<=0)){var z,L;const Ig=(((z=i.flip)==null?void 0:z.index)||0)+1,Ag=M[Ig];if(Ag&&(!(d==="alignment"&&p!==Ll(Ag))||X.every($=>$.overflows[0]>0&&Ll($.placement)===p)))return{data:{index:Ig,overflows:X},reset:{placement:Ag}};let Q=(L=X.filter($=>$.overflows[0]<=0).sort(($,mg)=>$.overflows[1]-mg.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(u){case"bestFit":{var O;const $=(O=X.filter(mg=>{if(f){const og=Ll(mg.placement);return og===p||og==="y"}return!0}).map(mg=>[mg.placement,mg.overflows.filter(og=>og>0).reduce((og,Gg)=>og+Gg,0)]).sort((mg,og)=>mg[1]-og[1])[0])==null?void 0:O[0];$&&(Q=$);break}case"initialPlacement":Q=n;break}if(t!==Q)return{reset:{placement:Q}}}return{}}}},Y7=new Set(["left","top"]);async function V7(e,g){const{placement:I,platform:C,elements:t}=e,i=await(C.isRTL==null?void 0:C.isRTL(t.floating)),A=hs(I),n=zr(I),l=Ll(I)==="y",s=Y7.has(A)?-1:1,a=i&&l?-1:1,d=Fr(g,e);let{mainAxis:m,crossAxis:u,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return n&&typeof h=="number"&&(u=n==="end"?h*-1:h),l?{x:u*a,y:m*s}:{x:m*s,y:u*a}}const N7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(g){var I,C;const{x:t,y:i,placement:A,middlewareData:n}=g,l=await V7(g,e);return A===((I=n.offset)==null?void 0:I.placement)&&(C=n.arrow)!=null&&C.alignmentOffset?{}:{x:t+l.x,y:i+l.y,data:{...l,placement:A}}}}},M7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(g){const{x:I,y:C,placement:t}=g,{mainAxis:i=!0,crossAxis:A=!1,limiter:n={fn:G=>{let{x:w,y:p}=G;return{x:w,y:p}}},...l}=Fr(e,g),s={x:I,y:C},a=await yY(g,l),d=Ll(hs(t)),m=dH(d);let u=s[m],h=s[d];if(i){const G=m==="y"?"top":"left",w=m==="y"?"bottom":"right",p=u+a[G],B=u-a[w];u=wY(p,u,B)}if(A){const G=d==="y"?"top":"left",w=d==="y"?"bottom":"right",p=h+a[G],B=h-a[w];h=wY(p,h,B)}const Z=n.fn({...g,[m]:u,[d]:h});return{...Z,data:{x:Z.x-I,y:Z.y-C,enabled:{[m]:i,[d]:A}}}}}},f7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(g){var I,C;const{placement:t,rects:i,platform:A,elements:n}=g,{apply:l=()=>{},...s}=Fr(e,g),a=await yY(g,s),d=hs(t),m=zr(t),u=Ll(t)==="y",{width:h,height:Z}=i.floating;let G,w;d==="top"||d==="bottom"?(G=d,w=m===(await(A.isRTL==null?void 0:A.isRTL(n.floating))?"start":"end")?"left":"right"):(w=d,G=m==="end"?"top":"bottom");const p=Z-a.top-a.bottom,B=h-a.left-a.right,y=us(Z-a[G],p),Y=us(h-a[w],B),f=!g.middlewareData.shift;let M=y,K=Y;if((I=g.middlewareData.shift)!=null&&I.enabled.x&&(K=B),(C=g.middlewareData.shift)!=null&&C.enabled.y&&(M=p),f&&!m){const X=Ri(a.left,0),z=Ri(a.right,0),L=Ri(a.top,0),O=Ri(a.bottom,0);u?K=h-2*(X!==0||z!==0?X+z:Ri(a.left,a.right)):M=Z-2*(L!==0||O!==0?L+O:Ri(a.top,a.bottom))}await l({...g,availableWidth:K,availableHeight:M});const F=await A.getDimensions(n.floating);return h!==F.width||Z!==F.height?{reset:{rects:!0}}:{}}}};function vw(){return typeof window<"u"}function Jr(e){return hH(e)?(e.nodeName||"").toLowerCase():"#document"}function Xi(e){var g;return(e==null||(g=e.ownerDocument)==null?void 0:g.defaultView)||window}function Ln(e){var g;return(g=(hH(e)?e.ownerDocument:e.document)||window.document)==null?void 0:g.documentElement}function hH(e){return vw()?e instanceof Node||e instanceof Xi(e).Node:!1}function en(e){return vw()?e instanceof Element||e instanceof Xi(e).Element:!1}function Tn(e){return vw()?e instanceof HTMLElement||e instanceof Xi(e).HTMLElement:!1}function bH(e){return!vw()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xi(e).ShadowRoot}const R7=new Set(["inline","contents"]);function Ph(e){const{overflow:g,overflowX:I,overflowY:C,display:t}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(g+C+I)&&!R7.has(t)}const X7=new Set(["table","td","th"]);function H7(e){return X7.has(Jr(e))}const D7=[":popover-open",":modal"];function jw(e){return D7.some(g=>{try{return e.matches(g)}catch{return!1}})}const S7=["transform","translate","scale","rotate","perspective"],K7=["transform","translate","scale","rotate","perspective","filter"],k7=["paint","layout","strict","content"];function xw(e){const g=YY(),I=en(e)?Cn(e):e;return S7.some(C=>I[C]?I[C]!=="none":!1)||(I.containerType?I.containerType!=="normal":!1)||!g&&(I.backdropFilter?I.backdropFilter!=="none":!1)||!g&&(I.filter?I.filter!=="none":!1)||K7.some(C=>(I.willChange||"").includes(C))||k7.some(C=>(I.contain||"").includes(C))}function F7(e){let g=bs(e);for(;Tn(g)&&!Lr(g);){if(xw(g))return g;if(jw(g))return null;g=bs(g)}return null}function YY(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const z7=new Set(["html","body","#document"]);function Lr(e){return z7.has(Jr(e))}function Cn(e){return Xi(e).getComputedStyle(e)}function Ow(e){return en(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bs(e){if(Jr(e)==="html")return e;const g=e.assignedSlot||e.parentNode||bH(e)&&e.host||Ln(e);return bH(g)?g.host:g}function ZH(e){const g=bs(e);return Lr(g)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(g)&&Ph(g)?g:ZH(g)}function Tr(e,g,I){var C;g===void 0&&(g=[]),I===void 0&&(I=!0);const t=ZH(e),i=t===((C=e.ownerDocument)==null?void 0:C.body),A=Xi(t);if(i){const n=VY(A);return g.concat(A,A.visualViewport||[],Ph(t)?t:[],n&&I?Tr(n):[])}return g.concat(t,Tr(t,[],I))}function VY(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GH(e){const g=Cn(e);let I=parseFloat(g.width)||0,C=parseFloat(g.height)||0;const t=Tn(e),i=t?e.offsetWidth:I,A=t?e.offsetHeight:C,n=zw(I)!==i||zw(C)!==A;return n&&(I=i,C=A),{width:I,height:C,$:n}}function NY(e){return en(e)?e:e.contextElement}function vr(e){const g=NY(e);if(!Tn(g))return Jn(1);const I=g.getBoundingClientRect(),{width:C,height:t,$:i}=GH(g);let A=(i?zw(I.width):I.width)/C,n=(i?zw(I.height):I.height)/t;return(!A||!Number.isFinite(A))&&(A=1),(!n||!Number.isFinite(n))&&(n=1),{x:A,y:n}}const J7=Jn(0);function wH(e){const g=Xi(e);return!YY()||!g.visualViewport?J7:{x:g.visualViewport.offsetLeft,y:g.visualViewport.offsetTop}}function L7(e,g,I){return g===void 0&&(g=!1),!I||g&&I!==Xi(e)?!1:g}function ad(e,g,I,C){g===void 0&&(g=!1),I===void 0&&(I=!1);const t=e.getBoundingClientRect(),i=NY(e);let A=Jn(1);g&&(C?en(C)&&(A=vr(C)):A=vr(e));const n=L7(i,I,C)?wH(i):Jn(0);let l=(t.left+n.x)/A.x,s=(t.top+n.y)/A.y,a=t.width/A.x,d=t.height/A.y;if(i){const m=Xi(i),u=C&&en(C)?Xi(C):C;let h=m,Z=VY(h);for(;Z&&C&&u!==h;){const G=vr(Z),w=Z.getBoundingClientRect(),p=Cn(Z),B=w.left+(Z.clientLeft+parseFloat(p.paddingLeft))*G.x,y=w.top+(Z.clientTop+parseFloat(p.paddingTop))*G.y;l*=G.x,s*=G.y,a*=G.x,d*=G.y,l+=B,s+=y,h=Xi(Z),Z=VY(h)}}return Tw({width:a,height:d,x:l,y:s})}function MY(e,g){const I=Ow(e).scrollLeft;return g?g.left+I:ad(Ln(e)).left+I}function WH(e,g,I){I===void 0&&(I=!1);const C=e.getBoundingClientRect(),t=C.left+g.scrollLeft-(I?0:MY(e,C)),i=C.top+g.scrollTop;return{x:t,y:i}}function T7(e){let{elements:g,rect:I,offsetParent:C,strategy:t}=e;const i=t==="fixed",A=Ln(C),n=g?jw(g.floating):!1;if(C===A||n&&i)return I;let l={scrollLeft:0,scrollTop:0},s=Jn(1);const a=Jn(0),d=Tn(C);if((d||!d&&!i)&&((Jr(C)!=="body"||Ph(A))&&(l=Ow(C)),Tn(C))){const u=ad(C);s=vr(C),a.x=u.x+C.clientLeft,a.y=u.y+C.clientTop}const m=A&&!d&&!i?WH(A,l,!0):Jn(0);return{width:I.width*s.x,height:I.height*s.y,x:I.x*s.x-l.scrollLeft*s.x+a.x+m.x,y:I.y*s.y-l.scrollTop*s.y+a.y+m.y}}function v7(e){return Array.from(e.getClientRects())}function j7(e){const g=Ln(e),I=Ow(e),C=e.ownerDocument.body,t=Ri(g.scrollWidth,g.clientWidth,C.scrollWidth,C.clientWidth),i=Ri(g.scrollHeight,g.clientHeight,C.scrollHeight,C.clientHeight);let A=-I.scrollLeft+MY(e);const n=-I.scrollTop;return Cn(C).direction==="rtl"&&(A+=Ri(g.clientWidth,C.clientWidth)-t),{width:t,height:i,x:A,y:n}}function x7(e,g){const I=Xi(e),C=Ln(e),t=I.visualViewport;let i=C.clientWidth,A=C.clientHeight,n=0,l=0;if(t){i=t.width,A=t.height;const s=YY();(!s||s&&g==="fixed")&&(n=t.offsetLeft,l=t.offsetTop)}return{width:i,height:A,x:n,y:l}}const O7=new Set(["absolute","fixed"]);function Q7(e,g){const I=ad(e,!0,g==="fixed"),C=I.top+e.clientTop,t=I.left+e.clientLeft,i=Tn(e)?vr(e):Jn(1),A=e.clientWidth*i.x,n=e.clientHeight*i.y,l=t*i.x,s=C*i.y;return{width:A,height:n,x:l,y:s}}function pH(e,g,I){let C;if(g==="viewport")C=x7(e,I);else if(g==="document")C=j7(Ln(e));else if(en(g))C=Q7(g,I);else{const t=wH(e);C={x:g.x-t.x,y:g.y-t.y,width:g.width,height:g.height}}return Tw(C)}function BH(e,g){const I=bs(e);return I===g||!en(I)||Lr(I)?!1:Cn(I).position==="fixed"||BH(I,g)}function U7(e,g){const I=g.get(e);if(I)return I;let C=Tr(e,[],!1).filter(n=>en(n)&&Jr(n)!=="body"),t=null;const i=Cn(e).position==="fixed";let A=i?bs(e):e;for(;en(A)&&!Lr(A);){const n=Cn(A),l=xw(A);!l&&n.position==="fixed"&&(t=null),(i?!l&&!t:!l&&n.position==="static"&&t&&O7.has(t.position)||Ph(A)&&!l&&BH(e,A))?C=C.filter(s=>s!==A):t=n,A=bs(A)}return g.set(e,C),C}function E7(e){let{element:g,boundary:I,rootBoundary:C,strategy:t}=e;const i=[...I==="clippingAncestors"?jw(g)?[]:U7(g,this._c):[].concat(I),C],A=i[0],n=i.reduce((l,s)=>{const a=pH(g,s,t);return l.top=Ri(a.top,l.top),l.right=us(a.right,l.right),l.bottom=us(a.bottom,l.bottom),l.left=Ri(a.left,l.left),l},pH(g,A,t));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}}function P7(e){const{width:g,height:I}=GH(e);return{width:g,height:I}}function _7(e,g,I){const C=Tn(g),t=Ln(g),i=I==="fixed",A=ad(e,!0,i,g);let n={scrollLeft:0,scrollTop:0};const l=Jn(0);function s(){l.x=MY(t)}if(C||!C&&!i)if((Jr(g)!=="body"||Ph(t))&&(n=Ow(g)),C){const u=ad(g,!0,i,g);l.x=u.x+g.clientLeft,l.y=u.y+g.clientTop}else t&&s();i&&!C&&t&&s();const a=t&&!C&&!i?WH(t,n):Jn(0),d=A.left+n.scrollLeft-l.x-a.x,m=A.top+n.scrollTop-l.y-a.y;return{x:d,y:m,width:A.width,height:A.height}}function fY(e){return Cn(e).position==="static"}function yH(e,g){if(!Tn(e)||Cn(e).position==="fixed")return null;if(g)return g(e);let I=e.offsetParent;return Ln(e)===I&&(I=I.ownerDocument.body),I}function YH(e,g){const I=Xi(e);if(jw(e))return I;if(!Tn(e)){let t=bs(e);for(;t&&!Lr(t);){if(en(t)&&!fY(t))return t;t=bs(t)}return I}let C=yH(e,g);for(;C&&H7(C)&&fY(C);)C=yH(C,g);return C&&Lr(C)&&fY(C)&&!xw(C)?I:C||F7(e)||I}const $7=async function(e){const g=this.getOffsetParent||YH,I=this.getDimensions,C=await I(e.floating);return{reference:_7(e.reference,await g(e.floating),e.strategy),floating:{x:0,y:0,width:C.width,height:C.height}}};function q7(e){return Cn(e).direction==="rtl"}const Qw={convertOffsetParentRelativeRectToViewportRelativeRect:T7,getDocumentElement:Ln,getClippingRect:E7,getOffsetParent:YH,getElementRects:$7,getClientRects:v7,getDimensions:P7,getScale:vr,isElement:en,isRTL:q7};function VH(e,g){return e.x===g.x&&e.y===g.y&&e.width===g.width&&e.height===g.height}function gP(e,g){let I=null,C;const t=Ln(e);function i(){var n;clearTimeout(C),(n=I)==null||n.disconnect(),I=null}function A(n,l){n===void 0&&(n=!1),l===void 0&&(l=1),i();const s=e.getBoundingClientRect(),{left:a,top:d,width:m,height:u}=s;if(n||g(),!m||!u)return;const h=Jw(d),Z=Jw(t.clientWidth-(a+m)),G=Jw(t.clientHeight-(d+u)),w=Jw(a),p={rootMargin:-h+"px "+-Z+"px "+-G+"px "+-w+"px",threshold:Ri(0,us(1,l))||1};let B=!0;function y(Y){const f=Y[0].intersectionRatio;if(f!==l){if(!B)return A();f?A(!1,f):C=setTimeout(()=>{A(!1,1e-7)},1e3)}f===1&&!VH(s,e.getBoundingClientRect())&&A(),B=!1}try{I=new IntersectionObserver(y,{...p,root:t.ownerDocument})}catch{I=new IntersectionObserver(y,p)}I.observe(e)}return A(!0),i}function IP(e,g,I,C){C===void 0&&(C={});const{ancestorScroll:t=!0,ancestorResize:i=!0,elementResize:A=typeof ResizeObserver=="function",layoutShift:n=typeof IntersectionObserver=="function",animationFrame:l=!1}=C,s=NY(e),a=t||i?[...s?Tr(s):[],...Tr(g)]:[];a.forEach(w=>{t&&w.addEventListener("scroll",I,{passive:!0}),i&&w.addEventListener("resize",I)});const d=s&&n?gP(s,I):null;let m=-1,u=null;A&&(u=new ResizeObserver(w=>{let[p]=w;p&&p.target===s&&u&&(u.unobserve(g),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var B;(B=u)==null||B.observe(g)})),I()}),s&&!l&&u.observe(s),u.observe(g));let h,Z=l?ad(e):null;l&&G();function G(){const w=ad(e);Z&&!VH(Z,w)&&I(),Z=w,h=requestAnimationFrame(G)}return I(),()=>{var w;a.forEach(p=>{t&&p.removeEventListener("scroll",I),i&&p.removeEventListener("resize",I)}),d==null||d(),(w=u)==null||w.disconnect(),u=null,l&&cancelAnimationFrame(h)}}const eP=N7,CP=M7,tP=y7,NH=f7,iP=B7,AP=(e,g,I)=>{const C=new Map,t={platform:Qw,...I},i={...t.platform,_c:C};return p7(e,g,{...t,platform:i})};function nP(e){return lP(e)}function RY(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function lP(e){for(let g=e;g;g=RY(g))if(g instanceof Element&&getComputedStyle(g).display==="none")return null;for(let g=RY(e);g;g=RY(g)){if(!(g instanceof Element))continue;const I=getComputedStyle(g);if(I.display!=="contents"&&(I.position!=="static"||xw(I)||g.tagName==="BODY"))return g}return null}/**
707
+ `,Fw,Eh=class extends zn{constructor(){super(),sE(this,Fw,!1),this.initialReflectedProperties=new Map,this.didSSR=!!this.shadowRoot,this.customStates={set:(g,I)=>{var C;(C=this.internals)!=null&&C.states&&(I?this.internals.states.add(g):this.internals.states.delete(g))},has:g=>{var I;return(I=this.internals)!=null&&I.states?this.internals.states.has(g):!1}};try{this.internals=this.attachInternals()}catch{console.error("Element internals are not supported in your browser. Consider using a polyfill")}this.customStates.set("wa-defined",!0);let e=this.constructor;for(let[g,I]of e.elementProperties)I.default==="inherit"&&I.initial!==void 0&&typeof g=="string"&&this.customStates.set(`initial-${g}-${I.initial}`,!0)}static get styles(){const e=Array.isArray(this.css)?this.css:this.css?[this.css]:[];return[dE,...e].map(g=>typeof g=="string"?OX(g):g)}attributeChangedCallback(e,g,I){oE(this,Fw)||(this.constructor.elementProperties.forEach((C,t)=>{C.reflect&&this[t]!=null&&this.initialReflectedProperties.set(t,this[t])}),aE(this,Fw,!0)),super.attributeChangedCallback(e,g,I)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((g,I)=>{e.has(I)&&this[I]==null&&(this[I]=g)})}firstUpdated(e){var g;super.firstUpdated(e),this.didSSR&&((g=this.shadowRoot)==null||g.querySelectorAll("slot").forEach(I=>{I.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}update(e){try{super.update(e)}catch(g){if(this.didSSR&&!this.hasUpdated){const I=new Event("lit-hydration-error",{bubbles:!0,composed:!0,cancelable:!1});I.error=g,this.dispatchEvent(I)}throw g}}relayNativeEvent(e,g){e.stopImmediatePropagation(),this.dispatchEvent(new e.constructor(e.type,{...e,...g}))}};Fw=new WeakMap,dI([jg()],Eh.prototype,"dir",2),dI([jg()],Eh.prototype,"lang",2),dI([jg({type:Boolean,reflect:!0,attribute:"did-ssr"})],Eh.prototype,"didSSR",2);const us=Math.min,Ri=Math.max,zw=Math.round,Jw=Math.floor,Jn=e=>({x:e,y:e}),cE={left:"right",right:"left",bottom:"top",top:"bottom"},rE={start:"end",end:"start"};function wY(e,g,I){return Ri(e,us(g,I))}function Fr(e,g){return typeof e=="function"?e(g):e}function hs(e){return e.split("-")[0]}function zr(e){return e.split("-")[1]}function dH(e){return e==="x"?"y":"x"}function WY(e){return e==="y"?"height":"width"}const mE=new Set(["top","bottom"]);function Ll(e){return mE.has(hs(e))?"y":"x"}function pY(e){return dH(Ll(e))}function uE(e,g,I){I===void 0&&(I=!1);const C=zr(e),t=pY(e),i=WY(t);let A=t==="x"?C===(I?"end":"start")?"right":"left":C==="start"?"bottom":"top";return g.reference[i]>g.floating[i]&&(A=Lw(A)),[A,Lw(A)]}function hE(e){const g=Lw(e);return[BY(e),g,BY(g)]}function BY(e){return e.replace(/start|end/g,g=>rE[g])}const cH=["left","right"],rH=["right","left"],bE=["top","bottom"],ZE=["bottom","top"];function GE(e,g,I){switch(e){case"top":case"bottom":return I?g?rH:cH:g?cH:rH;case"left":case"right":return g?bE:ZE;default:return[]}}function wE(e,g,I,C){const t=zr(e);let i=GE(hs(e),I==="start",C);return t&&(i=i.map(A=>A+"-"+t),g&&(i=i.concat(i.map(BY)))),i}function Lw(e){return e.replace(/left|right|bottom|top/g,g=>cE[g])}function WE(e){return{top:0,right:0,bottom:0,left:0,...e}}function mH(e){return typeof e!="number"?WE(e):{top:e,right:e,bottom:e,left:e}}function Tw(e){const{x:g,y:I,width:C,height:t}=e;return{width:C,height:t,top:I,left:g,right:g+C,bottom:I+t,x:g,y:I}}function uH(e,g,I){let{reference:C,floating:t}=e;const i=Ll(g),A=pY(g),n=WY(A),l=hs(g),s=i==="y",a=C.x+C.width/2-t.width/2,d=C.y+C.height/2-t.height/2,m=C[n]/2-t[n]/2;let u;switch(l){case"top":u={x:a,y:C.y-t.height};break;case"bottom":u={x:a,y:C.y+C.height};break;case"right":u={x:C.x+C.width,y:d};break;case"left":u={x:C.x-t.width,y:d};break;default:u={x:C.x,y:C.y}}switch(zr(g)){case"start":u[A]-=m*(I&&s?-1:1);break;case"end":u[A]+=m*(I&&s?-1:1);break}return u}const pE=async(e,g,I)=>{const{placement:C="bottom",strategy:t="absolute",middleware:i=[],platform:A}=I,n=i.filter(Boolean),l=await(A.isRTL==null?void 0:A.isRTL(g));let s=await A.getElementRects({reference:e,floating:g,strategy:t}),{x:a,y:d}=uH(s,C,l),m=C,u={},h=0;for(let Z=0;Z<n.length;Z++){const{name:G,fn:w}=n[Z],{x:p,y:B,data:y,reset:Y}=await w({x:a,y:d,initialPlacement:C,placement:m,strategy:t,middlewareData:u,rects:s,platform:A,elements:{reference:e,floating:g}});a=p??a,d=B??d,u={...u,[G]:{...u[G],...y}},Y&&h<=50&&(h++,typeof Y=="object"&&(Y.placement&&(m=Y.placement),Y.rects&&(s=Y.rects===!0?await A.getElementRects({reference:e,floating:g,strategy:t}):Y.rects),{x:a,y:d}=uH(s,m,l)),Z=-1)}return{x:a,y:d,placement:m,strategy:t,middlewareData:u}};async function yY(e,g){var I;g===void 0&&(g={});const{x:C,y:t,platform:i,rects:A,elements:n,strategy:l}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:m=!1,padding:u=0}=Fr(g,e),h=mH(u),Z=n[m?d==="floating"?"reference":"floating":d],G=Tw(await i.getClippingRect({element:(I=await(i.isElement==null?void 0:i.isElement(Z)))==null||I?Z:Z.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(n.floating)),boundary:s,rootBoundary:a,strategy:l})),w=d==="floating"?{x:C,y:t,width:A.floating.width,height:A.floating.height}:A.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(n.floating)),B=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},y=Tw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:w,offsetParent:p,strategy:l}):w);return{top:(G.top-y.top+h.top)/B.y,bottom:(y.bottom-G.bottom+h.bottom)/B.y,left:(G.left-y.left+h.left)/B.x,right:(y.right-G.right+h.right)/B.x}}const BE=e=>({name:"arrow",options:e,async fn(g){const{x:I,y:C,placement:t,rects:i,platform:A,elements:n,middlewareData:l}=g,{element:s,padding:a=0}=Fr(e,g)||{};if(s==null)return{};const d=mH(a),m={x:I,y:C},u=pY(t),h=WY(u),Z=await A.getDimensions(s),G=u==="y",w=G?"top":"left",p=G?"bottom":"right",B=G?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[u]-m[u]-i.floating[h],Y=m[u]-i.reference[u],f=await(A.getOffsetParent==null?void 0:A.getOffsetParent(s));let M=f?f[B]:0;(!M||!await(A.isElement==null?void 0:A.isElement(f)))&&(M=n.floating[B]||i.floating[h]);const K=y/2-Y/2,F=M/2-Z[h]/2-1,X=us(d[w],F),z=us(d[p],F),L=X,O=M-Z[h]-z,Ig=M/2-Z[h]/2+K,Ag=wY(L,Ig,O),Q=!l.arrow&&zr(t)!=null&&Ig!==Ag&&i.reference[h]/2-(Ig<L?X:z)-Z[h]/2<0,$=Q?Ig<L?Ig-L:Ig-O:0;return{[u]:m[u]+$,data:{[u]:Ag,centerOffset:Ig-Ag-$,...Q&&{alignmentOffset:$}},reset:Q}}}),yE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(g){var I,C;const{placement:t,middlewareData:i,rects:A,initialPlacement:n,platform:l,elements:s}=g,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:Z=!0,...G}=Fr(e,g);if((I=i.arrow)!=null&&I.alignmentOffset)return{};const w=hs(t),p=Ll(n),B=hs(n)===n,y=await(l.isRTL==null?void 0:l.isRTL(s.floating)),Y=m||(B||!Z?[Lw(n)]:hE(n)),f=h!=="none";!m&&f&&Y.push(...wE(n,Z,h,y));const M=[n,...Y],K=await yY(g,G),F=[];let X=((C=i.flip)==null?void 0:C.overflows)||[];if(a&&F.push(K[w]),d){const Ig=uE(t,A,y);F.push(K[Ig[0]],K[Ig[1]])}if(X=[...X,{placement:t,overflows:F}],!F.every(Ig=>Ig<=0)){var z,L;const Ig=(((z=i.flip)==null?void 0:z.index)||0)+1,Ag=M[Ig];if(Ag&&(!(d==="alignment"&&p!==Ll(Ag))||X.every($=>$.overflows[0]>0&&Ll($.placement)===p)))return{data:{index:Ig,overflows:X},reset:{placement:Ag}};let Q=(L=X.filter($=>$.overflows[0]<=0).sort(($,mg)=>$.overflows[1]-mg.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(u){case"bestFit":{var O;const $=(O=X.filter(mg=>{if(f){const og=Ll(mg.placement);return og===p||og==="y"}return!0}).map(mg=>[mg.placement,mg.overflows.filter(og=>og>0).reduce((og,Gg)=>og+Gg,0)]).sort((mg,og)=>mg[1]-og[1])[0])==null?void 0:O[0];$&&(Q=$);break}case"initialPlacement":Q=n;break}if(t!==Q)return{reset:{placement:Q}}}return{}}}},YE=new Set(["left","top"]);async function VE(e,g){const{placement:I,platform:C,elements:t}=e,i=await(C.isRTL==null?void 0:C.isRTL(t.floating)),A=hs(I),n=zr(I),l=Ll(I)==="y",s=YE.has(A)?-1:1,a=i&&l?-1:1,d=Fr(g,e);let{mainAxis:m,crossAxis:u,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return n&&typeof h=="number"&&(u=n==="end"?h*-1:h),l?{x:u*a,y:m*s}:{x:m*s,y:u*a}}const NE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(g){var I,C;const{x:t,y:i,placement:A,middlewareData:n}=g,l=await VE(g,e);return A===((I=n.offset)==null?void 0:I.placement)&&(C=n.arrow)!=null&&C.alignmentOffset?{}:{x:t+l.x,y:i+l.y,data:{...l,placement:A}}}}},ME=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(g){const{x:I,y:C,placement:t}=g,{mainAxis:i=!0,crossAxis:A=!1,limiter:n={fn:G=>{let{x:w,y:p}=G;return{x:w,y:p}}},...l}=Fr(e,g),s={x:I,y:C},a=await yY(g,l),d=Ll(hs(t)),m=dH(d);let u=s[m],h=s[d];if(i){const G=m==="y"?"top":"left",w=m==="y"?"bottom":"right",p=u+a[G],B=u-a[w];u=wY(p,u,B)}if(A){const G=d==="y"?"top":"left",w=d==="y"?"bottom":"right",p=h+a[G],B=h-a[w];h=wY(p,h,B)}const Z=n.fn({...g,[m]:u,[d]:h});return{...Z,data:{x:Z.x-I,y:Z.y-C,enabled:{[m]:i,[d]:A}}}}}},fE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(g){var I,C;const{placement:t,rects:i,platform:A,elements:n}=g,{apply:l=()=>{},...s}=Fr(e,g),a=await yY(g,s),d=hs(t),m=zr(t),u=Ll(t)==="y",{width:h,height:Z}=i.floating;let G,w;d==="top"||d==="bottom"?(G=d,w=m===(await(A.isRTL==null?void 0:A.isRTL(n.floating))?"start":"end")?"left":"right"):(w=d,G=m==="end"?"top":"bottom");const p=Z-a.top-a.bottom,B=h-a.left-a.right,y=us(Z-a[G],p),Y=us(h-a[w],B),f=!g.middlewareData.shift;let M=y,K=Y;if((I=g.middlewareData.shift)!=null&&I.enabled.x&&(K=B),(C=g.middlewareData.shift)!=null&&C.enabled.y&&(M=p),f&&!m){const X=Ri(a.left,0),z=Ri(a.right,0),L=Ri(a.top,0),O=Ri(a.bottom,0);u?K=h-2*(X!==0||z!==0?X+z:Ri(a.left,a.right)):M=Z-2*(L!==0||O!==0?L+O:Ri(a.top,a.bottom))}await l({...g,availableWidth:K,availableHeight:M});const F=await A.getDimensions(n.floating);return h!==F.width||Z!==F.height?{reset:{rects:!0}}:{}}}};function vw(){return typeof window<"u"}function Jr(e){return hH(e)?(e.nodeName||"").toLowerCase():"#document"}function Xi(e){var g;return(e==null||(g=e.ownerDocument)==null?void 0:g.defaultView)||window}function Ln(e){var g;return(g=(hH(e)?e.ownerDocument:e.document)||window.document)==null?void 0:g.documentElement}function hH(e){return vw()?e instanceof Node||e instanceof Xi(e).Node:!1}function en(e){return vw()?e instanceof Element||e instanceof Xi(e).Element:!1}function Tn(e){return vw()?e instanceof HTMLElement||e instanceof Xi(e).HTMLElement:!1}function bH(e){return!vw()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xi(e).ShadowRoot}const RE=new Set(["inline","contents"]);function Ph(e){const{overflow:g,overflowX:I,overflowY:C,display:t}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(g+C+I)&&!RE.has(t)}const XE=new Set(["table","td","th"]);function HE(e){return XE.has(Jr(e))}const DE=[":popover-open",":modal"];function jw(e){return DE.some(g=>{try{return e.matches(g)}catch{return!1}})}const SE=["transform","translate","scale","rotate","perspective"],KE=["transform","translate","scale","rotate","perspective","filter"],kE=["paint","layout","strict","content"];function xw(e){const g=YY(),I=en(e)?Cn(e):e;return SE.some(C=>I[C]?I[C]!=="none":!1)||(I.containerType?I.containerType!=="normal":!1)||!g&&(I.backdropFilter?I.backdropFilter!=="none":!1)||!g&&(I.filter?I.filter!=="none":!1)||KE.some(C=>(I.willChange||"").includes(C))||kE.some(C=>(I.contain||"").includes(C))}function FE(e){let g=bs(e);for(;Tn(g)&&!Lr(g);){if(xw(g))return g;if(jw(g))return null;g=bs(g)}return null}function YY(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zE=new Set(["html","body","#document"]);function Lr(e){return zE.has(Jr(e))}function Cn(e){return Xi(e).getComputedStyle(e)}function Ow(e){return en(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bs(e){if(Jr(e)==="html")return e;const g=e.assignedSlot||e.parentNode||bH(e)&&e.host||Ln(e);return bH(g)?g.host:g}function ZH(e){const g=bs(e);return Lr(g)?e.ownerDocument?e.ownerDocument.body:e.body:Tn(g)&&Ph(g)?g:ZH(g)}function Tr(e,g,I){var C;g===void 0&&(g=[]),I===void 0&&(I=!0);const t=ZH(e),i=t===((C=e.ownerDocument)==null?void 0:C.body),A=Xi(t);if(i){const n=VY(A);return g.concat(A,A.visualViewport||[],Ph(t)?t:[],n&&I?Tr(n):[])}return g.concat(t,Tr(t,[],I))}function VY(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GH(e){const g=Cn(e);let I=parseFloat(g.width)||0,C=parseFloat(g.height)||0;const t=Tn(e),i=t?e.offsetWidth:I,A=t?e.offsetHeight:C,n=zw(I)!==i||zw(C)!==A;return n&&(I=i,C=A),{width:I,height:C,$:n}}function NY(e){return en(e)?e:e.contextElement}function vr(e){const g=NY(e);if(!Tn(g))return Jn(1);const I=g.getBoundingClientRect(),{width:C,height:t,$:i}=GH(g);let A=(i?zw(I.width):I.width)/C,n=(i?zw(I.height):I.height)/t;return(!A||!Number.isFinite(A))&&(A=1),(!n||!Number.isFinite(n))&&(n=1),{x:A,y:n}}const JE=Jn(0);function wH(e){const g=Xi(e);return!YY()||!g.visualViewport?JE:{x:g.visualViewport.offsetLeft,y:g.visualViewport.offsetTop}}function LE(e,g,I){return g===void 0&&(g=!1),!I||g&&I!==Xi(e)?!1:g}function ad(e,g,I,C){g===void 0&&(g=!1),I===void 0&&(I=!1);const t=e.getBoundingClientRect(),i=NY(e);let A=Jn(1);g&&(C?en(C)&&(A=vr(C)):A=vr(e));const n=LE(i,I,C)?wH(i):Jn(0);let l=(t.left+n.x)/A.x,s=(t.top+n.y)/A.y,a=t.width/A.x,d=t.height/A.y;if(i){const m=Xi(i),u=C&&en(C)?Xi(C):C;let h=m,Z=VY(h);for(;Z&&C&&u!==h;){const G=vr(Z),w=Z.getBoundingClientRect(),p=Cn(Z),B=w.left+(Z.clientLeft+parseFloat(p.paddingLeft))*G.x,y=w.top+(Z.clientTop+parseFloat(p.paddingTop))*G.y;l*=G.x,s*=G.y,a*=G.x,d*=G.y,l+=B,s+=y,h=Xi(Z),Z=VY(h)}}return Tw({width:a,height:d,x:l,y:s})}function MY(e,g){const I=Ow(e).scrollLeft;return g?g.left+I:ad(Ln(e)).left+I}function WH(e,g,I){I===void 0&&(I=!1);const C=e.getBoundingClientRect(),t=C.left+g.scrollLeft-(I?0:MY(e,C)),i=C.top+g.scrollTop;return{x:t,y:i}}function TE(e){let{elements:g,rect:I,offsetParent:C,strategy:t}=e;const i=t==="fixed",A=Ln(C),n=g?jw(g.floating):!1;if(C===A||n&&i)return I;let l={scrollLeft:0,scrollTop:0},s=Jn(1);const a=Jn(0),d=Tn(C);if((d||!d&&!i)&&((Jr(C)!=="body"||Ph(A))&&(l=Ow(C)),Tn(C))){const u=ad(C);s=vr(C),a.x=u.x+C.clientLeft,a.y=u.y+C.clientTop}const m=A&&!d&&!i?WH(A,l,!0):Jn(0);return{width:I.width*s.x,height:I.height*s.y,x:I.x*s.x-l.scrollLeft*s.x+a.x+m.x,y:I.y*s.y-l.scrollTop*s.y+a.y+m.y}}function vE(e){return Array.from(e.getClientRects())}function jE(e){const g=Ln(e),I=Ow(e),C=e.ownerDocument.body,t=Ri(g.scrollWidth,g.clientWidth,C.scrollWidth,C.clientWidth),i=Ri(g.scrollHeight,g.clientHeight,C.scrollHeight,C.clientHeight);let A=-I.scrollLeft+MY(e);const n=-I.scrollTop;return Cn(C).direction==="rtl"&&(A+=Ri(g.clientWidth,C.clientWidth)-t),{width:t,height:i,x:A,y:n}}function xE(e,g){const I=Xi(e),C=Ln(e),t=I.visualViewport;let i=C.clientWidth,A=C.clientHeight,n=0,l=0;if(t){i=t.width,A=t.height;const s=YY();(!s||s&&g==="fixed")&&(n=t.offsetLeft,l=t.offsetTop)}return{width:i,height:A,x:n,y:l}}const OE=new Set(["absolute","fixed"]);function QE(e,g){const I=ad(e,!0,g==="fixed"),C=I.top+e.clientTop,t=I.left+e.clientLeft,i=Tn(e)?vr(e):Jn(1),A=e.clientWidth*i.x,n=e.clientHeight*i.y,l=t*i.x,s=C*i.y;return{width:A,height:n,x:l,y:s}}function pH(e,g,I){let C;if(g==="viewport")C=xE(e,I);else if(g==="document")C=jE(Ln(e));else if(en(g))C=QE(g,I);else{const t=wH(e);C={x:g.x-t.x,y:g.y-t.y,width:g.width,height:g.height}}return Tw(C)}function BH(e,g){const I=bs(e);return I===g||!en(I)||Lr(I)?!1:Cn(I).position==="fixed"||BH(I,g)}function UE(e,g){const I=g.get(e);if(I)return I;let C=Tr(e,[],!1).filter(n=>en(n)&&Jr(n)!=="body"),t=null;const i=Cn(e).position==="fixed";let A=i?bs(e):e;for(;en(A)&&!Lr(A);){const n=Cn(A),l=xw(A);!l&&n.position==="fixed"&&(t=null),(i?!l&&!t:!l&&n.position==="static"&&t&&OE.has(t.position)||Ph(A)&&!l&&BH(e,A))?C=C.filter(s=>s!==A):t=n,A=bs(A)}return g.set(e,C),C}function EE(e){let{element:g,boundary:I,rootBoundary:C,strategy:t}=e;const i=[...I==="clippingAncestors"?jw(g)?[]:UE(g,this._c):[].concat(I),C],A=i[0],n=i.reduce((l,s)=>{const a=pH(g,s,t);return l.top=Ri(a.top,l.top),l.right=us(a.right,l.right),l.bottom=us(a.bottom,l.bottom),l.left=Ri(a.left,l.left),l},pH(g,A,t));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}}function PE(e){const{width:g,height:I}=GH(e);return{width:g,height:I}}function _E(e,g,I){const C=Tn(g),t=Ln(g),i=I==="fixed",A=ad(e,!0,i,g);let n={scrollLeft:0,scrollTop:0};const l=Jn(0);function s(){l.x=MY(t)}if(C||!C&&!i)if((Jr(g)!=="body"||Ph(t))&&(n=Ow(g)),C){const u=ad(g,!0,i,g);l.x=u.x+g.clientLeft,l.y=u.y+g.clientTop}else t&&s();i&&!C&&t&&s();const a=t&&!C&&!i?WH(t,n):Jn(0),d=A.left+n.scrollLeft-l.x-a.x,m=A.top+n.scrollTop-l.y-a.y;return{x:d,y:m,width:A.width,height:A.height}}function fY(e){return Cn(e).position==="static"}function yH(e,g){if(!Tn(e)||Cn(e).position==="fixed")return null;if(g)return g(e);let I=e.offsetParent;return Ln(e)===I&&(I=I.ownerDocument.body),I}function YH(e,g){const I=Xi(e);if(jw(e))return I;if(!Tn(e)){let t=bs(e);for(;t&&!Lr(t);){if(en(t)&&!fY(t))return t;t=bs(t)}return I}let C=yH(e,g);for(;C&&HE(C)&&fY(C);)C=yH(C,g);return C&&Lr(C)&&fY(C)&&!xw(C)?I:C||FE(e)||I}const $E=async function(e){const g=this.getOffsetParent||YH,I=this.getDimensions,C=await I(e.floating);return{reference:_E(e.reference,await g(e.floating),e.strategy),floating:{x:0,y:0,width:C.width,height:C.height}}};function qE(e){return Cn(e).direction==="rtl"}const Qw={convertOffsetParentRelativeRectToViewportRelativeRect:TE,getDocumentElement:Ln,getClippingRect:EE,getOffsetParent:YH,getElementRects:$E,getClientRects:vE,getDimensions:PE,getScale:vr,isElement:en,isRTL:qE};function VH(e,g){return e.x===g.x&&e.y===g.y&&e.width===g.width&&e.height===g.height}function gP(e,g){let I=null,C;const t=Ln(e);function i(){var n;clearTimeout(C),(n=I)==null||n.disconnect(),I=null}function A(n,l){n===void 0&&(n=!1),l===void 0&&(l=1),i();const s=e.getBoundingClientRect(),{left:a,top:d,width:m,height:u}=s;if(n||g(),!m||!u)return;const h=Jw(d),Z=Jw(t.clientWidth-(a+m)),G=Jw(t.clientHeight-(d+u)),w=Jw(a),p={rootMargin:-h+"px "+-Z+"px "+-G+"px "+-w+"px",threshold:Ri(0,us(1,l))||1};let B=!0;function y(Y){const f=Y[0].intersectionRatio;if(f!==l){if(!B)return A();f?A(!1,f):C=setTimeout(()=>{A(!1,1e-7)},1e3)}f===1&&!VH(s,e.getBoundingClientRect())&&A(),B=!1}try{I=new IntersectionObserver(y,{...p,root:t.ownerDocument})}catch{I=new IntersectionObserver(y,p)}I.observe(e)}return A(!0),i}function IP(e,g,I,C){C===void 0&&(C={});const{ancestorScroll:t=!0,ancestorResize:i=!0,elementResize:A=typeof ResizeObserver=="function",layoutShift:n=typeof IntersectionObserver=="function",animationFrame:l=!1}=C,s=NY(e),a=t||i?[...s?Tr(s):[],...Tr(g)]:[];a.forEach(w=>{t&&w.addEventListener("scroll",I,{passive:!0}),i&&w.addEventListener("resize",I)});const d=s&&n?gP(s,I):null;let m=-1,u=null;A&&(u=new ResizeObserver(w=>{let[p]=w;p&&p.target===s&&u&&(u.unobserve(g),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var B;(B=u)==null||B.observe(g)})),I()}),s&&!l&&u.observe(s),u.observe(g));let h,Z=l?ad(e):null;l&&G();function G(){const w=ad(e);Z&&!VH(Z,w)&&I(),Z=w,h=requestAnimationFrame(G)}return I(),()=>{var w;a.forEach(p=>{t&&p.removeEventListener("scroll",I),i&&p.removeEventListener("resize",I)}),d==null||d(),(w=u)==null||w.disconnect(),u=null,l&&cancelAnimationFrame(h)}}const eP=NE,CP=ME,tP=yE,NH=fE,iP=BE,AP=(e,g,I)=>{const C=new Map,t={platform:Qw,...I},i={...t.platform,_c:C};return pE(e,g,{...t,platform:i})};function nP(e){return lP(e)}function RY(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function lP(e){for(let g=e;g;g=RY(g))if(g instanceof Element&&getComputedStyle(g).display==="none")return null;for(let g=RY(e);g;g=RY(g)){if(!(g instanceof Element))continue;const I=getComputedStyle(g);if(I.display!=="contents"&&(I.position!=="static"||xw(I)||g.tagName==="BODY"))return g}return null}/**
706
708
  * @license
707
709
  * Copyright 2017 Google LLC
708
710
  * SPDX-License-Identifier: BSD-3-Clause
@@ -831,7 +833,7 @@
831
833
  scale: 1;
832
834
  }
833
835
  }
834
- `;function XH(e){return e!==null&&typeof e=="object"&&"getBoundingClientRect"in e&&("contextElement"in e?e instanceof Element:!0)}var Uw=(qJ=globalThis==null?void 0:globalThis.HTMLElement)==null?void 0:qJ.prototype.hasOwnProperty("popover"),qI=class extends Eh{constructor(){super(...arguments),this.localize=new A7(this),this.active=!1,this.placement="top",this.boundary="viewport",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const e=this.anchorEl.getBoundingClientRect(),g=this.popup.getBoundingClientRect(),I=this.placement.includes("top")||this.placement.includes("bottom");let C=0,t=0,i=0,A=0,n=0,l=0,s=0,a=0;I?e.top<g.top?(C=e.left,t=e.bottom,i=e.right,A=e.bottom,n=g.left,l=g.top,s=g.right,a=g.top):(C=g.left,t=g.bottom,i=g.right,A=g.bottom,n=e.left,l=e.top,s=e.right,a=e.top):e.left<g.left?(C=e.right,t=e.top,i=g.left,A=g.top,n=e.right,l=e.bottom,s=g.left,a=g.bottom):(C=g.right,t=g.top,i=e.left,A=e.top,n=g.right,l=g.bottom,s=e.left,a=e.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${C}px`),this.style.setProperty("--hover-bridge-top-left-y",`${t}px`),this.style.setProperty("--hover-bridge-top-right-x",`${i}px`),this.style.setProperty("--hover-bridge-top-right-y",`${A}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${s}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${a}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(e){super.updated(e),e.has("active")&&(this.active?this.start():this.stop()),e.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){const e=this.getRootNode();this.anchorEl=e.getElementById(this.anchor)}else this.anchor instanceof Element||XH(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){var e,g;!this.anchorEl||!this.active||((g=(e=this.popup).showPopover)==null||g.call(e),this.cleanup=IP(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(e=>{var g,I;(I=(g=this.popup).hidePopover)==null||I.call(g),this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>e())):e()})}reposition(){if(!this.active||!this.anchorEl)return;const e=[eP({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?e.push(NH({apply:({rects:C})=>{const t=this.sync==="width"||this.sync==="both",i=this.sync==="height"||this.sync==="both";this.popup.style.width=t?`${C.reference.width}px`:"",this.popup.style.height=i?`${C.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height="");let g;Uw&&!XH(this.anchor)&&this.boundary==="scroll"&&(g=Tr(this.anchorEl).filter(C=>C instanceof Element)),this.flip&&e.push(tP({boundary:this.flipBoundary||g,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&e.push(CP({boundary:this.shiftBoundary||g,padding:this.shiftPadding})),this.autoSize?e.push(NH({boundary:this.autoSizeBoundary||g,padding:this.autoSizePadding,apply:({availableWidth:C,availableHeight:t})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${t}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${C}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&e.push(iP({element:this.arrowEl,padding:this.arrowPadding}));const I=Uw?C=>Qw.getOffsetParent(C,nP):Qw.getOffsetParent;AP(this.anchorEl,this.popup,{placement:this.placement,middleware:e,strategy:Uw?"absolute":"fixed",platform:{...Qw,getOffsetParent:I}}).then(({x:C,y:t,middlewareData:i,placement:A})=>{const n=this.localize.dir()==="rtl",l={top:"bottom",right:"left",bottom:"top",left:"right"}[A.split("-")[0]];if(this.setAttribute("data-current-placement",A),Object.assign(this.popup.style,{left:`${C}px`,top:`${t}px`}),this.arrow){const s=i.arrow.x,a=i.arrow.y;let d="",m="",u="",h="";if(this.arrowPlacement==="start"){const Z=typeof s=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";d=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=n?Z:"",h=n?"":Z}else if(this.arrowPlacement==="end"){const Z=typeof s=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=n?"":Z,h=n?Z:"",u=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(h=typeof s=="number"?"calc(50% - var(--arrow-size-diagonal))":"",d=typeof a=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(h=typeof s=="number"?`${s}px`:"",d=typeof a=="number"?`${a}px`:"");Object.assign(this.arrowEl.style,{top:d,right:m,bottom:u,left:h,[l]:"calc(var(--arrow-size-diagonal) * -1)"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.dispatchEvent(new C7)}render(){return rA`
836
+ `;function XH(e){return e!==null&&typeof e=="object"&&"getBoundingClientRect"in e&&("contextElement"in e?e instanceof Element:!0)}var Uw=(qJ=globalThis==null?void 0:globalThis.HTMLElement)==null?void 0:qJ.prototype.hasOwnProperty("popover"),qI=class extends Eh{constructor(){super(...arguments),this.localize=new AE(this),this.active=!1,this.placement="top",this.boundary="viewport",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const e=this.anchorEl.getBoundingClientRect(),g=this.popup.getBoundingClientRect(),I=this.placement.includes("top")||this.placement.includes("bottom");let C=0,t=0,i=0,A=0,n=0,l=0,s=0,a=0;I?e.top<g.top?(C=e.left,t=e.bottom,i=e.right,A=e.bottom,n=g.left,l=g.top,s=g.right,a=g.top):(C=g.left,t=g.bottom,i=g.right,A=g.bottom,n=e.left,l=e.top,s=e.right,a=e.top):e.left<g.left?(C=e.right,t=e.top,i=g.left,A=g.top,n=e.right,l=e.bottom,s=g.left,a=g.bottom):(C=g.right,t=g.top,i=e.left,A=e.top,n=g.right,l=g.bottom,s=e.left,a=e.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${C}px`),this.style.setProperty("--hover-bridge-top-left-y",`${t}px`),this.style.setProperty("--hover-bridge-top-right-x",`${i}px`),this.style.setProperty("--hover-bridge-top-right-y",`${A}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${s}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${a}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(e){super.updated(e),e.has("active")&&(this.active?this.start():this.stop()),e.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){const e=this.getRootNode();this.anchorEl=e.getElementById(this.anchor)}else this.anchor instanceof Element||XH(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){var e,g;!this.anchorEl||!this.active||((g=(e=this.popup).showPopover)==null||g.call(e),this.cleanup=IP(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(e=>{var g,I;(I=(g=this.popup).hidePopover)==null||I.call(g),this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>e())):e()})}reposition(){if(!this.active||!this.anchorEl)return;const e=[eP({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?e.push(NH({apply:({rects:C})=>{const t=this.sync==="width"||this.sync==="both",i=this.sync==="height"||this.sync==="both";this.popup.style.width=t?`${C.reference.width}px`:"",this.popup.style.height=i?`${C.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height="");let g;Uw&&!XH(this.anchor)&&this.boundary==="scroll"&&(g=Tr(this.anchorEl).filter(C=>C instanceof Element)),this.flip&&e.push(tP({boundary:this.flipBoundary||g,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&e.push(CP({boundary:this.shiftBoundary||g,padding:this.shiftPadding})),this.autoSize?e.push(NH({boundary:this.autoSizeBoundary||g,padding:this.autoSizePadding,apply:({availableWidth:C,availableHeight:t})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${t}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${C}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&e.push(iP({element:this.arrowEl,padding:this.arrowPadding}));const I=Uw?C=>Qw.getOffsetParent(C,nP):Qw.getOffsetParent;AP(this.anchorEl,this.popup,{placement:this.placement,middleware:e,strategy:Uw?"absolute":"fixed",platform:{...Qw,getOffsetParent:I}}).then(({x:C,y:t,middlewareData:i,placement:A})=>{const n=this.localize.dir()==="rtl",l={top:"bottom",right:"left",bottom:"top",left:"right"}[A.split("-")[0]];if(this.setAttribute("data-current-placement",A),Object.assign(this.popup.style,{left:`${C}px`,top:`${t}px`}),this.arrow){const s=i.arrow.x,a=i.arrow.y;let d="",m="",u="",h="";if(this.arrowPlacement==="start"){const Z=typeof s=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";d=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=n?Z:"",h=n?"":Z}else if(this.arrowPlacement==="end"){const Z=typeof s=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=n?"":Z,h=n?Z:"",u=typeof a=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(h=typeof s=="number"?"calc(50% - var(--arrow-size-diagonal))":"",d=typeof a=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(h=typeof s=="number"?`${s}px`:"",d=typeof a=="number"?`${a}px`:"");Object.assign(this.arrowEl.style,{top:d,right:m,bottom:u,left:h,[l]:"calc(var(--arrow-size-diagonal) * -1)"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.dispatchEvent(new CE)}render(){return rA`
835
837
  <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
836
838
 
837
839
  <span
@@ -1447,20 +1449,20 @@ function print() { __p += __j.call(arguments, '') }
1447
1449
  size: A4 portrait;
1448
1450
  margin: 10mm;
1449
1451
  }
1450
- `,Ng="max-height: 95vh; margin-bottom: 10px; max-width: 100%"),Pxg({printable:(pI=i.file)==null?void 0:pI.path,type:Cg,style:lg,imageStyle:Ng})},Vg=()=>{var Cg,lg,Ng,Dg;(Cg=i.file)!=null&&Cg.path&&Uxg((lg=i.file)==null?void 0:lg.path,(Ng=i.file)==null?void 0:Ng.name,(Dg=i.file)==null?void 0:Dg.file)},pg=(Cg,lg=!1)=>{const Ng=Cg.target;Ng instanceof HTMLImageElement&&(Ng.src=En),lg&&(X(),i.isErrorFile=!0)},CI=()=>{var Cg;X(),!i.isErrorFile&&!y.value?L()||z((Cg=i.file)==null?void 0:Cg.path):(O(),X(),i.isImagePositioned=!0)},Og=Cg=>{o.nextTick(()=>{var Ng;if(!Cg||((Ng=i.file)==null?void 0:Ng.path)!==Cg||i.isImagePositioned||i.isErrorFile||y.value)return;const lg=u.value;!(lg!=null&&lg.complete)||lg.naturalWidth<=0||CI()})},kI=()=>{m.value&&At(m.value.nextSlide())},Ge=()=>{m.value&&At(m.value.prevSlide())},FI=Cg=>{if(i.isMobile)return;const lg=Cg.target;(lg===a.value||lg===l.value||lg===s.value)&&(i.isClickOnExit=!0)},ZI=Cg=>{const lg=Cg.target;(lg===a.value||lg===l.value||lg===s.value)&&Ag(),i.isClickOnExit=!1},TI=Cg=>{i.isMobile&&(i.startXForMobile=Cg.clientX,i.startYForMobile=Cg.clientY,i.isPointerActive=!0)},CC=Cg=>{i.isMobile&&(i.startXForMobile=Cg.touches[0].clientX,i.startYForMobile=Cg.touches[0].clientY,i.isPointerActive=!0)},we=()=>{i.isMobile&&(Yi(),VC())},yC=Cg=>{var pI,ne;if(!i.isMobile)return;const lg=Cg.clientX,Ng=Cg.clientY,Dg=Math.abs(lg-i.startXForMobile),Lg=Ng-i.startYForMobile;i.isExistSwipe&&Lg>gN&&Lg>Dg&&C("close"),i.isChangeItemSwipe&&m.value&&(i.isMobile&&i.zoomValue===1||!i.isMobile)&&(i.isSwipeNextSlide&&At((pI=m.value)==null?void 0:pI.nextSlide()),i.isSwipePrevSlide&&At((ne=m.value)==null?void 0:ne.prevSlide())),Yi(),o.nextTick(()=>{VC()})},pt=Cg=>{var pI,ne;if(!i.isMobile)return;const lg=Cg.changedTouches[0].clientX,Ng=Cg.changedTouches[0].clientY,Dg=Math.abs(lg-i.startXForMobile),Lg=Ng-i.startYForMobile;i.isExistSwipe&&Lg>gN&&Lg>Dg&&C("close"),i.isChangeItemSwipe&&m.value&&(i.isMobile&&i.zoomValue===1||!i.isMobile)&&(i.isSwipeNextSlide&&At((pI=m.value)==null?void 0:pI.nextSlide()),i.isSwipePrevSlide&&At((ne=m.value)==null?void 0:ne.prevSlide())),Yi(),o.nextTick(()=>{VC()})},Xe=Cg=>{if(!i.isMobile||!i.isPointerActive)return;const lg=Cg.clientY-i.startYForMobile,Ng=Cg.clientX-i.startXForMobile;ye(Ng,lg)},YC=Cg=>{if(!i.isMobile)return;const lg=Cg.touches[0].clientX,Ng=Cg.touches[0].clientY,Dg=lg-i.startXForMobile,Lg=Ng-i.startYForMobile;ye(Dg,Lg)},_t=Cg=>{const lg=Cg.target;!i.isMobile||!lg||lg.scrollHeight<=lg.clientHeight||!i.isExitScrollActive&&lg.scrollTop===0&&Cg.preventDefault()},mC=()=>{if(!l.value||!u.value)return 1;if(i.zoomValue!==1)return i.zoomValue;const Cg=l.value.offsetWidth,lg=l.value.offsetHeight,Ng=u.value.offsetWidth,Dg=u.value.offsetHeight;let Lg=1;return Math.abs(i.rotateValue)%180===0||(Dg>Cg?Lg=Cg/Dg:Ng>lg&&(Lg=lg/Ng)),Lg},ye=(Cg,lg)=>{const Ng=Math.abs(Cg);if(i.zoomValue===1){if(Ng<lg&&lg>qK&&!i.isChangeItemSwipe&&l.value&&l.value.scrollTop===0&&(i.isExistSwipe=!0),Ng>lg&&Ng>kOg&&!i.isExistSwipe&&(i.isChangeItemSwipe=!0),i.isExistSwipe){const Dg=Math.max(0,1-(lg-qK)/gN);requestAnimationFrame(()=>{a.value&&KI({opacity:Dg},a.value)})}if(i.isChangeItemSwipe&&Ng>KOg){const Dg=i.defaultIndex===I.items.length-1,Lg=i.defaultIndex===0;if(Cg>0){if(Lg)return;i.isSwipePrevSlide=!0}if(Cg<0){if(Dg)return;i.isSwipeNextSlide=!0}}}},it=()=>{const Cg=i.rotateValue!==0;i.rotateValue=0,Cg&&u.value&&KI({transform:"none"},u.value)},VC=()=>{requestAnimationFrame(()=>{a.value&&KI({opacity:1},a.value)})},Yi=()=>{i.isPointerActive=!1,i.isExistSwipe=!1,i.isSwipeNextSlide=!1,i.isSwipePrevSlide=!1,i.isChangeItemSwipe=!1},vC=Cg=>{const lg=i.zoomValue;i.zoomValue+=Cg?1:-1,i.zoomValue=Math.min(Math.max(1,i.zoomValue),3);const Ng=i.zoomValue;lg!==Ng&&s.value&&(d.value&&KI(F.value,s.value),u.value&&(Z==null||Z.zoom(i.zoomValue,{force:!0}),i.zoomValue===1?(Z==null||Z.setOptions({cursor:"default"}),o.nextTick(()=>{Ig()})):Z==null||Z.setOptions({cursor:"move"})))},At=Cg=>{!I.items[Cg]||i.defaultIndex===Cg||(i.defaultIndex=Cg,Hn(),i.file=I.items[Cg])},$t=Cg=>{let lg=i.sideBarIndex;Cg>0?(lg=i.sideBarIndex+1,lg=Math.min(i.sideBarLength-1,lg)):(lg=i.sideBarIndex-1,lg=Math.max(0,lg)),i.sideBarIndex=lg},qt=()=>{var lg;const Cg=(lg=i.file)==null?void 0:lg.path;o.nextTick(()=>{var Ng,Dg,Lg;if(i.file){if(an((Ng=i.file)==null?void 0:Ng.path)||an((Dg=i.file)==null?void 0:Dg.file)){i.isErrorFile=!0,Xn();return}Xd((Lg=i.file)==null?void 0:Lg.path)&&Og(Cg)}})},Rn=()=>{o.nextTick(()=>{if(!A.value||!n.value)return;const Cg=A.value[i.sideBarIndex];jV(Cg,n.value)})},Xn=async()=>{var Cg,lg,Ng;try{if(!i.file)return;const Dg=Rd.getCache(i.file.path);let Lg;if(Dg)Lg=Dg;else if((Cg=i.file)!=null&&Cg.file){const pI=await i.file.file.arrayBuffer();Lg=await PW({data:new Uint8Array(pI)}).promise}else Lg=await PW((lg=i.file)==null?void 0:lg.path).promise;if(!Lg){i.isErrorFile=!0;return}i.sideBarLength=Lg.numPages,i.sideBarItems=new Array(Lg.numPages).fill(((Ng=i.file)==null?void 0:Ng.path)??""),Rd.setCache(i.file.path,Lg),Uo(0),i.isErrorFile=!1}catch(Dg){console.error(Dg),i.isErrorFile=!0}},Uo=async(Cg=0)=>{i.sideBarIndex=Cg},Hn=()=>{i.sideBarItems=[],i.sideBarIndex=0,i.sideBarLength=0},TA=()=>{i.isMobile=t.matches},Eo={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",mp4:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime"},vA=Cg=>Cg instanceof HTMLElement?!!Cg.closest('input, textarea, [contenteditable="true"], [contenteditable=""]'):!1,Bt=(Cg,lg)=>{var Lg;if(lg)return lg;const[Ng]=Cg.split("?"),Dg=(Lg=Ng.split(".").pop())==null?void 0:Lg.toLowerCase();return Dg?Eo[Dg]??"application/octet-stream":"application/octet-stream"},jA=()=>{G&&(URL.revokeObjectURL(G),G=null),h.value=null},Jg=async()=>{var lg;jA();const Cg=i.file;if(!(!(Cg!=null&&Cg.path)||!Ql(Cg.path))){if(Cg.file){G=URL.createObjectURL(Cg.file),h.value=G;return}try{const Ng=await fetch(Cg.path,{credentials:"include"});if(!Ng.ok)throw new Error(`Failed to fetch video: ${Ng.status}`);const Dg=await Ng.blob(),Lg=Dg.type?Dg:new Blob([Dg],{type:Bt(Cg.path)});if(((lg=i.file)==null?void 0:lg.path)!==Cg.path)return;G=URL.createObjectURL(Lg),h.value=G}catch(Ng){console.error("Failed to prepare video source",Ng),h.value=Cg.path}}},E=Cg=>new Promise((lg,Ng)=>{const Dg=new Image;Dg.onload=()=>{const Lg=document.createElement("canvas");Lg.width=Dg.width,Lg.height=Dg.height;const pI=Lg.getContext("2d");if(!pI)return Ng("No canvas context");pI.drawImage(Dg,0,0),Lg.toBlob(ne=>{if(!ne)return Ng("PNG conversion failed");lg(ne)},"image/png")},Dg.onerror=Ng,Dg.src=URL.createObjectURL(Cg)}),eg=async()=>{var lg;if(!((lg=i.file)!=null&&lg.path))return null;if(i.file.file)return new Blob([i.file.file],{type:Bt(i.file.path,i.file.file.type)});const Cg=await fetch(i.file.path,{credentials:"include"});if(!Cg.ok)throw new Error(`Failed to fetch media for clipboard: ${Cg.status}`);return await Cg.blob()},dg=async()=>{var Ng,Dg;if(!((Ng=i.file)!=null&&Ng.path)||Ql(i.file.path)||!Xd(i.file.path))return;const Cg=navigator;if(!((Dg=Cg.clipboard)!=null&&Dg.write)||typeof window.ClipboardItem>"u")return;let lg=await eg();if(lg){lg.type!=="image/png"&&(lg=await E(lg));try{await Cg.clipboard.write([new ClipboardItem({"image/png":lg})])}catch(Lg){console.error("Clipboard write failed",Lg)}}},Qg=Cg=>{var Dg,Lg;if(!((Cg.ctrlKey||Cg.metaKey)&&Cg.key&&Cg.key.toLowerCase()==="c")||vA(Cg.target))return;const Ng=(Dg=window.getSelection())==null?void 0:Dg.toString();Ng&&Ng.trim().length>0||!((Lg=i.file)!=null&&Lg.path)||i.isErrorFile||y.value||!Xd(i.file.path)&&!Ql(i.file.path)||(Cg.preventDefault(),Cg.stopPropagation(),dg().catch(pI=>{console.error("Failed to copy media to clipboard",pI)}))};return o.onMounted(()=>{n.value&&n.value.addEventListener("resize",Ig),TA(),t.addEventListener("change",TA),document.addEventListener("keydown",Qg)}),o.onUnmounted(()=>{Hn(),X(),jA(),n.value&&n.value.removeEventListener("resize",Ig),t.removeEventListener("change",TA),document.removeEventListener("keydown",Qg)}),(Cg,lg)=>(o.openBlock(),o.createBlock(L0,{position:"center",class:"slider-modal",ref:"modalRef",open:e.open,height:e.height,width:e.width,"animate-type":o.unref(vV).fade,onClose:Ag,onEndAnimation:Q,onUnmounted:lg[3]||(lg[3]=Ng=>Cg.$emit("unmounted")),onPointerup:yC,onPointerleave:we,onTouchend:pt},{default:o.withCtx(()=>{var Ng,Dg,Lg,pI,ne,xA,jC,AA,nA,Hl,Dl,Po,_o;return[o.createElementVNode("div",sOg,[o.createElementVNode("div",{ref_key:"sideBarRef",ref:n,class:o.normalizeClass(["slider-modal__side-bar",[{"slider-modal__side-bar_active":o.unref(an)((Ng=i.file)==null?void 0:Ng.path)||o.unref(an)((Dg=i.file)==null?void 0:Dg.file)}]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.sideBarItems,(j,P)=>{var ig;return o.openBlock(),o.createElementBlock("div",{ref_for:!0,ref_key:"miniItemsRef",ref:A,class:o.normalizeClass(["slider-modal__side-bar-item",{"slider-modal__side-bar-item_active":P===i.sideBarIndex}]),key:P},[o.createElementVNode("div",{class:"slider-modal__mini-prewiew-wrapper",onClick:Wg=>mg(P)},[o.createVNode(Ol,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__mini-preview",src:j,page:P+1,file:(ig=i.file)==null?void 0:ig.file},null,8,["src","page","file"])],8,aOg),o.createElementVNode("div",dOg,o.toDisplayString(P+1),1)],2)}),128))],2),i.isMobile?(o.openBlock(),o.createElementBlock("div",cOg,[o.createElementVNode("div",rOg,[o.createElementVNode("div",{class:"slider-modal__exit-button",onClick:lg[0]||(lg[0]=j=>Cg.$emit("close"))},[o.createVNode(Mg,{class:"slider-modal__exit-icon",name:o.unref(ug).leftBig,width:16,height:16},null,8,["name"]),lg[4]||(lg[4]=o.createElementVNode("div",{class:"slider-modal__exit-text"},"Назад",-1))])]),o.createElementVNode("div",mOg,[o.createElementVNode("div",uOg,o.toDisplayString(i.defaultIndex+1)+" из "+o.toDisplayString(I.items.length),1)]),lg[5]||(lg[5]=o.createElementVNode("div",{class:"slider-modal__mobile-header-block"},null,-1))])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"mainRef",ref:a,class:"slider-modal__main",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",hOg,o.toDisplayString((Lg=i.file)==null?void 0:Lg.name),1),o.unref(an)((pI=i.file)==null?void 0:pI.path)||o.unref(an)((ne=i.file)==null?void 0:ne.file)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"itemRef",ref:l,class:"slider-modal__item",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"]),onWheel:og,onScroll:_t,onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC},[i.isMobile?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.sideBarItems,(j,P)=>{var ig;return o.openBlock(),o.createElementBlock("div",{key:P,class:"slider-modal__viewport"},[o.createVNode(Ol,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__pdf slider-modal__pdf_mobile",src:j,page:P+1,file:(ig=i.file)==null?void 0:ig.file},null,8,["src","page","file"])])}),128)):(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createVNode(Ol,{class:"slider-modal__pdf",ref_key:"pdfRef",ref:d,src:(xA=i==null?void 0:i.file)==null?void 0:xA.path,page:i.sideBarIndex+1,file:(jC=i.file)==null?void 0:jC.file},null,8,["src","page","file"])],544))],544)):o.unref(Xd)((AA=i.file)==null?void 0:AA.path)?(o.openBlock(),o.createElementBlock("div",{key:1,ref_key:"itemRef",ref:l,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC,onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",{ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("img",{ref_key:"imagePreviewRef",ref:u,class:o.normalizeClass(["slider-modal__image",{"slider-modal__image_error":i.isErrorFile,"slider-modal__image_positioned":i.isImagePositioned}]),src:(nA=i.file)==null?void 0:nA.path,onError:lg[1]||(lg[1]=j=>pg(j,!0)),onLoad:CI},null,42,bOg)],544)],544)):o.unref(Ql)((Hl=i.file)==null?void 0:Hl.path)&&!i.isErrorFile?(o.openBlock(),o.createElementBlock("div",{key:2,ref_key:"itemRef",ref:l,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:o.withModifiers(CC,["prevent"]),onTouchmove:o.withModifiers(YC,["prevent"]),onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[(o.openBlock(),o.createElementBlock("video",{controls:"",autoplay:"",name:"media",playsinline:"","webkit-playsinline":"",class:"slider-modal__video",key:(Dl=i.file)==null?void 0:Dl.path,"data-testid":`${I.dataTestid}-Video`,onError:lg[2]||(lg[2]=j=>pg(j,!0))},[o.createElementVNode("source",{src:h.value??((Po=i.file)==null?void 0:Po.path)??"",type:Bt(((_o=i.file)==null?void 0:_o.path)??"")},null,8,GOg)],40,ZOg))],544)):(o.openBlock(),o.createElementBlock("div",{key:3,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC,onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",{ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("img",{class:"slider-modal__image slider-modal__image_error",src:o.unref(En)},null,8,wOg)],544)],32)),o.createElementVNode("div",WOg,[lg[6]||(lg[6]=o.createElementVNode("div",{class:"slider-modal__nav-block"},[o.createElementVNode("br")],-1)),o.createElementVNode("div",pOg,[I.items.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:p.value,onClick:Ge},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).leftBig,width:24,height:24},null,8,["name"])],8,BOg),o.createVNode(vxg,{ref_key:"sliderRef",ref:m,class:"slider-modal__bottom-slider","active-index":i.defaultIndex},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.items,(j,P)=>(o.openBlock(),o.createBlock(xxg,{class:o.normalizeClass(["slider-modal__slide",{"slider-modal__slide_active":P===i.defaultIndex}]),key:P,"is-active":P===i.defaultIndex,onClick:ig=>$(P)},{default:o.withCtx(()=>{var ig;return[o.unref(Xd)(j.path)?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider-modal__slide-image",src:j.path,alt:j.path,onError:pg},null,40,yOg)):o.unref(an)(j.path)||o.unref(an)((ig=i.file)==null?void 0:ig.file)?(o.openBlock(),o.createBlock(Ol,{key:1,class:"slider-modal__slide-image",src:j.path,page:1,file:j.file},null,8,["src","file"])):o.unref(Ql)(j.path)?(o.openBlock(),o.createBlock(T0,{key:2,class:"slider-modal__slide-image",src:j.path},null,8,["src"])):(o.openBlock(),o.createElementBlock("img",{key:3,class:"slider-modal__slide-image",src:o.unref(En)},null,8,YOg))]}),_:2},1032,["class","is-active","onClick"]))),128))]),_:1},8,["active-index"]),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:B.value,onClick:kI},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).rightBig,width:24,height:24},null,8,["name"])],8,VOg)],64)):o.createCommentVNode("",!0)]),o.createElementVNode("div",NOg,[o.createElementVNode("div",MOg,[o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_zoom",disabled:K.value,onClick:Rg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).zoomMinus,width:24,height:24},null,8,["name"])],8,fOg),o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_zoom",disabled:K.value,onClick:Gg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).zoomPlus,width:24,height:24},null,8,["name"])],8,ROg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:Y.value,onClick:Yg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).reset,width:24,height:24},null,8,["name"])],8,XOg)]),o.createElementVNode("div",HOg,[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:M.value,onClick:Vg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).uploadCloud,width:24,height:24},null,8,["name"])],8,DOg),o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_printer",disabled:f.value,onClick:hg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).printer,width:24,height:24},null,8,["name"])],8,SOg)])])])],544)],512)]}),_:1},8,["open","height","width","animate-type"]))}}),[["__scopeId","data-v-840c01d8"]]),zOg=["data-testid"],JOg=["data-testid"],LOg=["data-testid"],TOg=["data-testid"],vOg=["data-testid"],j0=Tg(o.defineComponent({__name:"Loader",props:{title:{default:"Загрузка..."},dataTestid:{default:"Loader"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("div",{class:"loader","data-testid":g.dataTestid},[o.createElementVNode("div",{class:"loader__area","data-testid":`${g.dataTestid}-Area`},[o.createElementVNode("div",{class:"loader__circle loader__circle--light-blue","data-testid":`${g.dataTestid}-Loader-LightBlue1`},null,8,LOg),o.createElementVNode("div",{class:"loader__circle loader__circle--blue","data-testid":`${g.dataTestid}-Loader-LightBlue2`},null,8,TOg)],8,JOg),g.title?(o.openBlock(),o.createElementBlock("span",{key:0,class:"loader__span","data-testid":`${g.dataTestid}-Loader-Title`},o.toDisplayString(g.title),9,vOg)):o.createCommentVNode("",!0)],8,zOg))}}),[["__scopeId","data-v-4086dc15"]]),jOg=["data-testid"],xOg=["data-testid"],OOg=["disabled","data-testid"],QOg=["data-testid"],UOg=["data-testid"],EOg=["src","data-testid"],POg=["data-testid"],_Og=["data-testid"],$Og=["src"],qOg=["src","data-testid"],gQg=["data-testid"],IQg=["data-testid"],eQg=["disabled","data-testid"],IN=Tg(o.defineComponent({__name:"Slider",props:{items:{},defaultIndex:{},dataTestid:{default:"Slider"}},setup(e,{expose:g}){const I=e,C=o.reactive({files:I.items.length?I.items:[],file:null,currentIndex:I.defaultIndex||0,extension:null,filePath:null,isShowSliderModal:!1,indexModal:0,isLoad:!1,isError:!1}),t=o.computed(()=>{if(!C.files.length)return!1;let y=!w();return y=y||!p(),y}),i=()=>{C.isError=!1,C.isLoad=!1};o.watch(()=>C.file,()=>{var Y;C.filePath=((Y=C.file)==null?void 0:Y.path)??null,i();const y=p();C.isError=y},{immediate:!0}),o.watch(()=>I.items,()=>{C.files=I.items.length?I.items:[]});const A=()=>{C.isLoad=!0},n=()=>{C.isError=!0,C.filePath=En},l=y=>{if(!y)return;const Y=C.files.findIndex(f=>y.path===f.path);Y!==-1&&(C.indexModal=Y,C.isShowSliderModal=!0)},s=()=>{C.isShowSliderModal=!1},a=()=>{var y;return(y=I.items)!=null&&y.length?C.currentIndex===I.items.length-1:!0},d=y=>{if(!y)return null;const Y=y.split("?")[0],f=/\.\w+$/,M=Y.match(f);return C.extension=M?M[0].replace(".",""):null,C.extension},m=y=>{const Y=d(y);return Y?Object.values(G0).includes(Y.toLowerCase()):!1},u=y=>{const Y=d(y);return Y?Object.values(w0).includes(Y):!1},h=y=>d(y)==="pdf",Z=()=>{C.currentIndex--,C.file=C.files[C.currentIndex]},G=()=>{C.currentIndex++,C.file=C.files[C.currentIndex]},w=()=>C.files.length===0,p=()=>{var y,Y,f;return m(((y=C.file)==null?void 0:y.path)??null)==!1&&u(((Y=C.file)==null?void 0:Y.path)??null)==!1&&h(((f=C.file)==null?void 0:f.path)??null)==!1&&C.files.length>0&&!C.isError};o.onMounted(()=>{if(!I.items)return 0;C.files=I.items,I.defaultIndex&&(C.file=C.files[C.currentIndex]),C.file=C.files[C.currentIndex]});const B=y=>{y>=0&&y<C.files.length&&(C.currentIndex=y,C.file=C.files[C.currentIndex])};return o.watch(()=>I.items,()=>{C.files=I.items,i()},{deep:!0}),g({setSlide:B}),(y,Y)=>{var f,M,K,F,X;return o.openBlock(),o.createElementBlock("div",{class:"slider-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",{class:"slider-yui-kit__wrapper",ref:"slider-yui-kitWrapperRef","data-testid":`${I.dataTestid}-Wrapper`},[o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--prev",onClick:Z,disabled:C.currentIndex===0,"data-testid":`${I.dataTestid}-Prev-Button`},[o.createVNode(Mg,{name:o.unref(ug).leftBig,"data-testid":`${I.dataTestid}-Prev-Icon`},null,8,["name","data-testid"])],8,OOg),o.createElementVNode("div",{class:"slider-yui-kit__slides","data-testid":`${I.dataTestid}-Slides-Container`},[w()?(o.openBlock(),o.createElementBlock("div",{key:0,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("img",{src:o.unref(En),alt:"",width:"111px",height:"111px","data-testid":`${I.dataTestid}-NoContent-Image`},null,8,EOg),o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Контент отсутствует ",8,POg)],8,UOg)):p()?(o.openBlock(),o.createElementBlock("div",{key:1,class:"placeholder-yui-kit","data-testid":`${I.dataTestid}-Invalid-Extension-Placeholder`},[o.createElementVNode("img",{src:o.unref(En),alt:"",width:"111px",height:"111px"},null,8,$Og),o.createElementVNode("p",null,"."+o.toDisplayString(C.extension),1)],8,_Og)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[m(((f=C.file)==null?void 0:f.path)??"")?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider__item",src:C.filePath??"","data-testid":`${I.dataTestid}-Image`,onClick:Y[0]||(Y[0]=z=>l(C.file)),onError:n,onLoad:A},null,40,qOg)):u(((M=C.file)==null?void 0:M.path)??"")?(o.openBlock(),o.createBlock(T0,{key:1,class:"slider__item slider__item_video",src:((K=C.file)==null?void 0:K.path)??"",onClick:Y[1]||(Y[1]=z=>l(C.file)),onLoad:A,onError:n},null,8,["src"])):h(((F=C.file)==null?void 0:F.path)??"")?(o.openBlock(),o.createBlock(Ol,{key:2,class:"slider-yui-kit__pdf-preview slider__item",src:(X=C.file)==null?void 0:X.path,onClick:Y[2]||(Y[2]=z=>l(C.file)),onLoad:A,onError:n},null,8,["src"])):(o.openBlock(),o.createElementBlock("div",{key:3,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Ошибка загрузки файла ",8,IQg)],8,gQg))],64)),!C.isLoad&&t.value&&!C.isError?(o.openBlock(),o.createBlock(j0,{key:3,class:"slider-yui-kit__loader"})):o.createCommentVNode("",!0)],8,QOg),o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--next",onClick:G,disabled:a(),"data-testid":`${I.dataTestid}-Next-Button`},[o.createVNode(Mg,{name:o.unref(ug).rightBig,"data-testid":`${I.dataTestid}-Next-Icon`},null,8,["name","data-testid"])],8,eQg)],8,xOg),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(sp,{open:C.isShowSliderModal,items:C.files,"default-index":C.indexModal,onClose:s},null,8,["open","items","default-index"])]))],8,jOg)}}}),[["__scopeId","data-v-c4471169"]]),CQg=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function tQg(e){return CQg.test(e)}function gk(){var e=URL.createObjectURL(new Blob),g=e.toString();return URL.revokeObjectURL(e),g.split(/[:\/]/g).pop().toLowerCase()}gk.valid=tQg;const iQg=(e="")=>e+gk();var x0=(e=>(e.small="small",e.medium="medium",e.big="big",e.large="large",e))(x0||{});const AQg=["disabled","data-testid"],nQg=["id","disabled","data-testid"],lQg=["for","data-testid"],oQg=o.defineComponent({__name:"Toggle",props:o.mergeModels({disabled:{type:Boolean,default:!1},backgroundColor:{},type:{default:x0.small},dataTestid:{default:"Toggle"}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["change"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=g,t=o.useModel(e,"modelValue"),i=iQg(),A=o.computed(()=>({"toggle-yui-kit":!0,"toggle-yui-kit_small":I.type===x0.small,"toggle-yui-kit_medium":I.type===x0.medium,"toggle-yui-kit_large":I.type===x0.large})),n=o.computed(()=>({backgroundColor:I.backgroundColor})),l=()=>C("change",!!t.value);return(s,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(A.value),disabled:I.disabled,style:o.normalizeStyle(n.value),"data-testid":`${I.dataTestid}-Toggle`},[o.withDirectives(o.createElementVNode("input",{class:"toggle-yui-kit-input",id:o.unref(i),type:"checkbox",disabled:e.disabled,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value=d),onChange:l,"data-testid":`${I.dataTestid}-Input`},null,40,nQg),[[o.vModelCheckbox,t.value]]),o.createElementVNode("label",{class:"toggle-yui-kit-label",for:o.unref(i),"data-testid":`${I.dataTestid}-Label`},null,8,lQg)],14,AQg))}}),ap=Tg(oQg,[["__scopeId","data-v-38cc7c65"]]);/*!
1452
+ `,Ng="max-height: 95vh; margin-bottom: 10px; max-width: 100%"),Pxg({printable:(pI=i.file)==null?void 0:pI.path,type:Cg,style:lg,imageStyle:Ng})},Vg=()=>{var Cg,lg,Ng,Dg;(Cg=i.file)!=null&&Cg.path&&Uxg((lg=i.file)==null?void 0:lg.path,(Ng=i.file)==null?void 0:Ng.name,(Dg=i.file)==null?void 0:Dg.file)},pg=(Cg,lg=!1)=>{const Ng=Cg.target;Ng instanceof HTMLImageElement&&(Ng.src=En),lg&&(X(),i.isErrorFile=!0)},CI=()=>{var Cg;X(),!i.isErrorFile&&!y.value?L()||z((Cg=i.file)==null?void 0:Cg.path):(O(),X(),i.isImagePositioned=!0)},Og=Cg=>{o.nextTick(()=>{var Ng;if(!Cg||((Ng=i.file)==null?void 0:Ng.path)!==Cg||i.isImagePositioned||i.isErrorFile||y.value)return;const lg=u.value;!(lg!=null&&lg.complete)||lg.naturalWidth<=0||CI()})},kI=()=>{m.value&&At(m.value.nextSlide())},Ge=()=>{m.value&&At(m.value.prevSlide())},FI=Cg=>{if(i.isMobile)return;const lg=Cg.target;(lg===a.value||lg===l.value||lg===s.value)&&(i.isClickOnExit=!0)},ZI=Cg=>{const lg=Cg.target;(lg===a.value||lg===l.value||lg===s.value)&&Ag(),i.isClickOnExit=!1},TI=Cg=>{i.isMobile&&(i.startXForMobile=Cg.clientX,i.startYForMobile=Cg.clientY,i.isPointerActive=!0)},CC=Cg=>{i.isMobile&&(i.startXForMobile=Cg.touches[0].clientX,i.startYForMobile=Cg.touches[0].clientY,i.isPointerActive=!0)},we=()=>{i.isMobile&&(Yi(),VC())},yC=Cg=>{var pI,ne;if(!i.isMobile)return;const lg=Cg.clientX,Ng=Cg.clientY,Dg=Math.abs(lg-i.startXForMobile),Lg=Ng-i.startYForMobile;i.isExistSwipe&&Lg>gN&&Lg>Dg&&C("close"),i.isChangeItemSwipe&&m.value&&(i.isMobile&&i.zoomValue===1||!i.isMobile)&&(i.isSwipeNextSlide&&At((pI=m.value)==null?void 0:pI.nextSlide()),i.isSwipePrevSlide&&At((ne=m.value)==null?void 0:ne.prevSlide())),Yi(),o.nextTick(()=>{VC()})},pt=Cg=>{var pI,ne;if(!i.isMobile)return;const lg=Cg.changedTouches[0].clientX,Ng=Cg.changedTouches[0].clientY,Dg=Math.abs(lg-i.startXForMobile),Lg=Ng-i.startYForMobile;i.isExistSwipe&&Lg>gN&&Lg>Dg&&C("close"),i.isChangeItemSwipe&&m.value&&(i.isMobile&&i.zoomValue===1||!i.isMobile)&&(i.isSwipeNextSlide&&At((pI=m.value)==null?void 0:pI.nextSlide()),i.isSwipePrevSlide&&At((ne=m.value)==null?void 0:ne.prevSlide())),Yi(),o.nextTick(()=>{VC()})},Xe=Cg=>{if(!i.isMobile||!i.isPointerActive)return;const lg=Cg.clientY-i.startYForMobile,Ng=Cg.clientX-i.startXForMobile;ye(Ng,lg)},YC=Cg=>{if(!i.isMobile)return;const lg=Cg.touches[0].clientX,Ng=Cg.touches[0].clientY,Dg=lg-i.startXForMobile,Lg=Ng-i.startYForMobile;ye(Dg,Lg)},_t=Cg=>{const lg=Cg.target;!i.isMobile||!lg||lg.scrollHeight<=lg.clientHeight||!i.isExitScrollActive&&lg.scrollTop===0&&Cg.preventDefault()},mC=()=>{if(!l.value||!u.value)return 1;if(i.zoomValue!==1)return i.zoomValue;const Cg=l.value.offsetWidth,lg=l.value.offsetHeight,Ng=u.value.offsetWidth,Dg=u.value.offsetHeight;let Lg=1;return Math.abs(i.rotateValue)%180===0||(Dg>Cg?Lg=Cg/Dg:Ng>lg&&(Lg=lg/Ng)),Lg},ye=(Cg,lg)=>{const Ng=Math.abs(Cg);if(i.zoomValue===1){if(Ng<lg&&lg>qK&&!i.isChangeItemSwipe&&l.value&&l.value.scrollTop===0&&(i.isExistSwipe=!0),Ng>lg&&Ng>kOg&&!i.isExistSwipe&&(i.isChangeItemSwipe=!0),i.isExistSwipe){const Dg=Math.max(0,1-(lg-qK)/gN);requestAnimationFrame(()=>{a.value&&KI({opacity:Dg},a.value)})}if(i.isChangeItemSwipe&&Ng>KOg){const Dg=i.defaultIndex===I.items.length-1,Lg=i.defaultIndex===0;if(Cg>0){if(Lg)return;i.isSwipePrevSlide=!0}if(Cg<0){if(Dg)return;i.isSwipeNextSlide=!0}}}},it=()=>{const Cg=i.rotateValue!==0;i.rotateValue=0,Cg&&u.value&&KI({transform:"none"},u.value)},VC=()=>{requestAnimationFrame(()=>{a.value&&KI({opacity:1},a.value)})},Yi=()=>{i.isPointerActive=!1,i.isExistSwipe=!1,i.isSwipeNextSlide=!1,i.isSwipePrevSlide=!1,i.isChangeItemSwipe=!1},vC=Cg=>{const lg=i.zoomValue;i.zoomValue+=Cg?1:-1,i.zoomValue=Math.min(Math.max(1,i.zoomValue),3);const Ng=i.zoomValue;lg!==Ng&&s.value&&(d.value&&KI(F.value,s.value),u.value&&(Z==null||Z.zoom(i.zoomValue,{force:!0}),i.zoomValue===1?(Z==null||Z.setOptions({cursor:"default"}),o.nextTick(()=>{Ig()})):Z==null||Z.setOptions({cursor:"move"})))},At=Cg=>{!I.items[Cg]||i.defaultIndex===Cg||(i.defaultIndex=Cg,Hn(),i.file=I.items[Cg])},$t=Cg=>{let lg=i.sideBarIndex;Cg>0?(lg=i.sideBarIndex+1,lg=Math.min(i.sideBarLength-1,lg)):(lg=i.sideBarIndex-1,lg=Math.max(0,lg)),i.sideBarIndex=lg},qt=()=>{var lg;const Cg=(lg=i.file)==null?void 0:lg.path;o.nextTick(()=>{var Ng,Dg,Lg;if(i.file){if(an((Ng=i.file)==null?void 0:Ng.path)||an((Dg=i.file)==null?void 0:Dg.file)){i.isErrorFile=!0,Xn();return}Xd((Lg=i.file)==null?void 0:Lg.path)&&Og(Cg)}})},Rn=()=>{o.nextTick(()=>{if(!A.value||!n.value)return;const Cg=A.value[i.sideBarIndex];jV(Cg,n.value)})},Xn=async()=>{var Cg,lg,Ng;try{if(!i.file)return;const Dg=Rd.getCache(i.file.path);let Lg;if(Dg)Lg=Dg;else if((Cg=i.file)!=null&&Cg.file){const pI=await i.file.file.arrayBuffer();Lg=await PW({data:new Uint8Array(pI)}).promise}else Lg=await PW((lg=i.file)==null?void 0:lg.path).promise;if(!Lg){i.isErrorFile=!0;return}i.sideBarLength=Lg.numPages,i.sideBarItems=new Array(Lg.numPages).fill(((Ng=i.file)==null?void 0:Ng.path)??""),Rd.setCache(i.file.path,Lg),Uo(0),i.isErrorFile=!1}catch(Dg){console.error(Dg),i.isErrorFile=!0}},Uo=async(Cg=0)=>{i.sideBarIndex=Cg},Hn=()=>{i.sideBarItems=[],i.sideBarIndex=0,i.sideBarLength=0},TA=()=>{i.isMobile=t.matches},Eo={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",mp4:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime"},vA=Cg=>Cg instanceof HTMLElement?!!Cg.closest('input, textarea, [contenteditable="true"], [contenteditable=""]'):!1,Bt=(Cg,lg)=>{var Lg;if(lg)return lg;const[Ng]=Cg.split("?"),Dg=(Lg=Ng.split(".").pop())==null?void 0:Lg.toLowerCase();return Dg?Eo[Dg]??"application/octet-stream":"application/octet-stream"},jA=()=>{G&&(URL.revokeObjectURL(G),G=null),h.value=null},Jg=async()=>{var lg;jA();const Cg=i.file;if(!(!(Cg!=null&&Cg.path)||!Ql(Cg.path))){if(Cg.file){G=URL.createObjectURL(Cg.file),h.value=G;return}try{const Ng=await fetch(Cg.path,{credentials:"include"});if(!Ng.ok)throw new Error(`Failed to fetch video: ${Ng.status}`);const Dg=await Ng.blob(),Lg=Dg.type?Dg:new Blob([Dg],{type:Bt(Cg.path)});if(((lg=i.file)==null?void 0:lg.path)!==Cg.path)return;G=URL.createObjectURL(Lg),h.value=G}catch(Ng){console.error("Failed to prepare video source",Ng),h.value=Cg.path}}},E=Cg=>new Promise((lg,Ng)=>{const Dg=new Image;Dg.onload=()=>{const Lg=document.createElement("canvas");Lg.width=Dg.width,Lg.height=Dg.height;const pI=Lg.getContext("2d");if(!pI)return Ng("No canvas context");pI.drawImage(Dg,0,0),Lg.toBlob(ne=>{if(!ne)return Ng("PNG conversion failed");lg(ne)},"image/png")},Dg.onerror=Ng,Dg.src=URL.createObjectURL(Cg)}),eg=async()=>{var lg;if(!((lg=i.file)!=null&&lg.path))return null;if(i.file.file)return new Blob([i.file.file],{type:Bt(i.file.path,i.file.file.type)});const Cg=await fetch(i.file.path,{credentials:"include"});if(!Cg.ok)throw new Error(`Failed to fetch media for clipboard: ${Cg.status}`);return await Cg.blob()},dg=async()=>{var Ng,Dg;if(!((Ng=i.file)!=null&&Ng.path)||Ql(i.file.path)||!Xd(i.file.path))return;const Cg=navigator;if(!((Dg=Cg.clipboard)!=null&&Dg.write)||typeof window.ClipboardItem>"u")return;let lg=await eg();if(lg){lg.type!=="image/png"&&(lg=await E(lg));try{await Cg.clipboard.write([new ClipboardItem({"image/png":lg})])}catch(Lg){console.error("Clipboard write failed",Lg)}}},Qg=Cg=>{var Dg,Lg;if(!((Cg.ctrlKey||Cg.metaKey)&&Cg.key&&Cg.key.toLowerCase()==="c")||vA(Cg.target))return;const Ng=(Dg=window.getSelection())==null?void 0:Dg.toString();Ng&&Ng.trim().length>0||!((Lg=i.file)!=null&&Lg.path)||i.isErrorFile||y.value||!Xd(i.file.path)&&!Ql(i.file.path)||(Cg.preventDefault(),Cg.stopPropagation(),dg().catch(pI=>{console.error("Failed to copy media to clipboard",pI)}))};return o.onMounted(()=>{n.value&&n.value.addEventListener("resize",Ig),TA(),t.addEventListener("change",TA),document.addEventListener("keydown",Qg)}),o.onUnmounted(()=>{Hn(),X(),jA(),n.value&&n.value.removeEventListener("resize",Ig),t.removeEventListener("change",TA),document.removeEventListener("keydown",Qg)}),(Cg,lg)=>(o.openBlock(),o.createBlock(L0,{position:"center",class:"slider-modal",ref:"modalRef",open:e.open,height:e.height,width:e.width,"animate-type":o.unref(vV).fade,onClose:Ag,onEndAnimation:Q,onUnmounted:lg[3]||(lg[3]=Ng=>Cg.$emit("unmounted")),onPointerup:yC,onPointerleave:we,onTouchend:pt},{default:o.withCtx(()=>{var Ng,Dg,Lg,pI,ne,xA,jC,AA,nA,Hl,Dl,Po,_o;return[o.createElementVNode("div",sOg,[o.createElementVNode("div",{ref_key:"sideBarRef",ref:n,class:o.normalizeClass(["slider-modal__side-bar",[{"slider-modal__side-bar_active":o.unref(an)((Ng=i.file)==null?void 0:Ng.path)||o.unref(an)((Dg=i.file)==null?void 0:Dg.file)}]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.sideBarItems,(j,P)=>{var ig;return o.openBlock(),o.createElementBlock("div",{ref_for:!0,ref_key:"miniItemsRef",ref:A,class:o.normalizeClass(["slider-modal__side-bar-item",{"slider-modal__side-bar-item_active":P===i.sideBarIndex}]),key:P},[o.createElementVNode("div",{class:"slider-modal__mini-prewiew-wrapper",onClick:Wg=>mg(P)},[o.createVNode(Ol,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__mini-preview",src:j,page:P+1,file:(ig=i.file)==null?void 0:ig.file},null,8,["src","page","file"])],8,aOg),o.createElementVNode("div",dOg,o.toDisplayString(P+1),1)],2)}),128))],2),i.isMobile?(o.openBlock(),o.createElementBlock("div",cOg,[o.createElementVNode("div",rOg,[o.createElementVNode("div",{class:"slider-modal__exit-button",onClick:lg[0]||(lg[0]=j=>Cg.$emit("close"))},[o.createVNode(Mg,{class:"slider-modal__exit-icon",name:o.unref(ug).leftBig,width:16,height:16},null,8,["name"]),lg[4]||(lg[4]=o.createElementVNode("div",{class:"slider-modal__exit-text"},"Назад",-1))])]),o.createElementVNode("div",mOg,[o.createElementVNode("div",uOg,o.toDisplayString(i.defaultIndex+1)+" из "+o.toDisplayString(I.items.length),1)]),lg[5]||(lg[5]=o.createElementVNode("div",{class:"slider-modal__mobile-header-block"},null,-1))])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"mainRef",ref:a,class:"slider-modal__main",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",hOg,o.toDisplayString((Lg=i.file)==null?void 0:Lg.name),1),o.unref(an)((pI=i.file)==null?void 0:pI.path)||o.unref(an)((ne=i.file)==null?void 0:ne.file)?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"itemRef",ref:l,class:"slider-modal__item",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"]),onWheel:og,onScroll:_t,onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC},[i.isMobile?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.sideBarItems,(j,P)=>{var ig;return o.openBlock(),o.createElementBlock("div",{key:P,class:"slider-modal__viewport"},[o.createVNode(Ol,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__pdf slider-modal__pdf_mobile",src:j,page:P+1,file:(ig=i.file)==null?void 0:ig.file},null,8,["src","page","file"])])}),128)):(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createVNode(Ol,{class:"slider-modal__pdf",ref_key:"pdfRef",ref:d,src:(xA=i==null?void 0:i.file)==null?void 0:xA.path,page:i.sideBarIndex+1,file:(jC=i.file)==null?void 0:jC.file},null,8,["src","page","file"])],544))],544)):o.unref(Xd)((AA=i.file)==null?void 0:AA.path)?(o.openBlock(),o.createElementBlock("div",{key:1,ref_key:"itemRef",ref:l,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC,onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",{ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("img",{ref_key:"imagePreviewRef",ref:u,class:o.normalizeClass(["slider-modal__image",{"slider-modal__image_error":i.isErrorFile,"slider-modal__image_positioned":i.isImagePositioned}]),src:(nA=i.file)==null?void 0:nA.path,onError:lg[1]||(lg[1]=j=>pg(j,!0)),onLoad:CI},null,42,bOg)],544)],544)):o.unref(Ql)((Hl=i.file)==null?void 0:Hl.path)&&!i.isErrorFile?(o.openBlock(),o.createElementBlock("div",{key:2,ref_key:"itemRef",ref:l,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:o.withModifiers(CC,["prevent"]),onTouchmove:o.withModifiers(YC,["prevent"]),onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[(o.openBlock(),o.createElementBlock("video",{controls:"",autoplay:"",name:"media",playsinline:"","webkit-playsinline":"",class:"slider-modal__video",key:(Dl=i.file)==null?void 0:Dl.path,"data-testid":`${I.dataTestid}-Video`,onError:lg[2]||(lg[2]=j=>pg(j,!0))},[o.createElementVNode("source",{src:h.value??((Po=i.file)==null?void 0:Po.path)??"",type:Bt(((_o=i.file)==null?void 0:_o.path)??"")},null,8,GOg)],40,ZOg))],544)):(o.openBlock(),o.createElementBlock("div",{key:3,class:"slider-modal__item",onClick:o.withModifiers(Ag,["self"]),onPointerdown:TI,onPointermove:Xe,onTouchstart:CC,onTouchmove:YC,onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("div",{ref_key:"viewportRef",ref:s,class:"slider-modal__viewport",onMousedown:o.withModifiers(FI,["self"]),onMouseup:o.withModifiers(ZI,["self"])},[o.createElementVNode("img",{class:"slider-modal__image slider-modal__image_error",src:o.unref(En)},null,8,wOg)],544)],32)),o.createElementVNode("div",WOg,[lg[6]||(lg[6]=o.createElementVNode("div",{class:"slider-modal__nav-block"},[o.createElementVNode("br")],-1)),o.createElementVNode("div",pOg,[I.items.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:p.value,onClick:Ge},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).leftBig,width:24,height:24},null,8,["name"])],8,BOg),o.createVNode(vxg,{ref_key:"sliderRef",ref:m,class:"slider-modal__bottom-slider","active-index":i.defaultIndex},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.items,(j,P)=>(o.openBlock(),o.createBlock(xxg,{class:o.normalizeClass(["slider-modal__slide",{"slider-modal__slide_active":P===i.defaultIndex}]),key:P,"is-active":P===i.defaultIndex,onClick:ig=>$(P)},{default:o.withCtx(()=>{var ig;return[o.unref(Xd)(j.path)?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider-modal__slide-image",src:j.path,alt:j.path,onError:pg},null,40,yOg)):o.unref(an)(j.path)||o.unref(an)((ig=i.file)==null?void 0:ig.file)?(o.openBlock(),o.createBlock(Ol,{key:1,class:"slider-modal__slide-image",src:j.path,page:1,file:j.file},null,8,["src","file"])):o.unref(Ql)(j.path)?(o.openBlock(),o.createBlock(T0,{key:2,class:"slider-modal__slide-image",src:j.path},null,8,["src"])):(o.openBlock(),o.createElementBlock("img",{key:3,class:"slider-modal__slide-image",src:o.unref(En)},null,8,YOg))]}),_:2},1032,["class","is-active","onClick"]))),128))]),_:1},8,["active-index"]),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:B.value,onClick:kI},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).rightBig,width:24,height:24},null,8,["name"])],8,VOg)],64)):o.createCommentVNode("",!0)]),o.createElementVNode("div",NOg,[o.createElementVNode("div",MOg,[o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_zoom",disabled:K.value,onClick:Rg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).zoomMinus,width:24,height:24},null,8,["name"])],8,fOg),o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_zoom",disabled:K.value,onClick:Gg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).zoomPlus,width:24,height:24},null,8,["name"])],8,ROg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:Y.value,onClick:Yg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).reset,width:24,height:24},null,8,["name"])],8,XOg)]),o.createElementVNode("div",HOg,[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:M.value,onClick:Vg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).uploadCloud,width:24,height:24},null,8,["name"])],8,DOg),o.createElementVNode("button",{class:"slider-modal__side-button slider-modal__side-button_printer",disabled:f.value,onClick:hg},[o.createVNode(Mg,{class:"slider-modal__icon",name:o.unref(ug).printer,width:24,height:24},null,8,["name"])],8,SOg)])])])],544)],512)]}),_:1},8,["open","height","width","animate-type"]))}}),[["__scopeId","data-v-840c01d8"]]),zOg=["data-testid"],JOg=["data-testid"],LOg=["data-testid"],TOg=["data-testid"],vOg=["data-testid"],j0=Tg(o.defineComponent({__name:"Loader",props:{title:{default:"Загрузка..."},dataTestid:{default:"Loader"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("div",{class:"loader","data-testid":g.dataTestid},[o.createElementVNode("div",{class:"loader__area","data-testid":`${g.dataTestid}-Area`},[o.createElementVNode("div",{class:"loader__circle loader__circle--light-blue","data-testid":`${g.dataTestid}-Loader-LightBlue1`},null,8,LOg),o.createElementVNode("div",{class:"loader__circle loader__circle--blue","data-testid":`${g.dataTestid}-Loader-LightBlue2`},null,8,TOg)],8,JOg),g.title?(o.openBlock(),o.createElementBlock("span",{key:0,class:"loader__span","data-testid":`${g.dataTestid}-Loader-Title`},o.toDisplayString(g.title),9,vOg)):o.createCommentVNode("",!0)],8,zOg))}}),[["__scopeId","data-v-4086dc15"]]),jOg=["data-testid"],xOg=["data-testid"],OOg=["disabled","data-testid"],QOg=["data-testid"],UOg=["data-testid"],EOg=["src","data-testid"],POg=["data-testid"],_Og=["data-testid"],$Og=["src"],qOg=["src","data-testid"],gQg=["data-testid"],IQg=["data-testid"],eQg=["disabled","data-testid"],IN=Tg(o.defineComponent({__name:"Slider",props:{items:{},defaultIndex:{},dataTestid:{default:"Slider"}},setup(e,{expose:g}){const I=e,C=o.reactive({files:I.items.length?I.items:[],file:null,currentIndex:I.defaultIndex||0,extension:null,filePath:null,isShowSliderModal:!1,indexModal:0,isLoad:!1,isError:!1}),t=o.computed(()=>{if(!C.files.length)return!1;let y=!w();return y=y||!p(),y}),i=()=>{C.isError=!1,C.isLoad=!1},A=()=>{C.isLoad=!0},n=()=>{C.isError=!0,C.filePath=En},l=y=>{if(!y)return;const Y=C.files.findIndex(f=>y.path===f.path);Y!==-1&&(C.indexModal=Y,C.isShowSliderModal=!0)},s=()=>{C.isShowSliderModal=!1},a=()=>{var y;return(y=I.items)!=null&&y.length?C.currentIndex===I.items.length-1:!0},d=y=>{if(!y)return null;const Y=y.split("?")[0],f=/\.\w+$/,M=Y.match(f);return C.extension=M?M[0].replace(".",""):null,C.extension},m=y=>{const Y=d(y);return Y?Object.values(G0).includes(Y.toLowerCase()):!1},u=y=>{const Y=d(y);return Y?Object.values(w0).includes(Y):!1},h=y=>d(y)==="pdf",Z=()=>{C.currentIndex--,C.file=C.files[C.currentIndex]},G=()=>{C.currentIndex++,C.file=C.files[C.currentIndex]},w=()=>C.files.length===0,p=()=>{var y,Y,f;return m(((y=C.file)==null?void 0:y.path)??null)==!1&&u(((Y=C.file)==null?void 0:Y.path)??null)==!1&&h(((f=C.file)==null?void 0:f.path)??null)==!1&&C.files.length>0&&!C.isError};return o.watch(()=>I.items,()=>{C.files=I.items,i()},{deep:!0}),o.watch(()=>C.file,()=>{var Y;C.filePath=((Y=C.file)==null?void 0:Y.path)??null,i();const y=p();C.isError=y},{immediate:!0}),o.watch(()=>I.items,()=>{C.files=I.items.length?I.items:[]}),o.onMounted(()=>{if(!I.items)return 0;C.files=I.items,I.defaultIndex&&(C.file=C.files[C.currentIndex]),C.file=C.files[C.currentIndex]}),g({setSlide:y=>{y>=0&&y<C.files.length&&(C.currentIndex=y,C.file=C.files[C.currentIndex])}}),(y,Y)=>{var f,M,K,F,X;return o.openBlock(),o.createElementBlock("div",{class:"slider-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",{class:"slider-yui-kit__wrapper",ref:"slider-yui-kitWrapperRef","data-testid":`${I.dataTestid}-Wrapper`},[o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--prev",onClick:Z,disabled:C.currentIndex===0,"data-testid":`${I.dataTestid}-Prev-Button`},[o.createVNode(Mg,{name:o.unref(ug).leftBig,"data-testid":`${I.dataTestid}-Prev-Icon`},null,8,["name","data-testid"])],8,OOg),o.createElementVNode("div",{class:"slider-yui-kit__slides","data-testid":`${I.dataTestid}-Slides-Container`},[w()?(o.openBlock(),o.createElementBlock("div",{key:0,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("img",{src:o.unref(En),alt:"",width:"111px",height:"111px","data-testid":`${I.dataTestid}-NoContent-Image`},null,8,EOg),o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Контент отсутствует ",8,POg)],8,UOg)):p()?(o.openBlock(),o.createElementBlock("div",{key:1,class:"placeholder-yui-kit","data-testid":`${I.dataTestid}-Invalid-Extension-Placeholder`},[o.createElementVNode("img",{src:o.unref(En),alt:"",width:"111px",height:"111px"},null,8,$Og),o.createElementVNode("p",null,"."+o.toDisplayString(C.extension),1)],8,_Og)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[m(((f=C.file)==null?void 0:f.path)??"")?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider__item",src:C.filePath??"","data-testid":`${I.dataTestid}-Image`,onClick:Y[0]||(Y[0]=z=>l(C.file)),onError:n,onLoad:A},null,40,qOg)):u(((M=C.file)==null?void 0:M.path)??"")?(o.openBlock(),o.createBlock(T0,{key:1,class:"slider__item slider__item_video",src:((K=C.file)==null?void 0:K.path)??"",onClick:Y[1]||(Y[1]=z=>l(C.file)),onLoad:A,onError:n},null,8,["src"])):h(((F=C.file)==null?void 0:F.path)??"")?(o.openBlock(),o.createBlock(Ol,{key:2,class:"slider-yui-kit__pdf-preview slider__item",src:(X=C.file)==null?void 0:X.path,onClick:Y[2]||(Y[2]=z=>l(C.file)),onLoad:A,onError:n},null,8,["src"])):(o.openBlock(),o.createElementBlock("div",{key:3,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Ошибка загрузки файла ",8,IQg)],8,gQg))],64)),!C.isLoad&&t.value&&!C.isError?(o.openBlock(),o.createBlock(j0,{key:3,class:"slider-yui-kit__loader"})):o.createCommentVNode("",!0)],8,QOg),o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--next",onClick:G,disabled:a(),"data-testid":`${I.dataTestid}-Next-Button`},[o.createVNode(Mg,{name:o.unref(ug).rightBig,"data-testid":`${I.dataTestid}-Next-Icon`},null,8,["name","data-testid"])],8,eQg)],8,xOg),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(sp,{open:C.isShowSliderModal,items:C.files,"default-index":C.indexModal,onClose:s},null,8,["open","items","default-index"])]))],8,jOg)}}}),[["__scopeId","data-v-36df582d"]]),CQg=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function tQg(e){return CQg.test(e)}function gk(){var e=URL.createObjectURL(new Blob),g=e.toString();return URL.revokeObjectURL(e),g.split(/[:\/]/g).pop().toLowerCase()}gk.valid=tQg;const iQg=(e="")=>e+gk();var x0=(e=>(e.small="small",e.medium="medium",e.big="big",e.large="large",e))(x0||{});const AQg=["disabled","data-testid"],nQg=["id","disabled","data-testid"],lQg=["for","data-testid"],oQg=o.defineComponent({__name:"Toggle",props:o.mergeModels({disabled:{type:Boolean,default:!1},backgroundColor:{},type:{default:x0.small},dataTestid:{default:"Toggle"}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["change"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=g,t=o.useModel(e,"modelValue"),i=iQg(),A=o.computed(()=>({"toggle-yui-kit":!0,"toggle-yui-kit_small":I.type===x0.small,"toggle-yui-kit_medium":I.type===x0.medium,"toggle-yui-kit_large":I.type===x0.large})),n=o.computed(()=>({backgroundColor:I.backgroundColor})),l=()=>C("change",!!t.value);return(s,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(A.value),disabled:I.disabled,style:o.normalizeStyle(n.value),"data-testid":`${I.dataTestid}-Toggle`},[o.withDirectives(o.createElementVNode("input",{class:"toggle-yui-kit-input",id:o.unref(i),type:"checkbox",disabled:e.disabled,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value=d),onChange:l,"data-testid":`${I.dataTestid}-Input`},null,40,nQg),[[o.vModelCheckbox,t.value]]),o.createElementVNode("label",{class:"toggle-yui-kit-label",for:o.unref(i),"data-testid":`${I.dataTestid}-Label`},null,8,lQg)],14,AQg))}}),ap=Tg(oQg,[["__scopeId","data-v-38cc7c65"]]);/*!
1451
1453
  * perfect-scrollbar v1.5.3
1452
1454
  * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors
1453
1455
  * Licensed under MIT
1454
1456
  */function gl(e){return getComputedStyle(e)}function ai(e,g){for(var I in g){var C=g[I];typeof C=="number"&&(C=C+"px"),e.style[I]=C}return e}function dp(e){var g=document.createElement("div");return g.className=e,g}var Ik=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Rs(e,g){if(!Ik)throw new Error("No element matching method supported");return Ik.call(e,g)}function cm(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function ek(e,g){return Array.prototype.filter.call(e.children,function(I){return Rs(I,g)})}var sC={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},Ck={x:null,y:null};function tk(e,g){var I=e.element.classList,C=sC.state.scrolling(g);I.contains(C)?clearTimeout(Ck[g]):I.add(C)}function ik(e,g){Ck[g]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(sC.state.scrolling(g))},e.settings.scrollingThreshold)}function sQg(e,g){tk(e,g),ik(e,g)}var O0=function(g){this.element=g,this.handlers={}},Ak={isEmpty:{configurable:!0}};O0.prototype.bind=function(g,I){typeof this.handlers[g]>"u"&&(this.handlers[g]=[]),this.handlers[g].push(I),this.element.addEventListener(g,I,!1)},O0.prototype.unbind=function(g,I){var C=this;this.handlers[g]=this.handlers[g].filter(function(t){return I&&t!==I?!0:(C.element.removeEventListener(g,t,!1),!1)})},O0.prototype.unbindAll=function(){for(var g in this.handlers)this.unbind(g)},Ak.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(g){return e.handlers[g].length===0})},Object.defineProperties(O0.prototype,Ak);var rm=function(){this.eventElements=[]};rm.prototype.eventElement=function(g){var I=this.eventElements.filter(function(C){return C.element===g})[0];return I||(I=new O0(g),this.eventElements.push(I)),I},rm.prototype.bind=function(g,I,C){this.eventElement(g).bind(I,C)},rm.prototype.unbind=function(g,I,C){var t=this.eventElement(g);t.unbind(I,C),t.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(t),1)},rm.prototype.unbindAll=function(){this.eventElements.forEach(function(g){return g.unbindAll()}),this.eventElements=[]},rm.prototype.once=function(g,I,C){var t=this.eventElement(g),i=function(A){t.unbind(I,i),C(A)};t.bind(I,i)};function cp(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var g=document.createEvent("CustomEvent");return g.initCustomEvent(e,!1,!1,void 0),g}function rp(e,g,I,C,t){C===void 0&&(C=!0),t===void 0&&(t=!1);var i;if(g==="top")i=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(g==="left")i=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");aQg(e,I,i,C,t)}function aQg(e,g,I,C,t){var i=I[0],A=I[1],n=I[2],l=I[3],s=I[4],a=I[5];C===void 0&&(C=!0),t===void 0&&(t=!1);var d=e.element;e.reach[l]=null,d[n]<1&&(e.reach[l]="start"),d[n]>e[i]-e[A]-1&&(e.reach[l]="end"),g&&(d.dispatchEvent(cp("ps-scroll-"+l)),g<0?d.dispatchEvent(cp("ps-scroll-"+s)):g>0&&d.dispatchEvent(cp("ps-scroll-"+a)),C&&sQg(e,l)),e.reach[l]&&(g||t)&&d.dispatchEvent(cp("ps-"+l+"-reach-"+e.reach[l]))}function Ke(e){return parseInt(e,10)||0}function dQg(e){return Rs(e,"input,[contenteditable]")||Rs(e,"select,[contenteditable]")||Rs(e,"textarea,[contenteditable]")||Rs(e,"button,[contenteditable]")}function cQg(e){var g=gl(e);return Ke(g.width)+Ke(g.paddingLeft)+Ke(g.paddingRight)+Ke(g.borderLeftWidth)+Ke(g.borderRightWidth)}var mm={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function Ul(e){var g=e.element,I=Math.floor(g.scrollTop),C=g.getBoundingClientRect();e.containerWidth=Math.round(C.width),e.containerHeight=Math.round(C.height),e.contentWidth=g.scrollWidth,e.contentHeight=g.scrollHeight,g.contains(e.scrollbarXRail)||(ek(g,sC.element.rail("x")).forEach(function(t){return cm(t)}),g.appendChild(e.scrollbarXRail)),g.contains(e.scrollbarYRail)||(ek(g,sC.element.rail("y")).forEach(function(t){return cm(t)}),g.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=nk(e,Ke(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=Ke((e.negativeScrollAdjustment+g.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=nk(e,Ke(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=Ke(I*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),rQg(g,e),e.scrollbarXActive?g.classList.add(sC.state.active("x")):(g.classList.remove(sC.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,g.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?g.classList.add(sC.state.active("y")):(g.classList.remove(sC.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,g.scrollTop=0)}function nk(e,g){return e.settings.minScrollbarLength&&(g=Math.max(g,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(g=Math.min(g,e.settings.maxScrollbarLength)),g}function rQg(e,g){var I={width:g.railXWidth},C=Math.floor(e.scrollTop);g.isRtl?I.left=g.negativeScrollAdjustment+e.scrollLeft+g.containerWidth-g.contentWidth:I.left=e.scrollLeft,g.isScrollbarXUsingBottom?I.bottom=g.scrollbarXBottom-C:I.top=g.scrollbarXTop+C,ai(g.scrollbarXRail,I);var t={top:C,height:g.railYHeight};g.isScrollbarYUsingRight?g.isRtl?t.right=g.contentWidth-(g.negativeScrollAdjustment+e.scrollLeft)-g.scrollbarYRight-g.scrollbarYOuterWidth-9:t.right=g.scrollbarYRight-e.scrollLeft:g.isRtl?t.left=g.negativeScrollAdjustment+e.scrollLeft+g.containerWidth*2-g.contentWidth-g.scrollbarYLeft-g.scrollbarYOuterWidth:t.left=g.scrollbarYLeft+e.scrollLeft,ai(g.scrollbarYRail,t),ai(g.scrollbarX,{left:g.scrollbarXLeft,width:g.scrollbarXWidth-g.railBorderXWidth}),ai(g.scrollbarY,{top:g.scrollbarYTop,height:g.scrollbarYHeight-g.railBorderYWidth})}function mQg(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(g){return g.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(g){var I=g.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,C=I>e.scrollbarYTop?1:-1;e.element.scrollTop+=C*e.containerHeight,Ul(e),g.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(g){return g.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(g){var I=g.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,C=I>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=C*e.containerWidth,Ul(e),g.stopPropagation()})}function uQg(e){lk(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),lk(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function lk(e,g){var I=g[0],C=g[1],t=g[2],i=g[3],A=g[4],n=g[5],l=g[6],s=g[7],a=g[8],d=e.element,m=null,u=null,h=null;function Z(p){p.touches&&p.touches[0]&&(p[t]=p.touches[0].pageY),d[l]=m+h*(p[t]-u),tk(e,s),Ul(e),p.stopPropagation(),p.type.startsWith("touch")&&p.changedTouches.length>1&&p.preventDefault()}function G(){ik(e,s),e[a].classList.remove(sC.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",Z)}function w(p,B){m=d[l],B&&p.touches&&(p[t]=p.touches[0].pageY),u=p[t],h=(e[C]-e[I])/(e[i]-e[n]),B?e.event.bind(e.ownerDocument,"touchmove",Z):(e.event.bind(e.ownerDocument,"mousemove",Z),e.event.once(e.ownerDocument,"mouseup",G),p.preventDefault()),e[a].classList.add(sC.state.clicking),p.stopPropagation()}e.event.bind(e[A],"mousedown",function(p){w(p)}),e.event.bind(e[A],"touchstart",function(p){w(p,!0)})}function hQg(e){var g=e.element,I=function(){return Rs(g,":hover")},C=function(){return Rs(e.scrollbarX,":focus")||Rs(e.scrollbarY,":focus")};function t(i,A){var n=Math.floor(g.scrollTop);if(i===0){if(!e.scrollbarYActive)return!1;if(n===0&&A>0||n>=e.contentHeight-e.containerHeight&&A<0)return!e.settings.wheelPropagation}var l=g.scrollLeft;if(A===0){if(!e.scrollbarXActive)return!1;if(l===0&&i<0||l>=e.contentWidth-e.containerWidth&&i>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&!(!I()&&!C())){var A=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(A){if(A.tagName==="IFRAME")A=A.contentDocument.activeElement;else for(;A.shadowRoot;)A=A.shadowRoot.activeElement;if(dQg(A))return}var n=0,l=0;switch(i.which){case 37:i.metaKey?n=-e.contentWidth:i.altKey?n=-e.containerWidth:n=-30;break;case 38:i.metaKey?l=e.contentHeight:i.altKey?l=e.containerHeight:l=30;break;case 39:i.metaKey?n=e.contentWidth:i.altKey?n=e.containerWidth:n=30;break;case 40:i.metaKey?l=-e.contentHeight:i.altKey?l=-e.containerHeight:l=-30;break;case 32:i.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&n!==0||e.settings.suppressScrollY&&l!==0||(g.scrollTop-=l,g.scrollLeft+=n,Ul(e),t(n,l)&&i.preventDefault())}})}function bQg(e){var g=e.element;function I(A,n){var l=Math.floor(g.scrollTop),s=g.scrollTop===0,a=l+g.offsetHeight===g.scrollHeight,d=g.scrollLeft===0,m=g.scrollLeft+g.offsetWidth===g.scrollWidth,u;return Math.abs(n)>Math.abs(A)?u=s||a:u=d||m,u?!e.settings.wheelPropagation:!0}function C(A){var n=A.deltaX,l=-1*A.deltaY;return(typeof n>"u"||typeof l>"u")&&(n=-1*A.wheelDeltaX/6,l=A.wheelDeltaY/6),A.deltaMode&&A.deltaMode===1&&(n*=10,l*=10),n!==n&&l!==l&&(n=0,l=A.wheelDelta),A.shiftKey?[-l,-n]:[n,l]}function t(A,n,l){if(!mm.isWebKit&&g.querySelector("select:focus"))return!0;if(!g.contains(A))return!1;for(var s=A;s&&s!==g;){if(s.classList.contains(sC.element.consuming))return!0;var a=gl(s);if(l&&a.overflowY.match(/(scroll|auto)/)){var d=s.scrollHeight-s.clientHeight;if(d>0&&(s.scrollTop>0&&l<0||s.scrollTop<d&&l>0))return!0}if(n&&a.overflowX.match(/(scroll|auto)/)){var m=s.scrollWidth-s.clientWidth;if(m>0&&(s.scrollLeft>0&&n<0||s.scrollLeft<m&&n>0))return!0}s=s.parentNode}return!1}function i(A){var n=C(A),l=n[0],s=n[1];if(!t(A.target,l,s)){var a=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(s?g.scrollTop-=s*e.settings.wheelSpeed:g.scrollTop+=l*e.settings.wheelSpeed,a=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?g.scrollLeft+=l*e.settings.wheelSpeed:g.scrollLeft-=s*e.settings.wheelSpeed,a=!0):(g.scrollTop-=s*e.settings.wheelSpeed,g.scrollLeft+=l*e.settings.wheelSpeed),Ul(e),a=a||I(l,s),a&&!A.ctrlKey&&(A.stopPropagation(),A.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(g,"wheel",i):typeof window.onmousewheel<"u"&&e.event.bind(g,"mousewheel",i)}function ZQg(e){if(!mm.supportsTouch&&!mm.supportsIePointer)return;var g=e.element;function I(h,Z){var G=Math.floor(g.scrollTop),w=g.scrollLeft,p=Math.abs(h),B=Math.abs(Z);if(B>p){if(Z<0&&G===e.contentHeight-e.containerHeight||Z>0&&G===0)return window.scrollY===0&&Z>0&&mm.isChrome}else if(p>B&&(h<0&&w===e.contentWidth-e.containerWidth||h>0&&w===0))return!0;return!0}function C(h,Z){g.scrollTop-=Z,g.scrollLeft-=h,Ul(e)}var t={},i=0,A={},n=null;function l(h){return h.targetTouches?h.targetTouches[0]:h}function s(h){return h.pointerType&&h.pointerType==="pen"&&h.buttons===0?!1:!!(h.targetTouches&&h.targetTouches.length===1||h.pointerType&&h.pointerType!=="mouse"&&h.pointerType!==h.MSPOINTER_TYPE_MOUSE)}function a(h){if(s(h)){var Z=l(h);t.pageX=Z.pageX,t.pageY=Z.pageY,i=new Date().getTime(),n!==null&&clearInterval(n)}}function d(h,Z,G){if(!g.contains(h))return!1;for(var w=h;w&&w!==g;){if(w.classList.contains(sC.element.consuming))return!0;var p=gl(w);if(G&&p.overflowY.match(/(scroll|auto)/)){var B=w.scrollHeight-w.clientHeight;if(B>0&&(w.scrollTop>0&&G<0||w.scrollTop<B&&G>0))return!0}if(Z&&p.overflowX.match(/(scroll|auto)/)){var y=w.scrollWidth-w.clientWidth;if(y>0&&(w.scrollLeft>0&&Z<0||w.scrollLeft<y&&Z>0))return!0}w=w.parentNode}return!1}function m(h){if(s(h)){var Z=l(h),G={pageX:Z.pageX,pageY:Z.pageY},w=G.pageX-t.pageX,p=G.pageY-t.pageY;if(d(h.target,w,p))return;C(w,p),t=G;var B=new Date().getTime(),y=B-i;y>0&&(A.x=w/y,A.y=p/y,i=B),I(w,p)&&h.preventDefault()}}function u(){e.settings.swipeEasing&&(clearInterval(n),n=setInterval(function(){if(e.isInitialized){clearInterval(n);return}if(!A.x&&!A.y){clearInterval(n);return}if(Math.abs(A.x)<.01&&Math.abs(A.y)<.01){clearInterval(n);return}if(!e.element){clearInterval(n);return}C(A.x*30,A.y*30),A.x*=.8,A.y*=.8},10))}mm.supportsTouch?(e.event.bind(g,"touchstart",a),e.event.bind(g,"touchmove",m),e.event.bind(g,"touchend",u)):mm.supportsIePointer&&(window.PointerEvent?(e.event.bind(g,"pointerdown",a),e.event.bind(g,"pointermove",m),e.event.bind(g,"pointerup",u)):window.MSPointerEvent&&(e.event.bind(g,"MSPointerDown",a),e.event.bind(g,"MSPointerMove",m),e.event.bind(g,"MSPointerUp",u)))}var GQg=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},wQg={"click-rail":mQg,"drag-thumb":uQg,keyboard:hQg,wheel:bQg,touch:ZQg},Q0=function(g,I){var C=this;if(I===void 0&&(I={}),typeof g=="string"&&(g=document.querySelector(g)),!g||!g.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=g,g.classList.add(sC.main),this.settings=GQg();for(var t in I)this.settings[t]=I[t];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var i=function(){return g.classList.add(sC.state.focus)},A=function(){return g.classList.remove(sC.state.focus)};this.isRtl=gl(g).direction==="rtl",this.isRtl===!0&&g.classList.add(sC.rtl),this.isNegativeScroll=function(){var s=g.scrollLeft,a=null;return g.scrollLeft=-1,a=g.scrollLeft<0,g.scrollLeft=s,a}(),this.negativeScrollAdjustment=this.isNegativeScroll?g.scrollWidth-g.clientWidth:0,this.event=new rm,this.ownerDocument=g.ownerDocument||document,this.scrollbarXRail=dp(sC.element.rail("x")),g.appendChild(this.scrollbarXRail),this.scrollbarX=dp(sC.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",i),this.event.bind(this.scrollbarX,"blur",A),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var n=gl(this.scrollbarXRail);this.scrollbarXBottom=parseInt(n.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Ke(n.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Ke(n.borderLeftWidth)+Ke(n.borderRightWidth),ai(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Ke(n.marginLeft)+Ke(n.marginRight),ai(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=dp(sC.element.rail("y")),g.appendChild(this.scrollbarYRail),this.scrollbarY=dp(sC.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",i),this.event.bind(this.scrollbarY,"blur",A),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var l=gl(this.scrollbarYRail);this.scrollbarYRight=parseInt(l.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Ke(l.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?cQg(this.scrollbarY):null,this.railBorderYWidth=Ke(l.borderTopWidth)+Ke(l.borderBottomWidth),ai(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Ke(l.marginTop)+Ke(l.marginBottom),ai(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:g.scrollLeft<=0?"start":g.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:g.scrollTop<=0?"start":g.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(s){return wQg[s](C)}),this.lastScrollTop=Math.floor(g.scrollTop),this.lastScrollLeft=g.scrollLeft,this.event.bind(this.element,"scroll",function(s){return C.onScroll(s)}),Ul(this)};Q0.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,ai(this.scrollbarXRail,{display:"block"}),ai(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Ke(gl(this.scrollbarXRail).marginLeft)+Ke(gl(this.scrollbarXRail).marginRight),this.railYMarginHeight=Ke(gl(this.scrollbarYRail).marginTop)+Ke(gl(this.scrollbarYRail).marginBottom),ai(this.scrollbarXRail,{display:"none"}),ai(this.scrollbarYRail,{display:"none"}),Ul(this),rp(this,"top",0,!1,!0),rp(this,"left",0,!1,!0),ai(this.scrollbarXRail,{display:""}),ai(this.scrollbarYRail,{display:""}))},Q0.prototype.onScroll=function(g){this.isAlive&&(Ul(this),rp(this,"top",this.element.scrollTop-this.lastScrollTop),rp(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},Q0.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),cm(this.scrollbarX),cm(this.scrollbarY),cm(this.scrollbarXRail),cm(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},Q0.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(g){return!g.match(/^ps([-_].+|)$/)}).join(" ")};const WQg=o.defineComponent({__name:"PerfectScrollbar",props:{tag:{default:"div"},options:{default:()=>({})}},emits:["scroll","ps-scroll-y","ps-scroll-x","ps-scroll-up","ps-scroll-down","ps-scroll-left","ps-scroll-right","ps-y-reach-start","ps-y-reach-end","ps-x-reach-start","ps-x-reach-end"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.ref(null),A=o.ref(null);o.watch(()=>C.options,()=>{l(),n()},{deep:!0}),o.onMounted(()=>{i.value&&n()}),o.onBeforeUnmount(()=>{l()});function n(){i.value&&(A.value=new Q0(i.value,C.options),d())}function l(){A.value&&(d(!1),A.value.destroy(),A.value=null)}const s={scroll:a("scroll"),"ps-scroll-y":a("ps-scroll-y"),"ps-scroll-x":a("ps-scroll-x"),"ps-scroll-up":a("ps-scroll-up"),"ps-scroll-down":a("ps-scroll-down"),"ps-scroll-left":a("ps-scroll-left"),"ps-scroll-right":a("ps-scroll-right"),"ps-y-reach-start":a("ps-y-reach-start"),"ps-y-reach-end":a("ps-y-reach-end"),"ps-x-reach-start":a("ps-x-reach-start"),"ps-x-reach-end":a("ps-x-reach-end")};function a(m){return function(u){t(m,u)}}function d(m=!0){var u;(u=A.value)!=null&&u.element&&Object.entries(s).forEach(([h,Z])=>{var G,w;m?(G=A.value)==null||G.element.addEventListener(h,Z):(w=A.value)==null||w.element.removeEventListener(h,Z)})}return g({ps:A}),(m,u)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(m.tag),{ref_key:"scrollbar",ref:i,class:"ps"},{default:o.withCtx(()=>[o.renderSlot(m.$slots,"default")]),_:3},512))}}),pQg=["data-testid"],eN=o.defineComponent({__name:"Scrollbar",props:{options:{},tag:{},class:{},style:{},thrumbStyle:{},railStyle:{},dataTestid:{default:"ScrollBar"}},emits:["scroll","ps-scroll-y","ps-scroll-x","ps-scroll-up","ps-scroll-down","ps-scroll-left","ps-scroll-right","ps-y-reach-start","ps-y-reach-end","ps-x-reach-start","ps-x-reach-end"],setup(e,{expose:g,emit:I}){const C=e,t=o.ref(null),i=I,A=d=>{i("scroll",d)},n={attributes:!0,attributeFilter:["style"]},l=(d,m)=>u=>{for(const h of u)h.type==="attributes"&&h.attributeName==="style"&&d.style.right!==m&&(d.style.right=m)},s=()=>{var w,p,B,y,Y,f,M,K,F,X,z,L,O,Ig,Ag,Q,$,mg,og,Gg,Rg,Yg,hg,Vg;if(!t.value)return;const d=t.value.querySelector(".ps__thumb-y"),m=t.value.querySelector(".ps__thumb-x"),u=t.value.querySelector(".ps__rail-y"),h=t.value.querySelector(".ps__rail-x");d.style.background=((p=(w=C.thrumbStyle)==null?void 0:w.y)==null?void 0:p.background)||"var(--primary-color)",d.style.width=((y=(B=C.thrumbStyle)==null?void 0:B.y)==null?void 0:y.width)||"6px",d.style.right="0px",m.style.background=((f=(Y=C.thrumbStyle)==null?void 0:Y.x)==null?void 0:f.background)||"var(--primary-color)",m.style.width=((K=(M=C.thrumbStyle)==null?void 0:M.x)==null?void 0:K.width)||"6px",m.style.right="0px",u.style.background=((X=(F=C.railStyle)==null?void 0:F.y)==null?void 0:X.background)||"var(--button-neutral-color)",u.style.width=((L=(z=C.thrumbStyle)==null?void 0:z.y)==null?void 0:L.width)||"6px",u.style.right=((Ig=(O=C.railStyle)==null?void 0:O.y)==null?void 0:Ig.right)||"0px",h.style.background=((Q=(Ag=C.railStyle)==null?void 0:Ag.x)==null?void 0:Q.background)||"var(--button-neutral-color)",h.style.width=((mg=($=C.thrumbStyle)==null?void 0:$.x)==null?void 0:mg.width)||"6px",h.style.right=((Gg=(og=C.railStyle)==null?void 0:og.x)==null?void 0:Gg.right)||"0px";const Z=new MutationObserver(l(u,((Yg=(Rg=C.railStyle)==null?void 0:Rg.y)==null?void 0:Yg.right)||"0px")),G=new MutationObserver(l(h,((Vg=(hg=C.railStyle)==null?void 0:hg.x)==null?void 0:Vg.right)||"0px"));Z.observe(u,n),G.observe(h,n)};return o.watch(()=>C,()=>{s()},{immediate:!0}),g({scrollToTop:()=>{t.value&&(t.value.children[0].scrollTop=0)}}),o.onMounted(()=>{s()}),(d,m)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbar",ref:t,"data-testid":C.dataTestid},[o.createVNode(o.unref(WQg),{onScroll:A,options:C.options,tag:C.tag,class:o.normalizeClass(C.class),style:o.normalizeStyle(C.style),"data-testid":`${C.dataTestid}-Scroll`,ref_key:"scrollbar",ref:t},{default:o.withCtx(()=>[o.renderSlot(d.$slots,"default")]),_:3},8,["options","tag","class","style","data-testid"])],8,pQg))}});var mp=(e=>(e.small="small",e.medium="medium",e.big="big",e))(mp||{}),up=(e=>(e.circled="circled",e.rounded="rounded",e))(up||{}),ok=(e=>(e.blue="blue",e.red="red",e))(ok||{});const BQg=["data-testid","checked","disabled"],yQg=o.defineComponent({__name:"Checkbox",props:{size:{default:mp.medium},circular:{default:up.rounded},color:{default:ok.blue},checked:{type:Boolean},modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestid:{default:"Checkbox"}},emits:["change","update:modelValue"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({isChecked:I.modelValue});o.watchEffect(()=>{t.isChecked=I.modelValue});const i=()=>{t.isChecked=!t.isChecked,C("change",t.isChecked),C("update:modelValue",t.isChecked)};return(A,n)=>(o.openBlock(),o.createElementBlock("input",{type:"checkbox",class:o.normalizeClass(`checkbox-yui-kit checkbox-yui-kit_${I.size} checkbox-yui-kit_${I.circular} checkbox-yui-kit_${I.color}`),"data-testid":`${I.dataTestid}`,tabindex:"0",onChange:i,checked:t.isChecked,disabled:I.disabled,onKeyup:o.withKeys(i,["enter"])},null,42,BQg))}}),CN=Tg(yQg,[["__scopeId","data-v-7ec339ee"]]),YQg=["data-testid"],VQg=["src","alt"],NQg={key:1,class:"avatar-yui-kit__fallback"},MQg=["src"],fQg={key:1,class:"avatar-yui-kit__text"},tN=new Set,iN=new Set,U0=Tg(o.defineComponent({__name:"Avatar",props:{initials:{},url:{},isIcon:{type:Boolean},alt:{},defaultImage:{},isOnline:{type:Boolean},dataTestid:{}},setup(e){const g=e,I=o.ref(null),C=o.ref(!1),t=o.ref(!1),i=o.computed(()=>g.initials?g.initials.charAt(0).toUpperCase():""),A=["var(--error-color)","var(--orange4)","var(--green2)","var(--blue24)","var(--blue22)","var(--blue4)","var(--violet2)","var(--pink-color)"],n=o.computed(()=>{if(!i.value)return A[0];const d=i.value.charCodeAt(0);return A[d%A.length]}),l=o.computed(()=>!g.url||!C.value||t.value),s=()=>{g.url&&(tN.add(g.url),iN.delete(g.url)),C.value=!0,t.value=!1},a=()=>{g.url&&(iN.add(g.url),tN.delete(g.url)),t.value=!0,C.value=!1};return o.watch(()=>g.url,async d=>{var m;if(C.value=!1,t.value=!1,!!d){if(tN.has(d)){C.value=!0;return}if(iN.has(d)){t.value=!0;return}await o.nextTick(),(m=I.value)!=null&&m.complete&&I.value.naturalWidth>0&&(C.value=!0)}},{immediate:!0}),(d,m)=>(o.openBlock(),o.createElementBlock("div",{"data-testid":g.dataTestid,class:o.normalizeClass(["avatar-yui-kit",{"is-online":g.isOnline}]),style:o.normalizeStyle({backgroundColor:n.value})},[g.url?(o.openBlock(),o.createElementBlock("img",{key:0,ref_key:"imageRef",ref:I,src:g.url,alt:g.alt,class:o.normalizeClass(["avatar-yui-kit__image",{"is-visible":C.value}]),onLoad:s,onError:a},null,42,VQg)):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createElementBlock("div",NQg,[g.defaultImage?(o.openBlock(),o.createElementBlock("img",{key:0,src:g.defaultImage,class:"avatar-yui-kit__image is-visible"},null,8,MQg)):(o.openBlock(),o.createElementBlock("div",fQg,o.toDisplayString(i.value),1))])):o.createCommentVNode("",!0)],14,YQg))}}),[["__scopeId","data-v-f0864d68"]]),RQg=["data-testid","aria-label"],XQg=["data-testid"],Hd=Tg(o.defineComponent({name:"Tooltip",__name:"Tooltip",props:{hint:{},isShow:{type:Boolean,default:!1},isCanShow:{type:Boolean,default:!0},position:{default:"bottom-center"},size:{default:"small"},type:{default:"black"},hintGap:{},hintClass:{default:""},dataTestid:{default:"Tooltip"}},setup(e){const g=e,I=CSS.supports("top","anchor(bottom)"),C=o.useId(),t=o.computed(()=>`--anchor-tooltip-${C}`),i=o.ref(null),A=o.ref(null),n=o.computed(()=>[{"tooltip-yui-kit__hint_show":g.isShow||s.isShow,"tooltip-yui-kit__hint_bottom-center":g.position==="bottom-center","tooltip-yui-kit__hint_bottom-left":g.position==="bottom-left","tooltip-yui-kit__hint_bottom-right":g.position==="bottom-right","tooltip-yui-kit__hint_top-center":g.position==="top-center","tooltip-yui-kit__hint_top-left":g.position==="top-left","tooltip-yui-kit__hint_top-right":g.position==="top-right","tooltip-yui-kit__hint_left-top":g.position==="left-top","tooltip-yui-kit__hint_left-center":g.position==="left-center","tooltip-yui-kit__hint_left-bottom":g.position==="left-bottom","tooltip-yui-kit__hint_right-top":g.position==="right-top","tooltip-yui-kit__hint_right-center":g.position==="right-center","tooltip-yui-kit__hint_right-bottom":g.position==="right-bottom","tooltip-yui-kit__hint_small":g.size==="small","tooltip-yui-kit__hint_medium":g.size==="medium","tooltip-yui-kit__hint_large":g.size==="large","tooltip-yui-kit__hint_black":g.type==="black","tooltip-yui-kit__hint_blue":g.type==="blue","tooltip-yui-kit__hint_white":g.type==="white",[g.hintClass]:!0}]),l=o.computed(()=>{var f;const Y=(f=i.value)==null?void 0:f.closest("dialog");return Y||"body"}),s=o.reactive({isShow:!1}),a=()=>{G()},d=()=>{w()},m=()=>{u()},u=()=>{requestAnimationFrame(()=>{if(!i.value||!A.value||!s.isShow&&!g.isShow)return;const Y={"--hint-top":"anchor(top)","--hint-left":"anchor(left)","--hint-measured-width":"0","--hint-height":"0","--tooltip-width":"0","--tooltip-height":"0","--hint-visibility":"visible"};I||(Y["--hint-top"]="0",Y["--hint-left"]="0");const f=i.value.getBoundingClientRect(),M=A.value.getBoundingClientRect();let K=f.top,F=f.left;const X=i.value.closest("dialog");if(X){const Ag=X.getBoundingClientRect();K=f.top-Ag.top,F=f.left-Ag.left;const Q=X.scrollTop,$=X.scrollLeft;K+=Q,F+=$}const z=f.width,L=f.height,O=M.width,Ig=M.height;I||(Y["--hint-top"]=`${K}px`,Y["--hint-left"]=`${F}px`),Y["--tooltip-width"]=`${z}px`,Y["--tooltip-height"]=`${L}px`,Y["--hint-measured-width"]=`${O}px`,Y["--hint-height"]=`${Ig}px`,A.value&&KI(Y,A.value)})},h=()=>{requestAnimationFrame(()=>{!A.value||g.hintGap===void 0||KI({"--tooltip-hint-gap":g.hintGap},A.value)})},Z=()=>{A.value&&(KI({"position-anchor":`${t.value}`},A.value),u())};o.watch(()=>g.hintGap,h,{immediate:!0}),o.watch(()=>g.isCanShow,()=>{o.nextTick(()=>{Z()})});const G=()=>{s.isShow=!0},w=()=>{s.isShow=!1},p=new MutationObserver(()=>{u()}),B=new ResizeObserver(()=>{var Y;(s.isShow||g.isShow)&&!((Y=i.value)!=null&&Y.matches(":hover"))?w():u()}),y=Y=>{p.observe(Y,{childList:!0,attributes:!0,characterData:!0}),B.observe(Y)};return o.onMounted(()=>{i.value&&KI({"anchor-name":`${t.value}`},i.value),Z(),A.value&&y(A.value),i.value&&y(i.value),I||(window.addEventListener("scroll",u,!0),window.addEventListener("resize",u))}),o.onUnmounted(()=>{B.disconnect(),p.disconnect(),window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}),(Y,f)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"tooltipRef",ref:i,class:"tooltip-yui-kit","data-testid":g.dataTestid,"aria-label":e.hint,onMouseenter:a,onMouseleave:d},[o.renderSlot(Y.$slots,"default",{},void 0,!0),e.isCanShow?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:l.value},[o.createVNode(o.Transition,{name:"hint-animate",onEnter:m},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"hintRef",ref:A,class:o.normalizeClass(["tooltip-yui-kit__hint",n.value]),"data-testid":g.dataTestid},o.toDisplayString(e.hint),11,XQg),[[o.vShow,e.isShow||s.isShow]])]),_:1})],8,["to"])):o.createCommentVNode("",!0)],40,RQg))}}),[["__scopeId","data-v-4cf4d114"]]),HQg=["data-testid"],DQg=["data-testid"],SQg=["data-testid"],KQg=["onClick","data-testid"],kQg=o.defineComponent({__name:"Popover",props:{isShow:{type:Boolean},iconName:{default:ug.moreVertical},options:{default:()=>[]},tooltip:{default:""},tooltipPosition:{default:"top-left"},isWCUse:{type:Boolean},translateY:{default:"0"},dataTestid:{default:"Popover"}},emits:["close"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({isShow:!1}),i=o.computed(()=>{var K;const M=(K=s.value)==null?void 0:K.closest("dialog");return M||"body"}),A=CSS.supports("top","anchor(bottom)"),n=o.useId(),l=o.computed(()=>`--anchor-popover-${n}`),s=o.ref(null),a=o.ref(null),d=o.ref(null),m=o.computed(()=>({"popover-yui-kit__wrapper":!0,"active-yui-kit":t.isShow,"empty-yui-kit":I.options.length===0})),u=()=>t.isShow=!t.isShow,h=()=>{t.isShow=!1,C("close")},Z=M=>{M.function(),h()},G=()=>{requestAnimationFrame(()=>{if(!s.value||!a.value||!t.isShow)return;const M={},K=s.value.getBoundingClientRect(),F=window.pageYOffset||document.documentElement.scrollTop,X=window.pageXOffset||document.documentElement.scrollLeft;let z=K.bottom+F,L=K.left+X;const O=s.value.closest("dialog");if(O){const Ag=O.getBoundingClientRect();z=K.top-Ag.top,L=K.left-Ag.left;const Q=O.scrollTop,$=O.scrollLeft;z+=Q,L+=$,z+=10}z+=10,M["--popover-top"]=`${z}px`,A||(M["--popover-left"]=`${L}px`),KI(M,a.value),(()=>{if(!a.value)return;const Ag=a.value.getBoundingClientRect();Ag.right>window.innerWidth&&(A?M["--popover-right"]="anchor(right) ":M["--popover-right"]=`${K.right-Ag.width}px`)})(),M["--popover-right"]&&(M.left="auto",KI(M,a.value))})},w=M=>{const K=M.getBoundingClientRect(),F=document.elementFromPoint(K.left,K.top),X=document.elementFromPoint(K.right,K.bottom);!(F&&M.contains(F))&&!(X&&M.contains(X))&&h()},p=new IntersectionObserver(M=>{M.forEach(K=>{K.isIntersecting||h()})}),B=()=>{s.value&&a.value&&(window.addEventListener("scroll",G,!0),window.addEventListener("resize",G))},y=()=>{s.value&&a.value&&(window.removeEventListener("scroll",G,!0),window.removeEventListener("resize",G))},Y=()=>{s.value&&window.addEventListener("scroll",w.bind(null,s.value),!0)},f=()=>{s.value&&window.removeEventListener("scroll",w.bind(null,s.value),!0)};return o.watch(()=>I.isShow,()=>t.isShow=I.isShow),o.watch(()=>t.isShow,()=>{t.isShow?(G(),Y()):f(),!A&&(t.isShow?B():y())}),o.onMounted(()=>{s.value&&KI({"anchor-name":`${l.value}`},s.value),a.value&&KI({"position-anchor":`${l.value}`},a.value),d.value&&p.observe(d.value),A||G()}),o.onUnmounted(()=>{p.disconnect(),f(),A||y()}),(M,K)=>(o.openBlock(),o.createBlock(Hd,{hint:I.tooltip,size:"small",type:"black",position:I.tooltipPosition,"data-testid":I.dataTestid,"is-can-show":!!I.tooltip&&!t.isShow&&I.options.length>0},{default:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"popover-yui-kit",ref_key:"popover",ref:d,"data-testid":`${I.dataTestid}-Popover`},[o.createElementVNode("div",{ref_key:"reference",ref:s,class:o.normalizeClass(m.value),"data-testid":`${I.dataTestid}-PopoverShow`,onClick:u},[o.renderSlot(M.$slots,"trigger",{},()=>[o.createVNode(Mg,{class:"popover-yui-kit__icon",name:I.iconName,"data-testid":`${I.dataTestid}-PopoverShow-Icon`},null,8,["name","data-testid"])],!0)],10,DQg),(o.openBlock(),o.createBlock(o.Teleport,{to:i.value,disabled:I.isWCUse},[o.createVNode(o.Transition,{name:"popover-animate"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:"popover-yui-kit__content",style:o.normalizeStyle({transform:`translateY(${I.translateY})`}),ref_key:"floating",ref:a},[o.renderSlot(M.$slots,"default",{},()=>{var F;return[(F=I.options)!=null&&F.length?(o.openBlock(),o.createElementBlock("div",{key:0,class:"popover-yui-kit__options","data-testid":`${I.dataTestid}-PopoverShow-Options`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.options,(X,z)=>(o.openBlock(),o.createElementBlock("div",{class:"popover-yui-kit__options__item",key:z,style:o.normalizeStyle(X.style),onClick:o.withModifiers(L=>Z(X),["stop"]),"data-testid":`${I.dataTestid}-Item${z}`},[X.iconName?(o.openBlock(),o.createBlock(Mg,{key:0,name:X.iconName,"data-testid":`${I.dataTestid}-Item${z}-Icon`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(X.value),1)],12,KQg))),128))],8,SQg)):o.createCommentVNode("",!0)]},!0)],4),[[o.vShow,t.isShow]])]),_:3})],8,["to","disabled"]))],8,HQg)),[[o.unref(Cd),h,void 0,{bubble:!0}]])]),_:3},8,["hint","position","data-testid","is-can-show"]))}}),Dd=Tg(kQg,[["__scopeId","data-v-4a781cc2"]]),FQg=["data-testid"],zQg={class:"list-yui-kit__item-text"},JQg=Tg(o.defineComponent({__name:"MenuItem",props:{active:{type:Boolean},disabled:{type:Boolean},dataTestid:{},iconName:{},text:{},menuType:{}},emits:["click"],setup(e,{emit:g}){const I=g,C=()=>{e.disabled||I("click",e.menuType)};return(t,i)=>(o.openBlock(),o.createElementBlock("li",{class:o.normalizeClass(["list-yui-kit__item",{"list-yui-kit__item--disabled":e.disabled,"list-yui-kit__item--active":e.active}]),onClick:C,"data-testid":e.dataTestid},[o.createVNode(Mg,{name:e.iconName},null,8,["name"]),o.createElementVNode("span",zQg,o.toDisplayString(e.text),1),o.renderSlot(t.$slots,"default",{},void 0,!0)],10,FQg))}}),[["__scopeId","data-v-6b345661"]]);var oe=(e=>(e.profile="profile",e.theme="theme",e.options="options",e.exit="exit",e.qrAuth="qr-auth",e.downloadChat="download-chat",e.help="help",e))(oe||{});const LQg={class:"menu-yui-kit__list"},TQg={class:"list-yui-kit"},vQg=Tg(o.defineComponent({__name:"UserMenuList",props:{closeAfterClick:{type:Boolean},menuOpen:{type:Boolean},categories:{},texts:{},user:{},languages:{},isBlackTheme:{type:Boolean},dataTestid:{default:"UserMenuList"}},emits:["click","unmount-qr-auth","themeChange","languageSwitch"],setup(e,{emit:g}){const I=e,C=g,t=o.ref(null);o.watch(()=>I.menuOpen,m=>{m||(t.value=null)});const i=m=>{if(t.value=m,m===oe.qrAuth){C("unmount-qr-auth");return}C("click",m)},A=m=>{C("languageSwitch",m)},n=()=>!1,l=m=>({[oe.profile]:"Profile",[oe.qrAuth]:"Auth with QR",[oe.downloadChat]:"Auth with QR",[oe.theme]:"Theme",[oe.options]:"Settings",[oe.exit]:"Log Out",[oe.help]:"Help"})[m]??"",s=m=>({[oe.profile]:ug.profile,[oe.qrAuth]:ug.qrCode,[oe.downloadChat]:ug.download,[oe.theme]:ug.darkThemeSwitcher,[oe.options]:ug.settings,[oe.exit]:ug.logout,[oe.help]:ug.help})[m]??ug.profile,a=m=>({[oe.profile]:"Profile",[oe.qrAuth]:"QR",[oe.downloadChat]:"Chat",[oe.theme]:"Theme",[oe.options]:"Settings",[oe.exit]:"Exit",[oe.help]:"Help"})[m]??m,d=m=>m===oe.theme;return(m,u)=>{var h,Z,G;return o.openBlock(),o.createElementBlock("div",LQg,[o.createElementVNode("ul",TQg,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.categories,w=>{var p;return o.openBlock(),o.createBlock(JQg,{key:w,"data-testid":`${I.dataTestid}-${a(w)}-Item`,iconName:s(w),text:((p=I.texts)==null?void 0:p[w])??l(w),menuType:w,disabled:d(w),active:t.value===w,onClick:()=>i(w)},{default:o.withCtx(()=>[w===o.unref(oe).theme?(o.openBlock(),o.createBlock(ap,{key:0,disabled:"",onChange:n})):o.createCommentVNode("",!0)]),_:2},1032,["data-testid","iconName","text","menuType","disabled","active","onClick"])}),128))]),(h=I.languages)!=null&&h.items?(o.openBlock(),o.createBlock(bw,{key:0,items:(Z=I.languages)==null?void 0:Z.items,"default-value":(G=I.languages)==null?void 0:G.defaultValue,onChange:A,"data-testid":`${I.dataTestid}-Language-Switch`},null,8,["items","default-value","data-testid"])):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-a4fe74e9"]]),jQg=["data-testid"],xQg={class:"menu-yui-kit__wrapper"},OQg={class:"menu-yui-kit__names"},QQg={class:"menu-yui-kit__name"},UQg={class:"menu-yui-kit__role"},AN=Tg(o.defineComponent({__name:"UserMenu",props:{closeAfterClick:{type:Boolean},menuOpen:{type:Boolean},categories:{},texts:{},user:{},languages:{},isBlackTheme:{type:Boolean},dataTestid:{default:"UserMenu"}},emits:["click","unmount-qr-auth","themeChange","languageSwitch"],setup(e,{emit:g}){const I=e,C=o.reactive({isShow:!1,isBlackTheme:I.isBlackTheme??!1}),t=g,i=o.computed(()=>({"menu-yui-kit__heading":!0,"active-yui-kit":C.isShow}));function A(m){t("click",m),I.closeAfterClick&&(C.isShow=!1)}const n=o.computed(()=>C.isShow?ug.chevronUp:ug.chevronDown),l=()=>{C.isShow=!C.isShow};function s(m){I.closeAfterClick&&(C.isShow=!1),t("themeChange",m),C.isBlackTheme=m}const a=m=>{I.closeAfterClick&&(C.isShow=!1),t("languageSwitch",m)},d=()=>{I.closeAfterClick&&(C.isShow=!1),t("unmount-qr-auth")};return(m,u)=>(o.openBlock(),o.createElementBlock("div",{class:"menu-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",xQg,[o.createVNode(Dd,{open:C.isShow,onClose:u[0]||(u[0]=h=>C.isShow=!1),placement:"bottom-start","data-testid":`${I.dataTestid}-Popover`},{trigger:o.withCtx(()=>{var h,Z,G;return[o.createElementVNode("div",{class:o.normalizeClass(i.value),onClick:l},[o.createVNode(U0,{class:"menu-yui-kit__avatar",url:(h=I.user)==null?void 0:h.avatar,alt:"user-avatar","data-testid":`${I.dataTestid}-Avatar`},null,8,["url","data-testid"]),o.createElementVNode("div",OQg,[o.createElementVNode("p",QQg,o.toDisplayString((Z=I.user)==null?void 0:Z.name),1),o.createElementVNode("p",UQg,o.toDisplayString((G=I.user)==null?void 0:G.role),1)]),o.createVNode(JI,{type:o.unref(NI).ghost,class:"menu-yui-kit__button","data-testid":`${I.dataTestid}-Toggle`},{default:o.withCtx(()=>[o.createVNode(Mg,{class:"menu-yui-kit__button-icon",name:n.value},null,8,["name"])]),_:1},8,["type","data-testid"])],2)]}),default:o.withCtx(()=>[o.createVNode(vQg,{"data-testid":`${I.dataTestid}-List`,"is-black-theme":C.isBlackTheme,"menu-open":C.isShow,languages:I.languages,categories:I.categories,texts:I.texts,onClick:A,onThemeChange:s,onLanguageSwitch:a,onUnmountQrAuth:d},null,8,["data-testid","is-black-theme","menu-open","languages","categories","texts"])]),_:1},8,["open","data-testid"])])],8,jQg))}}),[["__scopeId","data-v-976c86fb"]]);var hp=(e=>(e.default="default",e.minor="minor",e))(hp||{});const EQg=["data-testid"],PQg=["data-testid"],_Qg=["data-testid"],$Qg=["data-testid","placeholder","required","maxlength","readonly"],qQg=o.defineComponent({__name:"Textarea",props:{placeholder:{},inputMessage:{},required:{type:Boolean,default:!1},maxlength:{},modelValue:{default:""},readonly:{type:Boolean,default:!1},type:{default:hp.default},modelModifiers:{default:()=>({})},dataTestid:{default:"Textarea"}},emits:["update:modelValue"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({isPressed:!1,inputElement:I.modelValue}),i=o.computed(()=>[{pressed:t.isPressed,readonly:I.readonly,[I.type]:!0}]),A=()=>{C("update:modelValue",t.inputElement)},n=()=>{I.readonly||(t.isPressed=!0)},l=()=>{t.isPressed=!1};return o.watch(()=>I.modelValue,s=>{t.inputElement=s}),(s,a)=>(o.openBlock(),o.createElementBlock("fieldset",{class:o.normalizeClass(["input-yui-kit",i.value]),onFocusout:l,"data-testid":I.dataTestid},[I.inputMessage?(o.openBlock(),o.createElementBlock("legend",{key:0,class:"input-yui-kit__legend","data-testid":`${I.dataTestid}-Legend`},[o.createTextVNode(o.toDisplayString(I.inputMessage)+" ",1),I.required?(o.openBlock(),o.createElementBlock("sup",{key:0,class:"input-yui-kit__star","data-testid":`${I.dataTestid}-Legend-Star`},"*",8,_Qg)):o.createCommentVNode("",!0)],8,PQg)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("textarea",{"onUpdate:modelValue":a[0]||(a[0]=d=>t.inputElement=d),onFocus:n,onInput:A,"data-testid":`${I.dataTestid}-Textarea`,class:"input-yui-kit__input",placeholder:I.placeholder,required:I.required,maxlength:I.maxlength,readonly:I.readonly},null,40,$Qg),[[o.vModelText,t.inputElement]])],42,EQg))}}),nN=Tg(qQg,[["__scopeId","data-v-ac7acfbd"]]);var lN=(e=>(e.img="img",e.pdf="pdf",e.docx="docx",e))(lN||{});const gUg=["data-testid"],IUg=["data-testid"],eUg=["src","alt","data-testid"],CUg=["src","data-testid"],tUg=["data-testid"],iUg=["data-testid"],AUg=["data-testid"],oN=Tg(o.defineComponent({__name:"Picture",props:{type:{},alt:{},url:{},caption:{},dataTestid:{default:"Picture"}},setup(e){const g=e,I=o.reactive({isLoad:!1,isError:!1}),C=o.computed(()=>I.isError?!1:!g.url||!g.type||g.type==lN.img?!0:nm(g.url)),t=()=>{I.isLoad=!0},i=()=>{I.isError=!0},A=()=>{I.isLoad=!1,I.isError=!1};return o.watch(()=>g.url,()=>{A()}),(n,l)=>(o.openBlock(),o.createElementBlock("figure",{class:"picture-yui-kit","data-testid":g.dataTestid},[g.type==o.unref(lN).img?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("picture",{class:"picture-yui-kit__picture","data-testid":`${g.dataTestid}-Picture`},[!I.isError&&g.url?(o.openBlock(),o.createElementBlock("img",{key:0,class:"picture-yui-kit__picture_image",src:g.url,alt:g.alt,"data-testid":`${g.dataTestid}-Picture-Img`,onLoad:t,onError:i},null,40,eUg)):(o.openBlock(),o.createElementBlock("img",{key:1,src:o.unref(En),alt:"not found",class:"picture-yui-kit__picture_image","data-testid":`${g.dataTestid}-Picture-Img`},null,8,CUg))],8,IUg),o.createElementVNode("figcaption",{class:"picture-yui-kit__picture__caption","data-testid":`${g.dataTestid}-Caption`},o.toDisplayString(g.caption),9,tUg)],64)):o.unref(nm)(g.url)?(o.openBlock(),o.createBlock(Ol,{key:1,class:"picture-yui-kit__picture_image",src:g.url,page:1,dataTestid:`${g.dataTestid}-PdfPreview`,onLoad:t},null,8,["src","dataTestid"])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"picture-yui-kit__caption","data-testid":`${g.dataTestid}-Caption-Box`},[o.createElementVNode("h4",{class:"picture-yui-kit__caption__title","data-testid":`${g.dataTestid}-Caption-Title`},o.toDisplayString(g.caption),9,AUg)],8,iUg)),!I.isLoad&&C.value?(o.openBlock(),o.createBlock(j0,{key:3,class:"picture-yui-kit__loader"})):o.createCommentVNode("",!0)],8,gUg))}}),[["__scopeId","data-v-a93165dc"]]);var bp=(e=>(e.success="success",e.warning="warning",e.error="error",e.info="info",e))(bp||{}),sk=(e=>(e.success="Успешно",e.warning="Предупреждение",e.error="Ошибка",e.info="Уведомление",e))(sk||{}),ak=(e=>(e[e.success=ug.checkbox]="success",e[e.warning=ug.alertTriangle]="warning",e[e.error=ug.exitCircle]="error",e[e.info=ug.info]="info",e))(ak||{});const nUg=["id","data-testid"],lUg=["data-testid"],oUg=["data-testid"],sUg=["data-testid"],aUg=["data-testid"],dUg=o.defineComponent({__name:"Notification",props:{type:{default:bp.info},title:{},pushKey:{},description:{default:""},timeout:{default:3},showPopover:{type:Boolean,default:!0},dataTestid:{default:"Notification"}},emits:["close"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.ref(null);ag(i,"toggle",()=>{C.timeout>0&&setTimeout(()=>{var s;return(s=i.value)==null?void 0:s.hidePopover()},C.timeout*1e3)});const A=()=>(t("close"),"hide"),n=()=>{var s;(s=i.value)==null||s.showPopover()},l=o.reactive({message:{icon:ak[C.type],title:C.title||sk[C.type],description:C.description}});return o.onMounted(()=>{var s;C.showPopover&&((s=i.value)==null||s.showPopover())}),g({showPopover:n}),(s,a)=>(o.openBlock(),o.createElementBlock("div",{popover:"manual",id:C.pushKey.toString(),class:o.normalizeClass(`push-notification-yui-kit push-notification-yui-kit_${C.type}`),"data-testid":C.dataTestid,ref_key:"popover",ref:i},[o.createElementVNode("div",{class:"notification-yui-kit","data-testid":`${C.dataTestid}-Notification`},[o.createElementVNode("div",{class:"notification-yui-kit__block","data-testid":`${C.dataTestid}-Notification-Block`},[o.createVNode(Mg,{name:l.message.icon,class:"notification-yui-kit__block-icon","data-testid":`${C.dataTestid}-Notification-Icon`},null,8,["name","data-testid"]),o.createElementVNode("h4",{class:"notification-yui-kit__block-title","data-testid":`${C.dataTestid}-Notification-Title`},o.toDisplayString(l.message.title),9,sUg),o.createElementVNode("span",{class:"notification-yui-kit__block-text","data-testid":`${C.dataTestid}-Notification-Description`},o.toDisplayString(l.message.description),9,aUg)],8,oUg),o.createVNode(JI,{class:"notification-yui-kit__exit",type:o.unref(NI).ghost,popovertarget:C.pushKey.toString(),popovertargetaction:A,"data-testid":`${C.dataTestid}-Notification-Button`},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).crossSmall,"data-testid":`${C.dataTestid}-Notification-Icon`},null,8,["name","data-testid"])]),_:1},8,["type","popovertarget","data-testid"])],8,lUg)],10,nUg))}}),sN=Tg(dUg,[["__scopeId","data-v-934d2cab"]]),aN=o.defineComponent({__name:"CopyIcon",props:{content:{default:""},dataTestid:{default:"CopyIcon"}},setup(e){const g=e,I=()=>{const C=g.content,t=document.createElement("textarea");t.value=C;const i=document.querySelectorAll("dialog[open]"),A=i.length?i[i.length-1]:null;A?A.append(t):document.body.append(t),t.select(),t.setSelectionRange(0,99999),document.execCommand("copy"),t.remove()};return(C,t)=>(o.openBlock(),o.createBlock(Mg,{class:"copy-icon-yui-kit",name:o.unref(ug).copy,"data-testid":g.dataTestid,onClick:I},null,8,["name","data-testid"]))}}),cUg=["data-testid"],rUg=["data-testid"],mUg=["data-testid"],uUg=["data-testid"],hUg=["data-testid"],bUg=["data-testid"],ZUg=["data-testid"],GUg=["data-testid"],wUg=["data-testid"],WUg=["data-testid"],pUg=["data-testid"],BUg=["data-testid"],yUg=["data-testid"],YUg=["data-testid"],VUg=o.defineComponent({__name:"FilterTag",props:{title:{},iconName:{default:ug.filter},options:{default:()=>[]},selectedValues:{default:()=>[]},multiply:{type:Boolean,default:!0},maxShowCount:{default:5},showClearButton:{type:Boolean,default:!1},disallowNull:{type:Boolean,default:!1},dataTestid:{default:"FilterTag"}},emits:["change"],setup(e,{emit:g}){const I=e,C=o.reactive({isShow:!1,options:[]}),t=g,i=o.computed(()=>({"filter-yui-kit__wrapper":!0,"active-yui-kit":C.isShow})),A=()=>C.isShow=!C.isShow,n=()=>{C.isShow=!1},l=o.computed(()=>C.options.filter(u=>u.chose)),s=o.computed(()=>C.options.filter(u=>!u.chose)),a=u=>{I.disallowNull&&u.chose||(u.chose=!u.chose,I.multiply||(C.options=C.options.map(h=>({...h,chose:u.value===h.value&&u.chose}))),C.options.every(h=>h.chose)&&(C.options=C.options.map(h=>({...h,chose:!1}))),t("change",l.value.map(h=>h.value)),C.isShow=!1)},d=()=>{C.options=C.options.map(u=>({...u,chose:!1})),C.isShow=!1,t("change",[])},m=()=>{C.options=I.options.map(u=>({...u,chose:I.selectedValues.includes(u.value)})),C.options.every(u=>u.chose)&&(C.options=C.options.map(u=>({...u,chose:!1})))};return o.watch(()=>[I.options,I.selectedValues],m),o.watch(()=>I.selectedValues,m),o.onMounted(m),(u,h)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"filter-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",{class:o.normalizeClass(i.value),onClick:A,"data-testid":`${I.dataTestid}-Wrapper`},[I.iconName?(o.openBlock(),o.createBlock(Mg,{key:0,name:I.iconName,"data-testid":`${I.dataTestid}-Icon`},null,8,["name","data-testid"])):o.createCommentVNode("",!0),I.title?(o.openBlock(),o.createElementBlock("span",{key:1,"data-testid":`${I.dataTestid}-Title`},o.toDisplayString(I.title),9,mUg)):o.createCommentVNode("",!0),!l.value.length&&!I.disallowNull?(o.openBlock(),o.createBlock(ot,{key:2,disabled:"",text:"Все","data-testid":`${I.dataTestid}-Badges-All`},null,8,["data-testid"])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:3},o.renderList(l.value.filter((Z,G)=>G<I.maxShowCount),(Z,G)=>(o.openBlock(),o.createBlock(ot,{key:Z.value,type:Z.type,disabled:"","data-testid":`${I.dataTestid}-Badges${G}`,text:Z.label},null,8,["type","data-testid","text"]))),128)),I.maxShowCount<l.value.length?(o.openBlock(),o.createElementBlock("div",{key:4,class:"filter-yui-kit__counter","data-testid":`${I.dataTestid}-MaxShowCount-Counter`},[o.createTextVNode(" +"+o.toDisplayString(l.value.length-I.maxShowCount)+" ",1),o.createElementVNode("div",{class:"filter-yui-kit__counter-content","data-testid":`${I.dataTestid}-MaxShowCount-Content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value.filter((Z,G)=>G>=I.maxShowCount),(Z,G)=>(o.openBlock(),o.createBlock(ot,{key:Z.value,type:Z.type,disabled:"",text:Z.label,"data-testid":`${I.dataTestid}-MaxShow-Badges${G}`},null,8,["type","text","data-testid"]))),128))],8,hUg)],8,uUg)):o.createCommentVNode("",!0),I.showClearButton&&l.value.length>0?(o.openBlock(),o.createElementBlock("button",{key:5,type:"button",class:"filter-yui-kit__close",onClick:o.withModifiers(d,["stop"]),"data-testid":`${I.dataTestid}-Filter-CloseButton`},[o.createVNode(Mg,{name:o.unref(ug).crossSmall,"data-testid":`${I.dataTestid}-CloseButton-Icon`},null,8,["name","data-testid"])],8,bUg)):o.createCommentVNode("",!0)],10,rUg),C.isShow?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filter-yui-kit__select-wrapper","data-testid":`${I.dataTestid}-Select-Wrapper`},[o.createElementVNode("ul",{class:"filter-yui-kit__select-list selected-yui-kit","data-testid":`${I.dataTestid}-Select-List`},[l.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:"filter-yui-kit__select-item","data-testid":`${I.dataTestid}-Select-Item`},[o.createVNode(ot,{disabled:"",text:"Все","data-testid":`${I.dataTestid}-Select-Badges`},null,8,["data-testid"])],8,wUg)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(Z,G)=>(o.openBlock(),o.createElementBlock("li",{class:"filter-yui-kit__select-item",key:Z.value,"data-testid":`${I.dataTestid}-Select-Item${G}`},[o.createVNode(ot,{disabled:!0,choosed:!I.disallowNull&&Z.chose,type:Z.type,onClick:w=>a(Z),text:Z.label,"data-testid":`${I.dataTestid}-Select-Badges${G}`},null,8,["choosed","type","onClick","text","data-testid"])],8,WUg))),128))],8,GUg),o.createElementVNode("div",{class:"filter-yui-kit__select__divider","data-testid":`${I.dataTestid}-Select-Divider`},null,8,pUg),C.isShow?(o.openBlock(),o.createElementBlock("ul",{key:0,class:"filter-yui-kit__select-list","data-testid":`${I.dataTestid}-Select-List`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,(Z,G)=>(o.openBlock(),o.createElementBlock("li",{class:"filter-yui-kit__select-item",key:Z.value,"data-testid":`${I.dataTestid}-Select-List${G}`},[o.createVNode(ot,{disabled:!0,choosed:!1,type:Z.type,text:Z.label,"data-testid":`${I.dataTestid}-Select-Badges${G}`,onClick:w=>a(Z)},null,8,["type","text","data-testid","onClick"])],8,yUg))),128)),e.disallowNull?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:"filter-yui-kit__select-item","data-testid":`${I.dataTestid}-Select-Item`},[l.value.length?(o.openBlock(),o.createBlock(ot,{key:0,disabled:"","data-testid":`${I.dataTestid}-Select-Badges`,text:"Все",onClick:d},null,8,["data-testid"])):o.createCommentVNode("",!0)],8,YUg))],8,BUg)):o.createCommentVNode("",!0)],8,ZUg)):o.createCommentVNode("",!0)],8,cUg)),[[o.unref(Cd),n,void 0,{bubble:!0}]])}}),dN=Tg(VUg,[["__scopeId","data-v-c0eed368"]]),NUg=["data-testid"],MUg=["data-testid"],fUg=["data-testid"],RUg=["data-testid"],cN=Tg(o.defineComponent({__name:"CircularProgress",props:{percent:{},dataTestid:{default:"CircularProgress"}},setup(e){const g=e,I=()=>{const C=Math.min(Math.max(g.percent,0),100),t=C/100*360;if(C<=25)return`polygon(50% 50%, 50% 0%, calc(50% + 50% * cos(${t-90}deg)) 0,calc(50% + 50% * cos(${t-90}deg)) calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`;if(C<=50)return`polygon(50% 50%, 50% 0%, 100% 0%, 100% calc(50% + 50% * sin(${t-90}deg)), calc(50% + 50% * cos(${t-90}deg)) calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`;if(C<=75)return`polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%,
1455
- calc(50% + 50% * cos(${t-90}deg)) 100%, calc(50% + 50% * cos(${t-90}deg)) calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`;if(C<=100)return`polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%,0% 100%, 0% calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`};return(C,t)=>g.percent<100?(o.openBlock(),o.createElementBlock("div",{key:0,class:"pie-chart","data-testid":`${g.dataTestid}-PieChart`},[o.createElementVNode("div",{class:"pie-chart-border",style:o.normalizeStyle({"border-color":g.percent<50?"var(--error-light-color)":"var(--orange-color)"}),"data-testid":`${g.dataTestid}-PieChart-Border`},[o.createElementVNode("div",{class:"sector",style:o.normalizeStyle({clipPath:I(),"background-color":g.percent<50?"var(--error-light-color)":"var(--orange-color)"}),"data-testid":`${g.dataTestid}-PieChart-Sector`},null,12,fUg)],12,MUg)],8,NUg)):(o.openBlock(),o.createElementBlock("svg",{key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","data-testid":`${g.dataTestid}-Icon`,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||(t[0]=[o.createElementVNode("path",{d:"M8 1C4.136 1 1 4.136 1 8C1 11.864 4.136 15 8 15C11.864 15 15 11.864 15 8C15 4.136 11.864 1 8 1ZM8 13.6C4.906 13.6 2.4 11.094 2.4 8C2.4 4.906 4.906 2.4 8 2.4C11.094 2.4 13.6 4.906 13.6 8C13.6 11.094 11.094 13.6 8 13.6Z",fill:"#3BC648"},null,-1),o.createElementVNode("circle",{cx:"8",cy:"8",r:"4",transform:"rotate(-180 8 8)",fill:"#3BC648"},null,-1),o.createElementVNode("path",{d:"M10 6L7.5 9.83935L6 8.5",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],8,RUg))}}),[["__scopeId","data-v-393c7314"]]),XUg=["colspan","rowspan","data-testid"],um=Tg(o.defineComponent({name:"TableTh",__name:"TableTh",props:{colspan:{default:1},rowspan:{default:1},dataTestid:{default:"DataHeader"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("th",{colspan:e.colspan,rowspan:e.rowspan,"data-testid":g.dataTestid,class:"table-th"},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,XUg))}}),[["__scopeId","data-v-0411515d"]]),HUg=["data-testid"],E0=Tg(o.defineComponent({name:"HeadTableRow",__name:"HeadTableRow",props:{dataTestid:{default:"TableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("tr",{class:"head-table-row","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,HUg))}}),[["__scopeId","data-v-1c6483fb"]]),dk=(e,g,I,C)=>{const t=o.ref(!1),i=o.ref(100);let A=0,n=0;const l=o.computed(()=>[{"scroll-wrapper__track_hide":i.value===100,"scroll-wrapper__track_drag":t.value}]),s=o.computed(()=>i.value<100),a=()=>{if(e.value){const w=e.value.clientWidth,p=e.value.scrollWidth;return w>=p?100:w/p*100}return 100},d=()=>{if(!e.value||!g.value||!I.value||!C.value)return;const{scrollLeft:w,scrollWidth:p,clientWidth:B}=e.value,y=p-B;if(y<=0)return;const Y=w/y,f=C.value.clientWidth,M=I.value.clientWidth,K=f-M,F=Y*K;requestAnimationFrame(()=>{g.value&&KI({"--scroll-bar-left-position":`${F}px`},g.value)})},m=w=>{!e.value||!g.value||(t.value=!0,A=w.clientX,n=e.value.scrollLeft,document.addEventListener("pointermove",u),document.addEventListener("pointerup",h,!0))},u=w=>{if(t.value&&e.value&&I.value){const p=w.clientX-A,B=(e.value.scrollWidth-e.value.clientWidth)/(e.value.clientWidth-I.value.clientWidth);e.value.scrollLeft=n+p*B,d()}},h=()=>{t.value=!1,document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",h,!0)};return{onDrag:u,onTrackClick:w=>{if(e.value&&I.value){const p=w.currentTarget.getBoundingClientRect(),B=w.clientX-p.left,y=I.value.clientWidth,Y=p.width;let f=(B-y/2)*((e.value.scrollWidth-e.value.clientWidth)/(Y-y));f=Math.max(0,Math.min(f,e.value.scrollWidth-e.value.clientWidth)),e.value.scrollLeft=f,d()}},startDrag:m,getPercentHorizontalView:a,changeBarPosition:d,isDragging:t,scrollHorizontalWidthPercent:i,setHorizontalBarWidth:()=>{if(!e.value||!g.value)return;const w=a();i.value=w,KI({"--scroll-horizontal-bar-width":`${w}%`},g.value)},horizontalTrackClass:l,isExistHorizontalTrack:s}},ck=(e,g,I,C)=>{const t=o.ref(!1),i=o.ref(100);let A=0,n=0;const l=o.computed(()=>[{"scroll-wrapper__track_hide":i.value===100,"scroll-wrapper__track_drag":t.value}]),s=o.computed(()=>i.value<100),a=()=>{if(e.value){const w=e.value.clientHeight,p=e.value.scrollHeight;if(w>=p)return 100;if(w<p)return w/p*100}return 100},d=()=>{if(!e.value||!g.value||!I.value||!C.value)return;const{scrollTop:w,scrollHeight:p,clientHeight:B}=e.value,y=p-B;if(y<=0)return;const Y=w/y,f=C.value.clientHeight,M=I.value.clientHeight,K=f-M,F=Y*K;requestAnimationFrame(()=>{g.value&&KI({"--scroll-bar-top-postion":`${F}px`},g.value)})},m=w=>{!e.value||!g.value||(t.value=!0,A=w.clientY,n=e.value.scrollTop,document.addEventListener("pointermove",u),document.addEventListener("pointerup",h))},u=w=>{if(t.value&&e.value&&I.value){const p=w.clientY-A,B=(e.value.scrollHeight-e.value.clientHeight)/(e.value.clientHeight-I.value.clientHeight);e.value.scrollTop=n+p*B,d()}},h=()=>{t.value=!1,document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",h)};return{onDrag:u,onTrackClick:w=>{if(e.value&&I.value){const p=w.currentTarget.getBoundingClientRect(),B=w.clientY-p.top,y=I.value.clientHeight,Y=p.height;let f=(B-y/2)*((e.value.scrollHeight-e.value.clientHeight)/(Y-y));f=Math.max(0,Math.min(f,e.value.scrollHeight-e.value.clientHeight)),e.value.scrollTop=f,d()}},startDrag:m,getProcentVerticalView:a,changeBarPosition:d,isDragging:t,scrollVerticalHeightProcent:i,setVerticalBarHeight:()=>{if(!e.value||!g.value)return;const w=a();i.value=w,KI({"--scroll-vertical-bar-height":`${w}%`},g.value)},verticalTrackClass:l,isExistVerticalTrack:s}},DUg={class:"scroll-wrapper__vertical-wrapper"},SUg={class:"scroll-wrapper__horizont-wrapper"},P0=Tg(o.defineComponent({name:"ScrollWrapper",__name:"ScrollWrapper",props:{isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate","on-mounted"],setup(e,{expose:g,emit:I}){const C=I,t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),{onTrackClick:a,startDrag:d,changeBarPosition:m,setVerticalBarHeight:u,verticalTrackClass:h,isExistVerticalTrack:Z}=ck(t,i,n,A),{changeBarPosition:G,startDrag:w,onTrackClick:p,setHorizontalBarWidth:B,horizontalTrackClass:y,isExistHorizontalTrack:Y}=dk(t,i,s,l),f=Q=>{m(),G(),C("unmount-scroll",Q)},M=()=>{requestAnimationFrame(()=>{K(),F()})},K=()=>{if(!t.value||!i.value)return;const Q=getComputedStyle(i.value),$=i.value.style.minHeight||Q.minHeight,mg=i.value.style.maxHeight||Q.maxHeight,og=i.value.style.height;KI({"--scroll-wrapper-height":`${og}`,"--scroll-wrapper-max-height":`${mg}`,"--scroll-wrapper-min-height":`${$}`},i.value)},F=()=>{u(),B(),m(),G()},X=()=>{t.value&&t.value.addEventListener("scroll",f)},z=()=>{t.value&&(t.value.scrollTop=0)},L=()=>{t.value&&(t.value.scrollHeight<=t.value.clientHeight?C("unmount-paginate",!0):C("unmount-paginate",!1))},O=new MutationObserver(()=>{M(),L()}),Ig=new ResizeObserver(()=>{M(),L()}),Ag=Q=>{O.observe(Q,{childList:!0,subtree:!0,attributes:!0}),Ig.observe(Q)};return g({scrollToTop:z,setHeightSlot:K,slotRef:t}),o.onMounted(()=>{M(),X(),i.value&&Ag(i.value),A.value&&Ag(A.value),window.addEventListener("resize",M),C("on-mounted")}),o.onUnmounted(()=>{window.removeEventListener("resize",M)}),(Q,$)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollWrapperRef",ref:i,class:"scroll-wrapper"},[o.createElementVNode("div",DUg,[o.createElementVNode("div",SUg,[o.createElementVNode("div",{ref_key:"slotRef",ref:t,class:"scroll-wrapper__slot"},[o.renderSlot(Q.$slots,"default",{},void 0,!0)],512),o.unref(Y)||e.isShowHorizontalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"horizontTrackRef",ref:l,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_horizont",o.unref(y)]),onClick:$[1]||($[1]=o.withModifiers((...mg)=>o.unref(p)&&o.unref(p)(...mg),["self","prevent","left"]))},[o.createElementVNode("div",{ref_key:"horizontBarRef",ref:s,class:"scroll-wrapper__bar",onPointerdown:$[0]||($[0]=o.withModifiers((...mg)=>o.unref(w)&&o.unref(w)(...mg),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)]),o.unref(Z)||e.isShowVerticalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"verticalTrackRef",ref:A,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_vertical",o.unref(h)]),onClick:$[3]||($[3]=o.withModifiers((...mg)=>o.unref(a)&&o.unref(a)(...mg),["self","prevent","left"]))},[o.createElementVNode("div",{ref_key:"verticalBarRef",ref:n,class:"scroll-wrapper__bar",onPointerdown:$[2]||($[2]=o.withModifiers((...mg)=>o.unref(d)&&o.unref(d)(...mg),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)])],512))}}),[["__scopeId","data-v-854984d6"]]),KUg=["id","data-testid"],kUg=["id","data-testid"],FUg=["id","data-testid"],rN=Tg(o.defineComponent({name:"TableNew",__name:"Table",props:{tableId:{},search:{},tbodyId:{},theadId:{},columnCount:{},dataTestid:{default:"Table"},isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate"],setup(e,{expose:g,emit:I}){var B;const C=e,t=I,i=o.reactive({headHeight:0,maxColumnCount:0}),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),a=o.ref(null),d=y=>{t("unmount-scroll",y)},m=y=>t("unmount-paginate",y),u=()=>{if(!A.value||!a.value)return;const y=A.value.querySelector("thead");if(!y)return;const Y=y.getBoundingClientRect().height;i.headHeight=Y,KI({"--scroll-track-margin-top":`${Y}px`},a.value.$el)},h=()=>{a.value&&a.value.scrollToTop()},Z=()=>{if(a.value&&s.value){const y=getComputedStyle(a.value.$el),Y=Number(y.minHeight.replace(/\D/g,""));if(Y&&Y>0)return;KI({"min-height":`${i.headHeight+108}px`},a.value.$el)}},G=()=>{let y=1;if(n.value){for(let Y=0;Y<n.value.children.length;Y++)y=Math.max(n.value.children[Y].children.length,y);i.maxColumnCount=y}},w=new MutationObserver(()=>{G()}),p=new ResizeObserver(()=>{u()});return g({scrollToTop:h,setHeightSlot:(B=a.value)==null?void 0:B.setHeightSlot,scrollWrapperRef:a,tbodyRef:l,tableRef:A,theadRef:n}),o.onMounted(()=>{u(),G(),window.addEventListener("resize",u),A.value&&p.observe(A.value),n.value&&w.observe(n.value,{childList:!0,subtree:!0}),Z()}),(y,Y)=>(o.openBlock(),o.createBlock(P0,{ref_key:"scrollWrapperRef",ref:a,class:"table",onUnmountScroll:d,onUnmountPaginate:m,"is-show-vertical-scroll":C.isShowVerticalScroll,"is-show-horizontal-scroll":C.isShowHorizontalScroll,"data-testid":`${C.dataTestid}-ScrollWrapper`},{default:o.withCtx(()=>[o.createElementVNode("table",{ref_key:"tableRef",ref:A,id:C.tableId,class:"table__table","data-testid":`${C.dataTestid}`},[o.renderSlot(y.$slots,"default",{},()=>{var f;return[o.createElementVNode("colgroup",null,[o.renderSlot(y.$slots,"colspan",{},void 0,!0)]),y.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:n,id:C.theadId,class:"table__head","data-testid":`${C.dataTestid}-Thead`},[o.renderSlot(y.$slots,"head",{},void 0,!0),y.$slots.search?(o.openBlock(),o.createBlock(E0,{key:0,class:"table__search-tr",id:(f=C.search)==null?void 0:f.rowId,ref_key:"searchRowRef",ref:s,"data-testid":`${C.dataTestid}-Search-Row`},{default:o.withCtx(()=>{var M;return[o.createVNode(um,{colspan:C.columnCount||i.maxColumnCount,class:"table__search-th",id:(M=C.search)==null?void 0:M.headId,"data-testid":`${C.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(y.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","id","data-testid"])]}),_:3},8,["id","data-testid"])):o.createCommentVNode("",!0)],8,kUg)):o.createCommentVNode("",!0),o.renderSlot(y.$slots,"body-group",{},()=>[y.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,id:C.tbodyId,ref_key:"tbodyRef",ref:l,class:"table__body","data-testid":`${C.dataTestid}-Tbody`},[o.renderSlot(y.$slots,"body",{},void 0,!0)],8,FUg)):o.createCommentVNode("",!0)],!0)]},!0)],8,KUg)]),_:3},8,["is-show-vertical-scroll","is-show-horizontal-scroll","data-testid"]))}}),[["__scopeId","data-v-26ee537e"]]),zUg=["rowspan","colspan","data-testid"],_0=o.defineComponent({name:"TableTd",__name:"TableTd",props:{colspan:{default:1},rowspan:{default:1},dataTestid:{default:"DataCell"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("td",{rowspan:e.rowspan,colspan:e.colspan,class:"table-td","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default")],8,zUg))}}),JUg={class:"skeleton"},Zp=Tg(o.defineComponent({name:"Skeleton",__name:"Skeleton",setup(e){return(g,I)=>(o.openBlock(),o.createElementBlock("div",JUg))}}),[["__scopeId","data-v-6eb37767"]]),LUg=["data-testid"],Gp=Tg(o.defineComponent({name:"TableRow",__name:"TableRow",props:{type:{default:"default"},isObserved:{type:Boolean,default:!1},observer:{},scrolledElement:{},dataTestid:{},colspan:{default:1},rowspan:{default:1}},setup(e){const g=e,I=o.reactive({isShow:!g.isObserved,observer:null}),C=o.ref(null),t=o.computed(()=>[{"table-row_active":g.type==="selected","table-row_is-stub":g.isObserved}]),i=()=>{const n=new IntersectionObserver(l=>{l.forEach(s=>{s.isIntersecting&&(I.isShow=!0,n.unobserve(s.target))})},{root:g.scrolledElement,rootMargin:"600px"});return n},A=()=>{g.isObserved&&C.value&&(I.observer=i(),I.observer.observe(C.value))};return o.watch(()=>g.scrolledElement,()=>{var n;(n=I.observer)==null||n.disconnect(),A()}),o.onMounted(()=>{A()}),o.onUnmounted(()=>{var n;(n=I.observer)==null||n.disconnect()}),(n,l)=>(o.openBlock(),o.createElementBlock("tr",{ref_key:"row",ref:C,class:o.normalizeClass(["table-row",t.value]),"data-testid":g.dataTestid},[I.isShow?o.renderSlot(n.$slots,"default",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.$slots.skeleton?o.renderSlot(n.$slots,"skeleton",{key:0},void 0,!0):(o.openBlock(),o.createBlock(_0,{key:1,class:"table-row__td table-row__td_stub",colspan:g.colspan,rowspan:g.rowspan},{default:o.withCtx(()=>[o.createVNode(Zp,{class:"table-row__skeleton"})]),_:1},8,["colspan","rowspan"]))],64))],10,LUg))}}),[["__scopeId","data-v-703d9e37"]]),mN=Tg(o.defineComponent({name:"SectionTableRow",__name:"SectionTableRow",props:{colspan:{},dataTestid:{default:"SectionTableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createBlock(Gp,{class:"section-table-row","data-testid":g.dataTestid},{default:o.withCtx(()=>[o.createVNode(_0,{colspan:e.colspan,class:"section-table-row__td","data-testid":`${g.dataTestid}-DataCell`},{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"]))}}),[["__scopeId","data-v-35b23188"]]),TUg=["disabled","name","value","data-testid"],uN=Tg(o.defineComponent({name:"Radio",__name:"Radio",props:o.mergeModels({name:{},value:{},disabled:{type:Boolean,default:!1},dataTestid:{default:"Radio"}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const g=e,I=o.useModel(e,"modelValue");return(C,t)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>I.value=i),type:"radio",disabled:e.disabled,name:e.name,value:e.value,class:"radio","data-testid":g.dataTestid},null,8,TUg)),[[o.vModelRadio,I.value]])}}),[["__scopeId","data-v-3db64c64"]]),vUg=["data-testid"],jUg=["data-testid"],rk=Tg(o.defineComponent({name:"ChoosenMiniOptions",__name:"ChoosenMiniOptions",props:{options:{},dataTestid:{default:"ChoosenMiniOptions"}},emits:["remove"],setup(e,{emit:g}){const I=e,C=g,t=i=>{C("remove",i)};return(i,A)=>(o.openBlock(),o.createElementBlock("div",{class:"choosen-mini-options","data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.options,(n,l)=>(o.openBlock(),o.createElementBlock("div",{key:n.key,class:"choosen-mini-options__option","data-testid":`${I.dataTestid}-Option-Item${l}`},[o.createVNode(ot,{"data-testid":`${I.dataTestid}-Badge${l}`,type:o.unref(zI).blue,text:o.unref(nY)(n)?n.hint:n.value,class:"choosen-mini-options__badges",disabled:""},null,8,["data-testid","type","text"]),o.createVNode(Mg,{"data-testid":`${I.dataTestid}-Icon${l}`,name:o.unref(ug).crossLarge,width:10,height:10,class:"choosen-mini-options__cross",onClick:s=>t(n.key)},null,8,["data-testid","name","onClick"])],8,jUg))),128))],8,vUg))}}),[["__scopeId","data-v-03762d05"]]),xUg=["data-testid"],OUg=["data-testid"],QUg=["data-testid"],UUg=["data-testid"],EUg=["data-testid"],PUg=["data-testid"],hN=Tg(o.defineComponent({name:"BaseFilter",__name:"BaseFilter",props:o.mergeModels({options:{},title:{},isSearch:{type:Boolean,default:!1},isPosibleToClear:{type:Boolean,default:!1},isShowMiniOptions:{type:Boolean,default:!1},isUseAnchor:{type:Boolean,default:!0},isOpened:{type:Boolean,default:!1},tooltipPosition:{default:"top-center"},disabled:{type:Boolean,default:!1},onUnmountPagination:{},defaultOption:{default:"Выберите значение"},class:{},dataTestid:{default:"BaseFilter"}},{modelValue:{},modelModifiers:{}}),emits:o.mergeModels(["change","disabled-click","unmount-open","unmount-search","unmount-search-enter","unmount-pagination"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=o.reactive({isHovered:!1}),t=g,i=o.ref(null),A=o.ref(null),n=o.useModel(e,"modelValue"),l=o.ref(I.isOpened),s=o.computed(()=>[{filter_disabled:I.disabled},I.class]);o.watch(l,()=>{t("unmount-open",l.value),a.value=""}),o.watch(()=>I.isOpened,()=>{if(I.disabled){l.value=!1;return}l.value=I.isOpened}),o.watch(()=>I.onUnmountPagination,()=>{z()});const a=o.ref(""),d=o.computed(()=>{let L=[];return a.value?(Jh(I.options)?L=I.options.filter(O=>{var Ig;return O.value.toLowerCase().includes(a.value.toLowerCase())||((Ig=O==null?void 0:O.hint)==null?void 0:Ig.toLowerCase().includes(a.value.toLowerCase()))}):L=I.options.filter(O=>O.value.toLowerCase().includes(a.value.toLowerCase())),L):(Jh(I.options),L=I.options,L)}),m=o.computed(()=>{var O;return((O=I.options.find(Ig=>Un.isArray(n.value)?n.value.includes(Ig.key):Ig.key===String(n.value)))==null?void 0:O.value)||I.defaultOption}),u=o.computed(()=>I.options.filter(L=>Un.isArray(n.value)?n.value.includes(L.key)&&L.value!==m.value:L.key===String(n.value))),h=o.computed(()=>I.options.filter(L=>Un.isArray(n.value)?n.value.includes(L.key)&&L.value===m.value:L.key===String(n.value))),Z=o.computed(()=>{var Ig,Ag,Q;const L=I.options;let O;return Un.isArray(n.value)?Jh(L)?O=(Ig=L.find($=>$.value===m.value))==null?void 0:Ig.hint:O=(Ag=L.find($=>$.value===m.value))==null?void 0:Ag.value:O=(Q=L.find($=>$.key===String(n.value)))==null?void 0:Q.value,O||""}),G=()=>{C.isHovered=!0},w=()=>{C.isHovered=!1},p=o.computed(()=>{var L;return Jh(I.options)?C.isHovered&&!!Z.value:((L=i.value)==null?void 0:L.isSpanOverflow)||!1}),B=o.computed(()=>Un.isArray(n.value)?I.isPosibleToClear&&n.value.length>0:I.isPosibleToClear&&n.value),y=o.computed(()=>Un.isArray(n.value)&&n.value.length>1),Y=o.computed(()=>Un.isArray(n.value)?n.value.length:null),f=L=>{t("disabled-click",L)},M=async L=>{if(I.disabled){l.value=!1;return}if(Un.isArray(n.value))n.value.includes(L)?n.value=n.value.filter(O=>O!==L):n.value=[...n.value,L];else{let O=I.options.find(Ig=>Ig.key===L);!O&&Jh(I.options)&&(O=I.options.find(Ig=>Ig.hint===L)),n.value=(O==null?void 0:O.key)||"",l.value=!1}await o.nextTick(),t("change",String(n.value))},K=L=>{if(I.disabled){l.value=!1;return}l.value=L},F=async()=>{I.disabled||(Un.isArray(n.value)?n.value=[]:n.value="",await o.nextTick(),t("change",n.value))},X=new IntersectionObserver(L=>{L.forEach(O=>{O.isIntersecting&&t("unmount-pagination")})}),z=()=>{A.value&&I.onUnmountPagination&&(X.unobserve(A.value),X.observe(A.value))};return o.onMounted(()=>{z()}),o.onUnmounted(()=>{X.disconnect()}),(L,O)=>(o.openBlock(),o.createBlock(Dr,{"header-classes":"filter__header","options-classes":"filter__options","is-opened":l.value,class:o.normalizeClass(["filter",s.value]),"is-use-anchor":e.isUseAnchor,"data-testid":I.dataTestid,disabled:e.disabled,onChange:K},o.createSlots({header:o.withCtx(()=>[o.renderSlot(L.$slots,"header",{},()=>[o.createElementVNode("span",{class:o.normalizeClass(["filter__header-title",{"filter__header-title__active":l.value}]),"data-testid":`${I.dataTestid}-Title`},o.toDisplayString(e.title),11,xUg),o.createVNode(Hd,{position:e.tooltipPosition,type:"blue","is-can-show":p.value&&!(y.value&&e.isShowMiniOptions),hint:Z.value,"hint-gap":28,class:"filter__header-tooltip","data-testid":`${I.dataTestid}-Tooltip`},{default:o.withCtx(()=>[o.createVNode(ot,{ref_key:"badgesRef",ref:i,type:e.disabled?o.unref(zI).disabled:m.value===I.defaultOption?o.unref(zI).default:o.unref(zI).blue,class:"filter__options-badge","data-testid":`${I.dataTestid}-Badge`,text:m.value,onMouseenter:G,onMouseleave:w,disabled:""},null,8,["type","data-testid","text"]),y.value&&e.isShowMiniOptions?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filter__values","data-testid":`${I.dataTestid}-Filter-Value`},[o.createVNode(rk,{"data-testid":`${I.dataTestid}-Filter-Value-MiniOptions`,onClick:O[0]||(O[0]=o.withModifiers(()=>{},["stop"])),options:h.value,onRemove:M},null,8,["data-testid","options"])],8,OUg)):o.createCommentVNode("",!0)]),_:1},8,["position","is-can-show","hint","data-testid"]),Y.value&&Y.value>1?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filter__count","data-testid":`${I.dataTestid}-Filter-Count`},[o.createTextVNode(" +"+o.toDisplayString(Y.value-1)+" ",1),y.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filter__values","data-testid":`${I.dataTestid}-Filter-Values`},[o.createVNode(rk,{onClick:O[1]||(O[1]=o.withModifiers(()=>{},["stop"])),options:u.value,onRemove:M,"data-testid":`${I.dataTestid}-MiniOptions`},null,8,["options","data-testid"])],8,UUg)):o.createCommentVNode("",!0)],8,QUg)):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("span",{key:1,class:"filter__cross",onClick:o.withModifiers(F,["stop"]),"data-testid":`${I.dataTestid}-Filter-Cross`},[o.createVNode(Mg,{name:o.unref(ug).crossLarge,width:16,height:16},null,8,["name"])],8,EUg)):o.createCommentVNode("",!0)],!0)]),options:o.withCtx(()=>[e.isSearch?(o.openBlock(),o.createBlock(b0,{key:0,modelValue:a.value,"onUpdate:modelValue":O[2]||(O[2]=Ig=>a.value=Ig),"show-history":!1,"data-testid":`${I.dataTestid}-Search`,onInput:O[3]||(O[3]=Ig=>L.$emit("unmount-search",Ig)),onEnter:O[4]||(O[4]=Ig=>L.$emit("unmount-search-enter",Ig))},null,8,["modelValue","data-testid"])):o.createCommentVNode("",!0),o.createVNode(lY,{"data-testid":`${I.dataTestid}-Options`,class:"filter__options-option",options:d.value,"default-option":m.value,onChange:M,onDisabledClick:f},{default:o.withCtx(()=>[o.createElementVNode("li",{class:"filter__options-underline","data-testid":`${I.dataTestid}-Underline`},[...O[5]||(O[5]=[o.createElementVNode("hr",{class:"filter__options-underline-hr"},null,-1)])],8,PUg)]),_:1},8,["data-testid","options","default-option"]),o.withDirectives(o.createElementVNode("div",{ref_key:"lastOptionRef",ref:A,class:"filter__last-option"},null,512),[[o.vShow,e.onUnmountPagination]])]),_:2},[L.$slots.body?{name:"body",fn:o.withCtx(Ig=>[o.renderSlot(L.$slots,"body",{closeOpenList:Ig.closeOpenList},void 0,!0)]),key:"0"}:void 0]),1032,["is-opened","class","is-use-anchor","data-testid","disabled"]))}}),[["__scopeId","data-v-45631066"]]),_Ug=["data-testid"],wp=Tg(o.defineComponent({name:"Range",__name:"Range",props:o.mergeModels({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},dataTestid:{default:"Range"}},{modelValue:{default:0},modelModifiers:{}}),emits:o.mergeModels(["unmount-change","unmount-input"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=g,t=o.useModel(e,"modelValue"),i=o.ref(null);o.watch(t,()=>{n()});const A=()=>(t.value-I.min)/(I.max-I.min)*100,n=()=>{requestAnimationFrame(()=>{i.value&&KI({"--progress":A()+"%"},i.value)})},l=a=>{const d=a.target;d&&C("unmount-change",Number(d.value))},s=a=>{const d=a.target;d&&C("unmount-change",Number(d.value))};return o.onMounted(()=>{n()}),(a,d)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",o.mergeProps({ref_key:"input",ref:i,type:"range"},I,{class:"range","onUpdate:modelValue":d[0]||(d[0]=m=>t.value=m),onChange:l,onInput:s,"data-testid":I.dataTestid}),null,16,_Ug)),[[o.vModelText,t.value]])}}),[["__scopeId","data-v-50ada1b8"]]),$Ug=["id","data-testid"],qUg=["data-testid"],gEg=["data-testid"],bN=Tg(o.defineComponent({name:"TableNew",__name:"TableNew",props:{tableId:{},search:{},tbodyId:{},theadId:{},columnCount:{},dataTestid:{default:"Table"},isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate"],setup(e,{expose:g,emit:I}){var p;const C=e,t=I,i=o.reactive({headHeight:0,maxColumnCount:0}),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),a=o.ref(null),d=B=>{t("unmount-scroll",B)},m=()=>{if(!A.value||!a.value)return;const B=A.value.querySelector("thead");if(!B)return;const y=B.getBoundingClientRect().height;i.headHeight=y,KI({"--scroll-track-margin-top":`${y}px`},a.value.$el)},u=()=>{a.value&&a.value.scrollToTop()},h=()=>{if(a.value&&s.value){const B=getComputedStyle(a.value.$el),y=Number(B.minHeight.replace(/\D/g,""));if(y&&y>0)return;KI({"min-height":`${i.headHeight+108}px`},a.value.$el)}},Z=()=>{let B=1;if(n.value){for(let y=0;y<n.value.children.length;y++)B=Math.max(n.value.children[y].children.length,B);i.maxColumnCount=B}},G=new MutationObserver(()=>{Z()}),w=new ResizeObserver(()=>{m()});return g({scrollToTop:u,setHeightSlot:(p=a.value)==null?void 0:p.setHeightSlot,tbodyRef:l,tableRef:A,theadRef:n}),o.onMounted(()=>{m(),Z(),window.addEventListener("resize",m),A.value&&w.observe(A.value),n.value&&G.observe(n.value,{childList:!0,subtree:!0}),h()}),(B,y)=>(o.openBlock(),o.createBlock(P0,{ref_key:"scrollWrapperRef",ref:a,class:"table",onUnmountScroll:d,"is-show-vertical-scroll":C.isShowVerticalScroll,"is-show-horizontal-scroll":C.isShowHorizontalScroll,"data-testid":`${C.dataTestid}-ScrollWrapper`},{default:o.withCtx(()=>[o.createElementVNode("table",{ref_key:"tableRef",ref:A,id:C.tableId,class:"table__table","data-testid":`${C.dataTestid}`},[o.renderSlot(B.$slots,"default",{},()=>[o.createElementVNode("colgroup",null,[o.renderSlot(B.$slots,"colspan",{},void 0,!0)]),B.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:n,class:"table__head","data-testid":`${C.dataTestid}-Thead`},[o.renderSlot(B.$slots,"head",{},void 0,!0),B.$slots.search?(o.openBlock(),o.createBlock(E0,{key:0,class:"table__search-tr",ref_key:"searchRowRef",ref:s,"data-testid":`${C.dataTestid}-Search-Row`},{default:o.withCtx(()=>[o.createVNode(um,{colspan:i.maxColumnCount,class:"table__search-th","data-testid":`${C.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(B.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"])):o.createCommentVNode("",!0)],8,qUg)):o.createCommentVNode("",!0),o.renderSlot(B.$slots,"body-group",{},()=>[B.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,ref_key:"tbodyRef",ref:l,class:"table__body","data-testid":`${C.dataTestid}-Tbody`},[o.renderSlot(B.$slots,"body",{},void 0,!0)],8,gEg)):o.createCommentVNode("",!0)],!0)],!0)],8,$Ug)]),_:3},8,["is-show-vertical-scroll","is-show-horizontal-scroll","data-testid"]))}}),[["__scopeId","data-v-30a389ed"]]),IEg=["data-testid"],ZN=Tg(o.defineComponent({name:"TableRow",__name:"TableRowNew",props:{type:{default:"default"},isObserved:{type:Boolean},observer:{},scrolledElement:{},dataTestid:{},colspan:{default:1},rowspan:{}},setup(e){const g=e,I=o.computed(()=>[{"table-row_active":g.type==="selected"}]);return(C,t)=>(o.openBlock(),o.createElementBlock("tr",{class:o.normalizeClass(["table-row",I.value]),"data-testid":g.dataTestid},[o.renderSlot(C.$slots,"default",{},void 0,!0)],10,IEg))}}),[["__scopeId","data-v-c22d3f55"]]),eEg=["data-testid"],Wp=Tg(o.defineComponent({name:"HeadTableRow",__name:"HeadTableRowNew",props:{dataTestid:{default:"TableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("tr",{class:"head-table-row","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,eEg))}}),[["__scopeId","data-v-45b56a2a"]]),CEg={class:"scroll-wrapper__vertical-wrapper"},tEg={class:"scroll-wrapper__horizont-wrapper"},iEg=Tg(o.defineComponent({name:"ScrollWrapper",__name:"ScrollWrapperNew",props:{isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate","on-mounted"],setup(e,{expose:g,emit:I}){const C=I,t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),{onTrackClick:a,startDrag:d,changeBarPosition:m,setVerticalBarHeight:u,verticalTrackClass:h,isExistVerticalTrack:Z}=ck(t,i,n,A),{changeBarPosition:G,startDrag:w,onTrackClick:p,setHorizontalBarWidth:B,horizontalTrackClass:y,isExistHorizontalTrack:Y}=dk(t,i,s,l),f=Ag=>{m(),G(),C("unmount-scroll",Ag)},M=()=>{requestAnimationFrame(()=>{K(),F()})},K=()=>{if(!t.value||!i.value)return;const Ag=getComputedStyle(i.value),Q=i.value.style.minHeight||Ag.minHeight,$=i.value.style.maxHeight||Ag.maxHeight,mg=i.value.style.height;KI({"--scroll-wrapper-height":`${mg}`,"--scroll-wrapper-max-height":`${$}`,"--scroll-wrapper-min-height":`${Q}`},i.value)},F=()=>{u(),B(),m(),G()},X=()=>{t.value&&t.value.addEventListener("scroll",f)},z=()=>{t.value&&(t.value.scrollTop=0)},L=new MutationObserver(()=>{M()}),O=new ResizeObserver(()=>{M()}),Ig=Ag=>{L.observe(Ag,{childList:!0,subtree:!0,attributes:!0}),O.observe(Ag)};return g({scrollToTop:z,setHeightSlot:K}),o.onMounted(()=>{M(),X(),i.value&&Ig(i.value),A.value&&Ig(A.value),window.addEventListener("resize",M),C("on-mounted")}),o.onUnmounted(()=>{window.removeEventListener("resize",M)}),(Ag,Q)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollWrapperRef",ref:i,class:"scroll-wrapper"},[o.createElementVNode("div",CEg,[o.createElementVNode("div",tEg,[o.createElementVNode("div",{ref_key:"slotRef",ref:t,class:"scroll-wrapper__slot"},[o.renderSlot(Ag.$slots,"default",{},void 0,!0)],512),o.unref(Y)||e.isShowHorizontalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"horizontTrackRef",ref:l,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_horizont",o.unref(y)]),onClick:Q[1]||(Q[1]=o.withModifiers((...$)=>o.unref(p)&&o.unref(p)(...$),["prevent","left"]))},[o.createElementVNode("div",{ref_key:"horizontBarRef",ref:s,class:"scroll-wrapper__bar",onMousedown:Q[0]||(Q[0]=o.withModifiers((...$)=>o.unref(w)&&o.unref(w)(...$),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)]),o.unref(Z)||e.isShowVerticalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"verticalTrackRef",ref:A,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_vertical",o.unref(h)]),onClick:Q[3]||(Q[3]=o.withModifiers((...$)=>o.unref(a)&&o.unref(a)(...$),["prevent","left"]))},[o.createElementVNode("div",{ref_key:"verticalBarRef",ref:n,class:"scroll-wrapper__bar",onMousedown:Q[2]||(Q[2]=o.withModifiers((...$)=>o.unref(d)&&o.unref(d)(...$),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)])],512))}}),[["__scopeId","data-v-411a6b7a"]]),AEg=["data-testid"],nEg=["data-testid"],lEg=["data-testid"],GN=Tg(o.defineComponent({name:"TableSimple",__name:"TableSimple",props:{dataTestid:{default:"TableSimple"}},setup(e,{expose:g}){const I=e,C=o.ref(null),t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.computed(()=>{let l=1;if(t.value)for(let s=0;s<t.value.children.length;s++)l=Math.max(t.value.children[s].children.length,l);return l});return g({tbodyRef:i,tableRef:C,theadRef:t}),(l,s)=>(o.openBlock(),o.createElementBlock("table",{ref_key:"tableRef",ref:C,class:"simple-table-yui-kit","data-testid":`${I.dataTestid}`},[o.renderSlot(l.$slots,"default",{},()=>[o.renderSlot(l.$slots,"colspan",{},void 0,!0),l.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:t,class:"simple-table-yui-kit__head","data-testid":`${I.dataTestid}-Thead`},[o.renderSlot(l.$slots,"head",{},void 0,!0),l.$slots.search?(o.openBlock(),o.createBlock(Wp,{key:0,class:"table-new-yui-kit__search",ref_key:"searchRowRef",ref:A,"data-testid":`${I.dataTestid}-Search-Row`},{default:o.withCtx(()=>[o.createVNode(um,{colspan:n.value,class:"table-new-yui-kit__th","data-testid":`${I.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(l.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"])):o.createCommentVNode("",!0)],8,nEg)):o.createCommentVNode("",!0),o.renderSlot(l.$slots,"body-group",{},()=>[l.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,ref_key:"tbodyRef",ref:i,class:"simple-table-yui-kit__body","data-testid":`${I.dataTestid}-Tbody`},[o.renderSlot(l.$slots,"body",{},void 0,!0)],8,lEg)):o.createCommentVNode("",!0)],!0)],!0)],8,AEg))}}),[["__scopeId","data-v-eaeafe5b"]]),oEg=["data-testid"],sEg=["data-testid"],aEg=["onClick","data-testid"],dEg=["data-testid"],wN=Tg(o.defineComponent({name:"Tabs",__name:"Tabs",props:{defaultActiveTabId:{},tabCount:{},dataTestid:{default:"Tabs"}},emits:["unmount-tab"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({activeTab:1}),i=n=>Array.from({length:n},(l,s)=>s+1);o.watch(()=>I.defaultActiveTabId,()=>{I.defaultActiveTabId&&(t.activeTab=I.defaultActiveTabId)},{immediate:!0});const A=n=>{t.activeTab=n,C("unmount-tab",n)};return(n,l)=>(o.openBlock(),o.createElementBlock("div",{"data-testid":I.dataTestid,class:"tabs"},[o.createElementVNode("nav",{class:"tabs__navigation","data-testid":`${I.dataTestid}-Navigation`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i(I.tabCount),s=>(o.openBlock(),o.createElementBlock("button",{key:s,onClick:a=>A(s),class:o.normalizeClass(["tabs__navigation-button",{active:t.activeTab===s}]),"data-testid":`${I.dataTestid}-Navigation-Button`},[o.renderSlot(n.$slots,`header${s}`,{},void 0,!0)],10,aEg))),128))],8,sEg),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i(I.tabCount),s=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:s},[t.activeTab===s?(o.openBlock(),o.createElementBlock("article",{key:0,"data-testid":`${I.dataTestid}-Content`,class:"tabs__navigation-content"},[o.renderSlot(n.$slots,`tab${s}`,{},void 0,!0)],8,dEg)):o.createCommentVNode("",!0)],64))),128))],8,oEg))}}),[["__scopeId","data-v-9a94dd67"]]);function EC(e){this.content=e}EC.prototype={constructor:EC,find:function(e){for(var g=0;g<this.content.length;g+=2)if(this.content[g]===e)return g;return-1},get:function(e){var g=this.find(e);return g==-1?void 0:this.content[g+1]},update:function(e,g,I){var C=I&&I!=e?this.remove(I):this,t=C.find(e),i=C.content.slice();return t==-1?i.push(I||e,g):(i[t+1]=g,I&&(i[t]=I)),new EC(i)},remove:function(e){var g=this.find(e);if(g==-1)return this;var I=this.content.slice();return I.splice(g,2),new EC(I)},addToStart:function(e,g){return new EC([e,g].concat(this.remove(e).content))},addToEnd:function(e,g){var I=this.remove(e).content.slice();return I.push(e,g),new EC(I)},addBefore:function(e,g,I){var C=this.remove(g),t=C.content.slice(),i=C.find(e);return t.splice(i==-1?t.length:i,0,g,I),new EC(t)},forEach:function(e){for(var g=0;g<this.content.length;g+=2)e(this.content[g],this.content[g+1])},prepend:function(e){return e=EC.from(e),e.size?new EC(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=EC.from(e),e.size?new EC(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var g=this;e=EC.from(e);for(var I=0;I<e.content.length;I+=2)g=g.remove(e.content[I]);return g},toObject:function(){var e={};return this.forEach(function(g,I){e[g]=I}),e},get size(){return this.content.length>>1}},EC.from=function(e){if(e instanceof EC)return e;var g=[];if(e)for(var I in e)g.push(I,e[I]);return new EC(g)};function mk(e,g,I){for(let C=0;;C++){if(C==e.childCount||C==g.childCount)return e.childCount==g.childCount?null:I;let t=e.child(C),i=g.child(C);if(t==i){I+=t.nodeSize;continue}if(!t.sameMarkup(i))return I;if(t.isText&&t.text!=i.text){for(let A=0;t.text[A]==i.text[A];A++)I++;return I}if(t.content.size||i.content.size){let A=mk(t.content,i.content,I+1);if(A!=null)return A}I+=t.nodeSize}}function uk(e,g,I,C){for(let t=e.childCount,i=g.childCount;;){if(t==0||i==0)return t==i?null:{a:I,b:C};let A=e.child(--t),n=g.child(--i),l=A.nodeSize;if(A==n){I-=l,C-=l;continue}if(!A.sameMarkup(n))return{a:I,b:C};if(A.isText&&A.text!=n.text){let s=0,a=Math.min(A.text.length,n.text.length);for(;s<a&&A.text[A.text.length-s-1]==n.text[n.text.length-s-1];)s++,I--,C--;return{a:I,b:C}}if(A.content.size||n.content.size){let s=uk(A.content,n.content,I-1,C-1);if(s)return s}I-=l,C-=l}}let Bg=class ti{constructor(g,I){if(this.content=g,this.size=I||0,I==null)for(let C=0;C<g.length;C++)this.size+=g[C].nodeSize}nodesBetween(g,I,C,t=0,i){for(let A=0,n=0;n<I;A++){let l=this.content[A],s=n+l.nodeSize;if(s>g&&C(l,t+n,i||null,A)!==!1&&l.content.size){let a=n+1;l.nodesBetween(Math.max(0,g-a),Math.min(l.content.size,I-a),C,t+a)}n=s}}descendants(g){this.nodesBetween(0,this.size,g)}textBetween(g,I,C,t){let i="",A=!0;return this.nodesBetween(g,I,(n,l)=>{let s=n.isText?n.text.slice(Math.max(g,l)-l,I-l):n.isLeaf?t?typeof t=="function"?t(n):t:n.type.spec.leafText?n.type.spec.leafText(n):"":"";n.isBlock&&(n.isLeaf&&s||n.isTextblock)&&C&&(A?A=!1:i+=C),i+=s},0),i}append(g){if(!g.size)return this;if(!this.size)return g;let I=this.lastChild,C=g.firstChild,t=this.content.slice(),i=0;for(I.isText&&I.sameMarkup(C)&&(t[t.length-1]=I.withText(I.text+C.text),i=1);i<g.content.length;i++)t.push(g.content[i]);return new ti(t,this.size+g.size)}cut(g,I=this.size){if(g==0&&I==this.size)return this;let C=[],t=0;if(I>g)for(let i=0,A=0;A<I;i++){let n=this.content[i],l=A+n.nodeSize;l>g&&((A<g||l>I)&&(n.isText?n=n.cut(Math.max(0,g-A),Math.min(n.text.length,I-A)):n=n.cut(Math.max(0,g-A-1),Math.min(n.content.size,I-A-1))),C.push(n),t+=n.nodeSize),A=l}return new ti(C,t)}cutByIndex(g,I){return g==I?ti.empty:g==0&&I==this.content.length?this:new ti(this.content.slice(g,I))}replaceChild(g,I){let C=this.content[g];if(C==I)return this;let t=this.content.slice(),i=this.size+I.nodeSize-C.nodeSize;return t[g]=I,new ti(t,i)}addToStart(g){return new ti([g].concat(this.content),this.size+g.nodeSize)}addToEnd(g){return new ti(this.content.concat(g),this.size+g.nodeSize)}eq(g){if(this.content.length!=g.content.length)return!1;for(let I=0;I<this.content.length;I++)if(!this.content[I].eq(g.content[I]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(g){let I=this.content[g];if(!I)throw new RangeError("Index "+g+" out of range for "+this);return I}maybeChild(g){return this.content[g]||null}forEach(g){for(let I=0,C=0;I<this.content.length;I++){let t=this.content[I];g(t,C,I),C+=t.nodeSize}}findDiffStart(g,I=0){return mk(this,g,I)}findDiffEnd(g,I=this.size,C=g.size){return uk(this,g,I,C)}findIndex(g){if(g==0)return pp(0,g);if(g==this.size)return pp(this.content.length,g);if(g>this.size||g<0)throw new RangeError(`Position ${g} outside of fragment (${this})`);for(let I=0,C=0;;I++){let t=this.child(I),i=C+t.nodeSize;if(i>=g)return i==g?pp(I+1,i):pp(I,C);C=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(g=>g.toJSON()):null}static fromJSON(g,I){if(!I)return ti.empty;if(!Array.isArray(I))throw new RangeError("Invalid input for Fragment.fromJSON");return new ti(I.map(g.nodeFromJSON))}static fromArray(g){if(!g.length)return ti.empty;let I,C=0;for(let t=0;t<g.length;t++){let i=g[t];C+=i.nodeSize,t&&i.isText&&g[t-1].sameMarkup(i)?(I||(I=g.slice(0,t)),I[I.length-1]=i.withText(I[I.length-1].text+i.text)):I&&I.push(i)}return new ti(I||g,C)}static from(g){if(!g)return ti.empty;if(g instanceof ti)return g;if(Array.isArray(g))return this.fromArray(g);if(g.attrs)return new ti([g],g.nodeSize);throw new RangeError("Can not convert "+g+" to a Fragment"+(g.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Bg.empty=new Bg([],0);const WN={index:0,offset:0};function pp(e,g){return WN.index=e,WN.offset=g,WN}function Bp(e,g){if(e===g)return!0;if(!(e&&typeof e=="object")||!(g&&typeof g=="object"))return!1;let I=Array.isArray(e);if(Array.isArray(g)!=I)return!1;if(I){if(e.length!=g.length)return!1;for(let C=0;C<e.length;C++)if(!Bp(e[C],g[C]))return!1}else{for(let C in e)if(!(C in g)||!Bp(e[C],g[C]))return!1;for(let C in g)if(!(C in e))return!1}return!0}let se=class ER{constructor(g,I){this.type=g,this.attrs=I}addToSet(g){let I,C=!1;for(let t=0;t<g.length;t++){let i=g[t];if(this.eq(i))return g;if(this.type.excludes(i.type))I||(I=g.slice(0,t));else{if(i.type.excludes(this.type))return g;!C&&i.type.rank>this.type.rank&&(I||(I=g.slice(0,t)),I.push(this),C=!0),I&&I.push(i)}}return I||(I=g.slice()),C||I.push(this),I}removeFromSet(g){for(let I=0;I<g.length;I++)if(this.eq(g[I]))return g.slice(0,I).concat(g.slice(I+1));return g}isInSet(g){for(let I=0;I<g.length;I++)if(this.eq(g[I]))return!0;return!1}eq(g){return this==g||this.type==g.type&&Bp(this.attrs,g.attrs)}toJSON(){let g={type:this.type.name};for(let I in this.attrs){g.attrs=this.attrs;break}return g}static fromJSON(g,I){if(!I)throw new RangeError("Invalid input for Mark.fromJSON");let C=g.marks[I.type];if(!C)throw new RangeError(`There is no mark type ${I.type} in this schema`);let t=C.create(I.attrs);return C.checkAttrs(t.attrs),t}static sameSet(g,I){if(g==I)return!0;if(g.length!=I.length)return!1;for(let C=0;C<g.length;C++)if(!g[C].eq(I[C]))return!1;return!0}static setFrom(g){if(!g||Array.isArray(g)&&g.length==0)return ER.none;if(g instanceof ER)return[g];let I=g.slice();return I.sort((C,t)=>C.type.rank-t.type.rank),I}};se.none=[];let yp=class extends Error{},zg=class Sh{constructor(g,I,C){this.content=g,this.openStart=I,this.openEnd=C}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(g,I){let C=bk(this.content,g+this.openStart,I);return C&&new Sh(C,this.openStart,this.openEnd)}removeBetween(g,I){return new Sh(hk(this.content,g+this.openStart,I+this.openStart),this.openStart,this.openEnd)}eq(g){return this.content.eq(g.content)&&this.openStart==g.openStart&&this.openEnd==g.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let g={content:this.content.toJSON()};return this.openStart>0&&(g.openStart=this.openStart),this.openEnd>0&&(g.openEnd=this.openEnd),g}static fromJSON(g,I){if(!I)return Sh.empty;let C=I.openStart||0,t=I.openEnd||0;if(typeof C!="number"||typeof t!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Sh(Bg.fromJSON(g,I.content),C,t)}static maxOpen(g,I=!0){let C=0,t=0;for(let i=g.firstChild;i&&!i.isLeaf&&(I||!i.type.spec.isolating);i=i.firstChild)C++;for(let i=g.lastChild;i&&!i.isLeaf&&(I||!i.type.spec.isolating);i=i.lastChild)t++;return new Sh(g,C,t)}};zg.empty=new zg(Bg.empty,0,0);function hk(e,g,I){let{index:C,offset:t}=e.findIndex(g),i=e.maybeChild(C),{index:A,offset:n}=e.findIndex(I);if(t==g||i.isText){if(n!=I&&!e.child(A).isText)throw new RangeError("Removing non-flat range");return e.cut(0,g).append(e.cut(I))}if(C!=A)throw new RangeError("Removing non-flat range");return e.replaceChild(C,i.copy(hk(i.content,g-t-1,I-t-1)))}function bk(e,g,I,C){let{index:t,offset:i}=e.findIndex(g),A=e.maybeChild(t);if(i==g||A.isText)return C&&!C.canReplace(t,t,I)?null:e.cut(0,g).append(I).append(e.cut(g));let n=bk(A.content,g-i-1,I,A);return n&&e.replaceChild(t,A.copy(n))}function cEg(e,g,I){if(I.openStart>e.depth)throw new yp("Inserted content deeper than insertion position");if(e.depth-I.openStart!=g.depth-I.openEnd)throw new yp("Inconsistent open depths");return Zk(e,g,I,0)}function Zk(e,g,I,C){let t=e.index(C),i=e.node(C);if(t==g.index(C)&&C<e.depth-I.openStart){let A=Zk(e,g,I,C+1);return i.copy(i.content.replaceChild(t,A))}else if(I.content.size)if(!I.openStart&&!I.openEnd&&e.depth==C&&g.depth==C){let A=e.parent,n=A.content;return Kd(A,n.cut(0,e.parentOffset).append(I.content).append(n.cut(g.parentOffset)))}else{let{start:A,end:n}=rEg(I,e);return Kd(i,wk(e,A,n,g,C))}else return Kd(i,Yp(e,g,C))}function Gk(e,g){if(!g.type.compatibleContent(e.type))throw new yp("Cannot join "+g.type.name+" onto "+e.type.name)}function pN(e,g,I){let C=e.node(I);return Gk(C,g.node(I)),C}function Sd(e,g){let I=g.length-1;I>=0&&e.isText&&e.sameMarkup(g[I])?g[I]=e.withText(g[I].text+e.text):g.push(e)}function $0(e,g,I,C){let t=(g||e).node(I),i=0,A=g?g.index(I):t.childCount;e&&(i=e.index(I),e.depth>I?i++:e.textOffset&&(Sd(e.nodeAfter,C),i++));for(let n=i;n<A;n++)Sd(t.child(n),C);g&&g.depth==I&&g.textOffset&&Sd(g.nodeBefore,C)}function Kd(e,g){return e.type.checkContent(g),e.copy(g)}function wk(e,g,I,C,t){let i=e.depth>t&&pN(e,g,t+1),A=C.depth>t&&pN(I,C,t+1),n=[];return $0(null,e,t,n),i&&A&&g.index(t)==I.index(t)?(Gk(i,A),Sd(Kd(i,wk(e,g,I,C,t+1)),n)):(i&&Sd(Kd(i,Yp(e,g,t+1)),n),$0(g,I,t,n),A&&Sd(Kd(A,Yp(I,C,t+1)),n)),$0(C,null,t,n),new Bg(n)}function Yp(e,g,I){let C=[];if($0(null,e,I,C),e.depth>I){let t=pN(e,g,I+1);Sd(Kd(t,Yp(e,g,I+1)),C)}return $0(g,null,I,C),new Bg(C)}function rEg(e,g){let I=g.depth-e.openStart,t=g.node(I).copy(e.content);for(let i=I-1;i>=0;i--)t=g.node(i).copy(Bg.from(t));return{start:t.resolveNoCache(e.openStart+I),end:t.resolveNoCache(t.content.size-e.openEnd-I)}}class q0{constructor(g,I,C){this.pos=g,this.path=I,this.parentOffset=C,this.depth=I.length/3-1}resolveDepth(g){return g==null?this.depth:g<0?this.depth+g:g}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(g){return this.path[this.resolveDepth(g)*3]}index(g){return this.path[this.resolveDepth(g)*3+1]}indexAfter(g){return g=this.resolveDepth(g),this.index(g)+(g==this.depth&&!this.textOffset?0:1)}start(g){return g=this.resolveDepth(g),g==0?0:this.path[g*3-1]+1}end(g){return g=this.resolveDepth(g),this.start(g)+this.node(g).content.size}before(g){if(g=this.resolveDepth(g),!g)throw new RangeError("There is no position before the top-level node");return g==this.depth+1?this.pos:this.path[g*3-1]}after(g){if(g=this.resolveDepth(g),!g)throw new RangeError("There is no position after the top-level node");return g==this.depth+1?this.pos:this.path[g*3-1]+this.path[g*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let g=this.parent,I=this.index(this.depth);if(I==g.childCount)return null;let C=this.pos-this.path[this.path.length-1],t=g.child(I);return C?g.child(I).cut(C):t}get nodeBefore(){let g=this.index(this.depth),I=this.pos-this.path[this.path.length-1];return I?this.parent.child(g).cut(0,I):g==0?null:this.parent.child(g-1)}posAtIndex(g,I){I=this.resolveDepth(I);let C=this.path[I*3],t=I==0?0:this.path[I*3-1]+1;for(let i=0;i<g;i++)t+=C.child(i).nodeSize;return t}marks(){let g=this.parent,I=this.index();if(g.content.size==0)return se.none;if(this.textOffset)return g.child(I).marks;let C=g.maybeChild(I-1),t=g.maybeChild(I);if(!C){let n=C;C=t,t=n}let i=C.marks;for(var A=0;A<i.length;A++)i[A].type.spec.inclusive===!1&&(!t||!i[A].isInSet(t.marks))&&(i=i[A--].removeFromSet(i));return i}marksAcross(g){let I=this.parent.maybeChild(this.index());if(!I||!I.isInline)return null;let C=I.marks,t=g.parent.maybeChild(g.index());for(var i=0;i<C.length;i++)C[i].type.spec.inclusive===!1&&(!t||!C[i].isInSet(t.marks))&&(C=C[i--].removeFromSet(C));return C}sharedDepth(g){for(let I=this.depth;I>0;I--)if(this.start(I)<=g&&this.end(I)>=g)return I;return 0}blockRange(g=this,I){if(g.pos<this.pos)return g.blockRange(this);for(let C=this.depth-(this.parent.inlineContent||this.pos==g.pos?1:0);C>=0;C--)if(g.pos<=this.end(C)&&(!I||I(this.node(C))))return new Vp(this,g,C);return null}sameParent(g){return this.pos-this.parentOffset==g.pos-g.parentOffset}max(g){return g.pos>this.pos?g:this}min(g){return g.pos<this.pos?g:this}toString(){let g="";for(let I=1;I<=this.depth;I++)g+=(g?"/":"")+this.node(I).type.name+"_"+this.index(I-1);return g+":"+this.parentOffset}static resolve(g,I){if(!(I>=0&&I<=g.content.size))throw new RangeError("Position "+I+" out of range");let C=[],t=0,i=I;for(let A=g;;){let{index:n,offset:l}=A.content.findIndex(i),s=i-l;if(C.push(A,n,t+l),!s||(A=A.child(n),A.isText))break;i=s-1,t+=l+1}return new q0(I,C,i)}static resolveCached(g,I){let C=Wk.get(g);if(C)for(let i=0;i<C.elts.length;i++){let A=C.elts[i];if(A.pos==I)return A}else Wk.set(g,C=new mEg);let t=C.elts[C.i]=q0.resolve(g,I);return C.i=(C.i+1)%uEg,t}}class mEg{constructor(){this.elts=[],this.i=0}}const uEg=12,Wk=new WeakMap;class Vp{constructor(g,I,C){this.$from=g,this.$to=I,this.depth=C}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const hEg=Object.create(null);let Xs=class PR{constructor(g,I,C,t=se.none){this.type=g,this.attrs=I,this.marks=t,this.content=C||Bg.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(g){return this.content.child(g)}maybeChild(g){return this.content.maybeChild(g)}forEach(g){this.content.forEach(g)}nodesBetween(g,I,C,t=0){this.content.nodesBetween(g,I,C,t,this)}descendants(g){this.nodesBetween(0,this.content.size,g)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(g,I,C,t){return this.content.textBetween(g,I,C,t)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(g){return this==g||this.sameMarkup(g)&&this.content.eq(g.content)}sameMarkup(g){return this.hasMarkup(g.type,g.attrs,g.marks)}hasMarkup(g,I,C){return this.type==g&&Bp(this.attrs,I||g.defaultAttrs||hEg)&&se.sameSet(this.marks,C||se.none)}copy(g=null){return g==this.content?this:new PR(this.type,this.attrs,g,this.marks)}mark(g){return g==this.marks?this:new PR(this.type,this.attrs,this.content,g)}cut(g,I=this.content.size){return g==0&&I==this.content.size?this:this.copy(this.content.cut(g,I))}slice(g,I=this.content.size,C=!1){if(g==I)return zg.empty;let t=this.resolve(g),i=this.resolve(I),A=C?0:t.sharedDepth(I),n=t.start(A),s=t.node(A).content.cut(t.pos-n,i.pos-n);return new zg(s,t.depth-A,i.depth-A)}replace(g,I,C){return cEg(this.resolve(g),this.resolve(I),C)}nodeAt(g){for(let I=this;;){let{index:C,offset:t}=I.content.findIndex(g);if(I=I.maybeChild(C),!I)return null;if(t==g||I.isText)return I;g-=t+1}}childAfter(g){let{index:I,offset:C}=this.content.findIndex(g);return{node:this.content.maybeChild(I),index:I,offset:C}}childBefore(g){if(g==0)return{node:null,index:0,offset:0};let{index:I,offset:C}=this.content.findIndex(g);if(C<g)return{node:this.content.child(I),index:I,offset:C};let t=this.content.child(I-1);return{node:t,index:I-1,offset:C-t.nodeSize}}resolve(g){return q0.resolveCached(this,g)}resolveNoCache(g){return q0.resolve(this,g)}rangeHasMark(g,I,C){let t=!1;return I>g&&this.nodesBetween(g,I,i=>(C.isInSet(i.marks)&&(t=!0),!t)),t}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let g=this.type.name;return this.content.size&&(g+="("+this.content.toStringInner()+")"),pk(this.marks,g)}contentMatchAt(g){let I=this.type.contentMatch.matchFragment(this.content,0,g);if(!I)throw new Error("Called contentMatchAt on a node with invalid content");return I}canReplace(g,I,C=Bg.empty,t=0,i=C.childCount){let A=this.contentMatchAt(g).matchFragment(C,t,i),n=A&&A.matchFragment(this.content,I);if(!n||!n.validEnd)return!1;for(let l=t;l<i;l++)if(!this.type.allowsMarks(C.child(l).marks))return!1;return!0}canReplaceWith(g,I,C,t){if(t&&!this.type.allowsMarks(t))return!1;let i=this.contentMatchAt(g).matchType(C),A=i&&i.matchFragment(this.content,I);return A?A.validEnd:!1}canAppend(g){return g.content.size?this.canReplace(this.childCount,this.childCount,g.content):this.type.compatibleContent(g.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let g=se.none;for(let I=0;I<this.marks.length;I++){let C=this.marks[I];C.type.checkAttrs(C.attrs),g=C.addToSet(g)}if(!se.sameSet(g,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(I=>I.type.name)}`);this.content.forEach(I=>I.check())}toJSON(){let g={type:this.type.name};for(let I in this.attrs){g.attrs=this.attrs;break}return this.content.size&&(g.content=this.content.toJSON()),this.marks.length&&(g.marks=this.marks.map(I=>I.toJSON())),g}static fromJSON(g,I){if(!I)throw new RangeError("Invalid input for Node.fromJSON");let C;if(I.marks){if(!Array.isArray(I.marks))throw new RangeError("Invalid mark data for Node.fromJSON");C=I.marks.map(g.markFromJSON)}if(I.type=="text"){if(typeof I.text!="string")throw new RangeError("Invalid text node in JSON");return g.text(I.text,C)}let t=Bg.fromJSON(g,I.content),i=g.nodeType(I.type).create(I.attrs,t,C);return i.type.checkAttrs(i.attrs),i}};Xs.prototype.text=void 0;class Np extends Xs{constructor(g,I,C,t){if(super(g,I,null,t),!C)throw new RangeError("Empty text nodes are not allowed");this.text=C}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pk(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(g,I){return this.text.slice(g,I)}get nodeSize(){return this.text.length}mark(g){return g==this.marks?this:new Np(this.type,this.attrs,this.text,g)}withText(g){return g==this.text?this:new Np(this.type,this.attrs,g,this.marks)}cut(g=0,I=this.text.length){return g==0&&I==this.text.length?this:this.withText(this.text.slice(g,I))}eq(g){return this.sameMarkup(g)&&this.text==g.text}toJSON(){let g=super.toJSON();return g.text=this.text,g}}function pk(e,g){for(let I=e.length-1;I>=0;I--)g=e[I].type.name+"("+g+")";return g}class kd{constructor(g){this.validEnd=g,this.next=[],this.wrapCache=[]}static parse(g,I){let C=new bEg(g,I);if(C.next==null)return kd.empty;let t=Bk(C);C.next&&C.err("Unexpected trailing text");let i=yEg(BEg(t));return YEg(i,C),i}matchType(g){for(let I=0;I<this.next.length;I++)if(this.next[I].type==g)return this.next[I].next;return null}matchFragment(g,I=0,C=g.childCount){let t=this;for(let i=I;t&&i<C;i++)t=t.matchType(g.child(i).type);return t}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let g=0;g<this.next.length;g++){let{type:I}=this.next[g];if(!(I.isText||I.hasRequiredAttrs()))return I}return null}compatible(g){for(let I=0;I<this.next.length;I++)for(let C=0;C<g.next.length;C++)if(this.next[I].type==g.next[C].type)return!0;return!1}fillBefore(g,I=!1,C=0){let t=[this];function i(A,n){let l=A.matchFragment(g,C);if(l&&(!I||l.validEnd))return Bg.from(n.map(s=>s.createAndFill()));for(let s=0;s<A.next.length;s++){let{type:a,next:d}=A.next[s];if(!(a.isText||a.hasRequiredAttrs())&&t.indexOf(d)==-1){t.push(d);let m=i(d,n.concat(a));if(m)return m}}return null}return i(this,[])}findWrapping(g){for(let C=0;C<this.wrapCache.length;C+=2)if(this.wrapCache[C]==g)return this.wrapCache[C+1];let I=this.computeWrapping(g);return this.wrapCache.push(g,I),I}computeWrapping(g){let I=Object.create(null),C=[{match:this,type:null,via:null}];for(;C.length;){let t=C.shift(),i=t.match;if(i.matchType(g)){let A=[];for(let n=t;n.type;n=n.via)A.push(n.type);return A.reverse()}for(let A=0;A<i.next.length;A++){let{type:n,next:l}=i.next[A];!n.isLeaf&&!n.hasRequiredAttrs()&&!(n.name in I)&&(!t.type||l.validEnd)&&(C.push({match:n.contentMatch,type:n,via:t}),I[n.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(g){if(g>=this.next.length)throw new RangeError(`There's no ${g}th edge in this content match`);return this.next[g]}toString(){let g=[];function I(C){g.push(C);for(let t=0;t<C.next.length;t++)g.indexOf(C.next[t].next)==-1&&I(C.next[t].next)}return I(this),g.map((C,t)=>{let i=t+(C.validEnd?"*":" ")+" ";for(let A=0;A<C.next.length;A++)i+=(A?", ":"")+C.next[A].type.name+"->"+g.indexOf(C.next[A].next);return i}).join(`
1456
- `)}}kd.empty=new kd(!0);class bEg{constructor(g,I){this.string=g,this.nodeTypes=I,this.inline=null,this.pos=0,this.tokens=g.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(g){return this.next==g&&(this.pos++||!0)}err(g){throw new SyntaxError(g+" (in content expression '"+this.string+"')")}}function Bk(e){let g=[];do g.push(ZEg(e));while(e.eat("|"));return g.length==1?g[0]:{type:"choice",exprs:g}}function ZEg(e){let g=[];do g.push(GEg(e));while(e.next&&e.next!=")"&&e.next!="|");return g.length==1?g[0]:{type:"seq",exprs:g}}function GEg(e){let g=pEg(e);for(;;)if(e.eat("+"))g={type:"plus",expr:g};else if(e.eat("*"))g={type:"star",expr:g};else if(e.eat("?"))g={type:"opt",expr:g};else if(e.eat("{"))g=wEg(e,g);else break;return g}function yk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let g=Number(e.next);return e.pos++,g}function wEg(e,g){let I=yk(e),C=I;return e.eat(",")&&(e.next!="}"?C=yk(e):C=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:I,max:C,expr:g}}function WEg(e,g){let I=e.nodeTypes,C=I[g];if(C)return[C];let t=[];for(let i in I){let A=I[i];A.isInGroup(g)&&t.push(A)}return t.length==0&&e.err("No node type or group '"+g+"' found"),t}function pEg(e){if(e.eat("(")){let g=Bk(e);return e.eat(")")||e.err("Missing closing paren"),g}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let g=WEg(e,e.next).map(I=>(e.inline==null?e.inline=I.isInline:e.inline!=I.isInline&&e.err("Mixing inline and block content"),{type:"name",value:I}));return e.pos++,g.length==1?g[0]:{type:"choice",exprs:g}}}function BEg(e){let g=[[]];return t(i(e,0),I()),g;function I(){return g.push([])-1}function C(A,n,l){let s={term:l,to:n};return g[A].push(s),s}function t(A,n){A.forEach(l=>l.to=n)}function i(A,n){if(A.type=="choice")return A.exprs.reduce((l,s)=>l.concat(i(s,n)),[]);if(A.type=="seq")for(let l=0;;l++){let s=i(A.exprs[l],n);if(l==A.exprs.length-1)return s;t(s,n=I())}else if(A.type=="star"){let l=I();return C(n,l),t(i(A.expr,l),l),[C(l)]}else if(A.type=="plus"){let l=I();return t(i(A.expr,n),l),t(i(A.expr,l),l),[C(l)]}else{if(A.type=="opt")return[C(n)].concat(i(A.expr,n));if(A.type=="range"){let l=n;for(let s=0;s<A.min;s++){let a=I();t(i(A.expr,l),a),l=a}if(A.max==-1)t(i(A.expr,l),l);else for(let s=A.min;s<A.max;s++){let a=I();C(l,a),t(i(A.expr,l),a),l=a}return[C(l)]}else{if(A.type=="name")return[C(n,void 0,A.value)];throw new Error("Unknown expr type")}}}}function Yk(e,g){return g-e}function Vk(e,g){let I=[];return C(g),I.sort(Yk);function C(t){let i=e[t];if(i.length==1&&!i[0].term)return C(i[0].to);I.push(t);for(let A=0;A<i.length;A++){let{term:n,to:l}=i[A];!n&&I.indexOf(l)==-1&&C(l)}}}function yEg(e){let g=Object.create(null);return I(Vk(e,0));function I(C){let t=[];C.forEach(A=>{e[A].forEach(({term:n,to:l})=>{if(!n)return;let s;for(let a=0;a<t.length;a++)t[a][0]==n&&(s=t[a][1]);Vk(e,l).forEach(a=>{s||t.push([n,s=[]]),s.indexOf(a)==-1&&s.push(a)})})});let i=g[C.join(",")]=new kd(C.indexOf(e.length-1)>-1);for(let A=0;A<t.length;A++){let n=t[A][1].sort(Yk);i.next.push({type:t[A][0],next:g[n.join(",")]||I(n)})}return i}}function YEg(e,g){for(let I=0,C=[e];I<C.length;I++){let t=C[I],i=!t.validEnd,A=[];for(let n=0;n<t.next.length;n++){let{type:l,next:s}=t.next[n];A.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),C.indexOf(s)==-1&&C.push(s)}i&&g.err("Only non-generatable nodes ("+A.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Nk(e){let g=Object.create(null);for(let I in e){let C=e[I];if(!C.hasDefault)return null;g[I]=C.default}return g}function Mk(e,g){let I=Object.create(null);for(let C in e){let t=g&&g[C];if(t===void 0){let i=e[C];if(i.hasDefault)t=i.default;else throw new RangeError("No value supplied for attribute "+C)}I[C]=t}return I}function fk(e,g,I,C){for(let t in g)if(!(t in e))throw new RangeError(`Unsupported attribute ${t} for ${I} of type ${t}`);for(let t in e){let i=e[t];i.validate&&i.validate(g[t])}}function Rk(e,g){let I=Object.create(null);if(g)for(let C in g)I[C]=new NEg(e,C,g[C]);return I}let Xk=class n4{constructor(g,I,C){this.name=g,this.schema=I,this.spec=C,this.markSet=null,this.groups=C.group?C.group.split(" "):[],this.attrs=Rk(g,C.attrs),this.defaultAttrs=Nk(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(C.inline||g=="text"),this.isText=g=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kd.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(g){return this.groups.indexOf(g)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let g in this.attrs)if(this.attrs[g].isRequired)return!0;return!1}compatibleContent(g){return this==g||this.contentMatch.compatible(g.contentMatch)}computeAttrs(g){return!g&&this.defaultAttrs?this.defaultAttrs:Mk(this.attrs,g)}create(g=null,I,C){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xs(this,this.computeAttrs(g),Bg.from(I),se.setFrom(C))}createChecked(g=null,I,C){return I=Bg.from(I),this.checkContent(I),new Xs(this,this.computeAttrs(g),I,se.setFrom(C))}createAndFill(g=null,I,C){if(g=this.computeAttrs(g),I=Bg.from(I),I.size){let A=this.contentMatch.fillBefore(I);if(!A)return null;I=A.append(I)}let t=this.contentMatch.matchFragment(I),i=t&&t.fillBefore(Bg.empty,!0);return i?new Xs(this,g,I.append(i),se.setFrom(C)):null}validContent(g){let I=this.contentMatch.matchFragment(g);if(!I||!I.validEnd)return!1;for(let C=0;C<g.childCount;C++)if(!this.allowsMarks(g.child(C).marks))return!1;return!0}checkContent(g){if(!this.validContent(g))throw new RangeError(`Invalid content for node ${this.name}: ${g.toString().slice(0,50)}`)}checkAttrs(g){fk(this.attrs,g,"node",this.name)}allowsMarkType(g){return this.markSet==null||this.markSet.indexOf(g)>-1}allowsMarks(g){if(this.markSet==null)return!0;for(let I=0;I<g.length;I++)if(!this.allowsMarkType(g[I].type))return!1;return!0}allowedMarks(g){if(this.markSet==null)return g;let I;for(let C=0;C<g.length;C++)this.allowsMarkType(g[C].type)?I&&I.push(g[C]):I||(I=g.slice(0,C));return I?I.length?I:se.none:g}static compile(g,I){let C=Object.create(null);g.forEach((i,A)=>C[i]=new n4(i,I,A));let t=I.spec.topNode||"doc";if(!C[t])throw new RangeError("Schema is missing its top node type ('"+t+"')");if(!C.text)throw new RangeError("Every schema needs a 'text' type");for(let i in C.text.attrs)throw new RangeError("The text node type should not have attributes");return C}};function VEg(e,g,I){let C=I.split("|");return t=>{let i=t===null?"null":typeof t;if(C.indexOf(i)<0)throw new RangeError(`Expected value of type ${C} for attribute ${g} on type ${e}, got ${i}`)}}class NEg{constructor(g,I,C){this.hasDefault=Object.prototype.hasOwnProperty.call(C,"default"),this.default=C.default,this.validate=typeof C.validate=="string"?VEg(g,I,C.validate):C.validate}get isRequired(){return!this.hasDefault}}class Mp{constructor(g,I,C,t){this.name=g,this.rank=I,this.schema=C,this.spec=t,this.attrs=Rk(g,t.attrs),this.excluded=null;let i=Nk(this.attrs);this.instance=i?new se(this,i):null}create(g=null){return!g&&this.instance?this.instance:new se(this,Mk(this.attrs,g))}static compile(g,I){let C=Object.create(null),t=0;return g.forEach((i,A)=>C[i]=new Mp(i,t++,I,A)),C}removeFromSet(g){for(var I=0;I<g.length;I++)g[I].type==this&&(g=g.slice(0,I).concat(g.slice(I+1)),I--);return g}isInSet(g){for(let I=0;I<g.length;I++)if(g[I].type==this)return g[I]}checkAttrs(g){fk(this.attrs,g,"mark",this.name)}excludes(g){return this.excluded.indexOf(g)>-1}}class Hk{constructor(g){this.linebreakReplacement=null,this.cached=Object.create(null);let I=this.spec={};for(let t in g)I[t]=g[t];I.nodes=EC.from(g.nodes),I.marks=EC.from(g.marks||{}),this.nodes=Xk.compile(this.spec.nodes,this),this.marks=Mp.compile(this.spec.marks,this);let C=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let i=this.nodes[t],A=i.spec.content||"",n=i.spec.marks;if(i.contentMatch=C[A]||(C[A]=kd.parse(A,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=n=="_"?null:n?Dk(this,n.split(" ")):n==""||!i.inlineContent?[]:null}for(let t in this.marks){let i=this.marks[t],A=i.spec.excludes;i.excluded=A==null?[i]:A==""?[]:Dk(this,A.split(" "))}this.nodeFromJSON=t=>Xs.fromJSON(this,t),this.markFromJSON=t=>se.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(g,I=null,C,t){if(typeof g=="string")g=this.nodeType(g);else if(g instanceof Xk){if(g.schema!=this)throw new RangeError("Node type from different schema used ("+g.name+")")}else throw new RangeError("Invalid node type: "+g);return g.createChecked(I,C,t)}text(g,I){let C=this.nodes.text;return new Np(C,C.defaultAttrs,g,se.setFrom(I))}mark(g,I){return typeof g=="string"&&(g=this.marks[g]),g.create(I)}nodeType(g){let I=this.nodes[g];if(!I)throw new RangeError("Unknown node type: "+g);return I}}function Dk(e,g){let I=[];for(let C=0;C<g.length;C++){let t=g[C],i=e.marks[t],A=i;if(i)I.push(i);else for(let n in e.marks){let l=e.marks[n];(t=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(t)>-1)&&I.push(A=l)}if(!A)throw new SyntaxError("Unknown mark type: '"+g[C]+"'")}return I}function MEg(e){return e.tag!=null}function fEg(e){return e.style!=null}class Hs{constructor(g,I){this.schema=g,this.rules=I,this.tags=[],this.styles=[];let C=this.matchedStyles=[];I.forEach(t=>{if(MEg(t))this.tags.push(t);else if(fEg(t)){let i=/[^=]*/.exec(t.style)[0];C.indexOf(i)<0&&C.push(i),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let i=g.nodes[t.node];return i.contentMatch.matchType(i)})}parse(g,I={}){let C=new Fk(this,I,!1);return C.addAll(g,se.none,I.from,I.to),C.finish()}parseSlice(g,I={}){let C=new Fk(this,I,!0);return C.addAll(g,se.none,I.from,I.to),zg.maxOpen(C.finish())}matchTag(g,I,C){for(let t=C?this.tags.indexOf(C)+1:0;t<this.tags.length;t++){let i=this.tags[t];if(HEg(g,i.tag)&&(i.namespace===void 0||g.namespaceURI==i.namespace)&&(!i.context||I.matchesContext(i.context))){if(i.getAttrs){let A=i.getAttrs(g);if(A===!1)continue;i.attrs=A||void 0}return i}}}matchStyle(g,I,C,t){for(let i=t?this.styles.indexOf(t)+1:0;i<this.styles.length;i++){let A=this.styles[i],n=A.style;if(!(n.indexOf(g)!=0||A.context&&!C.matchesContext(A.context)||n.length>g.length&&(n.charCodeAt(g.length)!=61||n.slice(g.length+1)!=I))){if(A.getAttrs){let l=A.getAttrs(I);if(l===!1)continue;A.attrs=l||void 0}return A}}}static schemaRules(g){let I=[];function C(t){let i=t.priority==null?50:t.priority,A=0;for(;A<I.length;A++){let n=I[A];if((n.priority==null?50:n.priority)<i)break}I.splice(A,0,t)}for(let t in g.marks){let i=g.marks[t].spec.parseDOM;i&&i.forEach(A=>{C(A=zk(A)),A.mark||A.ignore||A.clearMark||(A.mark=t)})}for(let t in g.nodes){let i=g.nodes[t].spec.parseDOM;i&&i.forEach(A=>{C(A=zk(A)),A.node||A.ignore||A.mark||(A.node=t)})}return I}static fromSchema(g){return g.cached.domParser||(g.cached.domParser=new Hs(g,Hs.schemaRules(g)))}}const Sk={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},REg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Kk={ol:!0,ul:!0},gb=1,BN=2,Ib=4;function kk(e,g,I){return g!=null?(g?gb:0)|(g==="full"?BN:0):e&&e.whitespace=="pre"?gb|BN:I&~Ib}class fp{constructor(g,I,C,t,i,A){this.type=g,this.attrs=I,this.marks=C,this.solid=t,this.options=A,this.content=[],this.activeMarks=se.none,this.match=i||(A&Ib?null:g.contentMatch)}findWrapping(g){if(!this.match){if(!this.type)return[];let I=this.type.contentMatch.fillBefore(Bg.from(g));if(I)this.match=this.type.contentMatch.matchFragment(I);else{let C=this.type.contentMatch,t;return(t=C.findWrapping(g.type))?(this.match=C,t):null}}return this.match.findWrapping(g.type)}finish(g){if(!(this.options&gb)){let C=this.content[this.content.length-1],t;if(C&&C.isText&&(t=/[ \t\r\n\u000c]+$/.exec(C.text))){let i=C;C.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length))}}let I=Bg.from(this.content);return!g&&this.match&&(I=I.append(this.match.fillBefore(Bg.empty,!0))),this.type?this.type.create(this.attrs,I,this.marks):I}inlineContext(g){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:g.parentNode&&!Sk.hasOwnProperty(g.parentNode.nodeName.toLowerCase())}}class Fk{constructor(g,I,C){this.parser=g,this.options=I,this.isOpen=C,this.open=0,this.localPreserveWS=!1;let t=I.topNode,i,A=kk(null,I.preserveWhitespace,0)|(C?Ib:0);t?i=new fp(t.type,t.attrs,se.none,!0,I.topMatch||t.type.contentMatch,A):C?i=new fp(null,null,se.none,!0,null,A):i=new fp(g.schema.topNodeType,null,se.none,!0,null,A),this.nodes=[i],this.find=I.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(g,I){g.nodeType==3?this.addTextNode(g,I):g.nodeType==1&&this.addElement(g,I)}addTextNode(g,I){let C=g.nodeValue,t=this.top,i=t.options&BN?"full":this.localPreserveWS||(t.options&gb)>0;if(i==="full"||t.inlineContext(g)||/[^ \t\r\n\u000c]/.test(C)){if(i)i!=="full"?C=C.replace(/\r?\n|\r/g," "):C=C.replace(/\r\n?/g,`
1457
- `);else if(C=C.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(C)&&this.open==this.nodes.length-1){let A=t.content[t.content.length-1],n=g.previousSibling;(!A||n&&n.nodeName=="BR"||A.isText&&/[ \t\r\n\u000c]$/.test(A.text))&&(C=C.slice(1))}C&&this.insertNode(this.parser.schema.text(C),I,!/\S/.test(C)),this.findInText(g)}else this.findInside(g)}addElement(g,I,C){let t=this.localPreserveWS,i=this.top;(g.tagName=="PRE"||/pre/.test(g.style&&g.style.whiteSpace))&&(this.localPreserveWS=!0);let A=g.nodeName.toLowerCase(),n;Kk.hasOwnProperty(A)&&this.parser.normalizeLists&&XEg(g);let l=this.options.ruleFromNode&&this.options.ruleFromNode(g)||(n=this.parser.matchTag(g,this,C));g:if(l?l.ignore:REg.hasOwnProperty(A))this.findInside(g),this.ignoreFallback(g,I);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(g=l.skip);let s,a=this.needsBlock;if(Sk.hasOwnProperty(A))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),s=!0,i.type||(this.needsBlock=!0);else if(!g.firstChild){this.leafFallback(g,I);break g}let d=l&&l.skip?I:this.readStyles(g,I);d&&this.addAll(g,d),s&&this.sync(i),this.needsBlock=a}else{let s=this.readStyles(g,I);s&&this.addElementByRule(g,l,s,l.consuming===!1?n:void 0)}this.localPreserveWS=t}leafFallback(g,I){g.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(g.ownerDocument.createTextNode(`
1458
- `),I)}ignoreFallback(g,I){g.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),I,!0)}readStyles(g,I){let C=g.style;if(C&&C.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let i=this.parser.matchedStyles[t],A=C.getPropertyValue(i);if(A)for(let n=void 0;;){let l=this.parser.matchStyle(i,A,this,n);if(!l)break;if(l.ignore)return null;if(l.clearMark?I=I.filter(s=>!l.clearMark(s)):I=I.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)n=l;else break}}return I}addElementByRule(g,I,C,t){let i,A;if(I.node)if(A=this.parser.schema.nodes[I.node],A.isLeaf)this.insertNode(A.create(I.attrs),C,g.nodeName=="BR")||this.leafFallback(g,C);else{let l=this.enter(A,I.attrs||null,C,I.preserveWhitespace);l&&(i=!0,C=l)}else{let l=this.parser.schema.marks[I.mark];C=C.concat(l.create(I.attrs))}let n=this.top;if(A&&A.isLeaf)this.findInside(g);else if(t)this.addElement(g,C,t);else if(I.getContent)this.findInside(g),I.getContent(g,this.parser.schema).forEach(l=>this.insertNode(l,C,!1));else{let l=g;typeof I.contentElement=="string"?l=g.querySelector(I.contentElement):typeof I.contentElement=="function"?l=I.contentElement(g):I.contentElement&&(l=I.contentElement),this.findAround(g,l,!0),this.addAll(l,C),this.findAround(g,l,!1)}i&&this.sync(n)&&this.open--}addAll(g,I,C,t){let i=C||0;for(let A=C?g.childNodes[C]:g.firstChild,n=t==null?null:g.childNodes[t];A!=n;A=A.nextSibling,++i)this.findAtPoint(g,i),this.addDOM(A,I);this.findAtPoint(g,i)}findPlace(g,I,C){let t,i;for(let A=this.open,n=0;A>=0;A--){let l=this.nodes[A],s=l.findWrapping(g);if(s&&(!t||t.length>s.length+n)&&(t=s,i=l,!s.length))break;if(l.solid){if(C)break;n+=2}}if(!t)return null;this.sync(i);for(let A=0;A<t.length;A++)I=this.enterInner(t[A],null,I,!1);return I}insertNode(g,I,C){if(g.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(I=this.enterInner(i,null,I))}let t=this.findPlace(g,I,C);if(t){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(g.type));let A=se.none;for(let n of t.concat(g.marks))(i.type?i.type.allowsMarkType(n.type):Jk(n.type,g.type))&&(A=n.addToSet(A));return i.content.push(g.mark(A)),!0}return!1}enter(g,I,C,t){let i=this.findPlace(g.create(I),C,!1);return i&&(i=this.enterInner(g,I,C,!0,t)),i}enterInner(g,I,C,t=!1,i){this.closeExtra();let A=this.top;A.match=A.match&&A.match.matchType(g);let n=kk(g,i,A.options);A.options&Ib&&A.content.length==0&&(n|=Ib);let l=se.none;return C=C.filter(s=>(A.type?A.type.allowsMarkType(s.type):Jk(s.type,g))?(l=s.addToSet(l),!1):!0),this.nodes.push(new fp(g,I,l,t,null,n)),this.open++,C}closeExtra(g=!1){let I=this.nodes.length-1;if(I>this.open){for(;I>this.open;I--)this.nodes[I-1].content.push(this.nodes[I].finish(g));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(g){for(let I=this.open;I>=0;I--){if(this.nodes[I]==g)return this.open=I,!0;this.localPreserveWS&&(this.nodes[I].options|=gb)}return!1}get currentPos(){this.closeExtra();let g=0;for(let I=this.open;I>=0;I--){let C=this.nodes[I].content;for(let t=C.length-1;t>=0;t--)g+=C[t].nodeSize;I&&g++}return g}findAtPoint(g,I){if(this.find)for(let C=0;C<this.find.length;C++)this.find[C].node==g&&this.find[C].offset==I&&(this.find[C].pos=this.currentPos)}findInside(g){if(this.find)for(let I=0;I<this.find.length;I++)this.find[I].pos==null&&g.nodeType==1&&g.contains(this.find[I].node)&&(this.find[I].pos=this.currentPos)}findAround(g,I,C){if(g!=I&&this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&g.nodeType==1&&g.contains(this.find[t].node)&&I.compareDocumentPosition(this.find[t].node)&(C?2:4)&&(this.find[t].pos=this.currentPos)}findInText(g){if(this.find)for(let I=0;I<this.find.length;I++)this.find[I].node==g&&(this.find[I].pos=this.currentPos-(g.nodeValue.length-this.find[I].offset))}matchesContext(g){if(g.indexOf("|")>-1)return g.split(/\s*\|\s*/).some(this.matchesContext,this);let I=g.split("/"),C=this.options.context,t=!this.isOpen&&(!C||C.parent.type==this.nodes[0].type),i=-(C?C.depth+1:0)+(t?0:1),A=(n,l)=>{for(;n>=0;n--){let s=I[n];if(s==""){if(n==I.length-1||n==0)continue;for(;l>=i;l--)if(A(n-1,l))return!0;return!1}else{let a=l>0||l==0&&t?this.nodes[l].type:C&&l>=i?C.node(l-i).type:null;if(!a||a.name!=s&&!a.isInGroup(s))return!1;l--}}return!0};return A(I.length-1,this.open)}textblockFromContext(){let g=this.options.context;if(g)for(let I=g.depth;I>=0;I--){let C=g.node(I).contentMatchAt(g.indexAfter(I)).defaultType;if(C&&C.isTextblock&&C.defaultAttrs)return C}for(let I in this.parser.schema.nodes){let C=this.parser.schema.nodes[I];if(C.isTextblock&&C.defaultAttrs)return C}}}function XEg(e){for(let g=e.firstChild,I=null;g;g=g.nextSibling){let C=g.nodeType==1?g.nodeName.toLowerCase():null;C&&Kk.hasOwnProperty(C)&&I?(I.appendChild(g),g=I):C=="li"?I=g:C&&(I=null)}}function HEg(e,g){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,g)}function zk(e){let g={};for(let I in e)g[I]=e[I];return g}function Jk(e,g){let I=g.schema.nodes;for(let C in I){let t=I[C];if(!t.allowsMarkType(e))continue;let i=[],A=n=>{i.push(n);for(let l=0;l<n.edgeCount;l++){let{type:s,next:a}=n.edge(l);if(s==g||i.indexOf(a)<0&&A(a))return!0}};if(A(t.contentMatch))return!0}}class Fd{constructor(g,I){this.nodes=g,this.marks=I}serializeFragment(g,I={},C){C||(C=yN(I).createDocumentFragment());let t=C,i=[];return g.forEach(A=>{if(i.length||A.marks.length){let n=0,l=0;for(;n<i.length&&l<A.marks.length;){let s=A.marks[l];if(!this.marks[s.type.name]){l++;continue}if(!s.eq(i[n][0])||s.type.spec.spanning===!1)break;n++,l++}for(;n<i.length;)t=i.pop()[1];for(;l<A.marks.length;){let s=A.marks[l++],a=this.serializeMark(s,A.isInline,I);a&&(i.push([s,t]),t.appendChild(a.dom),t=a.contentDOM||a.dom)}}t.appendChild(this.serializeNodeInner(A,I))}),C}serializeNodeInner(g,I){let{dom:C,contentDOM:t}=Rp(yN(I),this.nodes[g.type.name](g),null,g.attrs);if(t){if(g.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(g.content,I,t)}return C}serializeNode(g,I={}){let C=this.serializeNodeInner(g,I);for(let t=g.marks.length-1;t>=0;t--){let i=this.serializeMark(g.marks[t],g.isInline,I);i&&((i.contentDOM||i.dom).appendChild(C),C=i.dom)}return C}serializeMark(g,I,C={}){let t=this.marks[g.type.name];return t&&Rp(yN(C),t(g,I),null,g.attrs)}static renderSpec(g,I,C=null,t){return Rp(g,I,C,t)}static fromSchema(g){return g.cached.domSerializer||(g.cached.domSerializer=new Fd(this.nodesFromSchema(g),this.marksFromSchema(g)))}static nodesFromSchema(g){let I=Lk(g.nodes);return I.text||(I.text=C=>C.text),I}static marksFromSchema(g){return Lk(g.marks)}}function Lk(e){let g={};for(let I in e){let C=e[I].spec.toDOM;C&&(g[I]=C)}return g}function yN(e){return e.document||window.document}const Tk=new WeakMap;function DEg(e){let g=Tk.get(e);return g===void 0&&Tk.set(e,g=SEg(e)),g}function SEg(e){let g=null;function I(C){if(C&&typeof C=="object")if(Array.isArray(C))if(typeof C[0]=="string")g||(g=[]),g.push(C);else for(let t=0;t<C.length;t++)I(C[t]);else for(let t in C)I(C[t])}return I(e),g}function Rp(e,g,I,C){if(typeof g=="string")return{dom:e.createTextNode(g)};if(g.nodeType!=null)return{dom:g};if(g.dom&&g.dom.nodeType!=null)return g;let t=g[0],i;if(typeof t!="string")throw new RangeError("Invalid array passed to renderSpec");if(C&&(i=DEg(C))&&i.indexOf(g)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let A=t.indexOf(" ");A>0&&(I=t.slice(0,A),t=t.slice(A+1));let n,l=I?e.createElementNS(I,t):e.createElement(t),s=g[1],a=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){a=2;for(let d in s)if(s[d]!=null){let m=d.indexOf(" ");m>0?l.setAttributeNS(d.slice(0,m),d.slice(m+1),s[d]):d=="style"&&l.style?l.style.cssText=s[d]:l.setAttribute(d,s[d])}}for(let d=a;d<g.length;d++){let m=g[d];if(m===0){if(d<g.length-1||d>a)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:u,contentDOM:h}=Rp(e,m,I,C);if(l.appendChild(u),h){if(n)throw new RangeError("Multiple content holes");n=h}}}return{dom:l,contentDOM:n}}const vk=65535,jk=Math.pow(2,16);function KEg(e,g){return e+g*jk}function xk(e){return e&vk}function kEg(e){return(e-(e&vk))/jk}const Ok=1,Qk=2,Xp=4,Uk=8;let YN=class{constructor(g,I,C){this.pos=g,this.delInfo=I,this.recover=C}get deleted(){return(this.delInfo&Uk)>0}get deletedBefore(){return(this.delInfo&(Ok|Xp))>0}get deletedAfter(){return(this.delInfo&(Qk|Xp))>0}get deletedAcross(){return(this.delInfo&Xp)>0}},zd=class Kh{constructor(g,I=!1){if(this.ranges=g,this.inverted=I,!g.length&&Kh.empty)return Kh.empty}recover(g){let I=0,C=xk(g);if(!this.inverted)for(let t=0;t<C;t++)I+=this.ranges[t*3+2]-this.ranges[t*3+1];return this.ranges[C*3]+I+kEg(g)}mapResult(g,I=1){return this._map(g,I,!1)}map(g,I=1){return this._map(g,I,!0)}_map(g,I,C){let t=0,i=this.inverted?2:1,A=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let l=this.ranges[n]-(this.inverted?t:0);if(l>g)break;let s=this.ranges[n+i],a=this.ranges[n+A],d=l+s;if(g<=d){let m=s?g==l?-1:g==d?1:I:I,u=l+t+(m<0?0:a);if(C)return u;let h=g==(I<0?l:d)?null:KEg(n/3,g-l),Z=g==l?Qk:g==d?Ok:Xp;return(I<0?g!=l:g!=d)&&(Z|=Uk),new YN(u,Z,h)}t+=a-s}return C?g+t:new YN(g+t,0,null)}touches(g,I){let C=0,t=xk(I),i=this.inverted?2:1,A=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let l=this.ranges[n]-(this.inverted?C:0);if(l>g)break;let s=this.ranges[n+i],a=l+s;if(g<=a&&n==t*3)return!0;C+=this.ranges[n+A]-s}return!1}forEach(g){let I=this.inverted?2:1,C=this.inverted?1:2;for(let t=0,i=0;t<this.ranges.length;t+=3){let A=this.ranges[t],n=A-(this.inverted?i:0),l=A+(this.inverted?0:i),s=this.ranges[t+I],a=this.ranges[t+C];g(n,n+s,l,l+a),i+=a-s}}invert(){return new Kh(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(g){return g==0?Kh.empty:new Kh(g<0?[0,-g,0]:[0,0,g])}};zd.empty=new zd([]);class eb{constructor(g,I,C=0,t=g?g.length:0){this.mirror=I,this.from=C,this.to=t,this._maps=g||[],this.ownData=!(g||I)}get maps(){return this._maps}slice(g=0,I=this.maps.length){return new eb(this._maps,this.mirror,g,I)}appendMap(g,I){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(g),I!=null&&this.setMirror(this._maps.length-1,I)}appendMapping(g){for(let I=0,C=this._maps.length;I<g._maps.length;I++){let t=g.getMirror(I);this.appendMap(g._maps[I],t!=null&&t<I?C+t:void 0)}}getMirror(g){if(this.mirror){for(let I=0;I<this.mirror.length;I++)if(this.mirror[I]==g)return this.mirror[I+(I%2?-1:1)]}}setMirror(g,I){this.mirror||(this.mirror=[]),this.mirror.push(g,I)}appendMappingInverted(g){for(let I=g.maps.length-1,C=this._maps.length+g._maps.length;I>=0;I--){let t=g.getMirror(I);this.appendMap(g._maps[I].invert(),t!=null&&t>I?C-t-1:void 0)}}invert(){let g=new eb;return g.appendMappingInverted(this),g}map(g,I=1){if(this.mirror)return this._map(g,I,!0);for(let C=this.from;C<this.to;C++)g=this._maps[C].map(g,I);return g}mapResult(g,I=1){return this._map(g,I,!1)}_map(g,I,C){let t=0;for(let i=this.from;i<this.to;i++){let A=this._maps[i],n=A.mapResult(g,I);if(n.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,g=this._maps[l].recover(n.recover);continue}}t|=n.delInfo,g=n.pos}return C?g:new YN(g,t,null)}}const VN=Object.create(null);let rt=class{getMap(){return zd.empty}merge(g){return null}static fromJSON(g,I){if(!I||!I.stepType)throw new RangeError("Invalid input for Step.fromJSON");let C=VN[I.stepType];if(!C)throw new RangeError(`No step type ${I.stepType} defined`);return C.fromJSON(g,I)}static jsonID(g,I){if(g in VN)throw new RangeError("Duplicate use of step JSON ID "+g);return VN[g]=I,I.prototype.jsonID=g,I}},Jt=class dw{constructor(g,I){this.doc=g,this.failed=I}static ok(g){return new dw(g,null)}static fail(g){return new dw(null,g)}static fromReplace(g,I,C,t){try{return dw.ok(g.replace(I,C,t))}catch(i){if(i instanceof yp)return dw.fail(i.message);throw i}}};function NN(e,g,I){let C=[];for(let t=0;t<e.childCount;t++){let i=e.child(t);i.content.size&&(i=i.copy(NN(i.content,g,i))),i.isInline&&(i=g(i,I,t)),C.push(i)}return Bg.fromArray(C)}let MN=class cw extends rt{constructor(g,I,C){super(),this.from=g,this.to=I,this.mark=C}apply(g){let I=g.slice(this.from,this.to),C=g.resolve(this.from),t=C.node(C.sharedDepth(this.to)),i=new zg(NN(I.content,(A,n)=>!A.isAtom||!n.type.allowsMarkType(this.mark.type)?A:A.mark(this.mark.addToSet(A.marks)),t),I.openStart,I.openEnd);return Jt.fromReplace(g,this.from,this.to,i)}invert(){return new hm(this.from,this.to,this.mark)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deleted&&C.deleted||I.pos>=C.pos?null:new cw(I.pos,C.pos,this.mark)}merge(g){return g instanceof cw&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new cw(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cw(I.from,I.to,g.markFromJSON(I.mark))}};rt.jsonID("addMark",MN);let hm=class rw extends rt{constructor(g,I,C){super(),this.from=g,this.to=I,this.mark=C}apply(g){let I=g.slice(this.from,this.to),C=new zg(NN(I.content,t=>t.mark(this.mark.removeFromSet(t.marks)),g),I.openStart,I.openEnd);return Jt.fromReplace(g,this.from,this.to,C)}invert(){return new MN(this.from,this.to,this.mark)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deleted&&C.deleted||I.pos>=C.pos?null:new rw(I.pos,C.pos,this.mark)}merge(g){return g instanceof rw&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new rw(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rw(I.from,I.to,g.markFromJSON(I.mark))}};rt.jsonID("removeMark",hm);let fN=class mw extends rt{constructor(g,I){super(),this.pos=g,this.mark=I}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at mark step's position");let C=I.type.create(I.attrs,null,this.mark.addToSet(I.marks));return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(C),0,I.isLeaf?0:1))}invert(g){let I=g.nodeAt(this.pos);if(I){let C=this.mark.addToSet(I.marks);if(C.length==I.marks.length){for(let t=0;t<I.marks.length;t++)if(!I.marks[t].isInSet(C))return new mw(this.pos,I.marks[t]);return new mw(this.pos,this.mark)}}return new Hp(this.pos,this.mark)}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new mw(I.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,I){if(typeof I.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new mw(I.pos,g.markFromJSON(I.mark))}};rt.jsonID("addNodeMark",fN);let Hp=class _R extends rt{constructor(g,I){super(),this.pos=g,this.mark=I}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at mark step's position");let C=I.type.create(I.attrs,null,this.mark.removeFromSet(I.marks));return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(C),0,I.isLeaf?0:1))}invert(g){let I=g.nodeAt(this.pos);return!I||!this.mark.isInSet(I.marks)?this:new fN(this.pos,this.mark)}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new _R(I.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,I){if(typeof I.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _R(I.pos,g.markFromJSON(I.mark))}};rt.jsonID("removeNodeMark",Hp);let dn=class Hr extends rt{constructor(g,I,C,t=!1){super(),this.from=g,this.to=I,this.slice=C,this.structure=t}apply(g){return this.structure&&RN(g,this.from,this.to)?Jt.fail("Structure replace would overwrite content"):Jt.fromReplace(g,this.from,this.to,this.slice)}getMap(){return new zd([this.from,this.to-this.from,this.slice.size])}invert(g){return new Hr(this.from,this.from+this.slice.size,g.slice(this.from,this.to))}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deletedAcross&&C.deletedAcross?null:new Hr(I.pos,Math.max(I.pos,C.pos),this.slice,this.structure)}merge(g){if(!(g instanceof Hr)||g.structure||this.structure)return null;if(this.from+this.slice.size==g.from&&!this.slice.openEnd&&!g.slice.openStart){let I=this.slice.size+g.slice.size==0?zg.empty:new zg(this.slice.content.append(g.slice.content),this.slice.openStart,g.slice.openEnd);return new Hr(this.from,this.to+(g.to-g.from),I,this.structure)}else if(g.to==this.from&&!this.slice.openStart&&!g.slice.openEnd){let I=this.slice.size+g.slice.size==0?zg.empty:new zg(g.slice.content.append(this.slice.content),g.slice.openStart,this.slice.openEnd);return new Hr(g.from,this.to,I,this.structure)}else return null}toJSON(){let g={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Hr(I.from,I.to,zg.fromJSON(g,I.slice),!!I.structure)}};rt.jsonID("replace",dn);let di=class Ly extends rt{constructor(g,I,C,t,i,A,n=!1){super(),this.from=g,this.to=I,this.gapFrom=C,this.gapTo=t,this.slice=i,this.insert=A,this.structure=n}apply(g){if(this.structure&&(RN(g,this.from,this.gapFrom)||RN(g,this.gapTo,this.to)))return Jt.fail("Structure gap-replace would overwrite content");let I=g.slice(this.gapFrom,this.gapTo);if(I.openStart||I.openEnd)return Jt.fail("Gap is not a flat range");let C=this.slice.insertAt(this.insert,I.content);return C?Jt.fromReplace(g,this.from,this.to,C):Jt.fail("Content does not fit in gap")}getMap(){return new zd([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(g){let I=this.gapTo-this.gapFrom;return new Ly(this.from,this.from+this.slice.size+I,this.from+this.insert,this.from+this.insert+I,g.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1),t=this.from==this.gapFrom?I.pos:g.map(this.gapFrom,-1),i=this.to==this.gapTo?C.pos:g.map(this.gapTo,1);return I.deletedAcross&&C.deletedAcross||t<I.pos||i>C.pos?null:new Ly(I.pos,C.pos,t,i,this.slice,this.insert,this.structure)}toJSON(){let g={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number"||typeof I.gapFrom!="number"||typeof I.gapTo!="number"||typeof I.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ly(I.from,I.to,I.gapFrom,I.gapTo,zg.fromJSON(g,I.slice),I.insert,!!I.structure)}};rt.jsonID("replaceAround",di);function RN(e,g,I){let C=e.resolve(g),t=I-g,i=C.depth;for(;t>0&&i>0&&C.indexAfter(i)==C.node(i).childCount;)i--,t--;if(t>0){let A=C.node(i).maybeChild(C.indexAfter(i));for(;t>0;){if(!A||A.isLeaf)return!0;A=A.firstChild,t--}}return!1}function FEg(e,g,I,C){let t=[],i=[],A,n;e.doc.nodesBetween(g,I,(l,s,a)=>{if(!l.isInline)return;let d=l.marks;if(!C.isInSet(d)&&a.type.allowsMarkType(C.type)){let m=Math.max(s,g),u=Math.min(s+l.nodeSize,I),h=C.addToSet(d);for(let Z=0;Z<d.length;Z++)d[Z].isInSet(h)||(A&&A.to==m&&A.mark.eq(d[Z])?A.to=u:t.push(A=new hm(m,u,d[Z])));n&&n.to==m?n.to=u:i.push(n=new MN(m,u,C))}}),t.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function zEg(e,g,I,C){let t=[],i=0;e.doc.nodesBetween(g,I,(A,n)=>{if(!A.isInline)return;i++;let l=null;if(C instanceof Mp){let s=A.marks,a;for(;a=C.isInSet(s);)(l||(l=[])).push(a),s=a.removeFromSet(s)}else C?C.isInSet(A.marks)&&(l=[C]):l=A.marks;if(l&&l.length){let s=Math.min(n+A.nodeSize,I);for(let a=0;a<l.length;a++){let d=l[a],m;for(let u=0;u<t.length;u++){let h=t[u];h.step==i-1&&d.eq(t[u].style)&&(m=h)}m?(m.to=s,m.step=i):t.push({style:d,from:Math.max(n,g),to:s,step:i})}}}),t.forEach(A=>e.step(new hm(A.from,A.to,A.style)))}function XN(e,g,I,C=I.contentMatch,t=!0){let i=e.doc.nodeAt(g),A=[],n=g+1;for(let l=0;l<i.childCount;l++){let s=i.child(l),a=n+s.nodeSize,d=C.matchType(s.type);if(!d)A.push(new dn(n,a,zg.empty));else{C=d;for(let m=0;m<s.marks.length;m++)I.allowsMarkType(s.marks[m].type)||e.step(new hm(n,a,s.marks[m]));if(t&&s.isText&&I.whitespace!="pre"){let m,u=/\r?\n|\r/g,h;for(;m=u.exec(s.text);)h||(h=new zg(Bg.from(I.schema.text(" ",I.allowedMarks(s.marks))),0,0)),A.push(new dn(n+m.index,n+m.index+m[0].length,h))}}n=a}if(!C.validEnd){let l=C.fillBefore(Bg.empty,!0);e.replace(n,n,new zg(l,0,0))}for(let l=A.length-1;l>=0;l--)e.step(A[l])}function JEg(e,g,I){return(g==0||e.canReplace(g,e.childCount))&&(I==e.childCount||e.canReplace(0,I))}function bm(e){let I=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let C=e.depth;;--C){let t=e.$from.node(C),i=e.$from.index(C),A=e.$to.indexAfter(C);if(C<e.depth&&t.canReplace(i,A,I))return C;if(C==0||t.type.spec.isolating||!JEg(t,i,A))break}return null}function LEg(e,g,I){let{$from:C,$to:t,depth:i}=g,A=C.before(i+1),n=t.after(i+1),l=A,s=n,a=Bg.empty,d=0;for(let h=i,Z=!1;h>I;h--)Z||C.index(h)>0?(Z=!0,a=Bg.from(C.node(h).copy(a)),d++):l--;let m=Bg.empty,u=0;for(let h=i,Z=!1;h>I;h--)Z||t.after(h+1)<t.end(h)?(Z=!0,m=Bg.from(t.node(h).copy(m)),u++):s++;e.step(new di(l,s,A,n,new zg(a.append(m),d,u),a.size-d,!0))}function HN(e,g,I=null,C=e){let t=TEg(e,g),i=t&&vEg(C,g);return i?t.map(Ek).concat({type:g,attrs:I}).concat(i.map(Ek)):null}function Ek(e){return{type:e,attrs:null}}function TEg(e,g){let{parent:I,startIndex:C,endIndex:t}=e,i=I.contentMatchAt(C).findWrapping(g);if(!i)return null;let A=i.length?i[0]:g;return I.canReplaceWith(C,t,A)?i:null}function vEg(e,g){let{parent:I,startIndex:C,endIndex:t}=e,i=I.child(C),A=g.contentMatch.findWrapping(i.type);if(!A)return null;let l=(A.length?A[A.length-1]:g).contentMatch;for(let s=C;l&&s<t;s++)l=l.matchType(I.child(s).type);return!l||!l.validEnd?null:A}function jEg(e,g,I){let C=Bg.empty;for(let A=I.length-1;A>=0;A--){if(C.size){let n=I[A].type.contentMatch.matchFragment(C);if(!n||!n.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}C=Bg.from(I[A].type.create(I[A].attrs,C))}let t=g.start,i=g.end;e.step(new di(t,i,t,i,new zg(C,0,0),I.length,!0))}function xEg(e,g,I,C,t){if(!C.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(g,I,(A,n)=>{let l=typeof t=="function"?t(A):t;if(A.isTextblock&&!A.hasMarkup(C,l)&&OEg(e.doc,e.mapping.slice(i).map(n),C)){let s=null;if(C.schema.linebreakReplacement){let u=C.whitespace=="pre",h=!!C.contentMatch.matchType(C.schema.linebreakReplacement);u&&!h?s=!1:!u&&h&&(s=!0)}s===!1&&_k(e,A,n,i),XN(e,e.mapping.slice(i).map(n,1),C,void 0,s===null);let a=e.mapping.slice(i),d=a.map(n,1),m=a.map(n+A.nodeSize,1);return e.step(new di(d,m,d+1,m-1,new zg(Bg.from(C.create(l,null,A.marks)),0,0),1,!0)),s===!0&&Pk(e,A,n,i),!1}})}function Pk(e,g,I,C){g.forEach((t,i)=>{if(t.isText){let A,n=/\r?\n|\r/g;for(;A=n.exec(t.text);){let l=e.mapping.slice(C).map(I+1+i+A.index);e.replaceWith(l,l+1,g.type.schema.linebreakReplacement.create())}}})}function _k(e,g,I,C){g.forEach((t,i)=>{if(t.type==t.type.schema.linebreakReplacement){let A=e.mapping.slice(C).map(I+1+i);e.replaceWith(A,A+1,g.type.schema.text(`
1459
- `))}})}function OEg(e,g,I){let C=e.resolve(g),t=C.index();return C.parent.canReplaceWith(t,t+1,I)}function QEg(e,g,I,C,t){let i=e.doc.nodeAt(g);if(!i)throw new RangeError("No node at given position");I||(I=i.type);let A=I.create(C,null,t||i.marks);if(i.isLeaf)return e.replaceWith(g,g+i.nodeSize,A);if(!I.validContent(i.content))throw new RangeError("Invalid content for node type "+I.name);e.step(new di(g,g+i.nodeSize,g+1,g+i.nodeSize-1,new zg(Bg.from(A),0,0),1,!0))}function Zm(e,g,I=1,C){let t=e.resolve(g),i=t.depth-I,A=C&&C[C.length-1]||t.parent;if(i<0||t.parent.type.spec.isolating||!t.parent.canReplace(t.index(),t.parent.childCount)||!A.type.validContent(t.parent.content.cutByIndex(t.index(),t.parent.childCount)))return!1;for(let s=t.depth-1,a=I-2;s>i;s--,a--){let d=t.node(s),m=t.index(s);if(d.type.spec.isolating)return!1;let u=d.content.cutByIndex(m,d.childCount),h=C&&C[a+1];h&&(u=u.replaceChild(0,h.type.create(h.attrs)));let Z=C&&C[a]||d;if(!d.canReplace(m+1,d.childCount)||!Z.type.validContent(u))return!1}let n=t.indexAfter(i),l=C&&C[0];return t.node(i).canReplaceWith(n,n,l?l.type:t.node(i+1).type)}function UEg(e,g,I=1,C){let t=e.doc.resolve(g),i=Bg.empty,A=Bg.empty;for(let n=t.depth,l=t.depth-I,s=I-1;n>l;n--,s--){i=Bg.from(t.node(n).copy(i));let a=C&&C[s];A=Bg.from(a?a.type.create(a.attrs,A):t.node(n).copy(A))}e.step(new dn(g,g,new zg(i.append(A),I,I),!0))}function Ds(e,g){let I=e.resolve(g),C=I.index();return $k(I.nodeBefore,I.nodeAfter)&&I.parent.canReplace(C,C+1)}function EEg(e,g){g.content.size||e.type.compatibleContent(g.type);let I=e.contentMatchAt(e.childCount),{linebreakReplacement:C}=e.type.schema;for(let t=0;t<g.childCount;t++){let i=g.child(t),A=i.type==C?e.type.schema.nodes.text:i.type;if(I=I.matchType(A),!I||!e.type.allowsMarks(i.marks))return!1}return I.validEnd}function $k(e,g){return!!(e&&g&&!e.isLeaf&&EEg(e,g))}function Dp(e,g,I=-1){let C=e.resolve(g);for(let t=C.depth;;t--){let i,A,n=C.index(t);if(t==C.depth?(i=C.nodeBefore,A=C.nodeAfter):I>0?(i=C.node(t+1),n++,A=C.node(t).maybeChild(n)):(i=C.node(t).maybeChild(n-1),A=C.node(t+1)),i&&!i.isTextblock&&$k(i,A)&&C.node(t).canReplace(n,n+1))return g;if(t==0)break;g=I<0?C.before(t):C.after(t)}}function PEg(e,g,I){let C=null,{linebreakReplacement:t}=e.doc.type.schema,i=e.doc.resolve(g-I),A=i.node().type;if(t&&A.inlineContent){let a=A.whitespace=="pre",d=!!A.contentMatch.matchType(t);a&&!d?C=!1:!a&&d&&(C=!0)}let n=e.steps.length;if(C===!1){let a=e.doc.resolve(g+I);_k(e,a.node(),a.before(),n)}A.inlineContent&&XN(e,g+I-1,A,i.node().contentMatchAt(i.index()),C==null);let l=e.mapping.slice(n),s=l.map(g-I);if(e.step(new dn(s,l.map(g+I,-1),zg.empty,!0)),C===!0){let a=e.doc.resolve(s);Pk(e,a.node(),a.before(),e.steps.length)}return e}function _Eg(e,g,I){let C=e.resolve(g);if(C.parent.canReplaceWith(C.index(),C.index(),I))return g;if(C.parentOffset==0)for(let t=C.depth-1;t>=0;t--){let i=C.index(t);if(C.node(t).canReplaceWith(i,i,I))return C.before(t+1);if(i>0)return null}if(C.parentOffset==C.parent.content.size)for(let t=C.depth-1;t>=0;t--){let i=C.indexAfter(t);if(C.node(t).canReplaceWith(i,i,I))return C.after(t+1);if(i<C.node(t).childCount)return null}return null}function qk(e,g,I){let C=e.resolve(g);if(!I.content.size)return g;let t=I.content;for(let i=0;i<I.openStart;i++)t=t.firstChild.content;for(let i=1;i<=(I.openStart==0&&I.size?2:1);i++)for(let A=C.depth;A>=0;A--){let n=A==C.depth?0:C.pos<=(C.start(A+1)+C.end(A+1))/2?-1:1,l=C.index(A)+(n>0?1:0),s=C.node(A),a=!1;if(i==1)a=s.canReplace(l,l,t);else{let d=s.contentMatchAt(l).findWrapping(t.firstChild.type);a=d&&s.canReplaceWith(l,l,d[0])}if(a)return n==0?C.pos:n<0?C.before(A+1):C.after(A+1)}return null}function Sp(e,g,I=g,C=zg.empty){if(g==I&&!C.size)return null;let t=e.resolve(g),i=e.resolve(I);return g3(t,i,C)?new dn(g,I,C):new $Eg(t,i,C).fit()}function g3(e,g,I){return!I.openStart&&!I.openEnd&&e.start()==g.start()&&e.parent.canReplace(e.index(),g.index(),I.content)}class $Eg{constructor(g,I,C){this.$from=g,this.$to=I,this.unplaced=C,this.frontier=[],this.placed=Bg.empty;for(let t=0;t<=g.depth;t++){let i=g.node(t);this.frontier.push({type:i.type,match:i.contentMatchAt(g.indexAfter(t))})}for(let t=g.depth;t>0;t--)this.placed=Bg.from(g.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let s=this.findFittable();s?this.placeNodes(s):this.openMore()||this.dropNode()}let g=this.mustMoveInline(),I=this.placed.size-this.depth-this.$from.depth,C=this.$from,t=this.close(g<0?this.$to:C.doc.resolve(g));if(!t)return null;let i=this.placed,A=C.depth,n=t.depth;for(;A&&n&&i.childCount==1;)i=i.firstChild.content,A--,n--;let l=new zg(i,A,n);return g>-1?new di(C.pos,g,this.$to.pos,this.$to.end(),l,I):l.size||C.pos!=this.$to.pos?new dn(C.pos,t.pos,l):null}findFittable(){let g=this.unplaced.openStart;for(let I=this.unplaced.content,C=0,t=this.unplaced.openEnd;C<g;C++){let i=I.firstChild;if(I.childCount>1&&(t=0),i.type.spec.isolating&&t<=C){g=C;break}I=i.content}for(let I=1;I<=2;I++)for(let C=I==1?g:this.unplaced.openStart;C>=0;C--){let t,i=null;C?(i=DN(this.unplaced.content,C-1).firstChild,t=i.content):t=this.unplaced.content;let A=t.firstChild;for(let n=this.depth;n>=0;n--){let{type:l,match:s}=this.frontier[n],a,d=null;if(I==1&&(A?s.matchType(A.type)||(d=s.fillBefore(Bg.from(A),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:C,frontierDepth:n,parent:i,inject:d};if(I==2&&A&&(a=s.findWrapping(A.type)))return{sliceDepth:C,frontierDepth:n,parent:i,wrap:a};if(i&&s.matchType(i.type))break}}}openMore(){let{content:g,openStart:I,openEnd:C}=this.unplaced,t=DN(g,I);return!t.childCount||t.firstChild.isLeaf?!1:(this.unplaced=new zg(g,I+1,Math.max(C,t.size+I>=g.size-C?I+1:0)),!0)}dropNode(){let{content:g,openStart:I,openEnd:C}=this.unplaced,t=DN(g,I);if(t.childCount<=1&&I>0){let i=g.size-I<=I+t.size;this.unplaced=new zg(Cb(g,I-1,1),I-1,i?I-1:C)}else this.unplaced=new zg(Cb(g,I,1),I,C)}placeNodes({sliceDepth:g,frontierDepth:I,parent:C,inject:t,wrap:i}){for(;this.depth>I;)this.closeFrontierNode();if(i)for(let Z=0;Z<i.length;Z++)this.openFrontierNode(i[Z]);let A=this.unplaced,n=C?C.content:A.content,l=A.openStart-g,s=0,a=[],{match:d,type:m}=this.frontier[I];if(t){for(let Z=0;Z<t.childCount;Z++)a.push(t.child(Z));d=d.matchFragment(t)}let u=n.size+g-(A.content.size-A.openEnd);for(;s<n.childCount;){let Z=n.child(s),G=d.matchType(Z.type);if(!G)break;s++,(s>1||l==0||Z.content.size)&&(d=G,a.push(I3(Z.mark(m.allowedMarks(Z.marks)),s==1?l:0,s==n.childCount?u:-1)))}let h=s==n.childCount;h||(u=-1),this.placed=tb(this.placed,I,Bg.from(a)),this.frontier[I].match=d,h&&u<0&&C&&C.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let Z=0,G=n;Z<u;Z++){let w=G.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),G=w.content}this.unplaced=h?g==0?zg.empty:new zg(Cb(A.content,g-1,1),g-1,u<0?A.openEnd:g-1):new zg(Cb(A.content,g,s),A.openStart,A.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let g=this.frontier[this.depth],I;if(!g.type.isTextblock||!SN(this.$to,this.$to.depth,g.type,g.match,!1)||this.$to.depth==this.depth&&(I=this.findCloseLevel(this.$to))&&I.depth==this.depth)return-1;let{depth:C}=this.$to,t=this.$to.after(C);for(;C>1&&t==this.$to.end(--C);)++t;return t}findCloseLevel(g){g:for(let I=Math.min(this.depth,g.depth);I>=0;I--){let{match:C,type:t}=this.frontier[I],i=I<g.depth&&g.end(I+1)==g.pos+(g.depth-(I+1)),A=SN(g,I,t,C,i);if(A){for(let n=I-1;n>=0;n--){let{match:l,type:s}=this.frontier[n],a=SN(g,n,s,l,!0);if(!a||a.childCount)continue g}return{depth:I,fit:A,move:i?g.doc.resolve(g.after(I+1)):g}}}}close(g){let I=this.findCloseLevel(g);if(!I)return null;for(;this.depth>I.depth;)this.closeFrontierNode();I.fit.childCount&&(this.placed=tb(this.placed,I.depth,I.fit)),g=I.move;for(let C=I.depth+1;C<=g.depth;C++){let t=g.node(C),i=t.type.contentMatch.fillBefore(t.content,!0,g.index(C));this.openFrontierNode(t.type,t.attrs,i)}return g}openFrontierNode(g,I=null,C){let t=this.frontier[this.depth];t.match=t.match.matchType(g),this.placed=tb(this.placed,this.depth,Bg.from(g.create(I,C))),this.frontier.push({type:g,match:g.contentMatch})}closeFrontierNode(){let I=this.frontier.pop().match.fillBefore(Bg.empty,!0);I.childCount&&(this.placed=tb(this.placed,this.frontier.length,I))}}function Cb(e,g,I){return g==0?e.cutByIndex(I,e.childCount):e.replaceChild(0,e.firstChild.copy(Cb(e.firstChild.content,g-1,I)))}function tb(e,g,I){return g==0?e.append(I):e.replaceChild(e.childCount-1,e.lastChild.copy(tb(e.lastChild.content,g-1,I)))}function DN(e,g){for(let I=0;I<g;I++)e=e.firstChild.content;return e}function I3(e,g,I){if(g<=0)return e;let C=e.content;return g>1&&(C=C.replaceChild(0,I3(C.firstChild,g-1,C.childCount==1?I-1:0))),g>0&&(C=e.type.contentMatch.fillBefore(C).append(C),I<=0&&(C=C.append(e.type.contentMatch.matchFragment(C).fillBefore(Bg.empty,!0)))),e.copy(C)}function SN(e,g,I,C,t){let i=e.node(g),A=t?e.indexAfter(g):e.index(g);if(A==i.childCount&&!I.compatibleContent(i.type))return null;let n=C.fillBefore(i.content,!0,A);return n&&!qEg(I,i.content,A)?n:null}function qEg(e,g,I){for(let C=I;C<g.childCount;C++)if(!e.allowsMarks(g.child(C).marks))return!0;return!1}function g7g(e){return e.spec.defining||e.spec.definingForContent}function I7g(e,g,I,C){if(!C.size)return e.deleteRange(g,I);let t=e.doc.resolve(g),i=e.doc.resolve(I);if(g3(t,i,C))return e.step(new dn(g,I,C));let A=C3(t,e.doc.resolve(I));A[A.length-1]==0&&A.pop();let n=-(t.depth+1);A.unshift(n);for(let m=t.depth,u=t.pos-1;m>0;m--,u--){let h=t.node(m).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;A.indexOf(m)>-1?n=m:t.before(m)==u&&A.splice(1,0,-m)}let l=A.indexOf(n),s=[],a=C.openStart;for(let m=C.content,u=0;;u++){let h=m.firstChild;if(s.push(h),u==C.openStart)break;m=h.content}for(let m=a-1;m>=0;m--){let u=s[m],h=g7g(u.type);if(h&&!u.sameMarkup(t.node(Math.abs(n)-1)))a=m;else if(h||!u.type.isTextblock)break}for(let m=C.openStart;m>=0;m--){let u=(m+a+1)%(C.openStart+1),h=s[u];if(h)for(let Z=0;Z<A.length;Z++){let G=A[(Z+l)%A.length],w=!0;G<0&&(w=!1,G=-G);let p=t.node(G-1),B=t.index(G-1);if(p.canReplaceWith(B,B,h.type,h.marks))return e.replace(t.before(G),w?i.after(G):I,new zg(e3(C.content,0,C.openStart,u),u,C.openEnd))}}let d=e.steps.length;for(let m=A.length-1;m>=0&&(e.replace(g,I,C),!(e.steps.length>d));m--){let u=A[m];u<0||(g=t.before(u),I=i.after(u))}}function e3(e,g,I,C,t){if(g<I){let i=e.firstChild;e=e.replaceChild(0,i.copy(e3(i.content,g+1,I,C,i)))}if(g>C){let i=t.contentMatchAt(0),A=i.fillBefore(e).append(e);e=A.append(i.matchFragment(A).fillBefore(Bg.empty,!0))}return e}function e7g(e,g,I,C){if(!C.isInline&&g==I&&e.doc.resolve(g).parent.content.size){let t=_Eg(e.doc,g,C.type);t!=null&&(g=I=t)}e.replaceRange(g,I,new zg(Bg.from(C),0,0))}function C7g(e,g,I){let C=e.doc.resolve(g),t=e.doc.resolve(I),i=C3(C,t);for(let A=0;A<i.length;A++){let n=i[A],l=A==i.length-1;if(l&&n==0||C.node(n).type.contentMatch.validEnd)return e.delete(C.start(n),t.end(n));if(n>0&&(l||C.node(n-1).canReplace(C.index(n-1),t.indexAfter(n-1))))return e.delete(C.before(n),t.after(n))}for(let A=1;A<=C.depth&&A<=t.depth;A++)if(g-C.start(A)==C.depth-A&&I>C.end(A)&&t.end(A)-I!=t.depth-A&&C.start(A-1)==t.start(A-1)&&C.node(A-1).canReplace(C.index(A-1),t.index(A-1)))return e.delete(C.before(A),I);e.delete(g,I)}function C3(e,g){let I=[],C=Math.min(e.depth,g.depth);for(let t=C;t>=0;t--){let i=e.start(t);if(i<e.pos-(e.depth-t)||g.end(t)>g.pos+(g.depth-t)||e.node(t).type.spec.isolating||g.node(t).type.spec.isolating)break;(i==g.start(t)||t==e.depth&&t==g.depth&&e.parent.inlineContent&&g.parent.inlineContent&&t&&g.start(t-1)==i-1)&&I.push(t)}return I}let t3=class Ty extends rt{constructor(g,I,C){super(),this.pos=g,this.attr=I,this.value=C}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at attribute step's position");let C=Object.create(null);for(let i in I.attrs)C[i]=I.attrs[i];C[this.attr]=this.value;let t=I.type.create(C,null,I.marks);return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(t),0,I.isLeaf?0:1))}getMap(){return zd.empty}invert(g){return new Ty(this.pos,this.attr,g.nodeAt(this.pos).attrs[this.attr])}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new Ty(I.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(g,I){if(typeof I.pos!="number"||typeof I.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ty(I.pos,I.attr,I.value)}};rt.jsonID("attr",t3);let i3=class $R extends rt{constructor(g,I){super(),this.attr=g,this.value=I}apply(g){let I=Object.create(null);for(let t in g.attrs)I[t]=g.attrs[t];I[this.attr]=this.value;let C=g.type.create(I,g.content,g.marks);return Jt.ok(C)}getMap(){return zd.empty}invert(g){return new $R(this.attr,g.attrs[this.attr])}map(g){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(g,I){if(typeof I.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $R(I.attr,I.value)}};rt.jsonID("docAttr",i3);let Gm=class extends Error{};Gm=function e(g){let I=Error.call(this,g);return I.__proto__=e.prototype,I},Gm.prototype=Object.create(Error.prototype),Gm.prototype.constructor=Gm,Gm.prototype.name="TransformError";class A3{constructor(g){this.doc=g,this.steps=[],this.docs=[],this.mapping=new eb}get before(){return this.docs.length?this.docs[0]:this.doc}step(g){let I=this.maybeStep(g);if(I.failed)throw new Gm(I.failed);return this}maybeStep(g){let I=g.apply(this.doc);return I.failed||this.addStep(g,I.doc),I}get docChanged(){return this.steps.length>0}addStep(g,I){this.docs.push(this.doc),this.steps.push(g),this.mapping.appendMap(g.getMap()),this.doc=I}replace(g,I=g,C=zg.empty){let t=Sp(this.doc,g,I,C);return t&&this.step(t),this}replaceWith(g,I,C){return this.replace(g,I,new zg(Bg.from(C),0,0))}delete(g,I){return this.replace(g,I,zg.empty)}insert(g,I){return this.replaceWith(g,g,I)}replaceRange(g,I,C){return I7g(this,g,I,C),this}replaceRangeWith(g,I,C){return e7g(this,g,I,C),this}deleteRange(g,I){return C7g(this,g,I),this}lift(g,I){return LEg(this,g,I),this}join(g,I=1){return PEg(this,g,I),this}wrap(g,I){return jEg(this,g,I),this}setBlockType(g,I=g,C,t=null){return xEg(this,g,I,C,t),this}setNodeMarkup(g,I,C=null,t){return QEg(this,g,I,C,t),this}setNodeAttribute(g,I,C){return this.step(new t3(g,I,C)),this}setDocAttribute(g,I){return this.step(new i3(g,I)),this}addNodeMark(g,I){return this.step(new fN(g,I)),this}removeNodeMark(g,I){let C=this.doc.nodeAt(g);if(!C)throw new RangeError("No node at position "+g);if(I instanceof se)I.isInSet(C.marks)&&this.step(new Hp(g,I));else{let t=C.marks,i,A=[];for(;i=I.isInSet(t);)A.push(new Hp(g,i)),t=i.removeFromSet(t);for(let n=A.length-1;n>=0;n--)this.step(A[n])}return this}split(g,I=1,C){return UEg(this,g,I,C),this}addMark(g,I,C){return FEg(this,g,I,C),this}removeMark(g,I,C){return zEg(this,g,I,C),this}clearIncompatible(g,I,C){return XN(this,g,I,C),this}}const KN=Object.create(null);let uI=class{constructor(g,I,C){this.$anchor=g,this.$head=I,this.ranges=C||[new t7g(g.min(I),g.max(I))]}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 g=this.ranges;for(let I=0;I<g.length;I++)if(g[I].$from.pos!=g[I].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(g,I=zg.empty){let C=I.content.lastChild,t=null;for(let n=0;n<I.openEnd;n++)t=C,C=C.lastChild;let i=g.steps.length,A=this.ranges;for(let n=0;n<A.length;n++){let{$from:l,$to:s}=A[n],a=g.mapping.slice(i);g.replaceRange(a.map(l.pos),a.map(s.pos),n?zg.empty:I),n==0&&s3(g,i,(C?C.isInline:t&&t.isTextblock)?-1:1)}}replaceWith(g,I){let C=g.steps.length,t=this.ranges;for(let i=0;i<t.length;i++){let{$from:A,$to:n}=t[i],l=g.mapping.slice(C),s=l.map(A.pos),a=l.map(n.pos);i?g.deleteRange(s,a):(g.replaceRangeWith(s,a,I),s3(g,C,I.isInline?-1:1))}}static findFrom(g,I,C=!1){let t=g.parent.inlineContent?new hI(g):wm(g.node(0),g.parent,g.pos,g.index(),I,C);if(t)return t;for(let i=g.depth-1;i>=0;i--){let A=I<0?wm(g.node(0),g.node(i),g.before(i+1),g.index(i),I,C):wm(g.node(0),g.node(i),g.after(i+1),g.index(i)+1,I,C);if(A)return A}return null}static near(g,I=1){return this.findFrom(g,I)||this.findFrom(g,-I)||new Ss(g.node(0))}static atStart(g){return wm(g,g,0,0,1)||new Ss(g)}static atEnd(g){return wm(g,g,g.content.size,g.childCount,-1)||new Ss(g)}static fromJSON(g,I){if(!I||!I.type)throw new RangeError("Invalid input for Selection.fromJSON");let C=KN[I.type];if(!C)throw new RangeError(`No selection type ${I.type} defined`);return C.fromJSON(g,I)}static jsonID(g,I){if(g in KN)throw new RangeError("Duplicate use of selection JSON ID "+g);return KN[g]=I,I.prototype.jsonID=g,I}getBookmark(){return hI.between(this.$anchor,this.$head).getBookmark()}};uI.prototype.visible=!0;let t7g=class{constructor(g,I){this.$from=g,this.$to=I}},n3=!1;function l3(e){!n3&&!e.parent.inlineContent&&(n3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}let hI=class uw extends uI{constructor(g,I=g){l3(g),l3(I),super(g,I)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(g,I){let C=g.resolve(I.map(this.head));if(!C.parent.inlineContent)return uI.near(C);let t=g.resolve(I.map(this.anchor));return new uw(t.parent.inlineContent?t:C,C)}replace(g,I=zg.empty){if(super.replace(g,I),I==zg.empty){let C=this.$from.marksAcross(this.$to);C&&g.ensureMarks(C)}}eq(g){return g instanceof uw&&g.anchor==this.anchor&&g.head==this.head}getBookmark(){return new o3(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(g,I){if(typeof I.anchor!="number"||typeof I.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new uw(g.resolve(I.anchor),g.resolve(I.head))}static create(g,I,C=I){let t=g.resolve(I);return new this(t,C==I?t:g.resolve(C))}static between(g,I,C){let t=g.pos-I.pos;if((!C||t)&&(C=t>=0?1:-1),!I.parent.inlineContent){let i=uI.findFrom(I,C,!0)||uI.findFrom(I,-C,!0);if(i)I=i.$head;else return uI.near(I,C)}return g.parent.inlineContent||(t==0?g=I:(g=(uI.findFrom(g,-C,!0)||uI.findFrom(g,C,!0)).$anchor,g.pos<I.pos!=t<0&&(g=I))),new uw(g,I)}};uI.jsonID("text",hI);let o3=class l4{constructor(g,I){this.anchor=g,this.head=I}map(g){return new l4(g.map(this.anchor),g.map(this.head))}resolve(g){return hI.between(g.resolve(this.anchor),g.resolve(this.head))}},eI=class hw extends uI{constructor(g){let I=g.nodeAfter,C=g.node(0).resolve(g.pos+I.nodeSize);super(g,C),this.node=I}map(g,I){let{deleted:C,pos:t}=I.mapResult(this.anchor),i=g.resolve(t);return C?uI.near(i):new hw(i)}content(){return new zg(Bg.from(this.node),0,0)}eq(g){return g instanceof hw&&g.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new i7g(this.anchor)}static fromJSON(g,I){if(typeof I.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new hw(g.resolve(I.anchor))}static create(g,I){return new hw(g.resolve(I))}static isSelectable(g){return!g.isText&&g.type.spec.selectable!==!1}};eI.prototype.visible=!1,uI.jsonID("node",eI);let i7g=class o4{constructor(g){this.anchor=g}map(g){let{deleted:I,pos:C}=g.mapResult(this.anchor);return I?new o3(C,C):new o4(C)}resolve(g){let I=g.resolve(this.anchor),C=I.nodeAfter;return C&&eI.isSelectable(C)?new eI(I):uI.near(I)}},Ss=class vy extends uI{constructor(g){super(g.resolve(0),g.resolve(g.content.size))}replace(g,I=zg.empty){if(I==zg.empty){g.delete(0,g.doc.content.size);let C=uI.atStart(g.doc);C.eq(g.selection)||g.setSelection(C)}else super.replace(g,I)}toJSON(){return{type:"all"}}static fromJSON(g){return new vy(g)}map(g){return new vy(g)}eq(g){return g instanceof vy}getBookmark(){return A7g}};uI.jsonID("all",Ss);const A7g={map(){return this},resolve(e){return new Ss(e)}};function wm(e,g,I,C,t,i=!1){if(g.inlineContent)return hI.create(e,I);for(let A=C-(t>0?0:1);t>0?A<g.childCount:A>=0;A+=t){let n=g.child(A);if(n.isAtom){if(!i&&eI.isSelectable(n))return eI.create(e,I-(t<0?n.nodeSize:0))}else{let l=wm(e,n,I+t,t<0?n.childCount:0,t,i);if(l)return l}I+=n.nodeSize*t}return null}function s3(e,g,I){let C=e.steps.length-1;if(C<g)return;let t=e.steps[C];if(!(t instanceof dn||t instanceof di))return;let i=e.mapping.maps[C],A;i.forEach((n,l,s,a)=>{A==null&&(A=a)}),e.setSelection(uI.near(e.doc.resolve(A),I))}const a3=1,Kp=2,d3=4;class n7g extends A3{constructor(g){super(g.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=g.selection,this.storedMarks=g.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(g){if(g.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=g,this.curSelectionFor=this.steps.length,this.updated=(this.updated|a3)&~Kp,this.storedMarks=null,this}get selectionSet(){return(this.updated&a3)>0}setStoredMarks(g){return this.storedMarks=g,this.updated|=Kp,this}ensureMarks(g){return se.sameSet(this.storedMarks||this.selection.$from.marks(),g)||this.setStoredMarks(g),this}addStoredMark(g){return this.ensureMarks(g.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(g){return this.ensureMarks(g.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Kp)>0}addStep(g,I){super.addStep(g,I),this.updated=this.updated&~Kp,this.storedMarks=null}setTime(g){return this.time=g,this}replaceSelection(g){return this.selection.replace(this,g),this}replaceSelectionWith(g,I=!0){let C=this.selection;return I&&(g=g.mark(this.storedMarks||(C.empty?C.$from.marks():C.$from.marksAcross(C.$to)||se.none))),C.replaceWith(this,g),this}deleteSelection(){return this.selection.replace(this),this}insertText(g,I,C){let t=this.doc.type.schema;if(I==null)return g?this.replaceSelectionWith(t.text(g),!0):this.deleteSelection();{if(C==null&&(C=I),C=C??I,!g)return this.deleteRange(I,C);let i=this.storedMarks;if(!i){let A=this.doc.resolve(I);i=C==I?A.marks():A.marksAcross(this.doc.resolve(C))}return this.replaceRangeWith(I,C,t.text(g,i)),this.selection.empty||this.setSelection(uI.near(this.selection.$to)),this}}setMeta(g,I){return this.meta[typeof g=="string"?g:g.key]=I,this}getMeta(g){return this.meta[typeof g=="string"?g:g.key]}get isGeneric(){for(let g in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=d3,this}get scrolledIntoView(){return(this.updated&d3)>0}}function c3(e,g){return!g||!e?e:e.bind(g)}let ib=class{constructor(g,I,C){this.name=g,this.init=c3(I.init,C),this.apply=c3(I.apply,C)}};const l7g=[new ib("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ib("selection",{init(e,g){return e.selection||uI.atStart(g.doc)},apply(e){return e.selection}}),new ib("storedMarks",{init(e){return e.storedMarks||null},apply(e,g,I,C){return C.selection.$cursor?e.storedMarks:null}}),new ib("scrollToSelection",{init(){return 0},apply(e,g){return e.scrolledIntoView?g+1:g}})];class kN{constructor(g,I){this.schema=g,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=l7g.slice(),I&&I.forEach(C=>{if(this.pluginsByKey[C.key])throw new RangeError("Adding different instances of a keyed plugin ("+C.key+")");this.plugins.push(C),this.pluginsByKey[C.key]=C,C.spec.state&&this.fields.push(new ib(C.key,C.spec.state,C))})}}class Wm{constructor(g){this.config=g}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(g){return this.applyTransaction(g).state}filterTransaction(g,I=-1){for(let C=0;C<this.config.plugins.length;C++)if(C!=I){let t=this.config.plugins[C];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,g,this))return!1}return!0}applyTransaction(g){if(!this.filterTransaction(g))return{state:this,transactions:[]};let I=[g],C=this.applyInner(g),t=null;for(;;){let i=!1;for(let A=0;A<this.config.plugins.length;A++){let n=this.config.plugins[A];if(n.spec.appendTransaction){let l=t?t[A].n:0,s=t?t[A].state:this,a=l<I.length&&n.spec.appendTransaction.call(n,l?I.slice(l):I,s,C);if(a&&C.filterTransaction(a,A)){if(a.setMeta("appendedTransaction",g),!t){t=[];for(let d=0;d<this.config.plugins.length;d++)t.push(d<A?{state:C,n:I.length}:{state:this,n:0})}I.push(a),C=C.applyInner(a),i=!0}t&&(t[A]={state:C,n:I.length})}}if(!i)return{state:C,transactions:I}}}applyInner(g){if(!g.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let I=new Wm(this.config),C=this.config.fields;for(let t=0;t<C.length;t++){let i=C[t];I[i.name]=i.apply(g,this[i.name],this,I)}return I}get tr(){return new n7g(this)}static create(g){let I=new kN(g.doc?g.doc.type.schema:g.schema,g.plugins),C=new Wm(I);for(let t=0;t<I.fields.length;t++)C[I.fields[t].name]=I.fields[t].init(g,C);return C}reconfigure(g){let I=new kN(this.schema,g.plugins),C=I.fields,t=new Wm(I);for(let i=0;i<C.length;i++){let A=C[i].name;t[A]=this.hasOwnProperty(A)?this[A]:C[i].init(g,t)}return t}toJSON(g){let I={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(I.storedMarks=this.storedMarks.map(C=>C.toJSON())),g&&typeof g=="object")for(let C in g){if(C=="doc"||C=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let t=g[C],i=t.spec.state;i&&i.toJSON&&(I[C]=i.toJSON.call(t,this[t.key]))}return I}static fromJSON(g,I,C){if(!I)throw new RangeError("Invalid input for EditorState.fromJSON");if(!g.schema)throw new RangeError("Required config field 'schema' missing");let t=new kN(g.schema,g.plugins),i=new Wm(t);return t.fields.forEach(A=>{if(A.name=="doc")i.doc=Xs.fromJSON(g.schema,I.doc);else if(A.name=="selection")i.selection=uI.fromJSON(i.doc,I.selection);else if(A.name=="storedMarks")I.storedMarks&&(i.storedMarks=I.storedMarks.map(g.schema.markFromJSON));else{if(C)for(let n in C){let l=C[n],s=l.spec.state;if(l.key==A.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(I,n)){i[A.name]=s.fromJSON.call(l,g,I[n],i);return}}i[A.name]=A.init(g,i)}}),i}}function r3(e,g,I){for(let C in e){let t=e[C];t instanceof Function?t=t.bind(g):C=="handleDOMEvents"&&(t=r3(t,g,{})),I[C]=t}return I}class je{constructor(g){this.spec=g,this.props={},g.props&&r3(g.props,this,this.props),this.key=g.key?g.key.key:m3("plugin")}getState(g){return g[this.key]}}const FN=Object.create(null);function m3(e){return e in FN?e+"$"+ ++FN[e]:(FN[e]=0,e+"$")}class HC{constructor(g="key"){this.key=m3(g)}get(g){return g.config.pluginsByKey[this.key]}getState(g){return g[this.key]}}const PC=function(e){for(var g=0;;g++)if(e=e.previousSibling,!e)return g},pm=function(e){let g=e.assignedSlot||e.parentNode;return g&&g.nodeType==11?g.host:g};let zN=null;const El=function(e,g,I){let C=zN||(zN=document.createRange());return C.setEnd(e,I??e.nodeValue.length),C.setStart(e,g||0),C},o7g=function(){zN=null},Jd=function(e,g,I,C){return I&&(u3(e,g,I,C,-1)||u3(e,g,I,C,1))},s7g=/^(img|br|input|textarea|hr)$/i;function u3(e,g,I,C,t){for(var i;;){if(e==I&&g==C)return!0;if(g==(t<0?0:ZA(e))){let A=e.parentNode;if(!A||A.nodeType!=1||Ab(e)||s7g.test(e.nodeName)||e.contentEditable=="false")return!1;g=PC(e)+(t<0?0:1),e=A}else if(e.nodeType==1){let A=e.childNodes[g+(t<0?-1:0)];if(A.nodeType==1&&A.contentEditable=="false")if(!((i=A.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)g+=t;else return!1;else e=A,g=t<0?ZA(e):0}else return!1}}function ZA(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function a7g(e,g){for(;;){if(e.nodeType==3&&g)return e;if(e.nodeType==1&&g>0){if(e.contentEditable=="false")return null;e=e.childNodes[g-1],g=ZA(e)}else if(e.parentNode&&!Ab(e))g=PC(e),e=e.parentNode;else return null}}function d7g(e,g){for(;;){if(e.nodeType==3&&g<e.nodeValue.length)return e;if(e.nodeType==1&&g<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[g],g=0}else if(e.parentNode&&!Ab(e))g=PC(e)+1,e=e.parentNode;else return null}}function c7g(e,g,I){for(let C=g==0,t=g==ZA(e);C||t;){if(e==I)return!0;let i=PC(e);if(e=e.parentNode,!e)return!1;C=C&&i==0,t=t&&i==ZA(e)}}function Ab(e){let g;for(let I=e;I&&!(g=I.pmViewDesc);I=I.parentNode);return g&&g.node&&g.node.isBlock&&(g.dom==e||g.contentDOM==e)}const kp=function(e){return e.focusNode&&Jd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ld(e,g){let I=document.createEvent("Event");return I.initEvent("keydown",!0,!0),I.keyCode=e,I.key=I.code=g,I}function r7g(e){let g=e.activeElement;for(;g&&g.shadowRoot;)g=g.shadowRoot.activeElement;return g}function m7g(e,g,I){if(e.caretPositionFromPoint)try{let C=e.caretPositionFromPoint(g,I);if(C)return{node:C.offsetNode,offset:Math.min(ZA(C.offsetNode),C.offset)}}catch{}if(e.caretRangeFromPoint){let C=e.caretRangeFromPoint(g,I);if(C)return{node:C.startContainer,offset:Math.min(ZA(C.startContainer),C.startOffset)}}}const Il=typeof navigator<"u"?navigator:null,h3=typeof document<"u"?document:null,Ks=Il&&Il.userAgent||"",JN=/Edge\/(\d+)/.exec(Ks),b3=/MSIE \d/.exec(Ks),LN=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ks),ci=!!(b3||LN||JN),ks=b3?document.documentMode:LN?+LN[1]:JN?+JN[1]:0,GA=!ci&&/gecko\/(\d+)/i.test(Ks);GA&&+(/Firefox\/(\d+)/.exec(Ks)||[0,0])[1];const TN=!ci&&/Chrome\/(\d+)/.exec(Ks),mt=!!TN,Z3=TN?+TN[1]:0,Lt=!ci&&!!Il&&/Apple Computer/.test(Il.vendor),Bm=Lt&&(/Mobile\/\w+/.test(Ks)||!!Il&&Il.maxTouchPoints>2),wA=Bm||(Il?/Mac/.test(Il.platform):!1),u7g=Il?/Win/.test(Il.platform):!1,Pl=/Android \d/.test(Ks),nb=!!h3&&"webkitFontSmoothing"in h3.documentElement.style,h7g=nb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function b7g(e){let g=e.defaultView&&e.defaultView.visualViewport;return g?{left:0,right:g.width,top:0,bottom:g.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _l(e,g){return typeof e=="number"?e:e[g]}function Z7g(e){let g=e.getBoundingClientRect(),I=g.width/e.offsetWidth||1,C=g.height/e.offsetHeight||1;return{left:g.left,right:g.left+e.clientWidth*I,top:g.top,bottom:g.top+e.clientHeight*C}}function G3(e,g,I){let C=e.someProp("scrollThreshold")||0,t=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let A=I||e.dom;A;){if(A.nodeType!=1){A=pm(A);continue}let n=A,l=n==i.body,s=l?b7g(i):Z7g(n),a=0,d=0;if(g.top<s.top+_l(C,"top")?d=-(s.top-g.top+_l(t,"top")):g.bottom>s.bottom-_l(C,"bottom")&&(d=g.bottom-g.top>s.bottom-s.top?g.top+_l(t,"top")-s.top:g.bottom-s.bottom+_l(t,"bottom")),g.left<s.left+_l(C,"left")?a=-(s.left-g.left+_l(t,"left")):g.right>s.right-_l(C,"right")&&(a=g.right-s.right+_l(t,"right")),a||d)if(l)i.defaultView.scrollBy(a,d);else{let u=n.scrollLeft,h=n.scrollTop;d&&(n.scrollTop+=d),a&&(n.scrollLeft+=a);let Z=n.scrollLeft-u,G=n.scrollTop-h;g={left:g.left-Z,top:g.top-G,right:g.right-Z,bottom:g.bottom-G}}let m=l?"fixed":getComputedStyle(A).position;if(/^(fixed|sticky)$/.test(m))break;A=m=="absolute"?A.offsetParent:pm(A)}}function G7g(e){let g=e.dom.getBoundingClientRect(),I=Math.max(0,g.top),C,t;for(let i=(g.left+g.right)/2,A=I+1;A<Math.min(innerHeight,g.bottom);A+=5){let n=e.root.elementFromPoint(i,A);if(!n||n==e.dom||!e.dom.contains(n))continue;let l=n.getBoundingClientRect();if(l.top>=I-20){C=n,t=l.top;break}}return{refDOM:C,refTop:t,stack:w3(e.dom)}}function w3(e){let g=[],I=e.ownerDocument;for(let C=e;C&&(g.push({dom:C,top:C.scrollTop,left:C.scrollLeft}),e!=I);C=pm(C));return g}function w7g({refDOM:e,refTop:g,stack:I}){let C=e?e.getBoundingClientRect().top:0;W3(I,C==0?0:C-g)}function W3(e,g){for(let I=0;I<e.length;I++){let{dom:C,top:t,left:i}=e[I];C.scrollTop!=t+g&&(C.scrollTop=t+g),C.scrollLeft!=i&&(C.scrollLeft=i)}}let ym=null;function W7g(e){if(e.setActive)return e.setActive();if(ym)return e.focus(ym);let g=w3(e);e.focus(ym==null?{get preventScroll(){return ym={preventScroll:!0},!0}}:void 0),ym||(ym=!1,W3(g,0))}function p3(e,g){let I,C=2e8,t,i=0,A=g.top,n=g.top,l,s;for(let a=e.firstChild,d=0;a;a=a.nextSibling,d++){let m;if(a.nodeType==1)m=a.getClientRects();else if(a.nodeType==3)m=El(a).getClientRects();else continue;for(let u=0;u<m.length;u++){let h=m[u];if(h.top<=A&&h.bottom>=n){A=Math.max(h.bottom,A),n=Math.min(h.top,n);let Z=h.left>g.left?h.left-g.left:h.right<g.left?g.left-h.right:0;if(Z<C){I=a,C=Z,t=Z&&I.nodeType==3?{left:h.right<g.left?h.right:h.left,top:g.top}:g,a.nodeType==1&&Z&&(i=d+(g.left>=(h.left+h.right)/2?1:0));continue}}else h.top>g.top&&!l&&h.left<=g.left&&h.right>=g.left&&(l=a,s={left:Math.max(h.left,Math.min(h.right,g.left)),top:h.top});!I&&(g.left>=h.right&&g.top>=h.top||g.left>=h.left&&g.top>=h.bottom)&&(i=d+1)}}return!I&&l&&(I=l,t=s,C=0),I&&I.nodeType==3?p7g(I,t):!I||C&&I.nodeType==1?{node:e,offset:i}:p3(I,t)}function p7g(e,g){let I=e.nodeValue.length,C=document.createRange();for(let t=0;t<I;t++){C.setEnd(e,t+1),C.setStart(e,t);let i=Fs(C,1);if(i.top!=i.bottom&&vN(g,i))return{node:e,offset:t+(g.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function vN(e,g){return e.left>=g.left-1&&e.left<=g.right+1&&e.top>=g.top-1&&e.top<=g.bottom+1}function B7g(e,g){let I=e.parentNode;return I&&/^li$/i.test(I.nodeName)&&g.left<e.getBoundingClientRect().left?I:e}function y7g(e,g,I){let{node:C,offset:t}=p3(g,I),i=-1;if(C.nodeType==1&&!C.firstChild){let A=C.getBoundingClientRect();i=A.left!=A.right&&I.left>(A.left+A.right)/2?1:-1}return e.docView.posFromDOM(C,t,i)}function Y7g(e,g,I,C){let t=-1;for(let i=g,A=!1;i!=e.dom;){let n=e.docView.nearestDesc(i,!0),l;if(!n)return null;if(n.dom.nodeType==1&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((l=n.dom.getBoundingClientRect()).width||l.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!A&&l.left>C.left||l.top>C.top?t=n.posBefore:(!A&&l.right<C.left||l.bottom<C.top)&&(t=n.posAfter),A=!0),!n.contentDOM&&t<0&&!n.node.isText))return(n.node.isBlock?C.top<(l.top+l.bottom)/2:C.left<(l.left+l.right)/2)?n.posBefore:n.posAfter;i=n.dom.parentNode}return t>-1?t:e.docView.posFromDOM(g,I,-1)}function B3(e,g,I){let C=e.childNodes.length;if(C&&I.top<I.bottom)for(let t=Math.max(0,Math.min(C-1,Math.floor(C*(g.top-I.top)/(I.bottom-I.top))-2)),i=t;;){let A=e.childNodes[i];if(A.nodeType==1){let n=A.getClientRects();for(let l=0;l<n.length;l++){let s=n[l];if(vN(g,s))return B3(A,g,s)}}if((i=(i+1)%C)==t)break}return e}function V7g(e,g){let I=e.dom.ownerDocument,C,t=0,i=m7g(I,g.left,g.top);i&&({node:C,offset:t}=i);let A=(e.root.elementFromPoint?e.root:I).elementFromPoint(g.left,g.top),n;if(!A||!e.dom.contains(A.nodeType!=1?A.parentNode:A)){let s=e.dom.getBoundingClientRect();if(!vN(g,s)||(A=B3(e.dom,g,s),!A))return null}if(Lt)for(let s=A;C&&s;s=pm(s))s.draggable&&(C=void 0);if(A=B7g(A,g),C){if(GA&&C.nodeType==1&&(t=Math.min(t,C.childNodes.length),t<C.childNodes.length)){let a=C.childNodes[t],d;a.nodeName=="IMG"&&(d=a.getBoundingClientRect()).right<=g.left&&d.bottom>g.top&&t++}let s;nb&&t&&C.nodeType==1&&(s=C.childNodes[t-1]).nodeType==1&&s.contentEditable=="false"&&s.getBoundingClientRect().top>=g.top&&t--,C==e.dom&&t==C.childNodes.length-1&&C.lastChild.nodeType==1&&g.top>C.lastChild.getBoundingClientRect().bottom?n=e.state.doc.content.size:(t==0||C.nodeType!=1||C.childNodes[t-1].nodeName!="BR")&&(n=Y7g(e,C,t,g))}n==null&&(n=y7g(e,A,g));let l=e.docView.nearestDesc(A,!0);return{pos:n,inside:l?l.posAtStart-l.border:-1}}function y3(e){return e.top<e.bottom||e.left<e.right}function Fs(e,g){let I=e.getClientRects();if(I.length){let C=I[g<0?0:I.length-1];if(y3(C))return C}return Array.prototype.find.call(I,y3)||e.getBoundingClientRect()}const N7g=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y3(e,g,I){let{node:C,offset:t,atom:i}=e.docView.domFromPos(g,I<0?-1:1),A=nb||GA;if(C.nodeType==3)if(A&&(N7g.test(C.nodeValue)||(I<0?!t:t==C.nodeValue.length))){let l=Fs(El(C,t,t),I);if(GA&&t&&/\s/.test(C.nodeValue[t-1])&&t<C.nodeValue.length){let s=Fs(El(C,t-1,t-1),-1);if(s.top==l.top){let a=Fs(El(C,t,t+1),-1);if(a.top!=l.top)return lb(a,a.left<s.left)}}return l}else{let l=t,s=t,a=I<0?1:-1;return I<0&&!t?(s++,a=-1):I>=0&&t==C.nodeValue.length?(l--,a=1):I<0?l--:s++,lb(Fs(El(C,l,s),a),a<0)}if(!e.state.doc.resolve(g-(i||0)).parent.inlineContent){if(i==null&&t&&(I<0||t==ZA(C))){let l=C.childNodes[t-1];if(l.nodeType==1)return jN(l.getBoundingClientRect(),!1)}if(i==null&&t<ZA(C)){let l=C.childNodes[t];if(l.nodeType==1)return jN(l.getBoundingClientRect(),!0)}return jN(C.getBoundingClientRect(),I>=0)}if(i==null&&t&&(I<0||t==ZA(C))){let l=C.childNodes[t-1],s=l.nodeType==3?El(l,ZA(l)-(A?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(s)return lb(Fs(s,1),!1)}if(i==null&&t<ZA(C)){let l=C.childNodes[t];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let s=l?l.nodeType==3?El(l,0,A?0:1):l.nodeType==1?l:null:null;if(s)return lb(Fs(s,-1),!0)}return lb(Fs(C.nodeType==3?El(C):C,-I),I>=0)}function lb(e,g){if(e.width==0)return e;let I=g?e.left:e.right;return{top:e.top,bottom:e.bottom,left:I,right:I}}function jN(e,g){if(e.height==0)return e;let I=g?e.top:e.bottom;return{top:I,bottom:I,left:e.left,right:e.right}}function V3(e,g,I){let C=e.state,t=e.root.activeElement;C!=g&&e.updateState(g),t!=e.dom&&e.focus();try{return I()}finally{C!=g&&e.updateState(C),t!=e.dom&&t&&t.focus()}}function M7g(e,g,I){let C=g.selection,t=I=="up"?C.$from:C.$to;return V3(e,g,()=>{let{node:i}=e.docView.domFromPos(t.pos,I=="up"?-1:1);for(;;){let n=e.docView.nearestDesc(i,!0);if(!n)break;if(n.node.isBlock){i=n.contentDOM||n.dom;break}i=n.dom.parentNode}let A=Y3(e,t.pos,1);for(let n=i.firstChild;n;n=n.nextSibling){let l;if(n.nodeType==1)l=n.getClientRects();else if(n.nodeType==3)l=El(n,0,n.nodeValue.length).getClientRects();else continue;for(let s=0;s<l.length;s++){let a=l[s];if(a.bottom>a.top+1&&(I=="up"?A.top-a.top>(a.bottom-A.top)*2:a.bottom-A.bottom>(A.bottom-a.top)*2))return!1}}return!0})}const f7g=/[\u0590-\u08ac]/;function R7g(e,g,I){let{$head:C}=g.selection;if(!C.parent.isTextblock)return!1;let t=C.parentOffset,i=!t,A=t==C.parent.content.size,n=e.domSelection();return n?!f7g.test(C.parent.textContent)||!n.modify?I=="left"||I=="backward"?i:A:V3(e,g,()=>{let{focusNode:l,focusOffset:s,anchorNode:a,anchorOffset:d}=e.domSelectionRange(),m=n.caretBidiLevel;n.modify("move",I,"character");let u=C.depth?e.docView.domAfterPos(C.before()):e.dom,{focusNode:h,focusOffset:Z}=e.domSelectionRange(),G=h&&!u.contains(h.nodeType==1?h:h.parentNode)||l==h&&s==Z;try{n.collapse(a,d),l&&(l!=a||s!=d)&&n.extend&&n.extend(l,s)}catch{}return m!=null&&(n.caretBidiLevel=m),G}):C.pos==C.start()||C.pos==C.end()}let N3=null,M3=null,f3=!1;function X7g(e,g,I){return N3==g&&M3==I?f3:(N3=g,M3=I,f3=I=="up"||I=="down"?M7g(e,g,I):R7g(e,g,I))}const WA=0,R3=1,Td=2,el=3;class ob{constructor(g,I,C,t){this.parent=g,this.children=I,this.dom=C,this.contentDOM=t,this.dirty=WA,C.pmViewDesc=this}matchesWidget(g){return!1}matchesMark(g){return!1}matchesNode(g,I,C){return!1}matchesHack(g){return!1}parseRule(){return null}stopEvent(g){return!1}get size(){let g=0;for(let I=0;I<this.children.length;I++)g+=this.children[I].size;return g}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let g=0;g<this.children.length;g++)this.children[g].destroy()}posBeforeChild(g){for(let I=0,C=this.posAtStart;;I++){let t=this.children[I];if(t==g)return C;C+=t.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(g,I,C){if(this.contentDOM&&this.contentDOM.contains(g.nodeType==1?g:g.parentNode))if(C<0){let i,A;if(g==this.contentDOM)i=g.childNodes[I-1];else{for(;g.parentNode!=this.contentDOM;)g=g.parentNode;i=g.previousSibling}for(;i&&!((A=i.pmViewDesc)&&A.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(A)+A.size:this.posAtStart}else{let i,A;if(g==this.contentDOM)i=g.childNodes[I];else{for(;g.parentNode!=this.contentDOM;)g=g.parentNode;i=g.nextSibling}for(;i&&!((A=i.pmViewDesc)&&A.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(A):this.posAtEnd}let t;if(g==this.dom&&this.contentDOM)t=I>PC(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))t=g.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(I==0)for(let i=g;;i=i.parentNode){if(i==this.dom){t=!1;break}if(i.previousSibling)break}if(t==null&&I==g.childNodes.length)for(let i=g;;i=i.parentNode){if(i==this.dom){t=!0;break}if(i.nextSibling)break}}return t??C>0?this.posAtEnd:this.posAtStart}nearestDesc(g,I=!1){for(let C=!0,t=g;t;t=t.parentNode){let i=this.getDesc(t),A;if(i&&(!I||i.node))if(C&&(A=i.nodeDOM)&&!(A.nodeType==1?A.contains(g.nodeType==1?g:g.parentNode):A==g))C=!1;else return i}}getDesc(g){let I=g.pmViewDesc;for(let C=I;C;C=C.parent)if(C==this)return I}posFromDOM(g,I,C){for(let t=g;t;t=t.parentNode){let i=this.getDesc(t);if(i)return i.localPosFromDOM(g,I,C)}return-1}descAt(g){for(let I=0,C=0;I<this.children.length;I++){let t=this.children[I],i=C+t.size;if(C==g&&i!=C){for(;!t.border&&t.children.length;)for(let A=0;A<t.children.length;A++){let n=t.children[A];if(n.size){t=n;break}}return t}if(g<i)return t.descAt(g-C-t.border);C=i}}domFromPos(g,I){if(!this.contentDOM)return{node:this.dom,offset:0,atom:g+1};let C=0,t=0;for(let i=0;C<this.children.length;C++){let A=this.children[C],n=i+A.size;if(n>g||A instanceof D3){t=g-i;break}i=n}if(t)return this.children[C].domFromPos(t-this.children[C].border,I);for(let i;C&&!(i=this.children[C-1]).size&&i instanceof X3&&i.side>=0;C--);if(I<=0){let i,A=!0;for(;i=C?this.children[C-1]:null,!(!i||i.dom.parentNode==this.contentDOM);C--,A=!1);return i&&I&&A&&!i.border&&!i.domAtom?i.domFromPos(i.size,I):{node:this.contentDOM,offset:i?PC(i.dom)+1:0}}else{let i,A=!0;for(;i=C<this.children.length?this.children[C]:null,!(!i||i.dom.parentNode==this.contentDOM);C++,A=!1);return i&&A&&!i.border&&!i.domAtom?i.domFromPos(0,I):{node:this.contentDOM,offset:i?PC(i.dom):this.contentDOM.childNodes.length}}}parseRange(g,I,C=0){if(this.children.length==0)return{node:this.contentDOM,from:g,to:I,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let t=-1,i=-1;for(let A=C,n=0;;n++){let l=this.children[n],s=A+l.size;if(t==-1&&g<=s){let a=A+l.border;if(g>=a&&I<=s-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(g,I,a);g=A;for(let d=n;d>0;d--){let m=this.children[d-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){t=PC(m.dom)+1;break}g-=m.size}t==-1&&(t=0)}if(t>-1&&(s>I||n==this.children.length-1)){I=s;for(let a=n+1;a<this.children.length;a++){let d=this.children[a];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=PC(d.dom);break}I+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}A=s}return{node:this.contentDOM,from:g,to:I,fromOffset:t,toOffset:i}}emptyChildAt(g){if(this.border||!this.contentDOM||!this.children.length)return!1;let I=this.children[g<0?0:this.children.length-1];return I.size==0||I.emptyChildAt(g)}domAfterPos(g){let{node:I,offset:C}=this.domFromPos(g,0);if(I.nodeType!=1||C==I.childNodes.length)throw new RangeError("No node after pos "+g);return I.childNodes[C]}setSelection(g,I,C,t=!1){let i=Math.min(g,I),A=Math.max(g,I);for(let u=0,h=0;u<this.children.length;u++){let Z=this.children[u],G=h+Z.size;if(i>h&&A<G)return Z.setSelection(g-h-Z.border,I-h-Z.border,C,t);h=G}let n=this.domFromPos(g,g?-1:1),l=I==g?n:this.domFromPos(I,I?-1:1),s=C.root.getSelection(),a=C.domSelectionRange(),d=!1;if((GA||Lt)&&g==I){let{node:u,offset:h}=n;if(u.nodeType==3){if(d=!!(h&&u.nodeValue[h-1]==`
1460
- `),d&&h==u.nodeValue.length)for(let Z=u,G;Z;Z=Z.parentNode){if(G=Z.nextSibling){G.nodeName=="BR"&&(n=l={node:G.parentNode,offset:PC(G)+1});break}let w=Z.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let Z=u.childNodes[h-1];d=Z&&(Z.nodeName=="BR"||Z.contentEditable=="false")}}if(GA&&a.focusNode&&a.focusNode!=l.node&&a.focusNode.nodeType==1){let u=a.focusNode.childNodes[a.focusOffset];u&&u.contentEditable=="false"&&(t=!0)}if(!(t||d&&Lt)&&Jd(n.node,n.offset,a.anchorNode,a.anchorOffset)&&Jd(l.node,l.offset,a.focusNode,a.focusOffset))return;let m=!1;if((s.extend||g==I)&&!(d&&GA)){s.collapse(n.node,n.offset);try{g!=I&&s.extend(l.node,l.offset),m=!0}catch{}}if(!m){if(g>I){let h=n;n=l,l=h}let u=document.createRange();u.setEnd(l.node,l.offset),u.setStart(n.node,n.offset),s.removeAllRanges(),s.addRange(u)}}ignoreMutation(g){return!this.contentDOM&&g.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(g,I){for(let C=0,t=0;t<this.children.length;t++){let i=this.children[t],A=C+i.size;if(C==A?g<=A&&I>=C:g<A&&I>C){let n=C+i.border,l=A-i.border;if(g>=n&&I<=l){this.dirty=g==C||I==A?Td:R3,g==n&&I==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=el:i.markDirty(g-n,I-n);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Td:el}C=A}this.dirty=Td}markParentsDirty(){let g=1;for(let I=this.parent;I;I=I.parent,g++){let C=g==1?Td:R3;I.dirty<C&&(I.dirty=C)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(g){return!1}}class X3 extends ob{constructor(g,I,C,t){let i,A=I.type.toDOM;if(typeof A=="function"&&(A=A(C,()=>{if(!i)return t;if(i.parent)return i.parent.posBeforeChild(i)})),!I.type.spec.raw){if(A.nodeType!=1){let n=document.createElement("span");n.appendChild(A),A=n}A.contentEditable="false",A.classList.add("ProseMirror-widget")}super(g,[],A,null),this.widget=I,this.widget=I,i=this}matchesWidget(g){return this.dirty==WA&&g.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(g){let I=this.widget.spec.stopEvent;return I?I(g):!1}ignoreMutation(g){return g.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 H7g extends ob{constructor(g,I,C,t){super(g,[],I,null),this.textDOM=C,this.text=t}get size(){return this.text.length}localPosFromDOM(g,I){return g!=this.textDOM?this.posAtStart+(I?this.size:0):this.posAtStart+I}domFromPos(g){return{node:this.textDOM,offset:g}}ignoreMutation(g){return g.type==="characterData"&&g.target.nodeValue==g.oldValue}}class vd extends ob{constructor(g,I,C,t,i){super(g,[],C,t),this.mark=I,this.spec=i}static create(g,I,C,t){let i=t.nodeViews[I.type.name],A=i&&i(I,t,C);return(!A||!A.dom)&&(A=Fd.renderSpec(document,I.type.spec.toDOM(I,C),null,I.attrs)),new vd(g,I,A.dom,A.contentDOM||A.dom,A)}parseRule(){return this.dirty&el||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(g){return this.dirty!=el&&this.mark.eq(g)}markDirty(g,I){if(super.markDirty(g,I),this.dirty!=WA){let C=this.parent;for(;!C.node;)C=C.parent;C.dirty<this.dirty&&(C.dirty=this.dirty),this.dirty=WA}}slice(g,I,C){let t=vd.create(this.parent,this.mark,!0,C),i=this.children,A=this.size;I<A&&(i=ON(i,I,A,C)),g>0&&(i=ON(i,0,g,C));for(let n=0;n<i.length;n++)i[n].parent=t;return t.children=i,t}ignoreMutation(g){return this.spec.ignoreMutation?this.spec.ignoreMutation(g):super.ignoreMutation(g)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class zs extends ob{constructor(g,I,C,t,i,A,n,l,s){super(g,[],i,A),this.node=I,this.outerDeco=C,this.innerDeco=t,this.nodeDOM=n}static create(g,I,C,t,i,A){let n=i.nodeViews[I.type.name],l,s=n&&n(I,i,()=>{if(!l)return A;if(l.parent)return l.parent.posBeforeChild(l)},C,t),a=s&&s.dom,d=s&&s.contentDOM;if(I.isText){if(!a)a=document.createTextNode(I.text);else if(a.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else a||({dom:a,contentDOM:d}=Fd.renderSpec(document,I.type.spec.toDOM(I),null,I.attrs));!d&&!I.isText&&a.nodeName!="BR"&&(a.hasAttribute("contenteditable")||(a.contentEditable="false"),I.type.spec.draggable&&(a.draggable=!0));let m=a;return a=k3(a,C,I),s?l=new D7g(g,I,C,t,a,d||null,m,s,i,A+1):I.isText?new Fp(g,I,C,t,a,m,i):new zs(g,I,C,t,a,d||null,m,i,A+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let g={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(g.preserveWhitespace="full"),!this.contentDOM)g.getContent=()=>this.node.content;else if(!this.contentLost)g.contentElement=this.contentDOM;else{for(let I=this.children.length-1;I>=0;I--){let C=this.children[I];if(this.dom.contains(C.dom.parentNode)){g.contentElement=C.dom.parentNode;break}}g.contentElement||(g.getContent=()=>Bg.empty)}return g}matchesNode(g,I,C){return this.dirty==WA&&g.eq(this.node)&&zp(I,this.outerDeco)&&C.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(g,I){let C=this.node.inlineContent,t=I,i=g.composing?this.localCompositionInfo(g,I):null,A=i&&i.pos>-1?i:null,n=i&&i.pos<0,l=new K7g(this,A&&A.node,g);z7g(this.node,this.innerDeco,(s,a,d)=>{s.spec.marks?l.syncToMarks(s.spec.marks,C,g):s.type.side>=0&&!d&&l.syncToMarks(a==this.node.childCount?se.none:this.node.child(a).marks,C,g),l.placeWidget(s,g,t)},(s,a,d,m)=>{l.syncToMarks(s.marks,C,g);let u;l.findNodeMatch(s,a,d,m)||n&&g.state.selection.from>t&&g.state.selection.to<t+s.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(s,a,d,u,g)||l.updateNextNode(s,a,d,g,m,t)||l.addNode(s,a,d,g,t),t+=s.nodeSize}),l.syncToMarks([],C,g),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Td)&&(A&&this.protectLocalComposition(g,A),S3(this.contentDOM,this.children,g),Bm&&J7g(this.dom))}localCompositionInfo(g,I){let{from:C,to:t}=g.state.selection;if(!(g.state.selection instanceof hI)||C<I||t>I+this.node.content.size)return null;let i=g.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let A=i.nodeValue,n=L7g(this.node.content,A,C-I,t-I);return n<0?null:{node:i,pos:n,text:A}}else return{node:i,pos:-1,text:""}}protectLocalComposition(g,{node:I,pos:C,text:t}){if(this.getDesc(I))return;let i=I;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let A=new H7g(this,i,I,t);g.input.compositionNodes.push(A),this.children=ON(this.children,C,C+t.length,g,A)}update(g,I,C,t){return this.dirty==el||!g.sameMarkup(this.node)?!1:(this.updateInner(g,I,C,t),!0)}updateInner(g,I,C,t){this.updateOuterDeco(I),this.node=g,this.innerDeco=C,this.contentDOM&&this.updateChildren(t,this.posAtStart),this.dirty=WA}updateOuterDeco(g){if(zp(g,this.outerDeco))return;let I=this.nodeDOM.nodeType!=1,C=this.dom;this.dom=K3(this.dom,this.nodeDOM,xN(this.outerDeco,this.node,I),xN(g,this.node,I)),this.dom!=C&&(C.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=g}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function H3(e,g,I,C,t){k3(C,g,e);let i=new zs(void 0,e,g,I,C,C,C,t,0);return i.contentDOM&&i.updateChildren(t,0),i}class Fp extends zs{constructor(g,I,C,t,i,A,n){super(g,I,C,t,i,null,A,n,0)}parseRule(){let g=this.nodeDOM.parentNode;for(;g&&g!=this.dom&&!g.pmIsDeco;)g=g.parentNode;return{skip:g||!0}}update(g,I,C,t){return this.dirty==el||this.dirty!=WA&&!this.inParent()||!g.sameMarkup(this.node)?!1:(this.updateOuterDeco(I),(this.dirty!=WA||g.text!=this.node.text)&&g.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=g.text,t.trackWrites==this.nodeDOM&&(t.trackWrites=null)),this.node=g,this.dirty=WA,!0)}inParent(){let g=this.parent.contentDOM;for(let I=this.nodeDOM;I;I=I.parentNode)if(I==g)return!0;return!1}domFromPos(g){return{node:this.nodeDOM,offset:g}}localPosFromDOM(g,I,C){return g==this.nodeDOM?this.posAtStart+Math.min(I,this.node.text.length):super.localPosFromDOM(g,I,C)}ignoreMutation(g){return g.type!="characterData"&&g.type!="selection"}slice(g,I,C){let t=this.node.cut(g,I),i=document.createTextNode(t.text);return new Fp(this.parent,t,this.outerDeco,this.innerDeco,i,i,C)}markDirty(g,I){super.markDirty(g,I),this.dom!=this.nodeDOM&&(g==0||I==this.nodeDOM.nodeValue.length)&&(this.dirty=el)}get domAtom(){return!1}isText(g){return this.node.text==g}}class D3 extends ob{parseRule(){return{ignore:!0}}matchesHack(g){return this.dirty==WA&&this.dom.nodeName==g}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class D7g extends zs{constructor(g,I,C,t,i,A,n,l,s,a){super(g,I,C,t,i,A,n,s,a),this.spec=l}update(g,I,C,t){if(this.dirty==el)return!1;if(this.spec.update&&(this.node.type==g.type||this.spec.multiType)){let i=this.spec.update(g,I,C);return i&&this.updateInner(g,I,C,t),i}else return!this.contentDOM&&!g.isLeaf?!1:super.update(g,I,C,t)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(g,I,C,t){this.spec.setSelection?this.spec.setSelection(g,I,C.root):super.setSelection(g,I,C,t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(g){return this.spec.stopEvent?this.spec.stopEvent(g):!1}ignoreMutation(g){return this.spec.ignoreMutation?this.spec.ignoreMutation(g):super.ignoreMutation(g)}}function S3(e,g,I){let C=e.firstChild,t=!1;for(let i=0;i<g.length;i++){let A=g[i],n=A.dom;if(n.parentNode==e){for(;n!=C;)C=F3(C),t=!0;C=C.nextSibling}else t=!0,e.insertBefore(n,C);if(A instanceof vd){let l=C?C.previousSibling:e.lastChild;S3(A.contentDOM,A.children,I),C=l?l.nextSibling:e.firstChild}}for(;C;)C=F3(C),t=!0;t&&I.trackWrites==e&&(I.trackWrites=null)}const sb=function(e){e&&(this.nodeName=e)};sb.prototype=Object.create(null);const jd=[new sb];function xN(e,g,I){if(e.length==0)return jd;let C=I?jd[0]:new sb,t=[C];for(let i=0;i<e.length;i++){let A=e[i].type.attrs;if(A){A.nodeName&&t.push(C=new sb(A.nodeName));for(let n in A){let l=A[n];l!=null&&(I&&t.length==1&&t.push(C=new sb(g.isInline?"span":"div")),n=="class"?C.class=(C.class?C.class+" ":"")+l:n=="style"?C.style=(C.style?C.style+";":"")+l:n!="nodeName"&&(C[n]=l))}}}return t}function K3(e,g,I,C){if(I==jd&&C==jd)return g;let t=g;for(let i=0;i<C.length;i++){let A=C[i],n=I[i];if(i){let l;n&&n.nodeName==A.nodeName&&t!=e&&(l=t.parentNode)&&l.nodeName.toLowerCase()==A.nodeName||(l=document.createElement(A.nodeName),l.pmIsDeco=!0,l.appendChild(t),n=jd[0]),t=l}S7g(t,n||jd[0],A)}return t}function S7g(e,g,I){for(let C in g)C!="class"&&C!="style"&&C!="nodeName"&&!(C in I)&&e.removeAttribute(C);for(let C in I)C!="class"&&C!="style"&&C!="nodeName"&&I[C]!=g[C]&&e.setAttribute(C,I[C]);if(g.class!=I.class){let C=g.class?g.class.split(" ").filter(Boolean):[],t=I.class?I.class.split(" ").filter(Boolean):[];for(let i=0;i<C.length;i++)t.indexOf(C[i])==-1&&e.classList.remove(C[i]);for(let i=0;i<t.length;i++)C.indexOf(t[i])==-1&&e.classList.add(t[i]);e.classList.length==0&&e.removeAttribute("class")}if(g.style!=I.style){if(g.style){let C=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,t;for(;t=C.exec(g.style);)e.style.removeProperty(t[1])}I.style&&(e.style.cssText+=I.style)}}function k3(e,g,I){return K3(e,e,jd,xN(g,I,e.nodeType!=1))}function zp(e,g){if(e.length!=g.length)return!1;for(let I=0;I<e.length;I++)if(!e[I].type.eq(g[I].type))return!1;return!0}function F3(e){let g=e.nextSibling;return e.parentNode.removeChild(e),g}class K7g{constructor(g,I,C){this.lock=I,this.view=C,this.index=0,this.stack=[],this.changed=!1,this.top=g,this.preMatch=k7g(g.node.content,g)}destroyBetween(g,I){if(g!=I){for(let C=g;C<I;C++)this.top.children[C].destroy();this.top.children.splice(g,I-g),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(g,I,C){let t=0,i=this.stack.length>>1,A=Math.min(i,g.length);for(;t<A&&(t==i-1?this.top:this.stack[t+1<<1]).matchesMark(g[t])&&g[t].type.spec.spanning!==!1;)t++;for(;t<i;)this.destroyRest(),this.top.dirty=WA,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<g.length;){this.stack.push(this.top,this.index+1);let n=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let s=this.top.children[l];if(s.matchesMark(g[i])&&!this.isLocked(s.dom)){n=l;break}}if(n>-1)n>this.index&&(this.changed=!0,this.destroyBetween(this.index,n)),this.top=this.top.children[this.index];else{let l=vd.create(this.top,g[i],I,C);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(g,I,C,t){let i=-1,A;if(t>=this.preMatch.index&&(A=this.preMatch.matches[t-this.preMatch.index]).parent==this.top&&A.matchesNode(g,I,C))i=this.top.children.indexOf(A,this.index);else for(let n=this.index,l=Math.min(this.top.children.length,n+5);n<l;n++){let s=this.top.children[n];if(s.matchesNode(g,I,C)&&!this.preMatch.matched.has(s)){i=n;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(g,I,C,t,i){let A=this.top.children[t];return A.dirty==el&&A.dom==A.contentDOM&&(A.dirty=Td),A.update(g,I,C,i)?(this.destroyBetween(this.index,t),this.index++,!0):!1}findIndexWithChild(g){for(;;){let I=g.parentNode;if(!I)return-1;if(I==this.top.contentDOM){let C=g.pmViewDesc;if(C){for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==C)return t}return-1}g=I}}updateNextNode(g,I,C,t,i,A){for(let n=this.index;n<this.top.children.length;n++){let l=this.top.children[n];if(l instanceof zs){let s=this.preMatch.matched.get(l);if(s!=null&&s!=i)return!1;let a=l.dom,d,m=this.isLocked(a)&&!(g.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==g.text&&l.dirty!=el&&zp(I,l.outerDeco));if(!m&&l.update(g,I,C,t))return this.destroyBetween(this.index,n),l.dom!=a&&(this.changed=!0),this.index++,!0;if(!m&&(d=this.recreateWrapper(l,g,I,C,t,A)))return this.destroyBetween(this.index,n),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Td,d.updateChildren(t,A+1),d.dirty=WA),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(g,I,C,t,i,A){if(g.dirty||I.isAtom||!g.children.length||!g.node.content.eq(I.content)||!zp(C,g.outerDeco)||!t.eq(g.innerDeco))return null;let n=zs.create(this.top,I,C,t,i,A);if(n.contentDOM){n.children=g.children,g.children=[];for(let l of n.children)l.parent=n}return g.destroy(),n}addNode(g,I,C,t,i){let A=zs.create(this.top,g,I,C,t,i);A.contentDOM&&A.updateChildren(t,i+1),this.top.children.splice(this.index++,0,A),this.changed=!0}placeWidget(g,I,C){let t=this.index<this.top.children.length?this.top.children[this.index]:null;if(t&&t.matchesWidget(g)&&(g==t.widget||!t.widget.type.toDOM.parentNode))this.index++;else{let i=new X3(this.top,g,I,C);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let g=this.top.children[this.index-1],I=this.top;for(;g instanceof vd;)I=g,g=I.children[I.children.length-1];(!g||!(g instanceof Fp)||/\n$/.test(g.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(g.node.text))&&((Lt||mt)&&g&&g.dom.contentEditable=="false"&&this.addHackNode("IMG",I),this.addHackNode("BR",this.top))}addHackNode(g,I){if(I==this.top&&this.index<I.children.length&&I.children[this.index].matchesHack(g))this.index++;else{let C=document.createElement(g);g=="IMG"&&(C.className="ProseMirror-separator",C.alt=""),g=="BR"&&(C.className="ProseMirror-trailingBreak");let t=new D3(this.top,[],C,null);I!=this.top?I.children.push(t):I.children.splice(this.index++,0,t),this.changed=!0}}isLocked(g){return this.lock&&(g==this.lock||g.nodeType==1&&g.contains(this.lock.parentNode))}}function k7g(e,g){let I=g,C=I.children.length,t=e.childCount,i=new Map,A=[];g:for(;t>0;){let n;for(;;)if(C){let s=I.children[C-1];if(s instanceof vd)I=s,C=s.children.length;else{n=s,C--;break}}else{if(I==g)break g;C=I.parent.children.indexOf(I),I=I.parent}let l=n.node;if(l){if(l!=e.child(t-1))break;--t,i.set(n,t),A.push(n)}}return{index:t,matched:i,matches:A.reverse()}}function F7g(e,g){return e.type.side-g.type.side}function z7g(e,g,I,C){let t=g.locals(e),i=0;if(t.length==0){for(let s=0;s<e.childCount;s++){let a=e.child(s);C(a,t,g.forChild(i,a),s),i+=a.nodeSize}return}let A=0,n=[],l=null;for(let s=0;;){let a,d;for(;A<t.length&&t[A].to==i;){let G=t[A++];G.widget&&(a?(d||(d=[a])).push(G):a=G)}if(a)if(d){d.sort(F7g);for(let G=0;G<d.length;G++)I(d[G],s,!!l)}else I(a,s,!!l);let m,u;if(l)u=-1,m=l,l=null;else if(s<e.childCount)u=s,m=e.child(s++);else break;for(let G=0;G<n.length;G++)n[G].to<=i&&n.splice(G--,1);for(;A<t.length&&t[A].from<=i&&t[A].to>i;)n.push(t[A++]);let h=i+m.nodeSize;if(m.isText){let G=h;A<t.length&&t[A].from<G&&(G=t[A].from);for(let w=0;w<n.length;w++)n[w].to<G&&(G=n[w].to);G<h&&(l=m.cut(G-i),m=m.cut(0,G-i),h=G,u=-1)}else for(;A<t.length&&t[A].to<h;)A++;let Z=m.isInline&&!m.isLeaf?n.filter(G=>!G.inline):n.slice();C(m,Z,g.forChild(i,m),u),i=h}}function J7g(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let g=e.style.cssText;e.style.cssText=g+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=g}}function L7g(e,g,I,C){for(let t=0,i=0;t<e.childCount&&i<=C;){let A=e.child(t++),n=i;if(i+=A.nodeSize,!A.isText)continue;let l=A.text;for(;t<e.childCount;){let s=e.child(t++);if(i+=s.nodeSize,!s.isText)break;l+=s.text}if(i>=I){if(i>=C&&l.slice(C-g.length-n,C-n)==g)return C-g.length;let s=n<C?l.lastIndexOf(g,C-n-1):-1;if(s>=0&&s+g.length+n>=I)return n+s;if(I==C&&l.length>=C+g.length-n&&l.slice(C-n,C-n+g.length)==g)return C}}return-1}function ON(e,g,I,C,t){let i=[];for(let A=0,n=0;A<e.length;A++){let l=e[A],s=n,a=n+=l.size;s>=I||a<=g?i.push(l):(s<g&&i.push(l.slice(0,g-s,C)),t&&(i.push(t),t=void 0),a>I&&i.push(l.slice(I-s,l.size,C)))}return i}function QN(e,g=null){let I=e.domSelectionRange(),C=e.state.doc;if(!I.focusNode)return null;let t=e.docView.nearestDesc(I.focusNode),i=t&&t.size==0,A=e.docView.posFromDOM(I.focusNode,I.focusOffset,1);if(A<0)return null;let n=C.resolve(A),l,s;if(kp(I)){for(l=A;t&&!t.node;)t=t.parent;let d=t.node;if(t&&d.isAtom&&eI.isSelectable(d)&&t.parent&&!(d.isInline&&c7g(I.focusNode,I.focusOffset,t.dom))){let m=t.posBefore;s=new eI(A==m?n:C.resolve(m))}}else{if(I instanceof e.dom.ownerDocument.defaultView.Selection&&I.rangeCount>1){let d=A,m=A;for(let u=0;u<I.rangeCount;u++){let h=I.getRangeAt(u);d=Math.min(d,e.docView.posFromDOM(h.startContainer,h.startOffset,1)),m=Math.max(m,e.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,A]=m==e.state.selection.anchor?[m,d]:[d,m],n=C.resolve(A)}else l=e.docView.posFromDOM(I.anchorNode,I.anchorOffset,1);if(l<0)return null}let a=C.resolve(l);if(!s){let d=g=="pointer"||e.state.selection.head<n.pos&&!i?1:-1;s=EN(e,a,n,d)}return s}function z3(e){return e.editable?e.hasFocus():O3(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function $l(e,g=!1){let I=e.state.selection;if(v3(e,I),!!z3(e)){if(!g&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&mt){let C=e.domSelectionRange(),t=e.domObserver.currentSelection;if(C.anchorNode&&t.anchorNode&&Jd(C.anchorNode,C.anchorOffset,t.anchorNode,t.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)v7g(e);else{let{anchor:C,head:t}=I,i,A;J3&&!(I instanceof hI)&&(I.$from.parent.inlineContent||(i=L3(e,I.from)),!I.empty&&!I.$from.parent.inlineContent&&(A=L3(e,I.to))),e.docView.setSelection(C,t,e,g),J3&&(i&&T3(i),A&&T3(A)),I.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&T7g(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const J3=Lt||mt&&Z3<63;function L3(e,g){let{node:I,offset:C}=e.docView.domFromPos(g,0),t=C<I.childNodes.length?I.childNodes[C]:null,i=C?I.childNodes[C-1]:null;if(Lt&&t&&t.contentEditable=="false")return UN(t);if((!t||t.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(t)return UN(t);if(i)return UN(i)}}function UN(e){return e.contentEditable="true",Lt&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function T3(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function T7g(e){let g=e.dom.ownerDocument;g.removeEventListener("selectionchange",e.input.hideSelectionGuard);let I=e.domSelectionRange(),C=I.anchorNode,t=I.anchorOffset;g.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(I.anchorNode!=C||I.anchorOffset!=t)&&(g.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!z3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function v7g(e){let g=e.domSelection();if(!g)return;let I=e.cursorWrapper.dom,C=I.nodeName=="IMG";C?g.collapse(I.parentNode,PC(I)+1):g.collapse(I,0),!C&&!e.state.selection.visible&&ci&&ks<=11&&(I.disabled=!0,I.disabled=!1)}function v3(e,g){if(g instanceof eI){let I=e.docView.descAt(g.from);I!=e.lastSelectedViewDesc&&(j3(e),I&&I.selectNode(),e.lastSelectedViewDesc=I)}else j3(e)}function j3(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function EN(e,g,I,C){return e.someProp("createSelectionBetween",t=>t(e,g,I))||hI.between(g,I,C)}function x3(e){return e.editable&&!e.hasFocus()?!1:O3(e)}function O3(e){let g=e.domSelectionRange();if(!g.anchorNode)return!1;try{return e.dom.contains(g.anchorNode.nodeType==3?g.anchorNode.parentNode:g.anchorNode)&&(e.editable||e.dom.contains(g.focusNode.nodeType==3?g.focusNode.parentNode:g.focusNode))}catch{return!1}}function j7g(e){let g=e.docView.domFromPos(e.state.selection.anchor,0),I=e.domSelectionRange();return Jd(g.node,g.offset,I.anchorNode,I.anchorOffset)}function PN(e,g){let{$anchor:I,$head:C}=e.selection,t=g>0?I.max(C):I.min(C),i=t.parent.inlineContent?t.depth?e.doc.resolve(g>0?t.after():t.before()):null:t;return i&&uI.findFrom(i,g)}function Js(e,g){return e.dispatch(e.state.tr.setSelection(g).scrollIntoView()),!0}function Q3(e,g,I){let C=e.state.selection;if(C instanceof hI)if(I.indexOf("s")>-1){let{$head:t}=C,i=t.textOffset?null:g<0?t.nodeBefore:t.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let A=e.state.doc.resolve(t.pos+i.nodeSize*(g<0?-1:1));return Js(e,new hI(C.$anchor,A))}else if(C.empty){if(e.endOfTextblock(g>0?"forward":"backward")){let t=PN(e.state,g);return t&&t instanceof eI?Js(e,t):!1}else if(!(wA&&I.indexOf("m")>-1)){let t=C.$head,i=t.textOffset?null:g<0?t.nodeBefore:t.nodeAfter,A;if(!i||i.isText)return!1;let n=g<0?t.pos-i.nodeSize:t.pos;return i.isAtom||(A=e.docView.descAt(n))&&!A.contentDOM?eI.isSelectable(i)?Js(e,new eI(g<0?e.state.doc.resolve(t.pos-i.nodeSize):t)):nb?Js(e,new hI(e.state.doc.resolve(g<0?n:n+i.nodeSize))):!1:!1}}else return!1;else{if(C instanceof eI&&C.node.isInline)return Js(e,new hI(g>0?C.$to:C.$from));{let t=PN(e.state,g);return t?Js(e,t):!1}}}function Jp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ab(e,g){let I=e.pmViewDesc;return I&&I.size==0&&(g<0||e.nextSibling||e.nodeName!="BR")}function Ym(e,g){return g<0?x7g(e):O7g(e)}function x7g(e){let g=e.domSelectionRange(),I=g.focusNode,C=g.focusOffset;if(!I)return;let t,i,A=!1;for(GA&&I.nodeType==1&&C<Jp(I)&&ab(I.childNodes[C],-1)&&(A=!0);;)if(C>0){if(I.nodeType!=1)break;{let n=I.childNodes[C-1];if(ab(n,-1))t=I,i=--C;else if(n.nodeType==3)I=n,C=I.nodeValue.length;else break}}else{if(U3(I))break;{let n=I.previousSibling;for(;n&&ab(n,-1);)t=I.parentNode,i=PC(n),n=n.previousSibling;if(n)I=n,C=Jp(I);else{if(I=I.parentNode,I==e.dom)break;C=0}}}A?_N(e,I,C):t&&_N(e,t,i)}function O7g(e){let g=e.domSelectionRange(),I=g.focusNode,C=g.focusOffset;if(!I)return;let t=Jp(I),i,A;for(;;)if(C<t){if(I.nodeType!=1)break;let n=I.childNodes[C];if(ab(n,1))i=I,A=++C;else break}else{if(U3(I))break;{let n=I.nextSibling;for(;n&&ab(n,1);)i=n.parentNode,A=PC(n)+1,n=n.nextSibling;if(n)I=n,C=0,t=Jp(I);else{if(I=I.parentNode,I==e.dom)break;C=t=0}}}i&&_N(e,i,A)}function U3(e){let g=e.pmViewDesc;return g&&g.node&&g.node.isBlock}function Q7g(e,g){for(;e&&g==e.childNodes.length&&!Ab(e);)g=PC(e)+1,e=e.parentNode;for(;e&&g<e.childNodes.length;){let I=e.childNodes[g];if(I.nodeType==3)return I;if(I.nodeType==1&&I.contentEditable=="false")break;e=I,g=0}}function U7g(e,g){for(;e&&!g&&!Ab(e);)g=PC(e),e=e.parentNode;for(;e&&g;){let I=e.childNodes[g-1];if(I.nodeType==3)return I;if(I.nodeType==1&&I.contentEditable=="false")break;e=I,g=e.childNodes.length}}function _N(e,g,I){if(g.nodeType!=3){let i,A;(A=Q7g(g,I))?(g=A,I=0):(i=U7g(g,I))&&(g=i,I=i.nodeValue.length)}let C=e.domSelection();if(!C)return;if(kp(C)){let i=document.createRange();i.setEnd(g,I),i.setStart(g,I),C.removeAllRanges(),C.addRange(i)}else C.extend&&C.extend(g,I);e.domObserver.setCurSelection();let{state:t}=e;setTimeout(()=>{e.state==t&&$l(e)},50)}function E3(e,g){let I=e.state.doc.resolve(g);if(!(mt||u7g)&&I.parent.inlineContent){let t=e.coordsAtPos(g);if(g>I.start()){let i=e.coordsAtPos(g-1),A=(i.top+i.bottom)/2;if(A>t.top&&A<t.bottom&&Math.abs(i.left-t.left)>1)return i.left<t.left?"ltr":"rtl"}if(g<I.end()){let i=e.coordsAtPos(g+1),A=(i.top+i.bottom)/2;if(A>t.top&&A<t.bottom&&Math.abs(i.left-t.left)>1)return i.left>t.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function P3(e,g,I){let C=e.state.selection;if(C instanceof hI&&!C.empty||I.indexOf("s")>-1||wA&&I.indexOf("m")>-1)return!1;let{$from:t,$to:i}=C;if(!t.parent.inlineContent||e.endOfTextblock(g<0?"up":"down")){let A=PN(e.state,g);if(A&&A instanceof eI)return Js(e,A)}if(!t.parent.inlineContent){let A=g<0?t:i,n=C instanceof Ss?uI.near(A,g):uI.findFrom(A,g);return n?Js(e,n):!1}return!1}function _3(e,g){if(!(e.state.selection instanceof hI))return!0;let{$head:I,$anchor:C,empty:t}=e.state.selection;if(!I.sameParent(C))return!0;if(!t)return!1;if(e.endOfTextblock(g>0?"forward":"backward"))return!0;let i=!I.textOffset&&(g<0?I.nodeBefore:I.nodeAfter);if(i&&!i.isText){let A=e.state.tr;return g<0?A.delete(I.pos-i.nodeSize,I.pos):A.delete(I.pos,I.pos+i.nodeSize),e.dispatch(A),!0}return!1}function $3(e,g,I){e.domObserver.stop(),g.contentEditable=I,e.domObserver.start()}function E7g(e){if(!Lt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:g,focusOffset:I}=e.domSelectionRange();if(g&&g.nodeType==1&&I==0&&g.firstChild&&g.firstChild.contentEditable=="false"){let C=g.firstChild;$3(e,C,"true"),setTimeout(()=>$3(e,C,"false"),20)}return!1}function P7g(e){let g="";return e.ctrlKey&&(g+="c"),e.metaKey&&(g+="m"),e.altKey&&(g+="a"),e.shiftKey&&(g+="s"),g}function _7g(e,g){let I=g.keyCode,C=P7g(g);if(I==8||wA&&I==72&&C=="c")return _3(e,-1)||Ym(e,-1);if(I==46&&!g.shiftKey||wA&&I==68&&C=="c")return _3(e,1)||Ym(e,1);if(I==13||I==27)return!0;if(I==37||wA&&I==66&&C=="c"){let t=I==37?E3(e,e.state.selection.from)=="ltr"?-1:1:-1;return Q3(e,t,C)||Ym(e,t)}else if(I==39||wA&&I==70&&C=="c"){let t=I==39?E3(e,e.state.selection.from)=="ltr"?1:-1:1;return Q3(e,t,C)||Ym(e,t)}else{if(I==38||wA&&I==80&&C=="c")return P3(e,-1,C)||Ym(e,-1);if(I==40||wA&&I==78&&C=="c")return E7g(e)||P3(e,1,C)||Ym(e,1);if(C==(wA?"m":"c")&&(I==66||I==73||I==89||I==90))return!0}return!1}function $N(e,g){e.someProp("transformCopied",u=>{g=u(g,e)});let I=[],{content:C,openStart:t,openEnd:i}=g;for(;t>1&&i>1&&C.childCount==1&&C.firstChild.childCount==1;){t--,i--;let u=C.firstChild;I.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),C=u.content}let A=e.someProp("clipboardSerializer")||Fd.fromSchema(e.state.schema),n=AF(),l=n.createElement("div");l.appendChild(A.serializeFragment(C,{document:n}));let s=l.firstChild,a,d=0;for(;s&&s.nodeType==1&&(a=tF[s.nodeName.toLowerCase()]);){for(let u=a.length-1;u>=0;u--){let h=n.createElement(a[u]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}s=l.firstChild}s&&s.nodeType==1&&s.setAttribute("data-pm-slice",`${t} ${i}${d?` -${d}`:""} ${JSON.stringify(I)}`);let m=e.someProp("clipboardTextSerializer",u=>u(g,e))||g.content.textBetween(0,g.content.size,`
1457
+ calc(50% + 50% * cos(${t-90}deg)) 100%, calc(50% + 50% * cos(${t-90}deg)) calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`;if(C<=100)return`polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%,0% 100%, 0% calc(50% + 50% * sin(${t-90}deg)), 50% 50%)`};return(C,t)=>g.percent<100?(o.openBlock(),o.createElementBlock("div",{key:0,class:"pie-chart","data-testid":`${g.dataTestid}-PieChart`},[o.createElementVNode("div",{class:"pie-chart-border",style:o.normalizeStyle({"border-color":g.percent<50?"var(--error-light-color)":"var(--orange-color)"}),"data-testid":`${g.dataTestid}-PieChart-Border`},[o.createElementVNode("div",{class:"sector",style:o.normalizeStyle({clipPath:I(),"background-color":g.percent<50?"var(--error-light-color)":"var(--orange-color)"}),"data-testid":`${g.dataTestid}-PieChart-Sector`},null,12,fUg)],12,MUg)],8,NUg)):(o.openBlock(),o.createElementBlock("svg",{key:1,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","data-testid":`${g.dataTestid}-Icon`,xmlns:"http://www.w3.org/2000/svg"},[...t[0]||(t[0]=[o.createElementVNode("path",{d:"M8 1C4.136 1 1 4.136 1 8C1 11.864 4.136 15 8 15C11.864 15 15 11.864 15 8C15 4.136 11.864 1 8 1ZM8 13.6C4.906 13.6 2.4 11.094 2.4 8C2.4 4.906 4.906 2.4 8 2.4C11.094 2.4 13.6 4.906 13.6 8C13.6 11.094 11.094 13.6 8 13.6Z",fill:"#3BC648"},null,-1),o.createElementVNode("circle",{cx:"8",cy:"8",r:"4",transform:"rotate(-180 8 8)",fill:"#3BC648"},null,-1),o.createElementVNode("path",{d:"M10 6L7.5 9.83935L6 8.5",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],8,RUg))}}),[["__scopeId","data-v-393c7314"]]),XUg=["colspan","rowspan","data-testid"],um=Tg(o.defineComponent({name:"TableTh",__name:"TableTh",props:{colspan:{default:1},rowspan:{default:1},dataTestid:{default:"DataHeader"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("th",{colspan:e.colspan,rowspan:e.rowspan,"data-testid":g.dataTestid,class:"table-th"},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,XUg))}}),[["__scopeId","data-v-0411515d"]]),HUg=["data-testid"],E0=Tg(o.defineComponent({name:"HeadTableRow",__name:"HeadTableRow",props:{dataTestid:{default:"TableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("tr",{class:"head-table-row","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,HUg))}}),[["__scopeId","data-v-1c6483fb"]]),dk=(e,g,I,C)=>{const t=o.ref(!1),i=o.ref(100);let A=0,n=0;const l=o.computed(()=>[{"scroll-wrapper__track_hide":i.value===100,"scroll-wrapper__track_drag":t.value}]),s=o.computed(()=>i.value<100),a=()=>{if(e.value){const w=e.value.clientWidth,p=e.value.scrollWidth;return w>=p?100:w/p*100}return 100},d=()=>{if(!e.value||!g.value||!I.value||!C.value)return;const{scrollLeft:w,scrollWidth:p,clientWidth:B}=e.value,y=p-B;if(y<=0)return;const Y=w/y,f=C.value.clientWidth,M=I.value.clientWidth,K=f-M,F=Y*K;requestAnimationFrame(()=>{g.value&&KI({"--scroll-bar-left-position":`${F}px`},g.value)})},m=w=>{!e.value||!g.value||(t.value=!0,A=w.clientX,n=e.value.scrollLeft,document.addEventListener("pointermove",u),document.addEventListener("pointerup",h,!0))},u=w=>{if(t.value&&e.value&&I.value){const p=w.clientX-A,B=(e.value.scrollWidth-e.value.clientWidth)/(e.value.clientWidth-I.value.clientWidth);e.value.scrollLeft=n+p*B,d()}},h=()=>{t.value=!1,document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",h,!0)};return{onDrag:u,onTrackClick:w=>{if(e.value&&I.value){const p=w.currentTarget.getBoundingClientRect(),B=w.clientX-p.left,y=I.value.clientWidth,Y=p.width;let f=(B-y/2)*((e.value.scrollWidth-e.value.clientWidth)/(Y-y));f=Math.max(0,Math.min(f,e.value.scrollWidth-e.value.clientWidth)),e.value.scrollLeft=f,d()}},startDrag:m,getPercentHorizontalView:a,changeBarPosition:d,isDragging:t,scrollHorizontalWidthPercent:i,setHorizontalBarWidth:()=>{if(!e.value||!g.value)return;const w=a();i.value=w,KI({"--scroll-horizontal-bar-width":`${w}%`},g.value)},horizontalTrackClass:l,isExistHorizontalTrack:s}},ck=(e,g,I,C)=>{const t=o.ref(!1),i=o.ref(100);let A=0,n=0;const l=o.computed(()=>[{"scroll-wrapper__track_hide":i.value===100,"scroll-wrapper__track_drag":t.value}]),s=o.computed(()=>i.value<100),a=()=>{if(e.value){const w=e.value.clientHeight,p=e.value.scrollHeight;if(w>=p)return 100;if(w<p)return w/p*100}return 100},d=()=>{if(!e.value||!g.value||!I.value||!C.value)return;const{scrollTop:w,scrollHeight:p,clientHeight:B}=e.value,y=p-B;if(y<=0)return;const Y=w/y,f=C.value.clientHeight,M=I.value.clientHeight,K=f-M,F=Y*K;requestAnimationFrame(()=>{g.value&&KI({"--scroll-bar-top-postion":`${F}px`},g.value)})},m=w=>{!e.value||!g.value||(t.value=!0,A=w.clientY,n=e.value.scrollTop,document.addEventListener("pointermove",u),document.addEventListener("pointerup",h))},u=w=>{if(t.value&&e.value&&I.value){const p=w.clientY-A,B=(e.value.scrollHeight-e.value.clientHeight)/(e.value.clientHeight-I.value.clientHeight);e.value.scrollTop=n+p*B,d()}},h=()=>{t.value=!1,document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",h)};return{onDrag:u,onTrackClick:w=>{if(e.value&&I.value){const p=w.currentTarget.getBoundingClientRect(),B=w.clientY-p.top,y=I.value.clientHeight,Y=p.height;let f=(B-y/2)*((e.value.scrollHeight-e.value.clientHeight)/(Y-y));f=Math.max(0,Math.min(f,e.value.scrollHeight-e.value.clientHeight)),e.value.scrollTop=f,d()}},startDrag:m,getProcentVerticalView:a,changeBarPosition:d,isDragging:t,scrollVerticalHeightProcent:i,setVerticalBarHeight:()=>{if(!e.value||!g.value)return;const w=a();i.value=w,KI({"--scroll-vertical-bar-height":`${w}%`},g.value)},verticalTrackClass:l,isExistVerticalTrack:s}},DUg={class:"scroll-wrapper__vertical-wrapper"},SUg={class:"scroll-wrapper__horizont-wrapper"},P0=Tg(o.defineComponent({name:"ScrollWrapper",__name:"ScrollWrapper",props:{isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate","on-mounted"],setup(e,{expose:g,emit:I}){const C=I,t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),{onTrackClick:a,startDrag:d,changeBarPosition:m,setVerticalBarHeight:u,verticalTrackClass:h,isExistVerticalTrack:Z}=ck(t,i,n,A),{changeBarPosition:G,startDrag:w,onTrackClick:p,setHorizontalBarWidth:B,horizontalTrackClass:y,isExistHorizontalTrack:Y}=dk(t,i,s,l),f=Q=>{m(),G(),C("unmount-scroll",Q)},M=()=>{requestAnimationFrame(()=>{K(),F()})},K=()=>{if(!t.value||!i.value)return;const Q=getComputedStyle(i.value),$=i.value.style.minHeight||Q.minHeight,mg=i.value.style.maxHeight||Q.maxHeight,og=i.value.style.height;KI({"--scroll-wrapper-height":`${og}`,"--scroll-wrapper-max-height":`${mg}`,"--scroll-wrapper-min-height":`${$}`},i.value)},F=()=>{u(),B(),m(),G()},X=()=>{t.value&&t.value.addEventListener("scroll",f)},z=()=>{t.value&&(t.value.scrollTop=0)},L=()=>{t.value&&(t.value.scrollHeight<=t.value.clientHeight?C("unmount-paginate",!0):C("unmount-paginate",!1))},O=new MutationObserver(()=>{M(),L()}),Ig=new ResizeObserver(()=>{M(),L()}),Ag=Q=>{O.observe(Q,{childList:!0,subtree:!0,attributes:!0}),Ig.observe(Q)};return g({scrollToTop:z,setHeightSlot:K,slotRef:t}),o.onMounted(()=>{M(),X(),i.value&&Ag(i.value),A.value&&Ag(A.value),window.addEventListener("resize",M),C("on-mounted")}),o.onUnmounted(()=>{window.removeEventListener("resize",M)}),(Q,$)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollWrapperRef",ref:i,class:"scroll-wrapper"},[o.createElementVNode("div",DUg,[o.createElementVNode("div",SUg,[o.createElementVNode("div",{ref_key:"slotRef",ref:t,class:"scroll-wrapper__slot"},[o.renderSlot(Q.$slots,"default",{},void 0,!0)],512),o.unref(Y)||e.isShowHorizontalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"horizontTrackRef",ref:l,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_horizont",o.unref(y)]),onClick:$[1]||($[1]=o.withModifiers((...mg)=>o.unref(p)&&o.unref(p)(...mg),["self","prevent","left"]))},[o.createElementVNode("div",{ref_key:"horizontBarRef",ref:s,class:"scroll-wrapper__bar",onPointerdown:$[0]||($[0]=o.withModifiers((...mg)=>o.unref(w)&&o.unref(w)(...mg),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)]),o.unref(Z)||e.isShowVerticalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"verticalTrackRef",ref:A,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_vertical",o.unref(h)]),onClick:$[3]||($[3]=o.withModifiers((...mg)=>o.unref(a)&&o.unref(a)(...mg),["self","prevent","left"]))},[o.createElementVNode("div",{ref_key:"verticalBarRef",ref:n,class:"scroll-wrapper__bar",onPointerdown:$[2]||($[2]=o.withModifiers((...mg)=>o.unref(d)&&o.unref(d)(...mg),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)])],512))}}),[["__scopeId","data-v-854984d6"]]),KUg=["id","data-testid"],kUg=["id","data-testid"],FUg=["id","data-testid"],rN=Tg(o.defineComponent({name:"TableNew",__name:"Table",props:{tableId:{},search:{},tbodyId:{},theadId:{},columnCount:{},dataTestid:{default:"Table"},isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate"],setup(e,{expose:g,emit:I}){var B;const C=e,t=I,i=o.reactive({headHeight:0,maxColumnCount:0}),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),a=o.ref(null),d=y=>{t("unmount-scroll",y)},m=y=>t("unmount-paginate",y),u=()=>{if(!A.value||!a.value)return;const y=A.value.querySelector("thead");if(!y)return;const Y=y.getBoundingClientRect().height;i.headHeight=Y,KI({"--scroll-track-margin-top":`${Y}px`},a.value.$el)},h=()=>{a.value&&a.value.scrollToTop()},Z=()=>{if(a.value&&s.value){const y=getComputedStyle(a.value.$el),Y=Number(y.minHeight.replace(/\D/g,""));if(Y&&Y>0)return;KI({"min-height":`${i.headHeight+108}px`},a.value.$el)}},G=()=>{let y=1;if(n.value){for(let Y=0;Y<n.value.children.length;Y++)y=Math.max(n.value.children[Y].children.length,y);i.maxColumnCount=y}},w=new MutationObserver(()=>{G()}),p=new ResizeObserver(()=>{u()});return g({scrollToTop:h,setHeightSlot:(B=a.value)==null?void 0:B.setHeightSlot,scrollWrapperRef:a,tbodyRef:l,tableRef:A,theadRef:n}),o.onMounted(()=>{u(),G(),window.addEventListener("resize",u),A.value&&p.observe(A.value),n.value&&w.observe(n.value,{childList:!0,subtree:!0}),Z()}),(y,Y)=>(o.openBlock(),o.createBlock(P0,{ref_key:"scrollWrapperRef",ref:a,class:"table",onUnmountScroll:d,onUnmountPaginate:m,"is-show-vertical-scroll":C.isShowVerticalScroll,"is-show-horizontal-scroll":C.isShowHorizontalScroll,"data-testid":`${C.dataTestid}-ScrollWrapper`},{default:o.withCtx(()=>[o.createElementVNode("table",{ref_key:"tableRef",ref:A,id:C.tableId,class:"table__table","data-testid":`${C.dataTestid}`},[o.renderSlot(y.$slots,"default",{},()=>{var f;return[o.createElementVNode("colgroup",null,[o.renderSlot(y.$slots,"colspan",{},void 0,!0)]),y.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:n,id:C.theadId,class:"table__head","data-testid":`${C.dataTestid}-Thead`},[o.renderSlot(y.$slots,"head",{},void 0,!0),y.$slots.search?(o.openBlock(),o.createBlock(E0,{key:0,class:"table__search-tr",id:(f=C.search)==null?void 0:f.rowId,ref_key:"searchRowRef",ref:s,"data-testid":`${C.dataTestid}-Search-Row`},{default:o.withCtx(()=>{var M;return[o.createVNode(um,{colspan:C.columnCount||i.maxColumnCount,class:"table__search-th",id:(M=C.search)==null?void 0:M.headId,"data-testid":`${C.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(y.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","id","data-testid"])]}),_:3},8,["id","data-testid"])):o.createCommentVNode("",!0)],8,kUg)):o.createCommentVNode("",!0),o.renderSlot(y.$slots,"body-group",{},()=>[y.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,id:C.tbodyId,ref_key:"tbodyRef",ref:l,class:"table__body","data-testid":`${C.dataTestid}-Tbody`},[o.renderSlot(y.$slots,"body",{},void 0,!0)],8,FUg)):o.createCommentVNode("",!0)],!0)]},!0)],8,KUg)]),_:3},8,["is-show-vertical-scroll","is-show-horizontal-scroll","data-testid"]))}}),[["__scopeId","data-v-26ee537e"]]),zUg=["rowspan","colspan","data-testid"],_0=o.defineComponent({name:"TableTd",__name:"TableTd",props:{colspan:{default:1},rowspan:{default:1},dataTestid:{default:"DataCell"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("td",{rowspan:e.rowspan,colspan:e.colspan,class:"table-td","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default")],8,zUg))}}),JUg={class:"skeleton"},Zp=Tg(o.defineComponent({name:"Skeleton",__name:"Skeleton",setup(e){return(g,I)=>(o.openBlock(),o.createElementBlock("div",JUg))}}),[["__scopeId","data-v-6eb37767"]]),LUg=["data-testid"],Gp=Tg(o.defineComponent({name:"TableRow",__name:"TableRow",props:{type:{default:"default"},isObserved:{type:Boolean,default:!1},observer:{},scrolledElement:{},dataTestid:{},colspan:{default:1},rowspan:{default:1}},setup(e){const g=e,I=o.reactive({isShow:!g.isObserved,observer:null}),C=o.ref(null),t=o.computed(()=>[{"table-row_active":g.type==="selected","table-row_is-stub":g.isObserved}]),i=()=>{const n=new IntersectionObserver(l=>{l.forEach(s=>{s.isIntersecting&&(I.isShow=!0,n.unobserve(s.target))})},{root:g.scrolledElement,rootMargin:"600px"});return n},A=()=>{g.isObserved&&C.value&&(I.observer=i(),I.observer.observe(C.value))};return o.watch(()=>g.scrolledElement,()=>{var n;(n=I.observer)==null||n.disconnect(),A()}),o.onMounted(()=>{A()}),o.onUnmounted(()=>{var n;(n=I.observer)==null||n.disconnect()}),(n,l)=>(o.openBlock(),o.createElementBlock("tr",{ref_key:"row",ref:C,class:o.normalizeClass(["table-row",t.value]),"data-testid":g.dataTestid},[I.isShow?o.renderSlot(n.$slots,"default",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.$slots.skeleton?o.renderSlot(n.$slots,"skeleton",{key:0},void 0,!0):(o.openBlock(),o.createBlock(_0,{key:1,class:"table-row__td table-row__td_stub",colspan:g.colspan,rowspan:g.rowspan},{default:o.withCtx(()=>[o.createVNode(Zp,{class:"table-row__skeleton"})]),_:1},8,["colspan","rowspan"]))],64))],10,LUg))}}),[["__scopeId","data-v-703d9e37"]]),mN=Tg(o.defineComponent({name:"SectionTableRow",__name:"SectionTableRow",props:{colspan:{},dataTestid:{default:"SectionTableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createBlock(Gp,{class:"section-table-row","data-testid":g.dataTestid},{default:o.withCtx(()=>[o.createVNode(_0,{colspan:e.colspan,class:"section-table-row__td","data-testid":`${g.dataTestid}-DataCell`},{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"]))}}),[["__scopeId","data-v-35b23188"]]),TUg=["disabled","name","value","data-testid"],uN=Tg(o.defineComponent({name:"Radio",__name:"Radio",props:o.mergeModels({name:{},value:{},disabled:{type:Boolean,default:!1},dataTestid:{default:"Radio"}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const g=e,I=o.useModel(e,"modelValue");return(C,t)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>I.value=i),type:"radio",disabled:e.disabled,name:e.name,value:e.value,class:"radio","data-testid":g.dataTestid},null,8,TUg)),[[o.vModelRadio,I.value]])}}),[["__scopeId","data-v-3db64c64"]]),vUg=["data-testid"],jUg=["data-testid"],rk=Tg(o.defineComponent({name:"ChoosenMiniOptions",__name:"ChoosenMiniOptions",props:{options:{},dataTestid:{default:"ChoosenMiniOptions"}},emits:["remove"],setup(e,{emit:g}){const I=e,C=g,t=i=>{C("remove",i)};return(i,A)=>(o.openBlock(),o.createElementBlock("div",{class:"choosen-mini-options","data-testid":I.dataTestid},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.options,(n,l)=>(o.openBlock(),o.createElementBlock("div",{key:n.key,class:"choosen-mini-options__option","data-testid":`${I.dataTestid}-Option-Item${l}`},[o.createVNode(ot,{"data-testid":`${I.dataTestid}-Badge${l}`,type:o.unref(zI).blue,text:o.unref(nY)(n)?n.hint:n.value,class:"choosen-mini-options__badges",disabled:""},null,8,["data-testid","type","text"]),o.createVNode(Mg,{"data-testid":`${I.dataTestid}-Icon${l}`,name:o.unref(ug).crossLarge,width:10,height:10,class:"choosen-mini-options__cross",onClick:s=>t(n.key)},null,8,["data-testid","name","onClick"])],8,jUg))),128))],8,vUg))}}),[["__scopeId","data-v-03762d05"]]),xUg=["data-testid"],OUg=["data-testid"],QUg=["data-testid"],UUg=["data-testid"],EUg=["data-testid"],PUg=["data-testid"],hN=Tg(o.defineComponent({name:"BaseFilter",__name:"BaseFilter",props:o.mergeModels({options:{},title:{},isSearch:{type:Boolean,default:!1},isPosibleToClear:{type:Boolean,default:!1},isShowMiniOptions:{type:Boolean,default:!1},isUseAnchor:{type:Boolean,default:!0},isOpened:{type:Boolean,default:!1},tooltipPosition:{default:"top-center"},disabled:{type:Boolean,default:!1},onUnmountPagination:{},defaultOption:{default:"Выберите значение"},class:{},dataTestid:{default:"BaseFilter"}},{modelValue:{},modelModifiers:{}}),emits:o.mergeModels(["change","disabled-click","unmount-open","unmount-search","unmount-search-enter","unmount-pagination"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=o.reactive({isHovered:!1}),t=g,i=o.ref(null),A=o.ref(null),n=o.useModel(e,"modelValue"),l=o.ref(I.isOpened),s=o.computed(()=>[{filter_disabled:I.disabled},I.class]);o.watch(l,()=>{t("unmount-open",l.value),a.value=""}),o.watch(()=>I.isOpened,()=>{if(I.disabled){l.value=!1;return}l.value=I.isOpened}),o.watch(()=>I.onUnmountPagination,()=>{z()});const a=o.ref(""),d=o.computed(()=>{let L=[];return a.value?(Jh(I.options)?L=I.options.filter(O=>{var Ig;return O.value.toLowerCase().includes(a.value.toLowerCase())||((Ig=O==null?void 0:O.hint)==null?void 0:Ig.toLowerCase().includes(a.value.toLowerCase()))}):L=I.options.filter(O=>O.value.toLowerCase().includes(a.value.toLowerCase())),L):(Jh(I.options),L=I.options,L)}),m=o.computed(()=>{var O;return((O=I.options.find(Ig=>Un.isArray(n.value)?n.value.includes(Ig.key):Ig.key===String(n.value)))==null?void 0:O.value)||I.defaultOption}),u=o.computed(()=>I.options.filter(L=>Un.isArray(n.value)?n.value.includes(L.key)&&L.value!==m.value:L.key===String(n.value))),h=o.computed(()=>I.options.filter(L=>Un.isArray(n.value)?n.value.includes(L.key)&&L.value===m.value:L.key===String(n.value))),Z=o.computed(()=>{var Ig,Ag,Q;const L=I.options;let O;return Un.isArray(n.value)?Jh(L)?O=(Ig=L.find($=>$.value===m.value))==null?void 0:Ig.hint:O=(Ag=L.find($=>$.value===m.value))==null?void 0:Ag.value:O=(Q=L.find($=>$.key===String(n.value)))==null?void 0:Q.value,O||""}),G=()=>{C.isHovered=!0},w=()=>{C.isHovered=!1},p=o.computed(()=>{var L;return Jh(I.options)?C.isHovered&&!!Z.value:((L=i.value)==null?void 0:L.isSpanOverflow)||!1}),B=o.computed(()=>Un.isArray(n.value)?I.isPosibleToClear&&n.value.length>0:I.isPosibleToClear&&n.value),y=o.computed(()=>Un.isArray(n.value)&&n.value.length>1),Y=o.computed(()=>Un.isArray(n.value)?n.value.length:null),f=L=>{t("disabled-click",L)},M=async L=>{if(I.disabled){l.value=!1;return}if(Un.isArray(n.value))n.value.includes(L)?n.value=n.value.filter(O=>O!==L):n.value=[...n.value,L];else{let O=I.options.find(Ig=>Ig.key===L);!O&&Jh(I.options)&&(O=I.options.find(Ig=>Ig.hint===L)),n.value=(O==null?void 0:O.key)||"",l.value=!1}await o.nextTick(),t("change",String(n.value))},K=L=>{if(I.disabled){l.value=!1;return}l.value=L},F=async()=>{I.disabled||(Un.isArray(n.value)?n.value=[]:n.value="",await o.nextTick(),t("change",n.value))},X=new IntersectionObserver(L=>{L.forEach(O=>{O.isIntersecting&&t("unmount-pagination")})}),z=()=>{A.value&&I.onUnmountPagination&&(X.unobserve(A.value),X.observe(A.value))};return o.onMounted(()=>{z()}),o.onUnmounted(()=>{X.disconnect()}),(L,O)=>(o.openBlock(),o.createBlock(Dr,{"header-classes":"filter__header","options-classes":"filter__options","is-opened":l.value,class:o.normalizeClass(["filter",s.value]),"is-use-anchor":e.isUseAnchor,"data-testid":I.dataTestid,disabled:e.disabled,onChange:K},o.createSlots({header:o.withCtx(()=>[o.renderSlot(L.$slots,"header",{},()=>[o.createElementVNode("span",{class:o.normalizeClass(["filter__header-title",{"filter__header-title__active":l.value}]),"data-testid":`${I.dataTestid}-Title`},o.toDisplayString(e.title),11,xUg),o.createVNode(Hd,{position:e.tooltipPosition,type:"blue","is-can-show":p.value&&!(y.value&&e.isShowMiniOptions),hint:Z.value,"hint-gap":28,class:"filter__header-tooltip","data-testid":`${I.dataTestid}-Tooltip`},{default:o.withCtx(()=>[o.createVNode(ot,{ref_key:"badgesRef",ref:i,type:e.disabled?o.unref(zI).disabled:m.value===I.defaultOption?o.unref(zI).default:o.unref(zI).blue,class:"filter__options-badge","data-testid":`${I.dataTestid}-Badge`,text:m.value,onMouseenter:G,onMouseleave:w,disabled:""},null,8,["type","data-testid","text"]),y.value&&e.isShowMiniOptions?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filter__values","data-testid":`${I.dataTestid}-Filter-Value`},[o.createVNode(rk,{"data-testid":`${I.dataTestid}-Filter-Value-MiniOptions`,onClick:O[0]||(O[0]=o.withModifiers(()=>{},["stop"])),options:h.value,onRemove:M},null,8,["data-testid","options"])],8,OUg)):o.createCommentVNode("",!0)]),_:1},8,["position","is-can-show","hint","data-testid"]),Y.value&&Y.value>1?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filter__count","data-testid":`${I.dataTestid}-Filter-Count`},[o.createTextVNode(" +"+o.toDisplayString(Y.value-1)+" ",1),y.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filter__values","data-testid":`${I.dataTestid}-Filter-Values`},[o.createVNode(rk,{onClick:O[1]||(O[1]=o.withModifiers(()=>{},["stop"])),options:u.value,onRemove:M,"data-testid":`${I.dataTestid}-MiniOptions`},null,8,["options","data-testid"])],8,UUg)):o.createCommentVNode("",!0)],8,QUg)):o.createCommentVNode("",!0),B.value?(o.openBlock(),o.createElementBlock("span",{key:1,class:"filter__cross",onClick:o.withModifiers(F,["stop"]),"data-testid":`${I.dataTestid}-Filter-Cross`},[o.createVNode(Mg,{name:o.unref(ug).crossLarge,width:16,height:16},null,8,["name"])],8,EUg)):o.createCommentVNode("",!0)],!0)]),options:o.withCtx(()=>[e.isSearch?(o.openBlock(),o.createBlock(b0,{key:0,modelValue:a.value,"onUpdate:modelValue":O[2]||(O[2]=Ig=>a.value=Ig),"show-history":!1,"data-testid":`${I.dataTestid}-Search`,onInput:O[3]||(O[3]=Ig=>L.$emit("unmount-search",Ig)),onEnter:O[4]||(O[4]=Ig=>L.$emit("unmount-search-enter",Ig))},null,8,["modelValue","data-testid"])):o.createCommentVNode("",!0),o.createVNode(lY,{"data-testid":`${I.dataTestid}-Options`,class:"filter__options-option",options:d.value,"default-option":m.value,onChange:M,onDisabledClick:f},{default:o.withCtx(()=>[o.createElementVNode("li",{class:"filter__options-underline","data-testid":`${I.dataTestid}-Underline`},[...O[5]||(O[5]=[o.createElementVNode("hr",{class:"filter__options-underline-hr"},null,-1)])],8,PUg)]),_:1},8,["data-testid","options","default-option"]),o.withDirectives(o.createElementVNode("div",{ref_key:"lastOptionRef",ref:A,class:"filter__last-option"},null,512),[[o.vShow,e.onUnmountPagination]])]),_:2},[L.$slots.body?{name:"body",fn:o.withCtx(Ig=>[o.renderSlot(L.$slots,"body",{closeOpenList:Ig.closeOpenList},void 0,!0)]),key:"0"}:void 0]),1032,["is-opened","class","is-use-anchor","data-testid","disabled"]))}}),[["__scopeId","data-v-45631066"]]),_Ug=["data-testid"],wp=Tg(o.defineComponent({name:"Range",__name:"Range",props:o.mergeModels({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},dataTestid:{default:"Range"}},{modelValue:{default:0},modelModifiers:{}}),emits:o.mergeModels(["unmount-change","unmount-input"],["update:modelValue"]),setup(e,{emit:g}){const I=e,C=g,t=o.useModel(e,"modelValue"),i=o.ref(null);o.watch(t,()=>{n()});const A=()=>(t.value-I.min)/(I.max-I.min)*100,n=()=>{requestAnimationFrame(()=>{i.value&&KI({"--progress":A()+"%"},i.value)})},l=a=>{const d=a.target;d&&C("unmount-change",Number(d.value))},s=a=>{const d=a.target;d&&C("unmount-change",Number(d.value))};return o.onMounted(()=>{n()}),(a,d)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",o.mergeProps({ref_key:"input",ref:i,type:"range"},I,{class:"range","onUpdate:modelValue":d[0]||(d[0]=m=>t.value=m),onChange:l,onInput:s,"data-testid":I.dataTestid}),null,16,_Ug)),[[o.vModelText,t.value]])}}),[["__scopeId","data-v-50ada1b8"]]),$Ug=["id","data-testid"],qUg=["data-testid"],g7g=["data-testid"],bN=Tg(o.defineComponent({name:"TableNew",__name:"TableNew",props:{tableId:{},search:{},tbodyId:{},theadId:{},columnCount:{},dataTestid:{default:"Table"},isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate"],setup(e,{expose:g,emit:I}){var p;const C=e,t=I,i=o.reactive({headHeight:0,maxColumnCount:0}),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),a=o.ref(null),d=B=>{t("unmount-scroll",B)},m=()=>{if(!A.value||!a.value)return;const B=A.value.querySelector("thead");if(!B)return;const y=B.getBoundingClientRect().height;i.headHeight=y,KI({"--scroll-track-margin-top":`${y}px`},a.value.$el)},u=()=>{a.value&&a.value.scrollToTop()},h=()=>{if(a.value&&s.value){const B=getComputedStyle(a.value.$el),y=Number(B.minHeight.replace(/\D/g,""));if(y&&y>0)return;KI({"min-height":`${i.headHeight+108}px`},a.value.$el)}},Z=()=>{let B=1;if(n.value){for(let y=0;y<n.value.children.length;y++)B=Math.max(n.value.children[y].children.length,B);i.maxColumnCount=B}},G=new MutationObserver(()=>{Z()}),w=new ResizeObserver(()=>{m()});return g({scrollToTop:u,setHeightSlot:(p=a.value)==null?void 0:p.setHeightSlot,tbodyRef:l,tableRef:A,theadRef:n}),o.onMounted(()=>{m(),Z(),window.addEventListener("resize",m),A.value&&w.observe(A.value),n.value&&G.observe(n.value,{childList:!0,subtree:!0}),h()}),(B,y)=>(o.openBlock(),o.createBlock(P0,{ref_key:"scrollWrapperRef",ref:a,class:"table",onUnmountScroll:d,"is-show-vertical-scroll":C.isShowVerticalScroll,"is-show-horizontal-scroll":C.isShowHorizontalScroll,"data-testid":`${C.dataTestid}-ScrollWrapper`},{default:o.withCtx(()=>[o.createElementVNode("table",{ref_key:"tableRef",ref:A,id:C.tableId,class:"table__table","data-testid":`${C.dataTestid}`},[o.renderSlot(B.$slots,"default",{},()=>[o.createElementVNode("colgroup",null,[o.renderSlot(B.$slots,"colspan",{},void 0,!0)]),B.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:n,class:"table__head","data-testid":`${C.dataTestid}-Thead`},[o.renderSlot(B.$slots,"head",{},void 0,!0),B.$slots.search?(o.openBlock(),o.createBlock(E0,{key:0,class:"table__search-tr",ref_key:"searchRowRef",ref:s,"data-testid":`${C.dataTestid}-Search-Row`},{default:o.withCtx(()=>[o.createVNode(um,{colspan:i.maxColumnCount,class:"table__search-th","data-testid":`${C.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(B.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"])):o.createCommentVNode("",!0)],8,qUg)):o.createCommentVNode("",!0),o.renderSlot(B.$slots,"body-group",{},()=>[B.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,ref_key:"tbodyRef",ref:l,class:"table__body","data-testid":`${C.dataTestid}-Tbody`},[o.renderSlot(B.$slots,"body",{},void 0,!0)],8,g7g)):o.createCommentVNode("",!0)],!0)],!0)],8,$Ug)]),_:3},8,["is-show-vertical-scroll","is-show-horizontal-scroll","data-testid"]))}}),[["__scopeId","data-v-30a389ed"]]),I7g=["data-testid"],ZN=Tg(o.defineComponent({name:"TableRow",__name:"TableRowNew",props:{type:{default:"default"},isObserved:{type:Boolean},observer:{},scrolledElement:{},dataTestid:{},colspan:{default:1},rowspan:{}},setup(e){const g=e,I=o.computed(()=>[{"table-row_active":g.type==="selected"}]);return(C,t)=>(o.openBlock(),o.createElementBlock("tr",{class:o.normalizeClass(["table-row",I.value]),"data-testid":g.dataTestid},[o.renderSlot(C.$slots,"default",{},void 0,!0)],10,I7g))}}),[["__scopeId","data-v-c22d3f55"]]),e7g=["data-testid"],Wp=Tg(o.defineComponent({name:"HeadTableRow",__name:"HeadTableRowNew",props:{dataTestid:{default:"TableRow"}},setup(e){const g=e;return(I,C)=>(o.openBlock(),o.createElementBlock("tr",{class:"head-table-row","data-testid":g.dataTestid},[o.renderSlot(I.$slots,"default",{},void 0,!0)],8,e7g))}}),[["__scopeId","data-v-45b56a2a"]]),C7g={class:"scroll-wrapper__vertical-wrapper"},t7g={class:"scroll-wrapper__horizont-wrapper"},i7g=Tg(o.defineComponent({name:"ScrollWrapper",__name:"ScrollWrapperNew",props:{isShowVerticalScroll:{type:Boolean,default:!1},isShowHorizontalScroll:{type:Boolean,default:!1}},emits:["unmount-scroll","unmount-paginate","on-mounted"],setup(e,{expose:g,emit:I}){const C=I,t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.ref(null),l=o.ref(null),s=o.ref(null),{onTrackClick:a,startDrag:d,changeBarPosition:m,setVerticalBarHeight:u,verticalTrackClass:h,isExistVerticalTrack:Z}=ck(t,i,n,A),{changeBarPosition:G,startDrag:w,onTrackClick:p,setHorizontalBarWidth:B,horizontalTrackClass:y,isExistHorizontalTrack:Y}=dk(t,i,s,l),f=Ag=>{m(),G(),C("unmount-scroll",Ag)},M=()=>{requestAnimationFrame(()=>{K(),F()})},K=()=>{if(!t.value||!i.value)return;const Ag=getComputedStyle(i.value),Q=i.value.style.minHeight||Ag.minHeight,$=i.value.style.maxHeight||Ag.maxHeight,mg=i.value.style.height;KI({"--scroll-wrapper-height":`${mg}`,"--scroll-wrapper-max-height":`${$}`,"--scroll-wrapper-min-height":`${Q}`},i.value)},F=()=>{u(),B(),m(),G()},X=()=>{t.value&&t.value.addEventListener("scroll",f)},z=()=>{t.value&&(t.value.scrollTop=0)},L=new MutationObserver(()=>{M()}),O=new ResizeObserver(()=>{M()}),Ig=Ag=>{L.observe(Ag,{childList:!0,subtree:!0,attributes:!0}),O.observe(Ag)};return g({scrollToTop:z,setHeightSlot:K}),o.onMounted(()=>{M(),X(),i.value&&Ig(i.value),A.value&&Ig(A.value),window.addEventListener("resize",M),C("on-mounted")}),o.onUnmounted(()=>{window.removeEventListener("resize",M)}),(Ag,Q)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollWrapperRef",ref:i,class:"scroll-wrapper"},[o.createElementVNode("div",C7g,[o.createElementVNode("div",t7g,[o.createElementVNode("div",{ref_key:"slotRef",ref:t,class:"scroll-wrapper__slot"},[o.renderSlot(Ag.$slots,"default",{},void 0,!0)],512),o.unref(Y)||e.isShowHorizontalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"horizontTrackRef",ref:l,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_horizont",o.unref(y)]),onClick:Q[1]||(Q[1]=o.withModifiers((...$)=>o.unref(p)&&o.unref(p)(...$),["prevent","left"]))},[o.createElementVNode("div",{ref_key:"horizontBarRef",ref:s,class:"scroll-wrapper__bar",onMousedown:Q[0]||(Q[0]=o.withModifiers((...$)=>o.unref(w)&&o.unref(w)(...$),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)]),o.unref(Z)||e.isShowVerticalScroll?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"verticalTrackRef",ref:A,class:o.normalizeClass(["scroll-wrapper__track scroll-wrapper__track_vertical",o.unref(h)]),onClick:Q[3]||(Q[3]=o.withModifiers((...$)=>o.unref(a)&&o.unref(a)(...$),["prevent","left"]))},[o.createElementVNode("div",{ref_key:"verticalBarRef",ref:n,class:"scroll-wrapper__bar",onMousedown:Q[2]||(Q[2]=o.withModifiers((...$)=>o.unref(d)&&o.unref(d)(...$),["prevent","left"]))},null,544)],2)):o.createCommentVNode("",!0)])],512))}}),[["__scopeId","data-v-411a6b7a"]]),A7g=["data-testid"],n7g=["data-testid"],l7g=["data-testid"],GN=Tg(o.defineComponent({name:"TableSimple",__name:"TableSimple",props:{dataTestid:{default:"TableSimple"}},setup(e,{expose:g}){const I=e,C=o.ref(null),t=o.ref(null),i=o.ref(null),A=o.ref(null),n=o.computed(()=>{let l=1;if(t.value)for(let s=0;s<t.value.children.length;s++)l=Math.max(t.value.children[s].children.length,l);return l});return g({tbodyRef:i,tableRef:C,theadRef:t}),(l,s)=>(o.openBlock(),o.createElementBlock("table",{ref_key:"tableRef",ref:C,class:"simple-table-yui-kit","data-testid":`${I.dataTestid}`},[o.renderSlot(l.$slots,"default",{},()=>[o.renderSlot(l.$slots,"colspan",{},void 0,!0),l.$slots.head?(o.openBlock(),o.createElementBlock("thead",{key:0,ref_key:"theadRef",ref:t,class:"simple-table-yui-kit__head","data-testid":`${I.dataTestid}-Thead`},[o.renderSlot(l.$slots,"head",{},void 0,!0),l.$slots.search?(o.openBlock(),o.createBlock(Wp,{key:0,class:"table-new-yui-kit__search",ref_key:"searchRowRef",ref:A,"data-testid":`${I.dataTestid}-Search-Row`},{default:o.withCtx(()=>[o.createVNode(um,{colspan:n.value,class:"table-new-yui-kit__th","data-testid":`${I.dataTestid}-SearchRow-Search`},{default:o.withCtx(()=>[o.renderSlot(l.$slots,"search",{},void 0,!0)]),_:3},8,["colspan","data-testid"])]),_:3},8,["data-testid"])):o.createCommentVNode("",!0)],8,n7g)):o.createCommentVNode("",!0),o.renderSlot(l.$slots,"body-group",{},()=>[l.$slots.body?(o.openBlock(),o.createElementBlock("tbody",{key:0,ref_key:"tbodyRef",ref:i,class:"simple-table-yui-kit__body","data-testid":`${I.dataTestid}-Tbody`},[o.renderSlot(l.$slots,"body",{},void 0,!0)],8,l7g)):o.createCommentVNode("",!0)],!0)],!0)],8,A7g))}}),[["__scopeId","data-v-eaeafe5b"]]),o7g=["data-testid"],s7g=["data-testid"],a7g=["onClick","data-testid"],d7g=["data-testid"],wN=Tg(o.defineComponent({name:"Tabs",__name:"Tabs",props:{defaultActiveTabId:{},tabCount:{},dataTestid:{default:"Tabs"}},emits:["unmount-tab"],setup(e,{emit:g}){const I=e,C=g,t=o.reactive({activeTab:1}),i=n=>Array.from({length:n},(l,s)=>s+1);o.watch(()=>I.defaultActiveTabId,()=>{I.defaultActiveTabId&&(t.activeTab=I.defaultActiveTabId)},{immediate:!0});const A=n=>{t.activeTab=n,C("unmount-tab",n)};return(n,l)=>(o.openBlock(),o.createElementBlock("div",{"data-testid":I.dataTestid,class:"tabs"},[o.createElementVNode("nav",{class:"tabs__navigation","data-testid":`${I.dataTestid}-Navigation`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i(I.tabCount),s=>(o.openBlock(),o.createElementBlock("button",{key:s,onClick:a=>A(s),class:o.normalizeClass(["tabs__navigation-button",{active:t.activeTab===s}]),"data-testid":`${I.dataTestid}-Navigation-Button`},[o.renderSlot(n.$slots,`header${s}`,{},void 0,!0)],10,a7g))),128))],8,s7g),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i(I.tabCount),s=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:s},[t.activeTab===s?(o.openBlock(),o.createElementBlock("article",{key:0,"data-testid":`${I.dataTestid}-Content`,class:"tabs__navigation-content"},[o.renderSlot(n.$slots,`tab${s}`,{},void 0,!0)],8,d7g)):o.createCommentVNode("",!0)],64))),128))],8,o7g))}}),[["__scopeId","data-v-9a94dd67"]]);function EC(e){this.content=e}EC.prototype={constructor:EC,find:function(e){for(var g=0;g<this.content.length;g+=2)if(this.content[g]===e)return g;return-1},get:function(e){var g=this.find(e);return g==-1?void 0:this.content[g+1]},update:function(e,g,I){var C=I&&I!=e?this.remove(I):this,t=C.find(e),i=C.content.slice();return t==-1?i.push(I||e,g):(i[t+1]=g,I&&(i[t]=I)),new EC(i)},remove:function(e){var g=this.find(e);if(g==-1)return this;var I=this.content.slice();return I.splice(g,2),new EC(I)},addToStart:function(e,g){return new EC([e,g].concat(this.remove(e).content))},addToEnd:function(e,g){var I=this.remove(e).content.slice();return I.push(e,g),new EC(I)},addBefore:function(e,g,I){var C=this.remove(g),t=C.content.slice(),i=C.find(e);return t.splice(i==-1?t.length:i,0,g,I),new EC(t)},forEach:function(e){for(var g=0;g<this.content.length;g+=2)e(this.content[g],this.content[g+1])},prepend:function(e){return e=EC.from(e),e.size?new EC(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=EC.from(e),e.size?new EC(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var g=this;e=EC.from(e);for(var I=0;I<e.content.length;I+=2)g=g.remove(e.content[I]);return g},toObject:function(){var e={};return this.forEach(function(g,I){e[g]=I}),e},get size(){return this.content.length>>1}},EC.from=function(e){if(e instanceof EC)return e;var g=[];if(e)for(var I in e)g.push(I,e[I]);return new EC(g)};function mk(e,g,I){for(let C=0;;C++){if(C==e.childCount||C==g.childCount)return e.childCount==g.childCount?null:I;let t=e.child(C),i=g.child(C);if(t==i){I+=t.nodeSize;continue}if(!t.sameMarkup(i))return I;if(t.isText&&t.text!=i.text){for(let A=0;t.text[A]==i.text[A];A++)I++;return I}if(t.content.size||i.content.size){let A=mk(t.content,i.content,I+1);if(A!=null)return A}I+=t.nodeSize}}function uk(e,g,I,C){for(let t=e.childCount,i=g.childCount;;){if(t==0||i==0)return t==i?null:{a:I,b:C};let A=e.child(--t),n=g.child(--i),l=A.nodeSize;if(A==n){I-=l,C-=l;continue}if(!A.sameMarkup(n))return{a:I,b:C};if(A.isText&&A.text!=n.text){let s=0,a=Math.min(A.text.length,n.text.length);for(;s<a&&A.text[A.text.length-s-1]==n.text[n.text.length-s-1];)s++,I--,C--;return{a:I,b:C}}if(A.content.size||n.content.size){let s=uk(A.content,n.content,I-1,C-1);if(s)return s}I-=l,C-=l}}let Bg=class ti{constructor(g,I){if(this.content=g,this.size=I||0,I==null)for(let C=0;C<g.length;C++)this.size+=g[C].nodeSize}nodesBetween(g,I,C,t=0,i){for(let A=0,n=0;n<I;A++){let l=this.content[A],s=n+l.nodeSize;if(s>g&&C(l,t+n,i||null,A)!==!1&&l.content.size){let a=n+1;l.nodesBetween(Math.max(0,g-a),Math.min(l.content.size,I-a),C,t+a)}n=s}}descendants(g){this.nodesBetween(0,this.size,g)}textBetween(g,I,C,t){let i="",A=!0;return this.nodesBetween(g,I,(n,l)=>{let s=n.isText?n.text.slice(Math.max(g,l)-l,I-l):n.isLeaf?t?typeof t=="function"?t(n):t:n.type.spec.leafText?n.type.spec.leafText(n):"":"";n.isBlock&&(n.isLeaf&&s||n.isTextblock)&&C&&(A?A=!1:i+=C),i+=s},0),i}append(g){if(!g.size)return this;if(!this.size)return g;let I=this.lastChild,C=g.firstChild,t=this.content.slice(),i=0;for(I.isText&&I.sameMarkup(C)&&(t[t.length-1]=I.withText(I.text+C.text),i=1);i<g.content.length;i++)t.push(g.content[i]);return new ti(t,this.size+g.size)}cut(g,I=this.size){if(g==0&&I==this.size)return this;let C=[],t=0;if(I>g)for(let i=0,A=0;A<I;i++){let n=this.content[i],l=A+n.nodeSize;l>g&&((A<g||l>I)&&(n.isText?n=n.cut(Math.max(0,g-A),Math.min(n.text.length,I-A)):n=n.cut(Math.max(0,g-A-1),Math.min(n.content.size,I-A-1))),C.push(n),t+=n.nodeSize),A=l}return new ti(C,t)}cutByIndex(g,I){return g==I?ti.empty:g==0&&I==this.content.length?this:new ti(this.content.slice(g,I))}replaceChild(g,I){let C=this.content[g];if(C==I)return this;let t=this.content.slice(),i=this.size+I.nodeSize-C.nodeSize;return t[g]=I,new ti(t,i)}addToStart(g){return new ti([g].concat(this.content),this.size+g.nodeSize)}addToEnd(g){return new ti(this.content.concat(g),this.size+g.nodeSize)}eq(g){if(this.content.length!=g.content.length)return!1;for(let I=0;I<this.content.length;I++)if(!this.content[I].eq(g.content[I]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(g){let I=this.content[g];if(!I)throw new RangeError("Index "+g+" out of range for "+this);return I}maybeChild(g){return this.content[g]||null}forEach(g){for(let I=0,C=0;I<this.content.length;I++){let t=this.content[I];g(t,C,I),C+=t.nodeSize}}findDiffStart(g,I=0){return mk(this,g,I)}findDiffEnd(g,I=this.size,C=g.size){return uk(this,g,I,C)}findIndex(g){if(g==0)return pp(0,g);if(g==this.size)return pp(this.content.length,g);if(g>this.size||g<0)throw new RangeError(`Position ${g} outside of fragment (${this})`);for(let I=0,C=0;;I++){let t=this.child(I),i=C+t.nodeSize;if(i>=g)return i==g?pp(I+1,i):pp(I,C);C=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(g=>g.toJSON()):null}static fromJSON(g,I){if(!I)return ti.empty;if(!Array.isArray(I))throw new RangeError("Invalid input for Fragment.fromJSON");return new ti(I.map(g.nodeFromJSON))}static fromArray(g){if(!g.length)return ti.empty;let I,C=0;for(let t=0;t<g.length;t++){let i=g[t];C+=i.nodeSize,t&&i.isText&&g[t-1].sameMarkup(i)?(I||(I=g.slice(0,t)),I[I.length-1]=i.withText(I[I.length-1].text+i.text)):I&&I.push(i)}return new ti(I||g,C)}static from(g){if(!g)return ti.empty;if(g instanceof ti)return g;if(Array.isArray(g))return this.fromArray(g);if(g.attrs)return new ti([g],g.nodeSize);throw new RangeError("Can not convert "+g+" to a Fragment"+(g.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Bg.empty=new Bg([],0);const WN={index:0,offset:0};function pp(e,g){return WN.index=e,WN.offset=g,WN}function Bp(e,g){if(e===g)return!0;if(!(e&&typeof e=="object")||!(g&&typeof g=="object"))return!1;let I=Array.isArray(e);if(Array.isArray(g)!=I)return!1;if(I){if(e.length!=g.length)return!1;for(let C=0;C<e.length;C++)if(!Bp(e[C],g[C]))return!1}else{for(let C in e)if(!(C in g)||!Bp(e[C],g[C]))return!1;for(let C in g)if(!(C in e))return!1}return!0}let se=class ER{constructor(g,I){this.type=g,this.attrs=I}addToSet(g){let I,C=!1;for(let t=0;t<g.length;t++){let i=g[t];if(this.eq(i))return g;if(this.type.excludes(i.type))I||(I=g.slice(0,t));else{if(i.type.excludes(this.type))return g;!C&&i.type.rank>this.type.rank&&(I||(I=g.slice(0,t)),I.push(this),C=!0),I&&I.push(i)}}return I||(I=g.slice()),C||I.push(this),I}removeFromSet(g){for(let I=0;I<g.length;I++)if(this.eq(g[I]))return g.slice(0,I).concat(g.slice(I+1));return g}isInSet(g){for(let I=0;I<g.length;I++)if(this.eq(g[I]))return!0;return!1}eq(g){return this==g||this.type==g.type&&Bp(this.attrs,g.attrs)}toJSON(){let g={type:this.type.name};for(let I in this.attrs){g.attrs=this.attrs;break}return g}static fromJSON(g,I){if(!I)throw new RangeError("Invalid input for Mark.fromJSON");let C=g.marks[I.type];if(!C)throw new RangeError(`There is no mark type ${I.type} in this schema`);let t=C.create(I.attrs);return C.checkAttrs(t.attrs),t}static sameSet(g,I){if(g==I)return!0;if(g.length!=I.length)return!1;for(let C=0;C<g.length;C++)if(!g[C].eq(I[C]))return!1;return!0}static setFrom(g){if(!g||Array.isArray(g)&&g.length==0)return ER.none;if(g instanceof ER)return[g];let I=g.slice();return I.sort((C,t)=>C.type.rank-t.type.rank),I}};se.none=[];let yp=class extends Error{},zg=class Sh{constructor(g,I,C){this.content=g,this.openStart=I,this.openEnd=C}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(g,I){let C=bk(this.content,g+this.openStart,I);return C&&new Sh(C,this.openStart,this.openEnd)}removeBetween(g,I){return new Sh(hk(this.content,g+this.openStart,I+this.openStart),this.openStart,this.openEnd)}eq(g){return this.content.eq(g.content)&&this.openStart==g.openStart&&this.openEnd==g.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let g={content:this.content.toJSON()};return this.openStart>0&&(g.openStart=this.openStart),this.openEnd>0&&(g.openEnd=this.openEnd),g}static fromJSON(g,I){if(!I)return Sh.empty;let C=I.openStart||0,t=I.openEnd||0;if(typeof C!="number"||typeof t!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Sh(Bg.fromJSON(g,I.content),C,t)}static maxOpen(g,I=!0){let C=0,t=0;for(let i=g.firstChild;i&&!i.isLeaf&&(I||!i.type.spec.isolating);i=i.firstChild)C++;for(let i=g.lastChild;i&&!i.isLeaf&&(I||!i.type.spec.isolating);i=i.lastChild)t++;return new Sh(g,C,t)}};zg.empty=new zg(Bg.empty,0,0);function hk(e,g,I){let{index:C,offset:t}=e.findIndex(g),i=e.maybeChild(C),{index:A,offset:n}=e.findIndex(I);if(t==g||i.isText){if(n!=I&&!e.child(A).isText)throw new RangeError("Removing non-flat range");return e.cut(0,g).append(e.cut(I))}if(C!=A)throw new RangeError("Removing non-flat range");return e.replaceChild(C,i.copy(hk(i.content,g-t-1,I-t-1)))}function bk(e,g,I,C){let{index:t,offset:i}=e.findIndex(g),A=e.maybeChild(t);if(i==g||A.isText)return C&&!C.canReplace(t,t,I)?null:e.cut(0,g).append(I).append(e.cut(g));let n=bk(A.content,g-i-1,I,A);return n&&e.replaceChild(t,A.copy(n))}function c7g(e,g,I){if(I.openStart>e.depth)throw new yp("Inserted content deeper than insertion position");if(e.depth-I.openStart!=g.depth-I.openEnd)throw new yp("Inconsistent open depths");return Zk(e,g,I,0)}function Zk(e,g,I,C){let t=e.index(C),i=e.node(C);if(t==g.index(C)&&C<e.depth-I.openStart){let A=Zk(e,g,I,C+1);return i.copy(i.content.replaceChild(t,A))}else if(I.content.size)if(!I.openStart&&!I.openEnd&&e.depth==C&&g.depth==C){let A=e.parent,n=A.content;return Kd(A,n.cut(0,e.parentOffset).append(I.content).append(n.cut(g.parentOffset)))}else{let{start:A,end:n}=r7g(I,e);return Kd(i,wk(e,A,n,g,C))}else return Kd(i,Yp(e,g,C))}function Gk(e,g){if(!g.type.compatibleContent(e.type))throw new yp("Cannot join "+g.type.name+" onto "+e.type.name)}function pN(e,g,I){let C=e.node(I);return Gk(C,g.node(I)),C}function Sd(e,g){let I=g.length-1;I>=0&&e.isText&&e.sameMarkup(g[I])?g[I]=e.withText(g[I].text+e.text):g.push(e)}function $0(e,g,I,C){let t=(g||e).node(I),i=0,A=g?g.index(I):t.childCount;e&&(i=e.index(I),e.depth>I?i++:e.textOffset&&(Sd(e.nodeAfter,C),i++));for(let n=i;n<A;n++)Sd(t.child(n),C);g&&g.depth==I&&g.textOffset&&Sd(g.nodeBefore,C)}function Kd(e,g){return e.type.checkContent(g),e.copy(g)}function wk(e,g,I,C,t){let i=e.depth>t&&pN(e,g,t+1),A=C.depth>t&&pN(I,C,t+1),n=[];return $0(null,e,t,n),i&&A&&g.index(t)==I.index(t)?(Gk(i,A),Sd(Kd(i,wk(e,g,I,C,t+1)),n)):(i&&Sd(Kd(i,Yp(e,g,t+1)),n),$0(g,I,t,n),A&&Sd(Kd(A,Yp(I,C,t+1)),n)),$0(C,null,t,n),new Bg(n)}function Yp(e,g,I){let C=[];if($0(null,e,I,C),e.depth>I){let t=pN(e,g,I+1);Sd(Kd(t,Yp(e,g,I+1)),C)}return $0(g,null,I,C),new Bg(C)}function r7g(e,g){let I=g.depth-e.openStart,t=g.node(I).copy(e.content);for(let i=I-1;i>=0;i--)t=g.node(i).copy(Bg.from(t));return{start:t.resolveNoCache(e.openStart+I),end:t.resolveNoCache(t.content.size-e.openEnd-I)}}class q0{constructor(g,I,C){this.pos=g,this.path=I,this.parentOffset=C,this.depth=I.length/3-1}resolveDepth(g){return g==null?this.depth:g<0?this.depth+g:g}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(g){return this.path[this.resolveDepth(g)*3]}index(g){return this.path[this.resolveDepth(g)*3+1]}indexAfter(g){return g=this.resolveDepth(g),this.index(g)+(g==this.depth&&!this.textOffset?0:1)}start(g){return g=this.resolveDepth(g),g==0?0:this.path[g*3-1]+1}end(g){return g=this.resolveDepth(g),this.start(g)+this.node(g).content.size}before(g){if(g=this.resolveDepth(g),!g)throw new RangeError("There is no position before the top-level node");return g==this.depth+1?this.pos:this.path[g*3-1]}after(g){if(g=this.resolveDepth(g),!g)throw new RangeError("There is no position after the top-level node");return g==this.depth+1?this.pos:this.path[g*3-1]+this.path[g*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let g=this.parent,I=this.index(this.depth);if(I==g.childCount)return null;let C=this.pos-this.path[this.path.length-1],t=g.child(I);return C?g.child(I).cut(C):t}get nodeBefore(){let g=this.index(this.depth),I=this.pos-this.path[this.path.length-1];return I?this.parent.child(g).cut(0,I):g==0?null:this.parent.child(g-1)}posAtIndex(g,I){I=this.resolveDepth(I);let C=this.path[I*3],t=I==0?0:this.path[I*3-1]+1;for(let i=0;i<g;i++)t+=C.child(i).nodeSize;return t}marks(){let g=this.parent,I=this.index();if(g.content.size==0)return se.none;if(this.textOffset)return g.child(I).marks;let C=g.maybeChild(I-1),t=g.maybeChild(I);if(!C){let n=C;C=t,t=n}let i=C.marks;for(var A=0;A<i.length;A++)i[A].type.spec.inclusive===!1&&(!t||!i[A].isInSet(t.marks))&&(i=i[A--].removeFromSet(i));return i}marksAcross(g){let I=this.parent.maybeChild(this.index());if(!I||!I.isInline)return null;let C=I.marks,t=g.parent.maybeChild(g.index());for(var i=0;i<C.length;i++)C[i].type.spec.inclusive===!1&&(!t||!C[i].isInSet(t.marks))&&(C=C[i--].removeFromSet(C));return C}sharedDepth(g){for(let I=this.depth;I>0;I--)if(this.start(I)<=g&&this.end(I)>=g)return I;return 0}blockRange(g=this,I){if(g.pos<this.pos)return g.blockRange(this);for(let C=this.depth-(this.parent.inlineContent||this.pos==g.pos?1:0);C>=0;C--)if(g.pos<=this.end(C)&&(!I||I(this.node(C))))return new Vp(this,g,C);return null}sameParent(g){return this.pos-this.parentOffset==g.pos-g.parentOffset}max(g){return g.pos>this.pos?g:this}min(g){return g.pos<this.pos?g:this}toString(){let g="";for(let I=1;I<=this.depth;I++)g+=(g?"/":"")+this.node(I).type.name+"_"+this.index(I-1);return g+":"+this.parentOffset}static resolve(g,I){if(!(I>=0&&I<=g.content.size))throw new RangeError("Position "+I+" out of range");let C=[],t=0,i=I;for(let A=g;;){let{index:n,offset:l}=A.content.findIndex(i),s=i-l;if(C.push(A,n,t+l),!s||(A=A.child(n),A.isText))break;i=s-1,t+=l+1}return new q0(I,C,i)}static resolveCached(g,I){let C=Wk.get(g);if(C)for(let i=0;i<C.elts.length;i++){let A=C.elts[i];if(A.pos==I)return A}else Wk.set(g,C=new m7g);let t=C.elts[C.i]=q0.resolve(g,I);return C.i=(C.i+1)%u7g,t}}class m7g{constructor(){this.elts=[],this.i=0}}const u7g=12,Wk=new WeakMap;class Vp{constructor(g,I,C){this.$from=g,this.$to=I,this.depth=C}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const h7g=Object.create(null);let Xs=class PR{constructor(g,I,C,t=se.none){this.type=g,this.attrs=I,this.marks=t,this.content=C||Bg.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(g){return this.content.child(g)}maybeChild(g){return this.content.maybeChild(g)}forEach(g){this.content.forEach(g)}nodesBetween(g,I,C,t=0){this.content.nodesBetween(g,I,C,t,this)}descendants(g){this.nodesBetween(0,this.content.size,g)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(g,I,C,t){return this.content.textBetween(g,I,C,t)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(g){return this==g||this.sameMarkup(g)&&this.content.eq(g.content)}sameMarkup(g){return this.hasMarkup(g.type,g.attrs,g.marks)}hasMarkup(g,I,C){return this.type==g&&Bp(this.attrs,I||g.defaultAttrs||h7g)&&se.sameSet(this.marks,C||se.none)}copy(g=null){return g==this.content?this:new PR(this.type,this.attrs,g,this.marks)}mark(g){return g==this.marks?this:new PR(this.type,this.attrs,this.content,g)}cut(g,I=this.content.size){return g==0&&I==this.content.size?this:this.copy(this.content.cut(g,I))}slice(g,I=this.content.size,C=!1){if(g==I)return zg.empty;let t=this.resolve(g),i=this.resolve(I),A=C?0:t.sharedDepth(I),n=t.start(A),s=t.node(A).content.cut(t.pos-n,i.pos-n);return new zg(s,t.depth-A,i.depth-A)}replace(g,I,C){return c7g(this.resolve(g),this.resolve(I),C)}nodeAt(g){for(let I=this;;){let{index:C,offset:t}=I.content.findIndex(g);if(I=I.maybeChild(C),!I)return null;if(t==g||I.isText)return I;g-=t+1}}childAfter(g){let{index:I,offset:C}=this.content.findIndex(g);return{node:this.content.maybeChild(I),index:I,offset:C}}childBefore(g){if(g==0)return{node:null,index:0,offset:0};let{index:I,offset:C}=this.content.findIndex(g);if(C<g)return{node:this.content.child(I),index:I,offset:C};let t=this.content.child(I-1);return{node:t,index:I-1,offset:C-t.nodeSize}}resolve(g){return q0.resolveCached(this,g)}resolveNoCache(g){return q0.resolve(this,g)}rangeHasMark(g,I,C){let t=!1;return I>g&&this.nodesBetween(g,I,i=>(C.isInSet(i.marks)&&(t=!0),!t)),t}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let g=this.type.name;return this.content.size&&(g+="("+this.content.toStringInner()+")"),pk(this.marks,g)}contentMatchAt(g){let I=this.type.contentMatch.matchFragment(this.content,0,g);if(!I)throw new Error("Called contentMatchAt on a node with invalid content");return I}canReplace(g,I,C=Bg.empty,t=0,i=C.childCount){let A=this.contentMatchAt(g).matchFragment(C,t,i),n=A&&A.matchFragment(this.content,I);if(!n||!n.validEnd)return!1;for(let l=t;l<i;l++)if(!this.type.allowsMarks(C.child(l).marks))return!1;return!0}canReplaceWith(g,I,C,t){if(t&&!this.type.allowsMarks(t))return!1;let i=this.contentMatchAt(g).matchType(C),A=i&&i.matchFragment(this.content,I);return A?A.validEnd:!1}canAppend(g){return g.content.size?this.canReplace(this.childCount,this.childCount,g.content):this.type.compatibleContent(g.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let g=se.none;for(let I=0;I<this.marks.length;I++){let C=this.marks[I];C.type.checkAttrs(C.attrs),g=C.addToSet(g)}if(!se.sameSet(g,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(I=>I.type.name)}`);this.content.forEach(I=>I.check())}toJSON(){let g={type:this.type.name};for(let I in this.attrs){g.attrs=this.attrs;break}return this.content.size&&(g.content=this.content.toJSON()),this.marks.length&&(g.marks=this.marks.map(I=>I.toJSON())),g}static fromJSON(g,I){if(!I)throw new RangeError("Invalid input for Node.fromJSON");let C;if(I.marks){if(!Array.isArray(I.marks))throw new RangeError("Invalid mark data for Node.fromJSON");C=I.marks.map(g.markFromJSON)}if(I.type=="text"){if(typeof I.text!="string")throw new RangeError("Invalid text node in JSON");return g.text(I.text,C)}let t=Bg.fromJSON(g,I.content),i=g.nodeType(I.type).create(I.attrs,t,C);return i.type.checkAttrs(i.attrs),i}};Xs.prototype.text=void 0;class Np extends Xs{constructor(g,I,C,t){if(super(g,I,null,t),!C)throw new RangeError("Empty text nodes are not allowed");this.text=C}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pk(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(g,I){return this.text.slice(g,I)}get nodeSize(){return this.text.length}mark(g){return g==this.marks?this:new Np(this.type,this.attrs,this.text,g)}withText(g){return g==this.text?this:new Np(this.type,this.attrs,g,this.marks)}cut(g=0,I=this.text.length){return g==0&&I==this.text.length?this:this.withText(this.text.slice(g,I))}eq(g){return this.sameMarkup(g)&&this.text==g.text}toJSON(){let g=super.toJSON();return g.text=this.text,g}}function pk(e,g){for(let I=e.length-1;I>=0;I--)g=e[I].type.name+"("+g+")";return g}class kd{constructor(g){this.validEnd=g,this.next=[],this.wrapCache=[]}static parse(g,I){let C=new b7g(g,I);if(C.next==null)return kd.empty;let t=Bk(C);C.next&&C.err("Unexpected trailing text");let i=y7g(B7g(t));return Y7g(i,C),i}matchType(g){for(let I=0;I<this.next.length;I++)if(this.next[I].type==g)return this.next[I].next;return null}matchFragment(g,I=0,C=g.childCount){let t=this;for(let i=I;t&&i<C;i++)t=t.matchType(g.child(i).type);return t}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let g=0;g<this.next.length;g++){let{type:I}=this.next[g];if(!(I.isText||I.hasRequiredAttrs()))return I}return null}compatible(g){for(let I=0;I<this.next.length;I++)for(let C=0;C<g.next.length;C++)if(this.next[I].type==g.next[C].type)return!0;return!1}fillBefore(g,I=!1,C=0){let t=[this];function i(A,n){let l=A.matchFragment(g,C);if(l&&(!I||l.validEnd))return Bg.from(n.map(s=>s.createAndFill()));for(let s=0;s<A.next.length;s++){let{type:a,next:d}=A.next[s];if(!(a.isText||a.hasRequiredAttrs())&&t.indexOf(d)==-1){t.push(d);let m=i(d,n.concat(a));if(m)return m}}return null}return i(this,[])}findWrapping(g){for(let C=0;C<this.wrapCache.length;C+=2)if(this.wrapCache[C]==g)return this.wrapCache[C+1];let I=this.computeWrapping(g);return this.wrapCache.push(g,I),I}computeWrapping(g){let I=Object.create(null),C=[{match:this,type:null,via:null}];for(;C.length;){let t=C.shift(),i=t.match;if(i.matchType(g)){let A=[];for(let n=t;n.type;n=n.via)A.push(n.type);return A.reverse()}for(let A=0;A<i.next.length;A++){let{type:n,next:l}=i.next[A];!n.isLeaf&&!n.hasRequiredAttrs()&&!(n.name in I)&&(!t.type||l.validEnd)&&(C.push({match:n.contentMatch,type:n,via:t}),I[n.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(g){if(g>=this.next.length)throw new RangeError(`There's no ${g}th edge in this content match`);return this.next[g]}toString(){let g=[];function I(C){g.push(C);for(let t=0;t<C.next.length;t++)g.indexOf(C.next[t].next)==-1&&I(C.next[t].next)}return I(this),g.map((C,t)=>{let i=t+(C.validEnd?"*":" ")+" ";for(let A=0;A<C.next.length;A++)i+=(A?", ":"")+C.next[A].type.name+"->"+g.indexOf(C.next[A].next);return i}).join(`
1458
+ `)}}kd.empty=new kd(!0);class b7g{constructor(g,I){this.string=g,this.nodeTypes=I,this.inline=null,this.pos=0,this.tokens=g.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(g){return this.next==g&&(this.pos++||!0)}err(g){throw new SyntaxError(g+" (in content expression '"+this.string+"')")}}function Bk(e){let g=[];do g.push(Z7g(e));while(e.eat("|"));return g.length==1?g[0]:{type:"choice",exprs:g}}function Z7g(e){let g=[];do g.push(G7g(e));while(e.next&&e.next!=")"&&e.next!="|");return g.length==1?g[0]:{type:"seq",exprs:g}}function G7g(e){let g=p7g(e);for(;;)if(e.eat("+"))g={type:"plus",expr:g};else if(e.eat("*"))g={type:"star",expr:g};else if(e.eat("?"))g={type:"opt",expr:g};else if(e.eat("{"))g=w7g(e,g);else break;return g}function yk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let g=Number(e.next);return e.pos++,g}function w7g(e,g){let I=yk(e),C=I;return e.eat(",")&&(e.next!="}"?C=yk(e):C=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:I,max:C,expr:g}}function W7g(e,g){let I=e.nodeTypes,C=I[g];if(C)return[C];let t=[];for(let i in I){let A=I[i];A.isInGroup(g)&&t.push(A)}return t.length==0&&e.err("No node type or group '"+g+"' found"),t}function p7g(e){if(e.eat("(")){let g=Bk(e);return e.eat(")")||e.err("Missing closing paren"),g}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let g=W7g(e,e.next).map(I=>(e.inline==null?e.inline=I.isInline:e.inline!=I.isInline&&e.err("Mixing inline and block content"),{type:"name",value:I}));return e.pos++,g.length==1?g[0]:{type:"choice",exprs:g}}}function B7g(e){let g=[[]];return t(i(e,0),I()),g;function I(){return g.push([])-1}function C(A,n,l){let s={term:l,to:n};return g[A].push(s),s}function t(A,n){A.forEach(l=>l.to=n)}function i(A,n){if(A.type=="choice")return A.exprs.reduce((l,s)=>l.concat(i(s,n)),[]);if(A.type=="seq")for(let l=0;;l++){let s=i(A.exprs[l],n);if(l==A.exprs.length-1)return s;t(s,n=I())}else if(A.type=="star"){let l=I();return C(n,l),t(i(A.expr,l),l),[C(l)]}else if(A.type=="plus"){let l=I();return t(i(A.expr,n),l),t(i(A.expr,l),l),[C(l)]}else{if(A.type=="opt")return[C(n)].concat(i(A.expr,n));if(A.type=="range"){let l=n;for(let s=0;s<A.min;s++){let a=I();t(i(A.expr,l),a),l=a}if(A.max==-1)t(i(A.expr,l),l);else for(let s=A.min;s<A.max;s++){let a=I();C(l,a),t(i(A.expr,l),a),l=a}return[C(l)]}else{if(A.type=="name")return[C(n,void 0,A.value)];throw new Error("Unknown expr type")}}}}function Yk(e,g){return g-e}function Vk(e,g){let I=[];return C(g),I.sort(Yk);function C(t){let i=e[t];if(i.length==1&&!i[0].term)return C(i[0].to);I.push(t);for(let A=0;A<i.length;A++){let{term:n,to:l}=i[A];!n&&I.indexOf(l)==-1&&C(l)}}}function y7g(e){let g=Object.create(null);return I(Vk(e,0));function I(C){let t=[];C.forEach(A=>{e[A].forEach(({term:n,to:l})=>{if(!n)return;let s;for(let a=0;a<t.length;a++)t[a][0]==n&&(s=t[a][1]);Vk(e,l).forEach(a=>{s||t.push([n,s=[]]),s.indexOf(a)==-1&&s.push(a)})})});let i=g[C.join(",")]=new kd(C.indexOf(e.length-1)>-1);for(let A=0;A<t.length;A++){let n=t[A][1].sort(Yk);i.next.push({type:t[A][0],next:g[n.join(",")]||I(n)})}return i}}function Y7g(e,g){for(let I=0,C=[e];I<C.length;I++){let t=C[I],i=!t.validEnd,A=[];for(let n=0;n<t.next.length;n++){let{type:l,next:s}=t.next[n];A.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),C.indexOf(s)==-1&&C.push(s)}i&&g.err("Only non-generatable nodes ("+A.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Nk(e){let g=Object.create(null);for(let I in e){let C=e[I];if(!C.hasDefault)return null;g[I]=C.default}return g}function Mk(e,g){let I=Object.create(null);for(let C in e){let t=g&&g[C];if(t===void 0){let i=e[C];if(i.hasDefault)t=i.default;else throw new RangeError("No value supplied for attribute "+C)}I[C]=t}return I}function fk(e,g,I,C){for(let t in g)if(!(t in e))throw new RangeError(`Unsupported attribute ${t} for ${I} of type ${t}`);for(let t in e){let i=e[t];i.validate&&i.validate(g[t])}}function Rk(e,g){let I=Object.create(null);if(g)for(let C in g)I[C]=new N7g(e,C,g[C]);return I}let Xk=class n4{constructor(g,I,C){this.name=g,this.schema=I,this.spec=C,this.markSet=null,this.groups=C.group?C.group.split(" "):[],this.attrs=Rk(g,C.attrs),this.defaultAttrs=Nk(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(C.inline||g=="text"),this.isText=g=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kd.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(g){return this.groups.indexOf(g)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let g in this.attrs)if(this.attrs[g].isRequired)return!0;return!1}compatibleContent(g){return this==g||this.contentMatch.compatible(g.contentMatch)}computeAttrs(g){return!g&&this.defaultAttrs?this.defaultAttrs:Mk(this.attrs,g)}create(g=null,I,C){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xs(this,this.computeAttrs(g),Bg.from(I),se.setFrom(C))}createChecked(g=null,I,C){return I=Bg.from(I),this.checkContent(I),new Xs(this,this.computeAttrs(g),I,se.setFrom(C))}createAndFill(g=null,I,C){if(g=this.computeAttrs(g),I=Bg.from(I),I.size){let A=this.contentMatch.fillBefore(I);if(!A)return null;I=A.append(I)}let t=this.contentMatch.matchFragment(I),i=t&&t.fillBefore(Bg.empty,!0);return i?new Xs(this,g,I.append(i),se.setFrom(C)):null}validContent(g){let I=this.contentMatch.matchFragment(g);if(!I||!I.validEnd)return!1;for(let C=0;C<g.childCount;C++)if(!this.allowsMarks(g.child(C).marks))return!1;return!0}checkContent(g){if(!this.validContent(g))throw new RangeError(`Invalid content for node ${this.name}: ${g.toString().slice(0,50)}`)}checkAttrs(g){fk(this.attrs,g,"node",this.name)}allowsMarkType(g){return this.markSet==null||this.markSet.indexOf(g)>-1}allowsMarks(g){if(this.markSet==null)return!0;for(let I=0;I<g.length;I++)if(!this.allowsMarkType(g[I].type))return!1;return!0}allowedMarks(g){if(this.markSet==null)return g;let I;for(let C=0;C<g.length;C++)this.allowsMarkType(g[C].type)?I&&I.push(g[C]):I||(I=g.slice(0,C));return I?I.length?I:se.none:g}static compile(g,I){let C=Object.create(null);g.forEach((i,A)=>C[i]=new n4(i,I,A));let t=I.spec.topNode||"doc";if(!C[t])throw new RangeError("Schema is missing its top node type ('"+t+"')");if(!C.text)throw new RangeError("Every schema needs a 'text' type");for(let i in C.text.attrs)throw new RangeError("The text node type should not have attributes");return C}};function V7g(e,g,I){let C=I.split("|");return t=>{let i=t===null?"null":typeof t;if(C.indexOf(i)<0)throw new RangeError(`Expected value of type ${C} for attribute ${g} on type ${e}, got ${i}`)}}class N7g{constructor(g,I,C){this.hasDefault=Object.prototype.hasOwnProperty.call(C,"default"),this.default=C.default,this.validate=typeof C.validate=="string"?V7g(g,I,C.validate):C.validate}get isRequired(){return!this.hasDefault}}class Mp{constructor(g,I,C,t){this.name=g,this.rank=I,this.schema=C,this.spec=t,this.attrs=Rk(g,t.attrs),this.excluded=null;let i=Nk(this.attrs);this.instance=i?new se(this,i):null}create(g=null){return!g&&this.instance?this.instance:new se(this,Mk(this.attrs,g))}static compile(g,I){let C=Object.create(null),t=0;return g.forEach((i,A)=>C[i]=new Mp(i,t++,I,A)),C}removeFromSet(g){for(var I=0;I<g.length;I++)g[I].type==this&&(g=g.slice(0,I).concat(g.slice(I+1)),I--);return g}isInSet(g){for(let I=0;I<g.length;I++)if(g[I].type==this)return g[I]}checkAttrs(g){fk(this.attrs,g,"mark",this.name)}excludes(g){return this.excluded.indexOf(g)>-1}}class Hk{constructor(g){this.linebreakReplacement=null,this.cached=Object.create(null);let I=this.spec={};for(let t in g)I[t]=g[t];I.nodes=EC.from(g.nodes),I.marks=EC.from(g.marks||{}),this.nodes=Xk.compile(this.spec.nodes,this),this.marks=Mp.compile(this.spec.marks,this);let C=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let i=this.nodes[t],A=i.spec.content||"",n=i.spec.marks;if(i.contentMatch=C[A]||(C[A]=kd.parse(A,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=n=="_"?null:n?Dk(this,n.split(" ")):n==""||!i.inlineContent?[]:null}for(let t in this.marks){let i=this.marks[t],A=i.spec.excludes;i.excluded=A==null?[i]:A==""?[]:Dk(this,A.split(" "))}this.nodeFromJSON=t=>Xs.fromJSON(this,t),this.markFromJSON=t=>se.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(g,I=null,C,t){if(typeof g=="string")g=this.nodeType(g);else if(g instanceof Xk){if(g.schema!=this)throw new RangeError("Node type from different schema used ("+g.name+")")}else throw new RangeError("Invalid node type: "+g);return g.createChecked(I,C,t)}text(g,I){let C=this.nodes.text;return new Np(C,C.defaultAttrs,g,se.setFrom(I))}mark(g,I){return typeof g=="string"&&(g=this.marks[g]),g.create(I)}nodeType(g){let I=this.nodes[g];if(!I)throw new RangeError("Unknown node type: "+g);return I}}function Dk(e,g){let I=[];for(let C=0;C<g.length;C++){let t=g[C],i=e.marks[t],A=i;if(i)I.push(i);else for(let n in e.marks){let l=e.marks[n];(t=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(t)>-1)&&I.push(A=l)}if(!A)throw new SyntaxError("Unknown mark type: '"+g[C]+"'")}return I}function M7g(e){return e.tag!=null}function f7g(e){return e.style!=null}class Hs{constructor(g,I){this.schema=g,this.rules=I,this.tags=[],this.styles=[];let C=this.matchedStyles=[];I.forEach(t=>{if(M7g(t))this.tags.push(t);else if(f7g(t)){let i=/[^=]*/.exec(t.style)[0];C.indexOf(i)<0&&C.push(i),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let i=g.nodes[t.node];return i.contentMatch.matchType(i)})}parse(g,I={}){let C=new Fk(this,I,!1);return C.addAll(g,se.none,I.from,I.to),C.finish()}parseSlice(g,I={}){let C=new Fk(this,I,!0);return C.addAll(g,se.none,I.from,I.to),zg.maxOpen(C.finish())}matchTag(g,I,C){for(let t=C?this.tags.indexOf(C)+1:0;t<this.tags.length;t++){let i=this.tags[t];if(H7g(g,i.tag)&&(i.namespace===void 0||g.namespaceURI==i.namespace)&&(!i.context||I.matchesContext(i.context))){if(i.getAttrs){let A=i.getAttrs(g);if(A===!1)continue;i.attrs=A||void 0}return i}}}matchStyle(g,I,C,t){for(let i=t?this.styles.indexOf(t)+1:0;i<this.styles.length;i++){let A=this.styles[i],n=A.style;if(!(n.indexOf(g)!=0||A.context&&!C.matchesContext(A.context)||n.length>g.length&&(n.charCodeAt(g.length)!=61||n.slice(g.length+1)!=I))){if(A.getAttrs){let l=A.getAttrs(I);if(l===!1)continue;A.attrs=l||void 0}return A}}}static schemaRules(g){let I=[];function C(t){let i=t.priority==null?50:t.priority,A=0;for(;A<I.length;A++){let n=I[A];if((n.priority==null?50:n.priority)<i)break}I.splice(A,0,t)}for(let t in g.marks){let i=g.marks[t].spec.parseDOM;i&&i.forEach(A=>{C(A=zk(A)),A.mark||A.ignore||A.clearMark||(A.mark=t)})}for(let t in g.nodes){let i=g.nodes[t].spec.parseDOM;i&&i.forEach(A=>{C(A=zk(A)),A.node||A.ignore||A.mark||(A.node=t)})}return I}static fromSchema(g){return g.cached.domParser||(g.cached.domParser=new Hs(g,Hs.schemaRules(g)))}}const Sk={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},R7g={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Kk={ol:!0,ul:!0},gb=1,BN=2,Ib=4;function kk(e,g,I){return g!=null?(g?gb:0)|(g==="full"?BN:0):e&&e.whitespace=="pre"?gb|BN:I&~Ib}class fp{constructor(g,I,C,t,i,A){this.type=g,this.attrs=I,this.marks=C,this.solid=t,this.options=A,this.content=[],this.activeMarks=se.none,this.match=i||(A&Ib?null:g.contentMatch)}findWrapping(g){if(!this.match){if(!this.type)return[];let I=this.type.contentMatch.fillBefore(Bg.from(g));if(I)this.match=this.type.contentMatch.matchFragment(I);else{let C=this.type.contentMatch,t;return(t=C.findWrapping(g.type))?(this.match=C,t):null}}return this.match.findWrapping(g.type)}finish(g){if(!(this.options&gb)){let C=this.content[this.content.length-1],t;if(C&&C.isText&&(t=/[ \t\r\n\u000c]+$/.exec(C.text))){let i=C;C.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length))}}let I=Bg.from(this.content);return!g&&this.match&&(I=I.append(this.match.fillBefore(Bg.empty,!0))),this.type?this.type.create(this.attrs,I,this.marks):I}inlineContext(g){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:g.parentNode&&!Sk.hasOwnProperty(g.parentNode.nodeName.toLowerCase())}}class Fk{constructor(g,I,C){this.parser=g,this.options=I,this.isOpen=C,this.open=0,this.localPreserveWS=!1;let t=I.topNode,i,A=kk(null,I.preserveWhitespace,0)|(C?Ib:0);t?i=new fp(t.type,t.attrs,se.none,!0,I.topMatch||t.type.contentMatch,A):C?i=new fp(null,null,se.none,!0,null,A):i=new fp(g.schema.topNodeType,null,se.none,!0,null,A),this.nodes=[i],this.find=I.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(g,I){g.nodeType==3?this.addTextNode(g,I):g.nodeType==1&&this.addElement(g,I)}addTextNode(g,I){let C=g.nodeValue,t=this.top,i=t.options&BN?"full":this.localPreserveWS||(t.options&gb)>0;if(i==="full"||t.inlineContext(g)||/[^ \t\r\n\u000c]/.test(C)){if(i)i!=="full"?C=C.replace(/\r?\n|\r/g," "):C=C.replace(/\r\n?/g,`
1459
+ `);else if(C=C.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(C)&&this.open==this.nodes.length-1){let A=t.content[t.content.length-1],n=g.previousSibling;(!A||n&&n.nodeName=="BR"||A.isText&&/[ \t\r\n\u000c]$/.test(A.text))&&(C=C.slice(1))}C&&this.insertNode(this.parser.schema.text(C),I,!/\S/.test(C)),this.findInText(g)}else this.findInside(g)}addElement(g,I,C){let t=this.localPreserveWS,i=this.top;(g.tagName=="PRE"||/pre/.test(g.style&&g.style.whiteSpace))&&(this.localPreserveWS=!0);let A=g.nodeName.toLowerCase(),n;Kk.hasOwnProperty(A)&&this.parser.normalizeLists&&X7g(g);let l=this.options.ruleFromNode&&this.options.ruleFromNode(g)||(n=this.parser.matchTag(g,this,C));g:if(l?l.ignore:R7g.hasOwnProperty(A))this.findInside(g),this.ignoreFallback(g,I);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(g=l.skip);let s,a=this.needsBlock;if(Sk.hasOwnProperty(A))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),s=!0,i.type||(this.needsBlock=!0);else if(!g.firstChild){this.leafFallback(g,I);break g}let d=l&&l.skip?I:this.readStyles(g,I);d&&this.addAll(g,d),s&&this.sync(i),this.needsBlock=a}else{let s=this.readStyles(g,I);s&&this.addElementByRule(g,l,s,l.consuming===!1?n:void 0)}this.localPreserveWS=t}leafFallback(g,I){g.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(g.ownerDocument.createTextNode(`
1460
+ `),I)}ignoreFallback(g,I){g.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),I,!0)}readStyles(g,I){let C=g.style;if(C&&C.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let i=this.parser.matchedStyles[t],A=C.getPropertyValue(i);if(A)for(let n=void 0;;){let l=this.parser.matchStyle(i,A,this,n);if(!l)break;if(l.ignore)return null;if(l.clearMark?I=I.filter(s=>!l.clearMark(s)):I=I.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)n=l;else break}}return I}addElementByRule(g,I,C,t){let i,A;if(I.node)if(A=this.parser.schema.nodes[I.node],A.isLeaf)this.insertNode(A.create(I.attrs),C,g.nodeName=="BR")||this.leafFallback(g,C);else{let l=this.enter(A,I.attrs||null,C,I.preserveWhitespace);l&&(i=!0,C=l)}else{let l=this.parser.schema.marks[I.mark];C=C.concat(l.create(I.attrs))}let n=this.top;if(A&&A.isLeaf)this.findInside(g);else if(t)this.addElement(g,C,t);else if(I.getContent)this.findInside(g),I.getContent(g,this.parser.schema).forEach(l=>this.insertNode(l,C,!1));else{let l=g;typeof I.contentElement=="string"?l=g.querySelector(I.contentElement):typeof I.contentElement=="function"?l=I.contentElement(g):I.contentElement&&(l=I.contentElement),this.findAround(g,l,!0),this.addAll(l,C),this.findAround(g,l,!1)}i&&this.sync(n)&&this.open--}addAll(g,I,C,t){let i=C||0;for(let A=C?g.childNodes[C]:g.firstChild,n=t==null?null:g.childNodes[t];A!=n;A=A.nextSibling,++i)this.findAtPoint(g,i),this.addDOM(A,I);this.findAtPoint(g,i)}findPlace(g,I,C){let t,i;for(let A=this.open,n=0;A>=0;A--){let l=this.nodes[A],s=l.findWrapping(g);if(s&&(!t||t.length>s.length+n)&&(t=s,i=l,!s.length))break;if(l.solid){if(C)break;n+=2}}if(!t)return null;this.sync(i);for(let A=0;A<t.length;A++)I=this.enterInner(t[A],null,I,!1);return I}insertNode(g,I,C){if(g.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(I=this.enterInner(i,null,I))}let t=this.findPlace(g,I,C);if(t){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(g.type));let A=se.none;for(let n of t.concat(g.marks))(i.type?i.type.allowsMarkType(n.type):Jk(n.type,g.type))&&(A=n.addToSet(A));return i.content.push(g.mark(A)),!0}return!1}enter(g,I,C,t){let i=this.findPlace(g.create(I),C,!1);return i&&(i=this.enterInner(g,I,C,!0,t)),i}enterInner(g,I,C,t=!1,i){this.closeExtra();let A=this.top;A.match=A.match&&A.match.matchType(g);let n=kk(g,i,A.options);A.options&Ib&&A.content.length==0&&(n|=Ib);let l=se.none;return C=C.filter(s=>(A.type?A.type.allowsMarkType(s.type):Jk(s.type,g))?(l=s.addToSet(l),!1):!0),this.nodes.push(new fp(g,I,l,t,null,n)),this.open++,C}closeExtra(g=!1){let I=this.nodes.length-1;if(I>this.open){for(;I>this.open;I--)this.nodes[I-1].content.push(this.nodes[I].finish(g));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(g){for(let I=this.open;I>=0;I--){if(this.nodes[I]==g)return this.open=I,!0;this.localPreserveWS&&(this.nodes[I].options|=gb)}return!1}get currentPos(){this.closeExtra();let g=0;for(let I=this.open;I>=0;I--){let C=this.nodes[I].content;for(let t=C.length-1;t>=0;t--)g+=C[t].nodeSize;I&&g++}return g}findAtPoint(g,I){if(this.find)for(let C=0;C<this.find.length;C++)this.find[C].node==g&&this.find[C].offset==I&&(this.find[C].pos=this.currentPos)}findInside(g){if(this.find)for(let I=0;I<this.find.length;I++)this.find[I].pos==null&&g.nodeType==1&&g.contains(this.find[I].node)&&(this.find[I].pos=this.currentPos)}findAround(g,I,C){if(g!=I&&this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&g.nodeType==1&&g.contains(this.find[t].node)&&I.compareDocumentPosition(this.find[t].node)&(C?2:4)&&(this.find[t].pos=this.currentPos)}findInText(g){if(this.find)for(let I=0;I<this.find.length;I++)this.find[I].node==g&&(this.find[I].pos=this.currentPos-(g.nodeValue.length-this.find[I].offset))}matchesContext(g){if(g.indexOf("|")>-1)return g.split(/\s*\|\s*/).some(this.matchesContext,this);let I=g.split("/"),C=this.options.context,t=!this.isOpen&&(!C||C.parent.type==this.nodes[0].type),i=-(C?C.depth+1:0)+(t?0:1),A=(n,l)=>{for(;n>=0;n--){let s=I[n];if(s==""){if(n==I.length-1||n==0)continue;for(;l>=i;l--)if(A(n-1,l))return!0;return!1}else{let a=l>0||l==0&&t?this.nodes[l].type:C&&l>=i?C.node(l-i).type:null;if(!a||a.name!=s&&!a.isInGroup(s))return!1;l--}}return!0};return A(I.length-1,this.open)}textblockFromContext(){let g=this.options.context;if(g)for(let I=g.depth;I>=0;I--){let C=g.node(I).contentMatchAt(g.indexAfter(I)).defaultType;if(C&&C.isTextblock&&C.defaultAttrs)return C}for(let I in this.parser.schema.nodes){let C=this.parser.schema.nodes[I];if(C.isTextblock&&C.defaultAttrs)return C}}}function X7g(e){for(let g=e.firstChild,I=null;g;g=g.nextSibling){let C=g.nodeType==1?g.nodeName.toLowerCase():null;C&&Kk.hasOwnProperty(C)&&I?(I.appendChild(g),g=I):C=="li"?I=g:C&&(I=null)}}function H7g(e,g){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,g)}function zk(e){let g={};for(let I in e)g[I]=e[I];return g}function Jk(e,g){let I=g.schema.nodes;for(let C in I){let t=I[C];if(!t.allowsMarkType(e))continue;let i=[],A=n=>{i.push(n);for(let l=0;l<n.edgeCount;l++){let{type:s,next:a}=n.edge(l);if(s==g||i.indexOf(a)<0&&A(a))return!0}};if(A(t.contentMatch))return!0}}class Fd{constructor(g,I){this.nodes=g,this.marks=I}serializeFragment(g,I={},C){C||(C=yN(I).createDocumentFragment());let t=C,i=[];return g.forEach(A=>{if(i.length||A.marks.length){let n=0,l=0;for(;n<i.length&&l<A.marks.length;){let s=A.marks[l];if(!this.marks[s.type.name]){l++;continue}if(!s.eq(i[n][0])||s.type.spec.spanning===!1)break;n++,l++}for(;n<i.length;)t=i.pop()[1];for(;l<A.marks.length;){let s=A.marks[l++],a=this.serializeMark(s,A.isInline,I);a&&(i.push([s,t]),t.appendChild(a.dom),t=a.contentDOM||a.dom)}}t.appendChild(this.serializeNodeInner(A,I))}),C}serializeNodeInner(g,I){let{dom:C,contentDOM:t}=Rp(yN(I),this.nodes[g.type.name](g),null,g.attrs);if(t){if(g.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(g.content,I,t)}return C}serializeNode(g,I={}){let C=this.serializeNodeInner(g,I);for(let t=g.marks.length-1;t>=0;t--){let i=this.serializeMark(g.marks[t],g.isInline,I);i&&((i.contentDOM||i.dom).appendChild(C),C=i.dom)}return C}serializeMark(g,I,C={}){let t=this.marks[g.type.name];return t&&Rp(yN(C),t(g,I),null,g.attrs)}static renderSpec(g,I,C=null,t){return Rp(g,I,C,t)}static fromSchema(g){return g.cached.domSerializer||(g.cached.domSerializer=new Fd(this.nodesFromSchema(g),this.marksFromSchema(g)))}static nodesFromSchema(g){let I=Lk(g.nodes);return I.text||(I.text=C=>C.text),I}static marksFromSchema(g){return Lk(g.marks)}}function Lk(e){let g={};for(let I in e){let C=e[I].spec.toDOM;C&&(g[I]=C)}return g}function yN(e){return e.document||window.document}const Tk=new WeakMap;function D7g(e){let g=Tk.get(e);return g===void 0&&Tk.set(e,g=S7g(e)),g}function S7g(e){let g=null;function I(C){if(C&&typeof C=="object")if(Array.isArray(C))if(typeof C[0]=="string")g||(g=[]),g.push(C);else for(let t=0;t<C.length;t++)I(C[t]);else for(let t in C)I(C[t])}return I(e),g}function Rp(e,g,I,C){if(typeof g=="string")return{dom:e.createTextNode(g)};if(g.nodeType!=null)return{dom:g};if(g.dom&&g.dom.nodeType!=null)return g;let t=g[0],i;if(typeof t!="string")throw new RangeError("Invalid array passed to renderSpec");if(C&&(i=D7g(C))&&i.indexOf(g)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let A=t.indexOf(" ");A>0&&(I=t.slice(0,A),t=t.slice(A+1));let n,l=I?e.createElementNS(I,t):e.createElement(t),s=g[1],a=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){a=2;for(let d in s)if(s[d]!=null){let m=d.indexOf(" ");m>0?l.setAttributeNS(d.slice(0,m),d.slice(m+1),s[d]):d=="style"&&l.style?l.style.cssText=s[d]:l.setAttribute(d,s[d])}}for(let d=a;d<g.length;d++){let m=g[d];if(m===0){if(d<g.length-1||d>a)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:u,contentDOM:h}=Rp(e,m,I,C);if(l.appendChild(u),h){if(n)throw new RangeError("Multiple content holes");n=h}}}return{dom:l,contentDOM:n}}const vk=65535,jk=Math.pow(2,16);function K7g(e,g){return e+g*jk}function xk(e){return e&vk}function k7g(e){return(e-(e&vk))/jk}const Ok=1,Qk=2,Xp=4,Uk=8;let YN=class{constructor(g,I,C){this.pos=g,this.delInfo=I,this.recover=C}get deleted(){return(this.delInfo&Uk)>0}get deletedBefore(){return(this.delInfo&(Ok|Xp))>0}get deletedAfter(){return(this.delInfo&(Qk|Xp))>0}get deletedAcross(){return(this.delInfo&Xp)>0}},zd=class Kh{constructor(g,I=!1){if(this.ranges=g,this.inverted=I,!g.length&&Kh.empty)return Kh.empty}recover(g){let I=0,C=xk(g);if(!this.inverted)for(let t=0;t<C;t++)I+=this.ranges[t*3+2]-this.ranges[t*3+1];return this.ranges[C*3]+I+k7g(g)}mapResult(g,I=1){return this._map(g,I,!1)}map(g,I=1){return this._map(g,I,!0)}_map(g,I,C){let t=0,i=this.inverted?2:1,A=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let l=this.ranges[n]-(this.inverted?t:0);if(l>g)break;let s=this.ranges[n+i],a=this.ranges[n+A],d=l+s;if(g<=d){let m=s?g==l?-1:g==d?1:I:I,u=l+t+(m<0?0:a);if(C)return u;let h=g==(I<0?l:d)?null:K7g(n/3,g-l),Z=g==l?Qk:g==d?Ok:Xp;return(I<0?g!=l:g!=d)&&(Z|=Uk),new YN(u,Z,h)}t+=a-s}return C?g+t:new YN(g+t,0,null)}touches(g,I){let C=0,t=xk(I),i=this.inverted?2:1,A=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let l=this.ranges[n]-(this.inverted?C:0);if(l>g)break;let s=this.ranges[n+i],a=l+s;if(g<=a&&n==t*3)return!0;C+=this.ranges[n+A]-s}return!1}forEach(g){let I=this.inverted?2:1,C=this.inverted?1:2;for(let t=0,i=0;t<this.ranges.length;t+=3){let A=this.ranges[t],n=A-(this.inverted?i:0),l=A+(this.inverted?0:i),s=this.ranges[t+I],a=this.ranges[t+C];g(n,n+s,l,l+a),i+=a-s}}invert(){return new Kh(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(g){return g==0?Kh.empty:new Kh(g<0?[0,-g,0]:[0,0,g])}};zd.empty=new zd([]);class eb{constructor(g,I,C=0,t=g?g.length:0){this.mirror=I,this.from=C,this.to=t,this._maps=g||[],this.ownData=!(g||I)}get maps(){return this._maps}slice(g=0,I=this.maps.length){return new eb(this._maps,this.mirror,g,I)}appendMap(g,I){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(g),I!=null&&this.setMirror(this._maps.length-1,I)}appendMapping(g){for(let I=0,C=this._maps.length;I<g._maps.length;I++){let t=g.getMirror(I);this.appendMap(g._maps[I],t!=null&&t<I?C+t:void 0)}}getMirror(g){if(this.mirror){for(let I=0;I<this.mirror.length;I++)if(this.mirror[I]==g)return this.mirror[I+(I%2?-1:1)]}}setMirror(g,I){this.mirror||(this.mirror=[]),this.mirror.push(g,I)}appendMappingInverted(g){for(let I=g.maps.length-1,C=this._maps.length+g._maps.length;I>=0;I--){let t=g.getMirror(I);this.appendMap(g._maps[I].invert(),t!=null&&t>I?C-t-1:void 0)}}invert(){let g=new eb;return g.appendMappingInverted(this),g}map(g,I=1){if(this.mirror)return this._map(g,I,!0);for(let C=this.from;C<this.to;C++)g=this._maps[C].map(g,I);return g}mapResult(g,I=1){return this._map(g,I,!1)}_map(g,I,C){let t=0;for(let i=this.from;i<this.to;i++){let A=this._maps[i],n=A.mapResult(g,I);if(n.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,g=this._maps[l].recover(n.recover);continue}}t|=n.delInfo,g=n.pos}return C?g:new YN(g,t,null)}}const VN=Object.create(null);let rt=class{getMap(){return zd.empty}merge(g){return null}static fromJSON(g,I){if(!I||!I.stepType)throw new RangeError("Invalid input for Step.fromJSON");let C=VN[I.stepType];if(!C)throw new RangeError(`No step type ${I.stepType} defined`);return C.fromJSON(g,I)}static jsonID(g,I){if(g in VN)throw new RangeError("Duplicate use of step JSON ID "+g);return VN[g]=I,I.prototype.jsonID=g,I}},Jt=class dw{constructor(g,I){this.doc=g,this.failed=I}static ok(g){return new dw(g,null)}static fail(g){return new dw(null,g)}static fromReplace(g,I,C,t){try{return dw.ok(g.replace(I,C,t))}catch(i){if(i instanceof yp)return dw.fail(i.message);throw i}}};function NN(e,g,I){let C=[];for(let t=0;t<e.childCount;t++){let i=e.child(t);i.content.size&&(i=i.copy(NN(i.content,g,i))),i.isInline&&(i=g(i,I,t)),C.push(i)}return Bg.fromArray(C)}let MN=class cw extends rt{constructor(g,I,C){super(),this.from=g,this.to=I,this.mark=C}apply(g){let I=g.slice(this.from,this.to),C=g.resolve(this.from),t=C.node(C.sharedDepth(this.to)),i=new zg(NN(I.content,(A,n)=>!A.isAtom||!n.type.allowsMarkType(this.mark.type)?A:A.mark(this.mark.addToSet(A.marks)),t),I.openStart,I.openEnd);return Jt.fromReplace(g,this.from,this.to,i)}invert(){return new hm(this.from,this.to,this.mark)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deleted&&C.deleted||I.pos>=C.pos?null:new cw(I.pos,C.pos,this.mark)}merge(g){return g instanceof cw&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new cw(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cw(I.from,I.to,g.markFromJSON(I.mark))}};rt.jsonID("addMark",MN);let hm=class rw extends rt{constructor(g,I,C){super(),this.from=g,this.to=I,this.mark=C}apply(g){let I=g.slice(this.from,this.to),C=new zg(NN(I.content,t=>t.mark(this.mark.removeFromSet(t.marks)),g),I.openStart,I.openEnd);return Jt.fromReplace(g,this.from,this.to,C)}invert(){return new MN(this.from,this.to,this.mark)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deleted&&C.deleted||I.pos>=C.pos?null:new rw(I.pos,C.pos,this.mark)}merge(g){return g instanceof rw&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new rw(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rw(I.from,I.to,g.markFromJSON(I.mark))}};rt.jsonID("removeMark",hm);let fN=class mw extends rt{constructor(g,I){super(),this.pos=g,this.mark=I}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at mark step's position");let C=I.type.create(I.attrs,null,this.mark.addToSet(I.marks));return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(C),0,I.isLeaf?0:1))}invert(g){let I=g.nodeAt(this.pos);if(I){let C=this.mark.addToSet(I.marks);if(C.length==I.marks.length){for(let t=0;t<I.marks.length;t++)if(!I.marks[t].isInSet(C))return new mw(this.pos,I.marks[t]);return new mw(this.pos,this.mark)}}return new Hp(this.pos,this.mark)}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new mw(I.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,I){if(typeof I.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new mw(I.pos,g.markFromJSON(I.mark))}};rt.jsonID("addNodeMark",fN);let Hp=class _R extends rt{constructor(g,I){super(),this.pos=g,this.mark=I}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at mark step's position");let C=I.type.create(I.attrs,null,this.mark.removeFromSet(I.marks));return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(C),0,I.isLeaf?0:1))}invert(g){let I=g.nodeAt(this.pos);return!I||!this.mark.isInSet(I.marks)?this:new fN(this.pos,this.mark)}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new _R(I.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,I){if(typeof I.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _R(I.pos,g.markFromJSON(I.mark))}};rt.jsonID("removeNodeMark",Hp);let dn=class Hr extends rt{constructor(g,I,C,t=!1){super(),this.from=g,this.to=I,this.slice=C,this.structure=t}apply(g){return this.structure&&RN(g,this.from,this.to)?Jt.fail("Structure replace would overwrite content"):Jt.fromReplace(g,this.from,this.to,this.slice)}getMap(){return new zd([this.from,this.to-this.from,this.slice.size])}invert(g){return new Hr(this.from,this.from+this.slice.size,g.slice(this.from,this.to))}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1);return I.deletedAcross&&C.deletedAcross?null:new Hr(I.pos,Math.max(I.pos,C.pos),this.slice,this.structure)}merge(g){if(!(g instanceof Hr)||g.structure||this.structure)return null;if(this.from+this.slice.size==g.from&&!this.slice.openEnd&&!g.slice.openStart){let I=this.slice.size+g.slice.size==0?zg.empty:new zg(this.slice.content.append(g.slice.content),this.slice.openStart,g.slice.openEnd);return new Hr(this.from,this.to+(g.to-g.from),I,this.structure)}else if(g.to==this.from&&!this.slice.openStart&&!g.slice.openEnd){let I=this.slice.size+g.slice.size==0?zg.empty:new zg(g.slice.content.append(this.slice.content),g.slice.openStart,this.slice.openEnd);return new Hr(g.from,this.to,I,this.structure)}else return null}toJSON(){let g={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Hr(I.from,I.to,zg.fromJSON(g,I.slice),!!I.structure)}};rt.jsonID("replace",dn);let di=class Ly extends rt{constructor(g,I,C,t,i,A,n=!1){super(),this.from=g,this.to=I,this.gapFrom=C,this.gapTo=t,this.slice=i,this.insert=A,this.structure=n}apply(g){if(this.structure&&(RN(g,this.from,this.gapFrom)||RN(g,this.gapTo,this.to)))return Jt.fail("Structure gap-replace would overwrite content");let I=g.slice(this.gapFrom,this.gapTo);if(I.openStart||I.openEnd)return Jt.fail("Gap is not a flat range");let C=this.slice.insertAt(this.insert,I.content);return C?Jt.fromReplace(g,this.from,this.to,C):Jt.fail("Content does not fit in gap")}getMap(){return new zd([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(g){let I=this.gapTo-this.gapFrom;return new Ly(this.from,this.from+this.slice.size+I,this.from+this.insert,this.from+this.insert+I,g.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(g){let I=g.mapResult(this.from,1),C=g.mapResult(this.to,-1),t=this.from==this.gapFrom?I.pos:g.map(this.gapFrom,-1),i=this.to==this.gapTo?C.pos:g.map(this.gapTo,1);return I.deletedAcross&&C.deletedAcross||t<I.pos||i>C.pos?null:new Ly(I.pos,C.pos,t,i,this.slice,this.insert,this.structure)}toJSON(){let g={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,I){if(typeof I.from!="number"||typeof I.to!="number"||typeof I.gapFrom!="number"||typeof I.gapTo!="number"||typeof I.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ly(I.from,I.to,I.gapFrom,I.gapTo,zg.fromJSON(g,I.slice),I.insert,!!I.structure)}};rt.jsonID("replaceAround",di);function RN(e,g,I){let C=e.resolve(g),t=I-g,i=C.depth;for(;t>0&&i>0&&C.indexAfter(i)==C.node(i).childCount;)i--,t--;if(t>0){let A=C.node(i).maybeChild(C.indexAfter(i));for(;t>0;){if(!A||A.isLeaf)return!0;A=A.firstChild,t--}}return!1}function F7g(e,g,I,C){let t=[],i=[],A,n;e.doc.nodesBetween(g,I,(l,s,a)=>{if(!l.isInline)return;let d=l.marks;if(!C.isInSet(d)&&a.type.allowsMarkType(C.type)){let m=Math.max(s,g),u=Math.min(s+l.nodeSize,I),h=C.addToSet(d);for(let Z=0;Z<d.length;Z++)d[Z].isInSet(h)||(A&&A.to==m&&A.mark.eq(d[Z])?A.to=u:t.push(A=new hm(m,u,d[Z])));n&&n.to==m?n.to=u:i.push(n=new MN(m,u,C))}}),t.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function z7g(e,g,I,C){let t=[],i=0;e.doc.nodesBetween(g,I,(A,n)=>{if(!A.isInline)return;i++;let l=null;if(C instanceof Mp){let s=A.marks,a;for(;a=C.isInSet(s);)(l||(l=[])).push(a),s=a.removeFromSet(s)}else C?C.isInSet(A.marks)&&(l=[C]):l=A.marks;if(l&&l.length){let s=Math.min(n+A.nodeSize,I);for(let a=0;a<l.length;a++){let d=l[a],m;for(let u=0;u<t.length;u++){let h=t[u];h.step==i-1&&d.eq(t[u].style)&&(m=h)}m?(m.to=s,m.step=i):t.push({style:d,from:Math.max(n,g),to:s,step:i})}}}),t.forEach(A=>e.step(new hm(A.from,A.to,A.style)))}function XN(e,g,I,C=I.contentMatch,t=!0){let i=e.doc.nodeAt(g),A=[],n=g+1;for(let l=0;l<i.childCount;l++){let s=i.child(l),a=n+s.nodeSize,d=C.matchType(s.type);if(!d)A.push(new dn(n,a,zg.empty));else{C=d;for(let m=0;m<s.marks.length;m++)I.allowsMarkType(s.marks[m].type)||e.step(new hm(n,a,s.marks[m]));if(t&&s.isText&&I.whitespace!="pre"){let m,u=/\r?\n|\r/g,h;for(;m=u.exec(s.text);)h||(h=new zg(Bg.from(I.schema.text(" ",I.allowedMarks(s.marks))),0,0)),A.push(new dn(n+m.index,n+m.index+m[0].length,h))}}n=a}if(!C.validEnd){let l=C.fillBefore(Bg.empty,!0);e.replace(n,n,new zg(l,0,0))}for(let l=A.length-1;l>=0;l--)e.step(A[l])}function J7g(e,g,I){return(g==0||e.canReplace(g,e.childCount))&&(I==e.childCount||e.canReplace(0,I))}function bm(e){let I=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let C=e.depth;;--C){let t=e.$from.node(C),i=e.$from.index(C),A=e.$to.indexAfter(C);if(C<e.depth&&t.canReplace(i,A,I))return C;if(C==0||t.type.spec.isolating||!J7g(t,i,A))break}return null}function L7g(e,g,I){let{$from:C,$to:t,depth:i}=g,A=C.before(i+1),n=t.after(i+1),l=A,s=n,a=Bg.empty,d=0;for(let h=i,Z=!1;h>I;h--)Z||C.index(h)>0?(Z=!0,a=Bg.from(C.node(h).copy(a)),d++):l--;let m=Bg.empty,u=0;for(let h=i,Z=!1;h>I;h--)Z||t.after(h+1)<t.end(h)?(Z=!0,m=Bg.from(t.node(h).copy(m)),u++):s++;e.step(new di(l,s,A,n,new zg(a.append(m),d,u),a.size-d,!0))}function HN(e,g,I=null,C=e){let t=T7g(e,g),i=t&&v7g(C,g);return i?t.map(Ek).concat({type:g,attrs:I}).concat(i.map(Ek)):null}function Ek(e){return{type:e,attrs:null}}function T7g(e,g){let{parent:I,startIndex:C,endIndex:t}=e,i=I.contentMatchAt(C).findWrapping(g);if(!i)return null;let A=i.length?i[0]:g;return I.canReplaceWith(C,t,A)?i:null}function v7g(e,g){let{parent:I,startIndex:C,endIndex:t}=e,i=I.child(C),A=g.contentMatch.findWrapping(i.type);if(!A)return null;let l=(A.length?A[A.length-1]:g).contentMatch;for(let s=C;l&&s<t;s++)l=l.matchType(I.child(s).type);return!l||!l.validEnd?null:A}function j7g(e,g,I){let C=Bg.empty;for(let A=I.length-1;A>=0;A--){if(C.size){let n=I[A].type.contentMatch.matchFragment(C);if(!n||!n.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}C=Bg.from(I[A].type.create(I[A].attrs,C))}let t=g.start,i=g.end;e.step(new di(t,i,t,i,new zg(C,0,0),I.length,!0))}function x7g(e,g,I,C,t){if(!C.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(g,I,(A,n)=>{let l=typeof t=="function"?t(A):t;if(A.isTextblock&&!A.hasMarkup(C,l)&&O7g(e.doc,e.mapping.slice(i).map(n),C)){let s=null;if(C.schema.linebreakReplacement){let u=C.whitespace=="pre",h=!!C.contentMatch.matchType(C.schema.linebreakReplacement);u&&!h?s=!1:!u&&h&&(s=!0)}s===!1&&_k(e,A,n,i),XN(e,e.mapping.slice(i).map(n,1),C,void 0,s===null);let a=e.mapping.slice(i),d=a.map(n,1),m=a.map(n+A.nodeSize,1);return e.step(new di(d,m,d+1,m-1,new zg(Bg.from(C.create(l,null,A.marks)),0,0),1,!0)),s===!0&&Pk(e,A,n,i),!1}})}function Pk(e,g,I,C){g.forEach((t,i)=>{if(t.isText){let A,n=/\r?\n|\r/g;for(;A=n.exec(t.text);){let l=e.mapping.slice(C).map(I+1+i+A.index);e.replaceWith(l,l+1,g.type.schema.linebreakReplacement.create())}}})}function _k(e,g,I,C){g.forEach((t,i)=>{if(t.type==t.type.schema.linebreakReplacement){let A=e.mapping.slice(C).map(I+1+i);e.replaceWith(A,A+1,g.type.schema.text(`
1461
+ `))}})}function O7g(e,g,I){let C=e.resolve(g),t=C.index();return C.parent.canReplaceWith(t,t+1,I)}function Q7g(e,g,I,C,t){let i=e.doc.nodeAt(g);if(!i)throw new RangeError("No node at given position");I||(I=i.type);let A=I.create(C,null,t||i.marks);if(i.isLeaf)return e.replaceWith(g,g+i.nodeSize,A);if(!I.validContent(i.content))throw new RangeError("Invalid content for node type "+I.name);e.step(new di(g,g+i.nodeSize,g+1,g+i.nodeSize-1,new zg(Bg.from(A),0,0),1,!0))}function Zm(e,g,I=1,C){let t=e.resolve(g),i=t.depth-I,A=C&&C[C.length-1]||t.parent;if(i<0||t.parent.type.spec.isolating||!t.parent.canReplace(t.index(),t.parent.childCount)||!A.type.validContent(t.parent.content.cutByIndex(t.index(),t.parent.childCount)))return!1;for(let s=t.depth-1,a=I-2;s>i;s--,a--){let d=t.node(s),m=t.index(s);if(d.type.spec.isolating)return!1;let u=d.content.cutByIndex(m,d.childCount),h=C&&C[a+1];h&&(u=u.replaceChild(0,h.type.create(h.attrs)));let Z=C&&C[a]||d;if(!d.canReplace(m+1,d.childCount)||!Z.type.validContent(u))return!1}let n=t.indexAfter(i),l=C&&C[0];return t.node(i).canReplaceWith(n,n,l?l.type:t.node(i+1).type)}function U7g(e,g,I=1,C){let t=e.doc.resolve(g),i=Bg.empty,A=Bg.empty;for(let n=t.depth,l=t.depth-I,s=I-1;n>l;n--,s--){i=Bg.from(t.node(n).copy(i));let a=C&&C[s];A=Bg.from(a?a.type.create(a.attrs,A):t.node(n).copy(A))}e.step(new dn(g,g,new zg(i.append(A),I,I),!0))}function Ds(e,g){let I=e.resolve(g),C=I.index();return $k(I.nodeBefore,I.nodeAfter)&&I.parent.canReplace(C,C+1)}function E7g(e,g){g.content.size||e.type.compatibleContent(g.type);let I=e.contentMatchAt(e.childCount),{linebreakReplacement:C}=e.type.schema;for(let t=0;t<g.childCount;t++){let i=g.child(t),A=i.type==C?e.type.schema.nodes.text:i.type;if(I=I.matchType(A),!I||!e.type.allowsMarks(i.marks))return!1}return I.validEnd}function $k(e,g){return!!(e&&g&&!e.isLeaf&&E7g(e,g))}function Dp(e,g,I=-1){let C=e.resolve(g);for(let t=C.depth;;t--){let i,A,n=C.index(t);if(t==C.depth?(i=C.nodeBefore,A=C.nodeAfter):I>0?(i=C.node(t+1),n++,A=C.node(t).maybeChild(n)):(i=C.node(t).maybeChild(n-1),A=C.node(t+1)),i&&!i.isTextblock&&$k(i,A)&&C.node(t).canReplace(n,n+1))return g;if(t==0)break;g=I<0?C.before(t):C.after(t)}}function P7g(e,g,I){let C=null,{linebreakReplacement:t}=e.doc.type.schema,i=e.doc.resolve(g-I),A=i.node().type;if(t&&A.inlineContent){let a=A.whitespace=="pre",d=!!A.contentMatch.matchType(t);a&&!d?C=!1:!a&&d&&(C=!0)}let n=e.steps.length;if(C===!1){let a=e.doc.resolve(g+I);_k(e,a.node(),a.before(),n)}A.inlineContent&&XN(e,g+I-1,A,i.node().contentMatchAt(i.index()),C==null);let l=e.mapping.slice(n),s=l.map(g-I);if(e.step(new dn(s,l.map(g+I,-1),zg.empty,!0)),C===!0){let a=e.doc.resolve(s);Pk(e,a.node(),a.before(),e.steps.length)}return e}function _7g(e,g,I){let C=e.resolve(g);if(C.parent.canReplaceWith(C.index(),C.index(),I))return g;if(C.parentOffset==0)for(let t=C.depth-1;t>=0;t--){let i=C.index(t);if(C.node(t).canReplaceWith(i,i,I))return C.before(t+1);if(i>0)return null}if(C.parentOffset==C.parent.content.size)for(let t=C.depth-1;t>=0;t--){let i=C.indexAfter(t);if(C.node(t).canReplaceWith(i,i,I))return C.after(t+1);if(i<C.node(t).childCount)return null}return null}function qk(e,g,I){let C=e.resolve(g);if(!I.content.size)return g;let t=I.content;for(let i=0;i<I.openStart;i++)t=t.firstChild.content;for(let i=1;i<=(I.openStart==0&&I.size?2:1);i++)for(let A=C.depth;A>=0;A--){let n=A==C.depth?0:C.pos<=(C.start(A+1)+C.end(A+1))/2?-1:1,l=C.index(A)+(n>0?1:0),s=C.node(A),a=!1;if(i==1)a=s.canReplace(l,l,t);else{let d=s.contentMatchAt(l).findWrapping(t.firstChild.type);a=d&&s.canReplaceWith(l,l,d[0])}if(a)return n==0?C.pos:n<0?C.before(A+1):C.after(A+1)}return null}function Sp(e,g,I=g,C=zg.empty){if(g==I&&!C.size)return null;let t=e.resolve(g),i=e.resolve(I);return g3(t,i,C)?new dn(g,I,C):new $7g(t,i,C).fit()}function g3(e,g,I){return!I.openStart&&!I.openEnd&&e.start()==g.start()&&e.parent.canReplace(e.index(),g.index(),I.content)}class $7g{constructor(g,I,C){this.$from=g,this.$to=I,this.unplaced=C,this.frontier=[],this.placed=Bg.empty;for(let t=0;t<=g.depth;t++){let i=g.node(t);this.frontier.push({type:i.type,match:i.contentMatchAt(g.indexAfter(t))})}for(let t=g.depth;t>0;t--)this.placed=Bg.from(g.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let s=this.findFittable();s?this.placeNodes(s):this.openMore()||this.dropNode()}let g=this.mustMoveInline(),I=this.placed.size-this.depth-this.$from.depth,C=this.$from,t=this.close(g<0?this.$to:C.doc.resolve(g));if(!t)return null;let i=this.placed,A=C.depth,n=t.depth;for(;A&&n&&i.childCount==1;)i=i.firstChild.content,A--,n--;let l=new zg(i,A,n);return g>-1?new di(C.pos,g,this.$to.pos,this.$to.end(),l,I):l.size||C.pos!=this.$to.pos?new dn(C.pos,t.pos,l):null}findFittable(){let g=this.unplaced.openStart;for(let I=this.unplaced.content,C=0,t=this.unplaced.openEnd;C<g;C++){let i=I.firstChild;if(I.childCount>1&&(t=0),i.type.spec.isolating&&t<=C){g=C;break}I=i.content}for(let I=1;I<=2;I++)for(let C=I==1?g:this.unplaced.openStart;C>=0;C--){let t,i=null;C?(i=DN(this.unplaced.content,C-1).firstChild,t=i.content):t=this.unplaced.content;let A=t.firstChild;for(let n=this.depth;n>=0;n--){let{type:l,match:s}=this.frontier[n],a,d=null;if(I==1&&(A?s.matchType(A.type)||(d=s.fillBefore(Bg.from(A),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:C,frontierDepth:n,parent:i,inject:d};if(I==2&&A&&(a=s.findWrapping(A.type)))return{sliceDepth:C,frontierDepth:n,parent:i,wrap:a};if(i&&s.matchType(i.type))break}}}openMore(){let{content:g,openStart:I,openEnd:C}=this.unplaced,t=DN(g,I);return!t.childCount||t.firstChild.isLeaf?!1:(this.unplaced=new zg(g,I+1,Math.max(C,t.size+I>=g.size-C?I+1:0)),!0)}dropNode(){let{content:g,openStart:I,openEnd:C}=this.unplaced,t=DN(g,I);if(t.childCount<=1&&I>0){let i=g.size-I<=I+t.size;this.unplaced=new zg(Cb(g,I-1,1),I-1,i?I-1:C)}else this.unplaced=new zg(Cb(g,I,1),I,C)}placeNodes({sliceDepth:g,frontierDepth:I,parent:C,inject:t,wrap:i}){for(;this.depth>I;)this.closeFrontierNode();if(i)for(let Z=0;Z<i.length;Z++)this.openFrontierNode(i[Z]);let A=this.unplaced,n=C?C.content:A.content,l=A.openStart-g,s=0,a=[],{match:d,type:m}=this.frontier[I];if(t){for(let Z=0;Z<t.childCount;Z++)a.push(t.child(Z));d=d.matchFragment(t)}let u=n.size+g-(A.content.size-A.openEnd);for(;s<n.childCount;){let Z=n.child(s),G=d.matchType(Z.type);if(!G)break;s++,(s>1||l==0||Z.content.size)&&(d=G,a.push(I3(Z.mark(m.allowedMarks(Z.marks)),s==1?l:0,s==n.childCount?u:-1)))}let h=s==n.childCount;h||(u=-1),this.placed=tb(this.placed,I,Bg.from(a)),this.frontier[I].match=d,h&&u<0&&C&&C.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let Z=0,G=n;Z<u;Z++){let w=G.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),G=w.content}this.unplaced=h?g==0?zg.empty:new zg(Cb(A.content,g-1,1),g-1,u<0?A.openEnd:g-1):new zg(Cb(A.content,g,s),A.openStart,A.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let g=this.frontier[this.depth],I;if(!g.type.isTextblock||!SN(this.$to,this.$to.depth,g.type,g.match,!1)||this.$to.depth==this.depth&&(I=this.findCloseLevel(this.$to))&&I.depth==this.depth)return-1;let{depth:C}=this.$to,t=this.$to.after(C);for(;C>1&&t==this.$to.end(--C);)++t;return t}findCloseLevel(g){g:for(let I=Math.min(this.depth,g.depth);I>=0;I--){let{match:C,type:t}=this.frontier[I],i=I<g.depth&&g.end(I+1)==g.pos+(g.depth-(I+1)),A=SN(g,I,t,C,i);if(A){for(let n=I-1;n>=0;n--){let{match:l,type:s}=this.frontier[n],a=SN(g,n,s,l,!0);if(!a||a.childCount)continue g}return{depth:I,fit:A,move:i?g.doc.resolve(g.after(I+1)):g}}}}close(g){let I=this.findCloseLevel(g);if(!I)return null;for(;this.depth>I.depth;)this.closeFrontierNode();I.fit.childCount&&(this.placed=tb(this.placed,I.depth,I.fit)),g=I.move;for(let C=I.depth+1;C<=g.depth;C++){let t=g.node(C),i=t.type.contentMatch.fillBefore(t.content,!0,g.index(C));this.openFrontierNode(t.type,t.attrs,i)}return g}openFrontierNode(g,I=null,C){let t=this.frontier[this.depth];t.match=t.match.matchType(g),this.placed=tb(this.placed,this.depth,Bg.from(g.create(I,C))),this.frontier.push({type:g,match:g.contentMatch})}closeFrontierNode(){let I=this.frontier.pop().match.fillBefore(Bg.empty,!0);I.childCount&&(this.placed=tb(this.placed,this.frontier.length,I))}}function Cb(e,g,I){return g==0?e.cutByIndex(I,e.childCount):e.replaceChild(0,e.firstChild.copy(Cb(e.firstChild.content,g-1,I)))}function tb(e,g,I){return g==0?e.append(I):e.replaceChild(e.childCount-1,e.lastChild.copy(tb(e.lastChild.content,g-1,I)))}function DN(e,g){for(let I=0;I<g;I++)e=e.firstChild.content;return e}function I3(e,g,I){if(g<=0)return e;let C=e.content;return g>1&&(C=C.replaceChild(0,I3(C.firstChild,g-1,C.childCount==1?I-1:0))),g>0&&(C=e.type.contentMatch.fillBefore(C).append(C),I<=0&&(C=C.append(e.type.contentMatch.matchFragment(C).fillBefore(Bg.empty,!0)))),e.copy(C)}function SN(e,g,I,C,t){let i=e.node(g),A=t?e.indexAfter(g):e.index(g);if(A==i.childCount&&!I.compatibleContent(i.type))return null;let n=C.fillBefore(i.content,!0,A);return n&&!q7g(I,i.content,A)?n:null}function q7g(e,g,I){for(let C=I;C<g.childCount;C++)if(!e.allowsMarks(g.child(C).marks))return!0;return!1}function gEg(e){return e.spec.defining||e.spec.definingForContent}function IEg(e,g,I,C){if(!C.size)return e.deleteRange(g,I);let t=e.doc.resolve(g),i=e.doc.resolve(I);if(g3(t,i,C))return e.step(new dn(g,I,C));let A=C3(t,e.doc.resolve(I));A[A.length-1]==0&&A.pop();let n=-(t.depth+1);A.unshift(n);for(let m=t.depth,u=t.pos-1;m>0;m--,u--){let h=t.node(m).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;A.indexOf(m)>-1?n=m:t.before(m)==u&&A.splice(1,0,-m)}let l=A.indexOf(n),s=[],a=C.openStart;for(let m=C.content,u=0;;u++){let h=m.firstChild;if(s.push(h),u==C.openStart)break;m=h.content}for(let m=a-1;m>=0;m--){let u=s[m],h=gEg(u.type);if(h&&!u.sameMarkup(t.node(Math.abs(n)-1)))a=m;else if(h||!u.type.isTextblock)break}for(let m=C.openStart;m>=0;m--){let u=(m+a+1)%(C.openStart+1),h=s[u];if(h)for(let Z=0;Z<A.length;Z++){let G=A[(Z+l)%A.length],w=!0;G<0&&(w=!1,G=-G);let p=t.node(G-1),B=t.index(G-1);if(p.canReplaceWith(B,B,h.type,h.marks))return e.replace(t.before(G),w?i.after(G):I,new zg(e3(C.content,0,C.openStart,u),u,C.openEnd))}}let d=e.steps.length;for(let m=A.length-1;m>=0&&(e.replace(g,I,C),!(e.steps.length>d));m--){let u=A[m];u<0||(g=t.before(u),I=i.after(u))}}function e3(e,g,I,C,t){if(g<I){let i=e.firstChild;e=e.replaceChild(0,i.copy(e3(i.content,g+1,I,C,i)))}if(g>C){let i=t.contentMatchAt(0),A=i.fillBefore(e).append(e);e=A.append(i.matchFragment(A).fillBefore(Bg.empty,!0))}return e}function eEg(e,g,I,C){if(!C.isInline&&g==I&&e.doc.resolve(g).parent.content.size){let t=_7g(e.doc,g,C.type);t!=null&&(g=I=t)}e.replaceRange(g,I,new zg(Bg.from(C),0,0))}function CEg(e,g,I){let C=e.doc.resolve(g),t=e.doc.resolve(I),i=C3(C,t);for(let A=0;A<i.length;A++){let n=i[A],l=A==i.length-1;if(l&&n==0||C.node(n).type.contentMatch.validEnd)return e.delete(C.start(n),t.end(n));if(n>0&&(l||C.node(n-1).canReplace(C.index(n-1),t.indexAfter(n-1))))return e.delete(C.before(n),t.after(n))}for(let A=1;A<=C.depth&&A<=t.depth;A++)if(g-C.start(A)==C.depth-A&&I>C.end(A)&&t.end(A)-I!=t.depth-A&&C.start(A-1)==t.start(A-1)&&C.node(A-1).canReplace(C.index(A-1),t.index(A-1)))return e.delete(C.before(A),I);e.delete(g,I)}function C3(e,g){let I=[],C=Math.min(e.depth,g.depth);for(let t=C;t>=0;t--){let i=e.start(t);if(i<e.pos-(e.depth-t)||g.end(t)>g.pos+(g.depth-t)||e.node(t).type.spec.isolating||g.node(t).type.spec.isolating)break;(i==g.start(t)||t==e.depth&&t==g.depth&&e.parent.inlineContent&&g.parent.inlineContent&&t&&g.start(t-1)==i-1)&&I.push(t)}return I}let t3=class Ty extends rt{constructor(g,I,C){super(),this.pos=g,this.attr=I,this.value=C}apply(g){let I=g.nodeAt(this.pos);if(!I)return Jt.fail("No node at attribute step's position");let C=Object.create(null);for(let i in I.attrs)C[i]=I.attrs[i];C[this.attr]=this.value;let t=I.type.create(C,null,I.marks);return Jt.fromReplace(g,this.pos,this.pos+1,new zg(Bg.from(t),0,I.isLeaf?0:1))}getMap(){return zd.empty}invert(g){return new Ty(this.pos,this.attr,g.nodeAt(this.pos).attrs[this.attr])}map(g){let I=g.mapResult(this.pos,1);return I.deletedAfter?null:new Ty(I.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(g,I){if(typeof I.pos!="number"||typeof I.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ty(I.pos,I.attr,I.value)}};rt.jsonID("attr",t3);let i3=class $R extends rt{constructor(g,I){super(),this.attr=g,this.value=I}apply(g){let I=Object.create(null);for(let t in g.attrs)I[t]=g.attrs[t];I[this.attr]=this.value;let C=g.type.create(I,g.content,g.marks);return Jt.ok(C)}getMap(){return zd.empty}invert(g){return new $R(this.attr,g.attrs[this.attr])}map(g){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(g,I){if(typeof I.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $R(I.attr,I.value)}};rt.jsonID("docAttr",i3);let Gm=class extends Error{};Gm=function e(g){let I=Error.call(this,g);return I.__proto__=e.prototype,I},Gm.prototype=Object.create(Error.prototype),Gm.prototype.constructor=Gm,Gm.prototype.name="TransformError";class A3{constructor(g){this.doc=g,this.steps=[],this.docs=[],this.mapping=new eb}get before(){return this.docs.length?this.docs[0]:this.doc}step(g){let I=this.maybeStep(g);if(I.failed)throw new Gm(I.failed);return this}maybeStep(g){let I=g.apply(this.doc);return I.failed||this.addStep(g,I.doc),I}get docChanged(){return this.steps.length>0}addStep(g,I){this.docs.push(this.doc),this.steps.push(g),this.mapping.appendMap(g.getMap()),this.doc=I}replace(g,I=g,C=zg.empty){let t=Sp(this.doc,g,I,C);return t&&this.step(t),this}replaceWith(g,I,C){return this.replace(g,I,new zg(Bg.from(C),0,0))}delete(g,I){return this.replace(g,I,zg.empty)}insert(g,I){return this.replaceWith(g,g,I)}replaceRange(g,I,C){return IEg(this,g,I,C),this}replaceRangeWith(g,I,C){return eEg(this,g,I,C),this}deleteRange(g,I){return CEg(this,g,I),this}lift(g,I){return L7g(this,g,I),this}join(g,I=1){return P7g(this,g,I),this}wrap(g,I){return j7g(this,g,I),this}setBlockType(g,I=g,C,t=null){return x7g(this,g,I,C,t),this}setNodeMarkup(g,I,C=null,t){return Q7g(this,g,I,C,t),this}setNodeAttribute(g,I,C){return this.step(new t3(g,I,C)),this}setDocAttribute(g,I){return this.step(new i3(g,I)),this}addNodeMark(g,I){return this.step(new fN(g,I)),this}removeNodeMark(g,I){let C=this.doc.nodeAt(g);if(!C)throw new RangeError("No node at position "+g);if(I instanceof se)I.isInSet(C.marks)&&this.step(new Hp(g,I));else{let t=C.marks,i,A=[];for(;i=I.isInSet(t);)A.push(new Hp(g,i)),t=i.removeFromSet(t);for(let n=A.length-1;n>=0;n--)this.step(A[n])}return this}split(g,I=1,C){return U7g(this,g,I,C),this}addMark(g,I,C){return F7g(this,g,I,C),this}removeMark(g,I,C){return z7g(this,g,I,C),this}clearIncompatible(g,I,C){return XN(this,g,I,C),this}}const KN=Object.create(null);let uI=class{constructor(g,I,C){this.$anchor=g,this.$head=I,this.ranges=C||[new tEg(g.min(I),g.max(I))]}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 g=this.ranges;for(let I=0;I<g.length;I++)if(g[I].$from.pos!=g[I].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(g,I=zg.empty){let C=I.content.lastChild,t=null;for(let n=0;n<I.openEnd;n++)t=C,C=C.lastChild;let i=g.steps.length,A=this.ranges;for(let n=0;n<A.length;n++){let{$from:l,$to:s}=A[n],a=g.mapping.slice(i);g.replaceRange(a.map(l.pos),a.map(s.pos),n?zg.empty:I),n==0&&s3(g,i,(C?C.isInline:t&&t.isTextblock)?-1:1)}}replaceWith(g,I){let C=g.steps.length,t=this.ranges;for(let i=0;i<t.length;i++){let{$from:A,$to:n}=t[i],l=g.mapping.slice(C),s=l.map(A.pos),a=l.map(n.pos);i?g.deleteRange(s,a):(g.replaceRangeWith(s,a,I),s3(g,C,I.isInline?-1:1))}}static findFrom(g,I,C=!1){let t=g.parent.inlineContent?new hI(g):wm(g.node(0),g.parent,g.pos,g.index(),I,C);if(t)return t;for(let i=g.depth-1;i>=0;i--){let A=I<0?wm(g.node(0),g.node(i),g.before(i+1),g.index(i),I,C):wm(g.node(0),g.node(i),g.after(i+1),g.index(i)+1,I,C);if(A)return A}return null}static near(g,I=1){return this.findFrom(g,I)||this.findFrom(g,-I)||new Ss(g.node(0))}static atStart(g){return wm(g,g,0,0,1)||new Ss(g)}static atEnd(g){return wm(g,g,g.content.size,g.childCount,-1)||new Ss(g)}static fromJSON(g,I){if(!I||!I.type)throw new RangeError("Invalid input for Selection.fromJSON");let C=KN[I.type];if(!C)throw new RangeError(`No selection type ${I.type} defined`);return C.fromJSON(g,I)}static jsonID(g,I){if(g in KN)throw new RangeError("Duplicate use of selection JSON ID "+g);return KN[g]=I,I.prototype.jsonID=g,I}getBookmark(){return hI.between(this.$anchor,this.$head).getBookmark()}};uI.prototype.visible=!0;let tEg=class{constructor(g,I){this.$from=g,this.$to=I}},n3=!1;function l3(e){!n3&&!e.parent.inlineContent&&(n3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}let hI=class uw extends uI{constructor(g,I=g){l3(g),l3(I),super(g,I)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(g,I){let C=g.resolve(I.map(this.head));if(!C.parent.inlineContent)return uI.near(C);let t=g.resolve(I.map(this.anchor));return new uw(t.parent.inlineContent?t:C,C)}replace(g,I=zg.empty){if(super.replace(g,I),I==zg.empty){let C=this.$from.marksAcross(this.$to);C&&g.ensureMarks(C)}}eq(g){return g instanceof uw&&g.anchor==this.anchor&&g.head==this.head}getBookmark(){return new o3(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(g,I){if(typeof I.anchor!="number"||typeof I.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new uw(g.resolve(I.anchor),g.resolve(I.head))}static create(g,I,C=I){let t=g.resolve(I);return new this(t,C==I?t:g.resolve(C))}static between(g,I,C){let t=g.pos-I.pos;if((!C||t)&&(C=t>=0?1:-1),!I.parent.inlineContent){let i=uI.findFrom(I,C,!0)||uI.findFrom(I,-C,!0);if(i)I=i.$head;else return uI.near(I,C)}return g.parent.inlineContent||(t==0?g=I:(g=(uI.findFrom(g,-C,!0)||uI.findFrom(g,C,!0)).$anchor,g.pos<I.pos!=t<0&&(g=I))),new uw(g,I)}};uI.jsonID("text",hI);let o3=class l4{constructor(g,I){this.anchor=g,this.head=I}map(g){return new l4(g.map(this.anchor),g.map(this.head))}resolve(g){return hI.between(g.resolve(this.anchor),g.resolve(this.head))}},eI=class hw extends uI{constructor(g){let I=g.nodeAfter,C=g.node(0).resolve(g.pos+I.nodeSize);super(g,C),this.node=I}map(g,I){let{deleted:C,pos:t}=I.mapResult(this.anchor),i=g.resolve(t);return C?uI.near(i):new hw(i)}content(){return new zg(Bg.from(this.node),0,0)}eq(g){return g instanceof hw&&g.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new iEg(this.anchor)}static fromJSON(g,I){if(typeof I.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new hw(g.resolve(I.anchor))}static create(g,I){return new hw(g.resolve(I))}static isSelectable(g){return!g.isText&&g.type.spec.selectable!==!1}};eI.prototype.visible=!1,uI.jsonID("node",eI);let iEg=class o4{constructor(g){this.anchor=g}map(g){let{deleted:I,pos:C}=g.mapResult(this.anchor);return I?new o3(C,C):new o4(C)}resolve(g){let I=g.resolve(this.anchor),C=I.nodeAfter;return C&&eI.isSelectable(C)?new eI(I):uI.near(I)}},Ss=class vy extends uI{constructor(g){super(g.resolve(0),g.resolve(g.content.size))}replace(g,I=zg.empty){if(I==zg.empty){g.delete(0,g.doc.content.size);let C=uI.atStart(g.doc);C.eq(g.selection)||g.setSelection(C)}else super.replace(g,I)}toJSON(){return{type:"all"}}static fromJSON(g){return new vy(g)}map(g){return new vy(g)}eq(g){return g instanceof vy}getBookmark(){return AEg}};uI.jsonID("all",Ss);const AEg={map(){return this},resolve(e){return new Ss(e)}};function wm(e,g,I,C,t,i=!1){if(g.inlineContent)return hI.create(e,I);for(let A=C-(t>0?0:1);t>0?A<g.childCount:A>=0;A+=t){let n=g.child(A);if(n.isAtom){if(!i&&eI.isSelectable(n))return eI.create(e,I-(t<0?n.nodeSize:0))}else{let l=wm(e,n,I+t,t<0?n.childCount:0,t,i);if(l)return l}I+=n.nodeSize*t}return null}function s3(e,g,I){let C=e.steps.length-1;if(C<g)return;let t=e.steps[C];if(!(t instanceof dn||t instanceof di))return;let i=e.mapping.maps[C],A;i.forEach((n,l,s,a)=>{A==null&&(A=a)}),e.setSelection(uI.near(e.doc.resolve(A),I))}const a3=1,Kp=2,d3=4;class nEg extends A3{constructor(g){super(g.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=g.selection,this.storedMarks=g.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(g){if(g.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=g,this.curSelectionFor=this.steps.length,this.updated=(this.updated|a3)&~Kp,this.storedMarks=null,this}get selectionSet(){return(this.updated&a3)>0}setStoredMarks(g){return this.storedMarks=g,this.updated|=Kp,this}ensureMarks(g){return se.sameSet(this.storedMarks||this.selection.$from.marks(),g)||this.setStoredMarks(g),this}addStoredMark(g){return this.ensureMarks(g.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(g){return this.ensureMarks(g.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Kp)>0}addStep(g,I){super.addStep(g,I),this.updated=this.updated&~Kp,this.storedMarks=null}setTime(g){return this.time=g,this}replaceSelection(g){return this.selection.replace(this,g),this}replaceSelectionWith(g,I=!0){let C=this.selection;return I&&(g=g.mark(this.storedMarks||(C.empty?C.$from.marks():C.$from.marksAcross(C.$to)||se.none))),C.replaceWith(this,g),this}deleteSelection(){return this.selection.replace(this),this}insertText(g,I,C){let t=this.doc.type.schema;if(I==null)return g?this.replaceSelectionWith(t.text(g),!0):this.deleteSelection();{if(C==null&&(C=I),C=C??I,!g)return this.deleteRange(I,C);let i=this.storedMarks;if(!i){let A=this.doc.resolve(I);i=C==I?A.marks():A.marksAcross(this.doc.resolve(C))}return this.replaceRangeWith(I,C,t.text(g,i)),this.selection.empty||this.setSelection(uI.near(this.selection.$to)),this}}setMeta(g,I){return this.meta[typeof g=="string"?g:g.key]=I,this}getMeta(g){return this.meta[typeof g=="string"?g:g.key]}get isGeneric(){for(let g in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=d3,this}get scrolledIntoView(){return(this.updated&d3)>0}}function c3(e,g){return!g||!e?e:e.bind(g)}let ib=class{constructor(g,I,C){this.name=g,this.init=c3(I.init,C),this.apply=c3(I.apply,C)}};const lEg=[new ib("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ib("selection",{init(e,g){return e.selection||uI.atStart(g.doc)},apply(e){return e.selection}}),new ib("storedMarks",{init(e){return e.storedMarks||null},apply(e,g,I,C){return C.selection.$cursor?e.storedMarks:null}}),new ib("scrollToSelection",{init(){return 0},apply(e,g){return e.scrolledIntoView?g+1:g}})];class kN{constructor(g,I){this.schema=g,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lEg.slice(),I&&I.forEach(C=>{if(this.pluginsByKey[C.key])throw new RangeError("Adding different instances of a keyed plugin ("+C.key+")");this.plugins.push(C),this.pluginsByKey[C.key]=C,C.spec.state&&this.fields.push(new ib(C.key,C.spec.state,C))})}}class Wm{constructor(g){this.config=g}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(g){return this.applyTransaction(g).state}filterTransaction(g,I=-1){for(let C=0;C<this.config.plugins.length;C++)if(C!=I){let t=this.config.plugins[C];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,g,this))return!1}return!0}applyTransaction(g){if(!this.filterTransaction(g))return{state:this,transactions:[]};let I=[g],C=this.applyInner(g),t=null;for(;;){let i=!1;for(let A=0;A<this.config.plugins.length;A++){let n=this.config.plugins[A];if(n.spec.appendTransaction){let l=t?t[A].n:0,s=t?t[A].state:this,a=l<I.length&&n.spec.appendTransaction.call(n,l?I.slice(l):I,s,C);if(a&&C.filterTransaction(a,A)){if(a.setMeta("appendedTransaction",g),!t){t=[];for(let d=0;d<this.config.plugins.length;d++)t.push(d<A?{state:C,n:I.length}:{state:this,n:0})}I.push(a),C=C.applyInner(a),i=!0}t&&(t[A]={state:C,n:I.length})}}if(!i)return{state:C,transactions:I}}}applyInner(g){if(!g.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let I=new Wm(this.config),C=this.config.fields;for(let t=0;t<C.length;t++){let i=C[t];I[i.name]=i.apply(g,this[i.name],this,I)}return I}get tr(){return new nEg(this)}static create(g){let I=new kN(g.doc?g.doc.type.schema:g.schema,g.plugins),C=new Wm(I);for(let t=0;t<I.fields.length;t++)C[I.fields[t].name]=I.fields[t].init(g,C);return C}reconfigure(g){let I=new kN(this.schema,g.plugins),C=I.fields,t=new Wm(I);for(let i=0;i<C.length;i++){let A=C[i].name;t[A]=this.hasOwnProperty(A)?this[A]:C[i].init(g,t)}return t}toJSON(g){let I={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(I.storedMarks=this.storedMarks.map(C=>C.toJSON())),g&&typeof g=="object")for(let C in g){if(C=="doc"||C=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let t=g[C],i=t.spec.state;i&&i.toJSON&&(I[C]=i.toJSON.call(t,this[t.key]))}return I}static fromJSON(g,I,C){if(!I)throw new RangeError("Invalid input for EditorState.fromJSON");if(!g.schema)throw new RangeError("Required config field 'schema' missing");let t=new kN(g.schema,g.plugins),i=new Wm(t);return t.fields.forEach(A=>{if(A.name=="doc")i.doc=Xs.fromJSON(g.schema,I.doc);else if(A.name=="selection")i.selection=uI.fromJSON(i.doc,I.selection);else if(A.name=="storedMarks")I.storedMarks&&(i.storedMarks=I.storedMarks.map(g.schema.markFromJSON));else{if(C)for(let n in C){let l=C[n],s=l.spec.state;if(l.key==A.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(I,n)){i[A.name]=s.fromJSON.call(l,g,I[n],i);return}}i[A.name]=A.init(g,i)}}),i}}function r3(e,g,I){for(let C in e){let t=e[C];t instanceof Function?t=t.bind(g):C=="handleDOMEvents"&&(t=r3(t,g,{})),I[C]=t}return I}class je{constructor(g){this.spec=g,this.props={},g.props&&r3(g.props,this,this.props),this.key=g.key?g.key.key:m3("plugin")}getState(g){return g[this.key]}}const FN=Object.create(null);function m3(e){return e in FN?e+"$"+ ++FN[e]:(FN[e]=0,e+"$")}class HC{constructor(g="key"){this.key=m3(g)}get(g){return g.config.pluginsByKey[this.key]}getState(g){return g[this.key]}}const PC=function(e){for(var g=0;;g++)if(e=e.previousSibling,!e)return g},pm=function(e){let g=e.assignedSlot||e.parentNode;return g&&g.nodeType==11?g.host:g};let zN=null;const El=function(e,g,I){let C=zN||(zN=document.createRange());return C.setEnd(e,I??e.nodeValue.length),C.setStart(e,g||0),C},oEg=function(){zN=null},Jd=function(e,g,I,C){return I&&(u3(e,g,I,C,-1)||u3(e,g,I,C,1))},sEg=/^(img|br|input|textarea|hr)$/i;function u3(e,g,I,C,t){for(var i;;){if(e==I&&g==C)return!0;if(g==(t<0?0:ZA(e))){let A=e.parentNode;if(!A||A.nodeType!=1||Ab(e)||sEg.test(e.nodeName)||e.contentEditable=="false")return!1;g=PC(e)+(t<0?0:1),e=A}else if(e.nodeType==1){let A=e.childNodes[g+(t<0?-1:0)];if(A.nodeType==1&&A.contentEditable=="false")if(!((i=A.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)g+=t;else return!1;else e=A,g=t<0?ZA(e):0}else return!1}}function ZA(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function aEg(e,g){for(;;){if(e.nodeType==3&&g)return e;if(e.nodeType==1&&g>0){if(e.contentEditable=="false")return null;e=e.childNodes[g-1],g=ZA(e)}else if(e.parentNode&&!Ab(e))g=PC(e),e=e.parentNode;else return null}}function dEg(e,g){for(;;){if(e.nodeType==3&&g<e.nodeValue.length)return e;if(e.nodeType==1&&g<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[g],g=0}else if(e.parentNode&&!Ab(e))g=PC(e)+1,e=e.parentNode;else return null}}function cEg(e,g,I){for(let C=g==0,t=g==ZA(e);C||t;){if(e==I)return!0;let i=PC(e);if(e=e.parentNode,!e)return!1;C=C&&i==0,t=t&&i==ZA(e)}}function Ab(e){let g;for(let I=e;I&&!(g=I.pmViewDesc);I=I.parentNode);return g&&g.node&&g.node.isBlock&&(g.dom==e||g.contentDOM==e)}const kp=function(e){return e.focusNode&&Jd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ld(e,g){let I=document.createEvent("Event");return I.initEvent("keydown",!0,!0),I.keyCode=e,I.key=I.code=g,I}function rEg(e){let g=e.activeElement;for(;g&&g.shadowRoot;)g=g.shadowRoot.activeElement;return g}function mEg(e,g,I){if(e.caretPositionFromPoint)try{let C=e.caretPositionFromPoint(g,I);if(C)return{node:C.offsetNode,offset:Math.min(ZA(C.offsetNode),C.offset)}}catch{}if(e.caretRangeFromPoint){let C=e.caretRangeFromPoint(g,I);if(C)return{node:C.startContainer,offset:Math.min(ZA(C.startContainer),C.startOffset)}}}const Il=typeof navigator<"u"?navigator:null,h3=typeof document<"u"?document:null,Ks=Il&&Il.userAgent||"",JN=/Edge\/(\d+)/.exec(Ks),b3=/MSIE \d/.exec(Ks),LN=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ks),ci=!!(b3||LN||JN),ks=b3?document.documentMode:LN?+LN[1]:JN?+JN[1]:0,GA=!ci&&/gecko\/(\d+)/i.test(Ks);GA&&+(/Firefox\/(\d+)/.exec(Ks)||[0,0])[1];const TN=!ci&&/Chrome\/(\d+)/.exec(Ks),mt=!!TN,Z3=TN?+TN[1]:0,Lt=!ci&&!!Il&&/Apple Computer/.test(Il.vendor),Bm=Lt&&(/Mobile\/\w+/.test(Ks)||!!Il&&Il.maxTouchPoints>2),wA=Bm||(Il?/Mac/.test(Il.platform):!1),uEg=Il?/Win/.test(Il.platform):!1,Pl=/Android \d/.test(Ks),nb=!!h3&&"webkitFontSmoothing"in h3.documentElement.style,hEg=nb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bEg(e){let g=e.defaultView&&e.defaultView.visualViewport;return g?{left:0,right:g.width,top:0,bottom:g.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _l(e,g){return typeof e=="number"?e:e[g]}function ZEg(e){let g=e.getBoundingClientRect(),I=g.width/e.offsetWidth||1,C=g.height/e.offsetHeight||1;return{left:g.left,right:g.left+e.clientWidth*I,top:g.top,bottom:g.top+e.clientHeight*C}}function G3(e,g,I){let C=e.someProp("scrollThreshold")||0,t=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let A=I||e.dom;A;){if(A.nodeType!=1){A=pm(A);continue}let n=A,l=n==i.body,s=l?bEg(i):ZEg(n),a=0,d=0;if(g.top<s.top+_l(C,"top")?d=-(s.top-g.top+_l(t,"top")):g.bottom>s.bottom-_l(C,"bottom")&&(d=g.bottom-g.top>s.bottom-s.top?g.top+_l(t,"top")-s.top:g.bottom-s.bottom+_l(t,"bottom")),g.left<s.left+_l(C,"left")?a=-(s.left-g.left+_l(t,"left")):g.right>s.right-_l(C,"right")&&(a=g.right-s.right+_l(t,"right")),a||d)if(l)i.defaultView.scrollBy(a,d);else{let u=n.scrollLeft,h=n.scrollTop;d&&(n.scrollTop+=d),a&&(n.scrollLeft+=a);let Z=n.scrollLeft-u,G=n.scrollTop-h;g={left:g.left-Z,top:g.top-G,right:g.right-Z,bottom:g.bottom-G}}let m=l?"fixed":getComputedStyle(A).position;if(/^(fixed|sticky)$/.test(m))break;A=m=="absolute"?A.offsetParent:pm(A)}}function GEg(e){let g=e.dom.getBoundingClientRect(),I=Math.max(0,g.top),C,t;for(let i=(g.left+g.right)/2,A=I+1;A<Math.min(innerHeight,g.bottom);A+=5){let n=e.root.elementFromPoint(i,A);if(!n||n==e.dom||!e.dom.contains(n))continue;let l=n.getBoundingClientRect();if(l.top>=I-20){C=n,t=l.top;break}}return{refDOM:C,refTop:t,stack:w3(e.dom)}}function w3(e){let g=[],I=e.ownerDocument;for(let C=e;C&&(g.push({dom:C,top:C.scrollTop,left:C.scrollLeft}),e!=I);C=pm(C));return g}function wEg({refDOM:e,refTop:g,stack:I}){let C=e?e.getBoundingClientRect().top:0;W3(I,C==0?0:C-g)}function W3(e,g){for(let I=0;I<e.length;I++){let{dom:C,top:t,left:i}=e[I];C.scrollTop!=t+g&&(C.scrollTop=t+g),C.scrollLeft!=i&&(C.scrollLeft=i)}}let ym=null;function WEg(e){if(e.setActive)return e.setActive();if(ym)return e.focus(ym);let g=w3(e);e.focus(ym==null?{get preventScroll(){return ym={preventScroll:!0},!0}}:void 0),ym||(ym=!1,W3(g,0))}function p3(e,g){let I,C=2e8,t,i=0,A=g.top,n=g.top,l,s;for(let a=e.firstChild,d=0;a;a=a.nextSibling,d++){let m;if(a.nodeType==1)m=a.getClientRects();else if(a.nodeType==3)m=El(a).getClientRects();else continue;for(let u=0;u<m.length;u++){let h=m[u];if(h.top<=A&&h.bottom>=n){A=Math.max(h.bottom,A),n=Math.min(h.top,n);let Z=h.left>g.left?h.left-g.left:h.right<g.left?g.left-h.right:0;if(Z<C){I=a,C=Z,t=Z&&I.nodeType==3?{left:h.right<g.left?h.right:h.left,top:g.top}:g,a.nodeType==1&&Z&&(i=d+(g.left>=(h.left+h.right)/2?1:0));continue}}else h.top>g.top&&!l&&h.left<=g.left&&h.right>=g.left&&(l=a,s={left:Math.max(h.left,Math.min(h.right,g.left)),top:h.top});!I&&(g.left>=h.right&&g.top>=h.top||g.left>=h.left&&g.top>=h.bottom)&&(i=d+1)}}return!I&&l&&(I=l,t=s,C=0),I&&I.nodeType==3?pEg(I,t):!I||C&&I.nodeType==1?{node:e,offset:i}:p3(I,t)}function pEg(e,g){let I=e.nodeValue.length,C=document.createRange();for(let t=0;t<I;t++){C.setEnd(e,t+1),C.setStart(e,t);let i=Fs(C,1);if(i.top!=i.bottom&&vN(g,i))return{node:e,offset:t+(g.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function vN(e,g){return e.left>=g.left-1&&e.left<=g.right+1&&e.top>=g.top-1&&e.top<=g.bottom+1}function BEg(e,g){let I=e.parentNode;return I&&/^li$/i.test(I.nodeName)&&g.left<e.getBoundingClientRect().left?I:e}function yEg(e,g,I){let{node:C,offset:t}=p3(g,I),i=-1;if(C.nodeType==1&&!C.firstChild){let A=C.getBoundingClientRect();i=A.left!=A.right&&I.left>(A.left+A.right)/2?1:-1}return e.docView.posFromDOM(C,t,i)}function YEg(e,g,I,C){let t=-1;for(let i=g,A=!1;i!=e.dom;){let n=e.docView.nearestDesc(i,!0),l;if(!n)return null;if(n.dom.nodeType==1&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((l=n.dom.getBoundingClientRect()).width||l.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!A&&l.left>C.left||l.top>C.top?t=n.posBefore:(!A&&l.right<C.left||l.bottom<C.top)&&(t=n.posAfter),A=!0),!n.contentDOM&&t<0&&!n.node.isText))return(n.node.isBlock?C.top<(l.top+l.bottom)/2:C.left<(l.left+l.right)/2)?n.posBefore:n.posAfter;i=n.dom.parentNode}return t>-1?t:e.docView.posFromDOM(g,I,-1)}function B3(e,g,I){let C=e.childNodes.length;if(C&&I.top<I.bottom)for(let t=Math.max(0,Math.min(C-1,Math.floor(C*(g.top-I.top)/(I.bottom-I.top))-2)),i=t;;){let A=e.childNodes[i];if(A.nodeType==1){let n=A.getClientRects();for(let l=0;l<n.length;l++){let s=n[l];if(vN(g,s))return B3(A,g,s)}}if((i=(i+1)%C)==t)break}return e}function VEg(e,g){let I=e.dom.ownerDocument,C,t=0,i=mEg(I,g.left,g.top);i&&({node:C,offset:t}=i);let A=(e.root.elementFromPoint?e.root:I).elementFromPoint(g.left,g.top),n;if(!A||!e.dom.contains(A.nodeType!=1?A.parentNode:A)){let s=e.dom.getBoundingClientRect();if(!vN(g,s)||(A=B3(e.dom,g,s),!A))return null}if(Lt)for(let s=A;C&&s;s=pm(s))s.draggable&&(C=void 0);if(A=BEg(A,g),C){if(GA&&C.nodeType==1&&(t=Math.min(t,C.childNodes.length),t<C.childNodes.length)){let a=C.childNodes[t],d;a.nodeName=="IMG"&&(d=a.getBoundingClientRect()).right<=g.left&&d.bottom>g.top&&t++}let s;nb&&t&&C.nodeType==1&&(s=C.childNodes[t-1]).nodeType==1&&s.contentEditable=="false"&&s.getBoundingClientRect().top>=g.top&&t--,C==e.dom&&t==C.childNodes.length-1&&C.lastChild.nodeType==1&&g.top>C.lastChild.getBoundingClientRect().bottom?n=e.state.doc.content.size:(t==0||C.nodeType!=1||C.childNodes[t-1].nodeName!="BR")&&(n=YEg(e,C,t,g))}n==null&&(n=yEg(e,A,g));let l=e.docView.nearestDesc(A,!0);return{pos:n,inside:l?l.posAtStart-l.border:-1}}function y3(e){return e.top<e.bottom||e.left<e.right}function Fs(e,g){let I=e.getClientRects();if(I.length){let C=I[g<0?0:I.length-1];if(y3(C))return C}return Array.prototype.find.call(I,y3)||e.getBoundingClientRect()}const NEg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y3(e,g,I){let{node:C,offset:t,atom:i}=e.docView.domFromPos(g,I<0?-1:1),A=nb||GA;if(C.nodeType==3)if(A&&(NEg.test(C.nodeValue)||(I<0?!t:t==C.nodeValue.length))){let l=Fs(El(C,t,t),I);if(GA&&t&&/\s/.test(C.nodeValue[t-1])&&t<C.nodeValue.length){let s=Fs(El(C,t-1,t-1),-1);if(s.top==l.top){let a=Fs(El(C,t,t+1),-1);if(a.top!=l.top)return lb(a,a.left<s.left)}}return l}else{let l=t,s=t,a=I<0?1:-1;return I<0&&!t?(s++,a=-1):I>=0&&t==C.nodeValue.length?(l--,a=1):I<0?l--:s++,lb(Fs(El(C,l,s),a),a<0)}if(!e.state.doc.resolve(g-(i||0)).parent.inlineContent){if(i==null&&t&&(I<0||t==ZA(C))){let l=C.childNodes[t-1];if(l.nodeType==1)return jN(l.getBoundingClientRect(),!1)}if(i==null&&t<ZA(C)){let l=C.childNodes[t];if(l.nodeType==1)return jN(l.getBoundingClientRect(),!0)}return jN(C.getBoundingClientRect(),I>=0)}if(i==null&&t&&(I<0||t==ZA(C))){let l=C.childNodes[t-1],s=l.nodeType==3?El(l,ZA(l)-(A?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(s)return lb(Fs(s,1),!1)}if(i==null&&t<ZA(C)){let l=C.childNodes[t];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let s=l?l.nodeType==3?El(l,0,A?0:1):l.nodeType==1?l:null:null;if(s)return lb(Fs(s,-1),!0)}return lb(Fs(C.nodeType==3?El(C):C,-I),I>=0)}function lb(e,g){if(e.width==0)return e;let I=g?e.left:e.right;return{top:e.top,bottom:e.bottom,left:I,right:I}}function jN(e,g){if(e.height==0)return e;let I=g?e.top:e.bottom;return{top:I,bottom:I,left:e.left,right:e.right}}function V3(e,g,I){let C=e.state,t=e.root.activeElement;C!=g&&e.updateState(g),t!=e.dom&&e.focus();try{return I()}finally{C!=g&&e.updateState(C),t!=e.dom&&t&&t.focus()}}function MEg(e,g,I){let C=g.selection,t=I=="up"?C.$from:C.$to;return V3(e,g,()=>{let{node:i}=e.docView.domFromPos(t.pos,I=="up"?-1:1);for(;;){let n=e.docView.nearestDesc(i,!0);if(!n)break;if(n.node.isBlock){i=n.contentDOM||n.dom;break}i=n.dom.parentNode}let A=Y3(e,t.pos,1);for(let n=i.firstChild;n;n=n.nextSibling){let l;if(n.nodeType==1)l=n.getClientRects();else if(n.nodeType==3)l=El(n,0,n.nodeValue.length).getClientRects();else continue;for(let s=0;s<l.length;s++){let a=l[s];if(a.bottom>a.top+1&&(I=="up"?A.top-a.top>(a.bottom-A.top)*2:a.bottom-A.bottom>(A.bottom-a.top)*2))return!1}}return!0})}const fEg=/[\u0590-\u08ac]/;function REg(e,g,I){let{$head:C}=g.selection;if(!C.parent.isTextblock)return!1;let t=C.parentOffset,i=!t,A=t==C.parent.content.size,n=e.domSelection();return n?!fEg.test(C.parent.textContent)||!n.modify?I=="left"||I=="backward"?i:A:V3(e,g,()=>{let{focusNode:l,focusOffset:s,anchorNode:a,anchorOffset:d}=e.domSelectionRange(),m=n.caretBidiLevel;n.modify("move",I,"character");let u=C.depth?e.docView.domAfterPos(C.before()):e.dom,{focusNode:h,focusOffset:Z}=e.domSelectionRange(),G=h&&!u.contains(h.nodeType==1?h:h.parentNode)||l==h&&s==Z;try{n.collapse(a,d),l&&(l!=a||s!=d)&&n.extend&&n.extend(l,s)}catch{}return m!=null&&(n.caretBidiLevel=m),G}):C.pos==C.start()||C.pos==C.end()}let N3=null,M3=null,f3=!1;function XEg(e,g,I){return N3==g&&M3==I?f3:(N3=g,M3=I,f3=I=="up"||I=="down"?MEg(e,g,I):REg(e,g,I))}const WA=0,R3=1,Td=2,el=3;class ob{constructor(g,I,C,t){this.parent=g,this.children=I,this.dom=C,this.contentDOM=t,this.dirty=WA,C.pmViewDesc=this}matchesWidget(g){return!1}matchesMark(g){return!1}matchesNode(g,I,C){return!1}matchesHack(g){return!1}parseRule(){return null}stopEvent(g){return!1}get size(){let g=0;for(let I=0;I<this.children.length;I++)g+=this.children[I].size;return g}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let g=0;g<this.children.length;g++)this.children[g].destroy()}posBeforeChild(g){for(let I=0,C=this.posAtStart;;I++){let t=this.children[I];if(t==g)return C;C+=t.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(g,I,C){if(this.contentDOM&&this.contentDOM.contains(g.nodeType==1?g:g.parentNode))if(C<0){let i,A;if(g==this.contentDOM)i=g.childNodes[I-1];else{for(;g.parentNode!=this.contentDOM;)g=g.parentNode;i=g.previousSibling}for(;i&&!((A=i.pmViewDesc)&&A.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(A)+A.size:this.posAtStart}else{let i,A;if(g==this.contentDOM)i=g.childNodes[I];else{for(;g.parentNode!=this.contentDOM;)g=g.parentNode;i=g.nextSibling}for(;i&&!((A=i.pmViewDesc)&&A.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(A):this.posAtEnd}let t;if(g==this.dom&&this.contentDOM)t=I>PC(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))t=g.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(I==0)for(let i=g;;i=i.parentNode){if(i==this.dom){t=!1;break}if(i.previousSibling)break}if(t==null&&I==g.childNodes.length)for(let i=g;;i=i.parentNode){if(i==this.dom){t=!0;break}if(i.nextSibling)break}}return t??C>0?this.posAtEnd:this.posAtStart}nearestDesc(g,I=!1){for(let C=!0,t=g;t;t=t.parentNode){let i=this.getDesc(t),A;if(i&&(!I||i.node))if(C&&(A=i.nodeDOM)&&!(A.nodeType==1?A.contains(g.nodeType==1?g:g.parentNode):A==g))C=!1;else return i}}getDesc(g){let I=g.pmViewDesc;for(let C=I;C;C=C.parent)if(C==this)return I}posFromDOM(g,I,C){for(let t=g;t;t=t.parentNode){let i=this.getDesc(t);if(i)return i.localPosFromDOM(g,I,C)}return-1}descAt(g){for(let I=0,C=0;I<this.children.length;I++){let t=this.children[I],i=C+t.size;if(C==g&&i!=C){for(;!t.border&&t.children.length;)for(let A=0;A<t.children.length;A++){let n=t.children[A];if(n.size){t=n;break}}return t}if(g<i)return t.descAt(g-C-t.border);C=i}}domFromPos(g,I){if(!this.contentDOM)return{node:this.dom,offset:0,atom:g+1};let C=0,t=0;for(let i=0;C<this.children.length;C++){let A=this.children[C],n=i+A.size;if(n>g||A instanceof D3){t=g-i;break}i=n}if(t)return this.children[C].domFromPos(t-this.children[C].border,I);for(let i;C&&!(i=this.children[C-1]).size&&i instanceof X3&&i.side>=0;C--);if(I<=0){let i,A=!0;for(;i=C?this.children[C-1]:null,!(!i||i.dom.parentNode==this.contentDOM);C--,A=!1);return i&&I&&A&&!i.border&&!i.domAtom?i.domFromPos(i.size,I):{node:this.contentDOM,offset:i?PC(i.dom)+1:0}}else{let i,A=!0;for(;i=C<this.children.length?this.children[C]:null,!(!i||i.dom.parentNode==this.contentDOM);C++,A=!1);return i&&A&&!i.border&&!i.domAtom?i.domFromPos(0,I):{node:this.contentDOM,offset:i?PC(i.dom):this.contentDOM.childNodes.length}}}parseRange(g,I,C=0){if(this.children.length==0)return{node:this.contentDOM,from:g,to:I,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let t=-1,i=-1;for(let A=C,n=0;;n++){let l=this.children[n],s=A+l.size;if(t==-1&&g<=s){let a=A+l.border;if(g>=a&&I<=s-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(g,I,a);g=A;for(let d=n;d>0;d--){let m=this.children[d-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){t=PC(m.dom)+1;break}g-=m.size}t==-1&&(t=0)}if(t>-1&&(s>I||n==this.children.length-1)){I=s;for(let a=n+1;a<this.children.length;a++){let d=this.children[a];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=PC(d.dom);break}I+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}A=s}return{node:this.contentDOM,from:g,to:I,fromOffset:t,toOffset:i}}emptyChildAt(g){if(this.border||!this.contentDOM||!this.children.length)return!1;let I=this.children[g<0?0:this.children.length-1];return I.size==0||I.emptyChildAt(g)}domAfterPos(g){let{node:I,offset:C}=this.domFromPos(g,0);if(I.nodeType!=1||C==I.childNodes.length)throw new RangeError("No node after pos "+g);return I.childNodes[C]}setSelection(g,I,C,t=!1){let i=Math.min(g,I),A=Math.max(g,I);for(let u=0,h=0;u<this.children.length;u++){let Z=this.children[u],G=h+Z.size;if(i>h&&A<G)return Z.setSelection(g-h-Z.border,I-h-Z.border,C,t);h=G}let n=this.domFromPos(g,g?-1:1),l=I==g?n:this.domFromPos(I,I?-1:1),s=C.root.getSelection(),a=C.domSelectionRange(),d=!1;if((GA||Lt)&&g==I){let{node:u,offset:h}=n;if(u.nodeType==3){if(d=!!(h&&u.nodeValue[h-1]==`
1462
+ `),d&&h==u.nodeValue.length)for(let Z=u,G;Z;Z=Z.parentNode){if(G=Z.nextSibling){G.nodeName=="BR"&&(n=l={node:G.parentNode,offset:PC(G)+1});break}let w=Z.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let Z=u.childNodes[h-1];d=Z&&(Z.nodeName=="BR"||Z.contentEditable=="false")}}if(GA&&a.focusNode&&a.focusNode!=l.node&&a.focusNode.nodeType==1){let u=a.focusNode.childNodes[a.focusOffset];u&&u.contentEditable=="false"&&(t=!0)}if(!(t||d&&Lt)&&Jd(n.node,n.offset,a.anchorNode,a.anchorOffset)&&Jd(l.node,l.offset,a.focusNode,a.focusOffset))return;let m=!1;if((s.extend||g==I)&&!(d&&GA)){s.collapse(n.node,n.offset);try{g!=I&&s.extend(l.node,l.offset),m=!0}catch{}}if(!m){if(g>I){let h=n;n=l,l=h}let u=document.createRange();u.setEnd(l.node,l.offset),u.setStart(n.node,n.offset),s.removeAllRanges(),s.addRange(u)}}ignoreMutation(g){return!this.contentDOM&&g.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(g,I){for(let C=0,t=0;t<this.children.length;t++){let i=this.children[t],A=C+i.size;if(C==A?g<=A&&I>=C:g<A&&I>C){let n=C+i.border,l=A-i.border;if(g>=n&&I<=l){this.dirty=g==C||I==A?Td:R3,g==n&&I==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=el:i.markDirty(g-n,I-n);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Td:el}C=A}this.dirty=Td}markParentsDirty(){let g=1;for(let I=this.parent;I;I=I.parent,g++){let C=g==1?Td:R3;I.dirty<C&&(I.dirty=C)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(g){return!1}}class X3 extends ob{constructor(g,I,C,t){let i,A=I.type.toDOM;if(typeof A=="function"&&(A=A(C,()=>{if(!i)return t;if(i.parent)return i.parent.posBeforeChild(i)})),!I.type.spec.raw){if(A.nodeType!=1){let n=document.createElement("span");n.appendChild(A),A=n}A.contentEditable="false",A.classList.add("ProseMirror-widget")}super(g,[],A,null),this.widget=I,this.widget=I,i=this}matchesWidget(g){return this.dirty==WA&&g.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(g){let I=this.widget.spec.stopEvent;return I?I(g):!1}ignoreMutation(g){return g.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 HEg extends ob{constructor(g,I,C,t){super(g,[],I,null),this.textDOM=C,this.text=t}get size(){return this.text.length}localPosFromDOM(g,I){return g!=this.textDOM?this.posAtStart+(I?this.size:0):this.posAtStart+I}domFromPos(g){return{node:this.textDOM,offset:g}}ignoreMutation(g){return g.type==="characterData"&&g.target.nodeValue==g.oldValue}}class vd extends ob{constructor(g,I,C,t,i){super(g,[],C,t),this.mark=I,this.spec=i}static create(g,I,C,t){let i=t.nodeViews[I.type.name],A=i&&i(I,t,C);return(!A||!A.dom)&&(A=Fd.renderSpec(document,I.type.spec.toDOM(I,C),null,I.attrs)),new vd(g,I,A.dom,A.contentDOM||A.dom,A)}parseRule(){return this.dirty&el||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(g){return this.dirty!=el&&this.mark.eq(g)}markDirty(g,I){if(super.markDirty(g,I),this.dirty!=WA){let C=this.parent;for(;!C.node;)C=C.parent;C.dirty<this.dirty&&(C.dirty=this.dirty),this.dirty=WA}}slice(g,I,C){let t=vd.create(this.parent,this.mark,!0,C),i=this.children,A=this.size;I<A&&(i=ON(i,I,A,C)),g>0&&(i=ON(i,0,g,C));for(let n=0;n<i.length;n++)i[n].parent=t;return t.children=i,t}ignoreMutation(g){return this.spec.ignoreMutation?this.spec.ignoreMutation(g):super.ignoreMutation(g)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class zs extends ob{constructor(g,I,C,t,i,A,n,l,s){super(g,[],i,A),this.node=I,this.outerDeco=C,this.innerDeco=t,this.nodeDOM=n}static create(g,I,C,t,i,A){let n=i.nodeViews[I.type.name],l,s=n&&n(I,i,()=>{if(!l)return A;if(l.parent)return l.parent.posBeforeChild(l)},C,t),a=s&&s.dom,d=s&&s.contentDOM;if(I.isText){if(!a)a=document.createTextNode(I.text);else if(a.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else a||({dom:a,contentDOM:d}=Fd.renderSpec(document,I.type.spec.toDOM(I),null,I.attrs));!d&&!I.isText&&a.nodeName!="BR"&&(a.hasAttribute("contenteditable")||(a.contentEditable="false"),I.type.spec.draggable&&(a.draggable=!0));let m=a;return a=k3(a,C,I),s?l=new DEg(g,I,C,t,a,d||null,m,s,i,A+1):I.isText?new Fp(g,I,C,t,a,m,i):new zs(g,I,C,t,a,d||null,m,i,A+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let g={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(g.preserveWhitespace="full"),!this.contentDOM)g.getContent=()=>this.node.content;else if(!this.contentLost)g.contentElement=this.contentDOM;else{for(let I=this.children.length-1;I>=0;I--){let C=this.children[I];if(this.dom.contains(C.dom.parentNode)){g.contentElement=C.dom.parentNode;break}}g.contentElement||(g.getContent=()=>Bg.empty)}return g}matchesNode(g,I,C){return this.dirty==WA&&g.eq(this.node)&&zp(I,this.outerDeco)&&C.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(g,I){let C=this.node.inlineContent,t=I,i=g.composing?this.localCompositionInfo(g,I):null,A=i&&i.pos>-1?i:null,n=i&&i.pos<0,l=new KEg(this,A&&A.node,g);zEg(this.node,this.innerDeco,(s,a,d)=>{s.spec.marks?l.syncToMarks(s.spec.marks,C,g):s.type.side>=0&&!d&&l.syncToMarks(a==this.node.childCount?se.none:this.node.child(a).marks,C,g),l.placeWidget(s,g,t)},(s,a,d,m)=>{l.syncToMarks(s.marks,C,g);let u;l.findNodeMatch(s,a,d,m)||n&&g.state.selection.from>t&&g.state.selection.to<t+s.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(s,a,d,u,g)||l.updateNextNode(s,a,d,g,m,t)||l.addNode(s,a,d,g,t),t+=s.nodeSize}),l.syncToMarks([],C,g),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Td)&&(A&&this.protectLocalComposition(g,A),S3(this.contentDOM,this.children,g),Bm&&JEg(this.dom))}localCompositionInfo(g,I){let{from:C,to:t}=g.state.selection;if(!(g.state.selection instanceof hI)||C<I||t>I+this.node.content.size)return null;let i=g.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let A=i.nodeValue,n=LEg(this.node.content,A,C-I,t-I);return n<0?null:{node:i,pos:n,text:A}}else return{node:i,pos:-1,text:""}}protectLocalComposition(g,{node:I,pos:C,text:t}){if(this.getDesc(I))return;let i=I;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let A=new HEg(this,i,I,t);g.input.compositionNodes.push(A),this.children=ON(this.children,C,C+t.length,g,A)}update(g,I,C,t){return this.dirty==el||!g.sameMarkup(this.node)?!1:(this.updateInner(g,I,C,t),!0)}updateInner(g,I,C,t){this.updateOuterDeco(I),this.node=g,this.innerDeco=C,this.contentDOM&&this.updateChildren(t,this.posAtStart),this.dirty=WA}updateOuterDeco(g){if(zp(g,this.outerDeco))return;let I=this.nodeDOM.nodeType!=1,C=this.dom;this.dom=K3(this.dom,this.nodeDOM,xN(this.outerDeco,this.node,I),xN(g,this.node,I)),this.dom!=C&&(C.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=g}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function H3(e,g,I,C,t){k3(C,g,e);let i=new zs(void 0,e,g,I,C,C,C,t,0);return i.contentDOM&&i.updateChildren(t,0),i}class Fp extends zs{constructor(g,I,C,t,i,A,n){super(g,I,C,t,i,null,A,n,0)}parseRule(){let g=this.nodeDOM.parentNode;for(;g&&g!=this.dom&&!g.pmIsDeco;)g=g.parentNode;return{skip:g||!0}}update(g,I,C,t){return this.dirty==el||this.dirty!=WA&&!this.inParent()||!g.sameMarkup(this.node)?!1:(this.updateOuterDeco(I),(this.dirty!=WA||g.text!=this.node.text)&&g.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=g.text,t.trackWrites==this.nodeDOM&&(t.trackWrites=null)),this.node=g,this.dirty=WA,!0)}inParent(){let g=this.parent.contentDOM;for(let I=this.nodeDOM;I;I=I.parentNode)if(I==g)return!0;return!1}domFromPos(g){return{node:this.nodeDOM,offset:g}}localPosFromDOM(g,I,C){return g==this.nodeDOM?this.posAtStart+Math.min(I,this.node.text.length):super.localPosFromDOM(g,I,C)}ignoreMutation(g){return g.type!="characterData"&&g.type!="selection"}slice(g,I,C){let t=this.node.cut(g,I),i=document.createTextNode(t.text);return new Fp(this.parent,t,this.outerDeco,this.innerDeco,i,i,C)}markDirty(g,I){super.markDirty(g,I),this.dom!=this.nodeDOM&&(g==0||I==this.nodeDOM.nodeValue.length)&&(this.dirty=el)}get domAtom(){return!1}isText(g){return this.node.text==g}}class D3 extends ob{parseRule(){return{ignore:!0}}matchesHack(g){return this.dirty==WA&&this.dom.nodeName==g}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class DEg extends zs{constructor(g,I,C,t,i,A,n,l,s,a){super(g,I,C,t,i,A,n,s,a),this.spec=l}update(g,I,C,t){if(this.dirty==el)return!1;if(this.spec.update&&(this.node.type==g.type||this.spec.multiType)){let i=this.spec.update(g,I,C);return i&&this.updateInner(g,I,C,t),i}else return!this.contentDOM&&!g.isLeaf?!1:super.update(g,I,C,t)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(g,I,C,t){this.spec.setSelection?this.spec.setSelection(g,I,C.root):super.setSelection(g,I,C,t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(g){return this.spec.stopEvent?this.spec.stopEvent(g):!1}ignoreMutation(g){return this.spec.ignoreMutation?this.spec.ignoreMutation(g):super.ignoreMutation(g)}}function S3(e,g,I){let C=e.firstChild,t=!1;for(let i=0;i<g.length;i++){let A=g[i],n=A.dom;if(n.parentNode==e){for(;n!=C;)C=F3(C),t=!0;C=C.nextSibling}else t=!0,e.insertBefore(n,C);if(A instanceof vd){let l=C?C.previousSibling:e.lastChild;S3(A.contentDOM,A.children,I),C=l?l.nextSibling:e.firstChild}}for(;C;)C=F3(C),t=!0;t&&I.trackWrites==e&&(I.trackWrites=null)}const sb=function(e){e&&(this.nodeName=e)};sb.prototype=Object.create(null);const jd=[new sb];function xN(e,g,I){if(e.length==0)return jd;let C=I?jd[0]:new sb,t=[C];for(let i=0;i<e.length;i++){let A=e[i].type.attrs;if(A){A.nodeName&&t.push(C=new sb(A.nodeName));for(let n in A){let l=A[n];l!=null&&(I&&t.length==1&&t.push(C=new sb(g.isInline?"span":"div")),n=="class"?C.class=(C.class?C.class+" ":"")+l:n=="style"?C.style=(C.style?C.style+";":"")+l:n!="nodeName"&&(C[n]=l))}}}return t}function K3(e,g,I,C){if(I==jd&&C==jd)return g;let t=g;for(let i=0;i<C.length;i++){let A=C[i],n=I[i];if(i){let l;n&&n.nodeName==A.nodeName&&t!=e&&(l=t.parentNode)&&l.nodeName.toLowerCase()==A.nodeName||(l=document.createElement(A.nodeName),l.pmIsDeco=!0,l.appendChild(t),n=jd[0]),t=l}SEg(t,n||jd[0],A)}return t}function SEg(e,g,I){for(let C in g)C!="class"&&C!="style"&&C!="nodeName"&&!(C in I)&&e.removeAttribute(C);for(let C in I)C!="class"&&C!="style"&&C!="nodeName"&&I[C]!=g[C]&&e.setAttribute(C,I[C]);if(g.class!=I.class){let C=g.class?g.class.split(" ").filter(Boolean):[],t=I.class?I.class.split(" ").filter(Boolean):[];for(let i=0;i<C.length;i++)t.indexOf(C[i])==-1&&e.classList.remove(C[i]);for(let i=0;i<t.length;i++)C.indexOf(t[i])==-1&&e.classList.add(t[i]);e.classList.length==0&&e.removeAttribute("class")}if(g.style!=I.style){if(g.style){let C=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,t;for(;t=C.exec(g.style);)e.style.removeProperty(t[1])}I.style&&(e.style.cssText+=I.style)}}function k3(e,g,I){return K3(e,e,jd,xN(g,I,e.nodeType!=1))}function zp(e,g){if(e.length!=g.length)return!1;for(let I=0;I<e.length;I++)if(!e[I].type.eq(g[I].type))return!1;return!0}function F3(e){let g=e.nextSibling;return e.parentNode.removeChild(e),g}class KEg{constructor(g,I,C){this.lock=I,this.view=C,this.index=0,this.stack=[],this.changed=!1,this.top=g,this.preMatch=kEg(g.node.content,g)}destroyBetween(g,I){if(g!=I){for(let C=g;C<I;C++)this.top.children[C].destroy();this.top.children.splice(g,I-g),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(g,I,C){let t=0,i=this.stack.length>>1,A=Math.min(i,g.length);for(;t<A&&(t==i-1?this.top:this.stack[t+1<<1]).matchesMark(g[t])&&g[t].type.spec.spanning!==!1;)t++;for(;t<i;)this.destroyRest(),this.top.dirty=WA,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<g.length;){this.stack.push(this.top,this.index+1);let n=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let s=this.top.children[l];if(s.matchesMark(g[i])&&!this.isLocked(s.dom)){n=l;break}}if(n>-1)n>this.index&&(this.changed=!0,this.destroyBetween(this.index,n)),this.top=this.top.children[this.index];else{let l=vd.create(this.top,g[i],I,C);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(g,I,C,t){let i=-1,A;if(t>=this.preMatch.index&&(A=this.preMatch.matches[t-this.preMatch.index]).parent==this.top&&A.matchesNode(g,I,C))i=this.top.children.indexOf(A,this.index);else for(let n=this.index,l=Math.min(this.top.children.length,n+5);n<l;n++){let s=this.top.children[n];if(s.matchesNode(g,I,C)&&!this.preMatch.matched.has(s)){i=n;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(g,I,C,t,i){let A=this.top.children[t];return A.dirty==el&&A.dom==A.contentDOM&&(A.dirty=Td),A.update(g,I,C,i)?(this.destroyBetween(this.index,t),this.index++,!0):!1}findIndexWithChild(g){for(;;){let I=g.parentNode;if(!I)return-1;if(I==this.top.contentDOM){let C=g.pmViewDesc;if(C){for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==C)return t}return-1}g=I}}updateNextNode(g,I,C,t,i,A){for(let n=this.index;n<this.top.children.length;n++){let l=this.top.children[n];if(l instanceof zs){let s=this.preMatch.matched.get(l);if(s!=null&&s!=i)return!1;let a=l.dom,d,m=this.isLocked(a)&&!(g.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==g.text&&l.dirty!=el&&zp(I,l.outerDeco));if(!m&&l.update(g,I,C,t))return this.destroyBetween(this.index,n),l.dom!=a&&(this.changed=!0),this.index++,!0;if(!m&&(d=this.recreateWrapper(l,g,I,C,t,A)))return this.destroyBetween(this.index,n),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Td,d.updateChildren(t,A+1),d.dirty=WA),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(g,I,C,t,i,A){if(g.dirty||I.isAtom||!g.children.length||!g.node.content.eq(I.content)||!zp(C,g.outerDeco)||!t.eq(g.innerDeco))return null;let n=zs.create(this.top,I,C,t,i,A);if(n.contentDOM){n.children=g.children,g.children=[];for(let l of n.children)l.parent=n}return g.destroy(),n}addNode(g,I,C,t,i){let A=zs.create(this.top,g,I,C,t,i);A.contentDOM&&A.updateChildren(t,i+1),this.top.children.splice(this.index++,0,A),this.changed=!0}placeWidget(g,I,C){let t=this.index<this.top.children.length?this.top.children[this.index]:null;if(t&&t.matchesWidget(g)&&(g==t.widget||!t.widget.type.toDOM.parentNode))this.index++;else{let i=new X3(this.top,g,I,C);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let g=this.top.children[this.index-1],I=this.top;for(;g instanceof vd;)I=g,g=I.children[I.children.length-1];(!g||!(g instanceof Fp)||/\n$/.test(g.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(g.node.text))&&((Lt||mt)&&g&&g.dom.contentEditable=="false"&&this.addHackNode("IMG",I),this.addHackNode("BR",this.top))}addHackNode(g,I){if(I==this.top&&this.index<I.children.length&&I.children[this.index].matchesHack(g))this.index++;else{let C=document.createElement(g);g=="IMG"&&(C.className="ProseMirror-separator",C.alt=""),g=="BR"&&(C.className="ProseMirror-trailingBreak");let t=new D3(this.top,[],C,null);I!=this.top?I.children.push(t):I.children.splice(this.index++,0,t),this.changed=!0}}isLocked(g){return this.lock&&(g==this.lock||g.nodeType==1&&g.contains(this.lock.parentNode))}}function kEg(e,g){let I=g,C=I.children.length,t=e.childCount,i=new Map,A=[];g:for(;t>0;){let n;for(;;)if(C){let s=I.children[C-1];if(s instanceof vd)I=s,C=s.children.length;else{n=s,C--;break}}else{if(I==g)break g;C=I.parent.children.indexOf(I),I=I.parent}let l=n.node;if(l){if(l!=e.child(t-1))break;--t,i.set(n,t),A.push(n)}}return{index:t,matched:i,matches:A.reverse()}}function FEg(e,g){return e.type.side-g.type.side}function zEg(e,g,I,C){let t=g.locals(e),i=0;if(t.length==0){for(let s=0;s<e.childCount;s++){let a=e.child(s);C(a,t,g.forChild(i,a),s),i+=a.nodeSize}return}let A=0,n=[],l=null;for(let s=0;;){let a,d;for(;A<t.length&&t[A].to==i;){let G=t[A++];G.widget&&(a?(d||(d=[a])).push(G):a=G)}if(a)if(d){d.sort(FEg);for(let G=0;G<d.length;G++)I(d[G],s,!!l)}else I(a,s,!!l);let m,u;if(l)u=-1,m=l,l=null;else if(s<e.childCount)u=s,m=e.child(s++);else break;for(let G=0;G<n.length;G++)n[G].to<=i&&n.splice(G--,1);for(;A<t.length&&t[A].from<=i&&t[A].to>i;)n.push(t[A++]);let h=i+m.nodeSize;if(m.isText){let G=h;A<t.length&&t[A].from<G&&(G=t[A].from);for(let w=0;w<n.length;w++)n[w].to<G&&(G=n[w].to);G<h&&(l=m.cut(G-i),m=m.cut(0,G-i),h=G,u=-1)}else for(;A<t.length&&t[A].to<h;)A++;let Z=m.isInline&&!m.isLeaf?n.filter(G=>!G.inline):n.slice();C(m,Z,g.forChild(i,m),u),i=h}}function JEg(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let g=e.style.cssText;e.style.cssText=g+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=g}}function LEg(e,g,I,C){for(let t=0,i=0;t<e.childCount&&i<=C;){let A=e.child(t++),n=i;if(i+=A.nodeSize,!A.isText)continue;let l=A.text;for(;t<e.childCount;){let s=e.child(t++);if(i+=s.nodeSize,!s.isText)break;l+=s.text}if(i>=I){if(i>=C&&l.slice(C-g.length-n,C-n)==g)return C-g.length;let s=n<C?l.lastIndexOf(g,C-n-1):-1;if(s>=0&&s+g.length+n>=I)return n+s;if(I==C&&l.length>=C+g.length-n&&l.slice(C-n,C-n+g.length)==g)return C}}return-1}function ON(e,g,I,C,t){let i=[];for(let A=0,n=0;A<e.length;A++){let l=e[A],s=n,a=n+=l.size;s>=I||a<=g?i.push(l):(s<g&&i.push(l.slice(0,g-s,C)),t&&(i.push(t),t=void 0),a>I&&i.push(l.slice(I-s,l.size,C)))}return i}function QN(e,g=null){let I=e.domSelectionRange(),C=e.state.doc;if(!I.focusNode)return null;let t=e.docView.nearestDesc(I.focusNode),i=t&&t.size==0,A=e.docView.posFromDOM(I.focusNode,I.focusOffset,1);if(A<0)return null;let n=C.resolve(A),l,s;if(kp(I)){for(l=A;t&&!t.node;)t=t.parent;let d=t.node;if(t&&d.isAtom&&eI.isSelectable(d)&&t.parent&&!(d.isInline&&cEg(I.focusNode,I.focusOffset,t.dom))){let m=t.posBefore;s=new eI(A==m?n:C.resolve(m))}}else{if(I instanceof e.dom.ownerDocument.defaultView.Selection&&I.rangeCount>1){let d=A,m=A;for(let u=0;u<I.rangeCount;u++){let h=I.getRangeAt(u);d=Math.min(d,e.docView.posFromDOM(h.startContainer,h.startOffset,1)),m=Math.max(m,e.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,A]=m==e.state.selection.anchor?[m,d]:[d,m],n=C.resolve(A)}else l=e.docView.posFromDOM(I.anchorNode,I.anchorOffset,1);if(l<0)return null}let a=C.resolve(l);if(!s){let d=g=="pointer"||e.state.selection.head<n.pos&&!i?1:-1;s=EN(e,a,n,d)}return s}function z3(e){return e.editable?e.hasFocus():O3(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function $l(e,g=!1){let I=e.state.selection;if(v3(e,I),!!z3(e)){if(!g&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&mt){let C=e.domSelectionRange(),t=e.domObserver.currentSelection;if(C.anchorNode&&t.anchorNode&&Jd(C.anchorNode,C.anchorOffset,t.anchorNode,t.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)vEg(e);else{let{anchor:C,head:t}=I,i,A;J3&&!(I instanceof hI)&&(I.$from.parent.inlineContent||(i=L3(e,I.from)),!I.empty&&!I.$from.parent.inlineContent&&(A=L3(e,I.to))),e.docView.setSelection(C,t,e,g),J3&&(i&&T3(i),A&&T3(A)),I.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&TEg(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const J3=Lt||mt&&Z3<63;function L3(e,g){let{node:I,offset:C}=e.docView.domFromPos(g,0),t=C<I.childNodes.length?I.childNodes[C]:null,i=C?I.childNodes[C-1]:null;if(Lt&&t&&t.contentEditable=="false")return UN(t);if((!t||t.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(t)return UN(t);if(i)return UN(i)}}function UN(e){return e.contentEditable="true",Lt&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function T3(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function TEg(e){let g=e.dom.ownerDocument;g.removeEventListener("selectionchange",e.input.hideSelectionGuard);let I=e.domSelectionRange(),C=I.anchorNode,t=I.anchorOffset;g.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(I.anchorNode!=C||I.anchorOffset!=t)&&(g.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!z3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function vEg(e){let g=e.domSelection();if(!g)return;let I=e.cursorWrapper.dom,C=I.nodeName=="IMG";C?g.collapse(I.parentNode,PC(I)+1):g.collapse(I,0),!C&&!e.state.selection.visible&&ci&&ks<=11&&(I.disabled=!0,I.disabled=!1)}function v3(e,g){if(g instanceof eI){let I=e.docView.descAt(g.from);I!=e.lastSelectedViewDesc&&(j3(e),I&&I.selectNode(),e.lastSelectedViewDesc=I)}else j3(e)}function j3(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function EN(e,g,I,C){return e.someProp("createSelectionBetween",t=>t(e,g,I))||hI.between(g,I,C)}function x3(e){return e.editable&&!e.hasFocus()?!1:O3(e)}function O3(e){let g=e.domSelectionRange();if(!g.anchorNode)return!1;try{return e.dom.contains(g.anchorNode.nodeType==3?g.anchorNode.parentNode:g.anchorNode)&&(e.editable||e.dom.contains(g.focusNode.nodeType==3?g.focusNode.parentNode:g.focusNode))}catch{return!1}}function jEg(e){let g=e.docView.domFromPos(e.state.selection.anchor,0),I=e.domSelectionRange();return Jd(g.node,g.offset,I.anchorNode,I.anchorOffset)}function PN(e,g){let{$anchor:I,$head:C}=e.selection,t=g>0?I.max(C):I.min(C),i=t.parent.inlineContent?t.depth?e.doc.resolve(g>0?t.after():t.before()):null:t;return i&&uI.findFrom(i,g)}function Js(e,g){return e.dispatch(e.state.tr.setSelection(g).scrollIntoView()),!0}function Q3(e,g,I){let C=e.state.selection;if(C instanceof hI)if(I.indexOf("s")>-1){let{$head:t}=C,i=t.textOffset?null:g<0?t.nodeBefore:t.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let A=e.state.doc.resolve(t.pos+i.nodeSize*(g<0?-1:1));return Js(e,new hI(C.$anchor,A))}else if(C.empty){if(e.endOfTextblock(g>0?"forward":"backward")){let t=PN(e.state,g);return t&&t instanceof eI?Js(e,t):!1}else if(!(wA&&I.indexOf("m")>-1)){let t=C.$head,i=t.textOffset?null:g<0?t.nodeBefore:t.nodeAfter,A;if(!i||i.isText)return!1;let n=g<0?t.pos-i.nodeSize:t.pos;return i.isAtom||(A=e.docView.descAt(n))&&!A.contentDOM?eI.isSelectable(i)?Js(e,new eI(g<0?e.state.doc.resolve(t.pos-i.nodeSize):t)):nb?Js(e,new hI(e.state.doc.resolve(g<0?n:n+i.nodeSize))):!1:!1}}else return!1;else{if(C instanceof eI&&C.node.isInline)return Js(e,new hI(g>0?C.$to:C.$from));{let t=PN(e.state,g);return t?Js(e,t):!1}}}function Jp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ab(e,g){let I=e.pmViewDesc;return I&&I.size==0&&(g<0||e.nextSibling||e.nodeName!="BR")}function Ym(e,g){return g<0?xEg(e):OEg(e)}function xEg(e){let g=e.domSelectionRange(),I=g.focusNode,C=g.focusOffset;if(!I)return;let t,i,A=!1;for(GA&&I.nodeType==1&&C<Jp(I)&&ab(I.childNodes[C],-1)&&(A=!0);;)if(C>0){if(I.nodeType!=1)break;{let n=I.childNodes[C-1];if(ab(n,-1))t=I,i=--C;else if(n.nodeType==3)I=n,C=I.nodeValue.length;else break}}else{if(U3(I))break;{let n=I.previousSibling;for(;n&&ab(n,-1);)t=I.parentNode,i=PC(n),n=n.previousSibling;if(n)I=n,C=Jp(I);else{if(I=I.parentNode,I==e.dom)break;C=0}}}A?_N(e,I,C):t&&_N(e,t,i)}function OEg(e){let g=e.domSelectionRange(),I=g.focusNode,C=g.focusOffset;if(!I)return;let t=Jp(I),i,A;for(;;)if(C<t){if(I.nodeType!=1)break;let n=I.childNodes[C];if(ab(n,1))i=I,A=++C;else break}else{if(U3(I))break;{let n=I.nextSibling;for(;n&&ab(n,1);)i=n.parentNode,A=PC(n)+1,n=n.nextSibling;if(n)I=n,C=0,t=Jp(I);else{if(I=I.parentNode,I==e.dom)break;C=t=0}}}i&&_N(e,i,A)}function U3(e){let g=e.pmViewDesc;return g&&g.node&&g.node.isBlock}function QEg(e,g){for(;e&&g==e.childNodes.length&&!Ab(e);)g=PC(e)+1,e=e.parentNode;for(;e&&g<e.childNodes.length;){let I=e.childNodes[g];if(I.nodeType==3)return I;if(I.nodeType==1&&I.contentEditable=="false")break;e=I,g=0}}function UEg(e,g){for(;e&&!g&&!Ab(e);)g=PC(e),e=e.parentNode;for(;e&&g;){let I=e.childNodes[g-1];if(I.nodeType==3)return I;if(I.nodeType==1&&I.contentEditable=="false")break;e=I,g=e.childNodes.length}}function _N(e,g,I){if(g.nodeType!=3){let i,A;(A=QEg(g,I))?(g=A,I=0):(i=UEg(g,I))&&(g=i,I=i.nodeValue.length)}let C=e.domSelection();if(!C)return;if(kp(C)){let i=document.createRange();i.setEnd(g,I),i.setStart(g,I),C.removeAllRanges(),C.addRange(i)}else C.extend&&C.extend(g,I);e.domObserver.setCurSelection();let{state:t}=e;setTimeout(()=>{e.state==t&&$l(e)},50)}function E3(e,g){let I=e.state.doc.resolve(g);if(!(mt||uEg)&&I.parent.inlineContent){let t=e.coordsAtPos(g);if(g>I.start()){let i=e.coordsAtPos(g-1),A=(i.top+i.bottom)/2;if(A>t.top&&A<t.bottom&&Math.abs(i.left-t.left)>1)return i.left<t.left?"ltr":"rtl"}if(g<I.end()){let i=e.coordsAtPos(g+1),A=(i.top+i.bottom)/2;if(A>t.top&&A<t.bottom&&Math.abs(i.left-t.left)>1)return i.left>t.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function P3(e,g,I){let C=e.state.selection;if(C instanceof hI&&!C.empty||I.indexOf("s")>-1||wA&&I.indexOf("m")>-1)return!1;let{$from:t,$to:i}=C;if(!t.parent.inlineContent||e.endOfTextblock(g<0?"up":"down")){let A=PN(e.state,g);if(A&&A instanceof eI)return Js(e,A)}if(!t.parent.inlineContent){let A=g<0?t:i,n=C instanceof Ss?uI.near(A,g):uI.findFrom(A,g);return n?Js(e,n):!1}return!1}function _3(e,g){if(!(e.state.selection instanceof hI))return!0;let{$head:I,$anchor:C,empty:t}=e.state.selection;if(!I.sameParent(C))return!0;if(!t)return!1;if(e.endOfTextblock(g>0?"forward":"backward"))return!0;let i=!I.textOffset&&(g<0?I.nodeBefore:I.nodeAfter);if(i&&!i.isText){let A=e.state.tr;return g<0?A.delete(I.pos-i.nodeSize,I.pos):A.delete(I.pos,I.pos+i.nodeSize),e.dispatch(A),!0}return!1}function $3(e,g,I){e.domObserver.stop(),g.contentEditable=I,e.domObserver.start()}function EEg(e){if(!Lt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:g,focusOffset:I}=e.domSelectionRange();if(g&&g.nodeType==1&&I==0&&g.firstChild&&g.firstChild.contentEditable=="false"){let C=g.firstChild;$3(e,C,"true"),setTimeout(()=>$3(e,C,"false"),20)}return!1}function PEg(e){let g="";return e.ctrlKey&&(g+="c"),e.metaKey&&(g+="m"),e.altKey&&(g+="a"),e.shiftKey&&(g+="s"),g}function _Eg(e,g){let I=g.keyCode,C=PEg(g);if(I==8||wA&&I==72&&C=="c")return _3(e,-1)||Ym(e,-1);if(I==46&&!g.shiftKey||wA&&I==68&&C=="c")return _3(e,1)||Ym(e,1);if(I==13||I==27)return!0;if(I==37||wA&&I==66&&C=="c"){let t=I==37?E3(e,e.state.selection.from)=="ltr"?-1:1:-1;return Q3(e,t,C)||Ym(e,t)}else if(I==39||wA&&I==70&&C=="c"){let t=I==39?E3(e,e.state.selection.from)=="ltr"?1:-1:1;return Q3(e,t,C)||Ym(e,t)}else{if(I==38||wA&&I==80&&C=="c")return P3(e,-1,C)||Ym(e,-1);if(I==40||wA&&I==78&&C=="c")return EEg(e)||P3(e,1,C)||Ym(e,1);if(C==(wA?"m":"c")&&(I==66||I==73||I==89||I==90))return!0}return!1}function $N(e,g){e.someProp("transformCopied",u=>{g=u(g,e)});let I=[],{content:C,openStart:t,openEnd:i}=g;for(;t>1&&i>1&&C.childCount==1&&C.firstChild.childCount==1;){t--,i--;let u=C.firstChild;I.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),C=u.content}let A=e.someProp("clipboardSerializer")||Fd.fromSchema(e.state.schema),n=AF(),l=n.createElement("div");l.appendChild(A.serializeFragment(C,{document:n}));let s=l.firstChild,a,d=0;for(;s&&s.nodeType==1&&(a=tF[s.nodeName.toLowerCase()]);){for(let u=a.length-1;u>=0;u--){let h=n.createElement(a[u]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}s=l.firstChild}s&&s.nodeType==1&&s.setAttribute("data-pm-slice",`${t} ${i}${d?` -${d}`:""} ${JSON.stringify(I)}`);let m=e.someProp("clipboardTextSerializer",u=>u(g,e))||g.content.textBetween(0,g.content.size,`
1461
1463
 
1462
1464
  `);return{dom:l,text:m,slice:g}}function q3(e,g,I,C,t){let i=t.parent.type.spec.code,A,n;if(!I&&!g)return null;let l=!!g&&(C||i||!I);if(l){if(e.someProp("transformPastedText",m=>{g=m(g,i||C,e)}),i)return n=new zg(Bg.from(e.state.schema.text(g.replace(/\r\n?/g,`
1463
- `))),0,0),e.someProp("transformPasted",m=>{n=m(n,e,!0)}),n;let d=e.someProp("clipboardTextParser",m=>m(g,t,C,e));if(d)n=d;else{let m=t.marks(),{schema:u}=e.state,h=Fd.fromSchema(u);A=document.createElement("div"),g.split(/(?:\r\n?|\n)+/).forEach(Z=>{let G=A.appendChild(document.createElement("p"));Z&&G.appendChild(h.serializeNode(u.text(Z,m)))})}}else e.someProp("transformPastedHTML",d=>{I=d(I,e)}),A=IPg(I),nb&&ePg(A);let s=A&&A.querySelector("[data-pm-slice]"),a=s&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(s.getAttribute("data-pm-slice")||"");if(a&&a[3])for(let d=+a[3];d>0;d--){let m=A.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;A=m}if(n||(n=(e.someProp("clipboardParser")||e.someProp("domParser")||Hs.fromSchema(e.state.schema)).parseSlice(A,{preserveWhitespace:!!(l||a),context:t,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!$7g.test(m.parentNode.nodeName)?{ignore:!0}:null}})),a)n=CPg(CF(n,+a[1],+a[2]),a[4]);else if(n=zg.maxOpen(q7g(n.content,t),!0),n.openStart||n.openEnd){let d=0,m=0;for(let u=n.content.firstChild;d<n.openStart&&!u.type.spec.isolating;d++,u=u.firstChild);for(let u=n.content.lastChild;m<n.openEnd&&!u.type.spec.isolating;m++,u=u.lastChild);n=CF(n,d,m)}return e.someProp("transformPasted",d=>{n=d(n,e,l)}),n}const $7g=/^(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 q7g(e,g){if(e.childCount<2)return e;for(let I=g.depth;I>=0;I--){let t=g.node(I).contentMatchAt(g.index(I)),i,A=[];if(e.forEach(n=>{if(!A)return;let l=t.findWrapping(n.type),s;if(!l)return A=null;if(s=A.length&&i.length&&IF(l,i,n,A[A.length-1],0))A[A.length-1]=s;else{A.length&&(A[A.length-1]=eF(A[A.length-1],i.length));let a=gF(n,l);A.push(a),t=t.matchType(a.type),i=l}}),A)return Bg.from(A)}return e}function gF(e,g,I=0){for(let C=g.length-1;C>=I;C--)e=g[C].create(null,Bg.from(e));return e}function IF(e,g,I,C,t){if(t<e.length&&t<g.length&&e[t]==g[t]){let i=IF(e,g,I,C.lastChild,t+1);if(i)return C.copy(C.content.replaceChild(C.childCount-1,i));if(C.contentMatchAt(C.childCount).matchType(t==e.length-1?I.type:e[t+1]))return C.copy(C.content.append(Bg.from(gF(I,e,t+1))))}}function eF(e,g){if(g==0)return e;let I=e.content.replaceChild(e.childCount-1,eF(e.lastChild,g-1)),C=e.contentMatchAt(e.childCount).fillBefore(Bg.empty,!0);return e.copy(I.append(C))}function qN(e,g,I,C,t,i){let A=g<0?e.firstChild:e.lastChild,n=A.content;return e.childCount>1&&(i=0),t<C-1&&(n=qN(n,g,I,C,t+1,i)),t>=I&&(n=g<0?A.contentMatchAt(0).fillBefore(n,i<=t).append(n):n.append(A.contentMatchAt(A.childCount).fillBefore(Bg.empty,!0))),e.replaceChild(g<0?0:e.childCount-1,A.copy(n))}function CF(e,g,I){return g<e.openStart&&(e=new zg(qN(e.content,-1,g,e.openStart,0,e.openEnd),g,e.openEnd)),I<e.openEnd&&(e=new zg(qN(e.content,1,I,e.openEnd,0,0),e.openStart,I)),e}const tF={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 iF=null;function AF(){return iF||(iF=document.implementation.createHTMLDocument("title"))}let gM=null;function gPg(e){let g=window.trustedTypes;return g?(gM||(gM=g.defaultPolicy||g.createPolicy("ProseMirrorClipboard",{createHTML:I=>I})),gM.createHTML(e)):e}function IPg(e){let g=/^(\s*<meta [^>]*>)*/.exec(e);g&&(e=e.slice(g[0].length));let I=AF().createElement("div"),C=/<([a-z][^>\s]+)/i.exec(e),t;if((t=C&&tF[C[1].toLowerCase()])&&(e=t.map(i=>"<"+i+">").join("")+e+t.map(i=>"</"+i+">").reverse().join("")),I.innerHTML=gPg(e),t)for(let i=0;i<t.length;i++)I=I.querySelector(t[i])||I;return I}function ePg(e){let g=e.querySelectorAll(mt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let I=0;I<g.length;I++){let C=g[I];C.childNodes.length==1&&C.textContent==" "&&C.parentNode&&C.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),C)}}function CPg(e,g){if(!e.size)return e;let I=e.content.firstChild.type.schema,C;try{C=JSON.parse(g)}catch{return e}let{content:t,openStart:i,openEnd:A}=e;for(let n=C.length-2;n>=0;n-=2){let l=I.nodes[C[n]];if(!l||l.hasRequiredAttrs())break;t=Bg.from(l.create(C[n+1],t)),i++,A++}return new zg(t,i,A)}const Tt={},vt={},tPg={touchstart:!0,touchmove:!0};class iPg{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 APg(e){for(let g in Tt){let I=Tt[g];e.dom.addEventListener(g,e.input.eventHandlers[g]=C=>{lPg(e,C)&&!eM(e,C)&&(e.editable||!(C.type in vt))&&I(e,C)},tPg[g]?{passive:!0}:void 0)}Lt&&e.dom.addEventListener("input",()=>null),IM(e)}function Ls(e,g){e.input.lastSelectionOrigin=g,e.input.lastSelectionTime=Date.now()}function nPg(e){e.domObserver.stop();for(let g in e.input.eventHandlers)e.dom.removeEventListener(g,e.input.eventHandlers[g]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function IM(e){e.someProp("handleDOMEvents",g=>{for(let I in g)e.input.eventHandlers[I]||e.dom.addEventListener(I,e.input.eventHandlers[I]=C=>eM(e,C))})}function eM(e,g){return e.someProp("handleDOMEvents",I=>{let C=I[g.type];return C?C(e,g)||g.defaultPrevented:!1})}function lPg(e,g){if(!g.bubbles)return!0;if(g.defaultPrevented)return!1;for(let I=g.target;I!=e.dom;I=I.parentNode)if(!I||I.nodeType==11||I.pmViewDesc&&I.pmViewDesc.stopEvent(g))return!1;return!0}function oPg(e,g){!eM(e,g)&&Tt[g.type]&&(e.editable||!(g.type in vt))&&Tt[g.type](e,g)}vt.keydown=(e,g)=>{let I=g;if(e.input.shiftKey=I.keyCode==16||I.shiftKey,!lF(e,I)&&(e.input.lastKeyCode=I.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Pl&&mt&&I.keyCode==13)))if(I.keyCode!=229&&e.domObserver.forceFlush(),Bm&&I.keyCode==13&&!I.ctrlKey&&!I.altKey&&!I.metaKey){let C=Date.now();e.input.lastIOSEnter=C,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==C&&(e.someProp("handleKeyDown",t=>t(e,Ld(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",C=>C(e,I))||_7g(e,I)?I.preventDefault():Ls(e,"key")},vt.keyup=(e,g)=>{g.keyCode==16&&(e.input.shiftKey=!1)},vt.keypress=(e,g)=>{let I=g;if(lF(e,I)||!I.charCode||I.ctrlKey&&!I.altKey||wA&&I.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,I))){I.preventDefault();return}let C=e.state.selection;if(!(C instanceof hI)||!C.$from.sameParent(C.$to)){let t=String.fromCharCode(I.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp("handleTextInput",A=>A(e,C.$from.pos,C.$to.pos,t,i))&&e.dispatch(i()),I.preventDefault()}};function Lp(e){return{left:e.clientX,top:e.clientY}}function sPg(e,g){let I=g.x-e.clientX,C=g.y-e.clientY;return I*I+C*C<100}function CM(e,g,I,C,t){if(C==-1)return!1;let i=e.state.doc.resolve(C);for(let A=i.depth+1;A>0;A--)if(e.someProp(g,n=>A>i.depth?n(e,I,i.nodeAfter,i.before(A),t,!0):n(e,I,i.node(A),i.before(A),t,!1)))return!0;return!1}function Vm(e,g,I){if(e.focused||e.focus(),e.state.selection.eq(g))return;let C=e.state.tr.setSelection(g);C.setMeta("pointer",!0),e.dispatch(C)}function aPg(e,g){if(g==-1)return!1;let I=e.state.doc.resolve(g),C=I.nodeAfter;return C&&C.isAtom&&eI.isSelectable(C)?(Vm(e,new eI(I)),!0):!1}function dPg(e,g){if(g==-1)return!1;let I=e.state.selection,C,t;I instanceof eI&&(C=I.node);let i=e.state.doc.resolve(g);for(let A=i.depth+1;A>0;A--){let n=A>i.depth?i.nodeAfter:i.node(A);if(eI.isSelectable(n)){C&&I.$from.depth>0&&A>=I.$from.depth&&i.before(I.$from.depth+1)==I.$from.pos?t=i.before(I.$from.depth):t=i.before(A);break}}return t!=null?(Vm(e,eI.create(e.state.doc,t)),!0):!1}function cPg(e,g,I,C,t){return CM(e,"handleClickOn",g,I,C)||e.someProp("handleClick",i=>i(e,g,C))||(t?dPg(e,I):aPg(e,I))}function rPg(e,g,I,C){return CM(e,"handleDoubleClickOn",g,I,C)||e.someProp("handleDoubleClick",t=>t(e,g,C))}function mPg(e,g,I,C){return CM(e,"handleTripleClickOn",g,I,C)||e.someProp("handleTripleClick",t=>t(e,g,C))||uPg(e,I,C)}function uPg(e,g,I){if(I.button!=0)return!1;let C=e.state.doc;if(g==-1)return C.inlineContent?(Vm(e,hI.create(C,0,C.content.size)),!0):!1;let t=C.resolve(g);for(let i=t.depth+1;i>0;i--){let A=i>t.depth?t.nodeAfter:t.node(i),n=t.before(i);if(A.inlineContent)Vm(e,hI.create(C,n+1,n+1+A.content.size));else if(eI.isSelectable(A))Vm(e,eI.create(C,n));else continue;return!0}}function tM(e){return Tp(e)}const nF=wA?"metaKey":"ctrlKey";Tt.mousedown=(e,g)=>{let I=g;e.input.shiftKey=I.shiftKey;let C=tM(e),t=Date.now(),i="singleClick";t-e.input.lastClick.time<500&&sPg(I,e.input.lastClick)&&!I[nF]&&e.input.lastClick.button==I.button&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:t,x:I.clientX,y:I.clientY,type:i,button:I.button};let A=e.posAtCoords(Lp(I));A&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new hPg(e,A,I,!!C)):(i=="doubleClick"?rPg:mPg)(e,A.pos,A.inside,I)?I.preventDefault():Ls(e,"pointer"))};class hPg{constructor(g,I,C,t){this.view=g,this.pos=I,this.event=C,this.flushed=t,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=g.state.doc,this.selectNode=!!C[nF],this.allowDefault=C.shiftKey;let i,A;if(I.inside>-1)i=g.state.doc.nodeAt(I.inside),A=I.inside;else{let a=g.state.doc.resolve(I.pos);i=a.parent,A=a.depth?a.before():0}const n=t?null:C.target,l=n?g.docView.nearestDesc(n,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:s}=g.state;(C.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||s instanceof eI&&s.from<=A&&s.to>A)&&(this.mightDrag={node:i,pos:A,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&GA&&!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()),g.root.addEventListener("mouseup",this.up=this.up.bind(this)),g.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ls(g,"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(()=>$l(this.view)),this.view.input.mouseDown=null}up(g){if(this.done(),!this.view.dom.contains(g.target))return;let I=this.pos;this.view.state.doc!=this.startDoc&&(I=this.view.posAtCoords(Lp(g))),this.updateAllowDefault(g),this.allowDefault||!I?Ls(this.view,"pointer"):cPg(this.view,I.pos,I.inside,g,this.selectNode)?g.preventDefault():g.button==0&&(this.flushed||Lt&&this.mightDrag&&!this.mightDrag.node.isAtom||mt&&!this.view.state.selection.visible&&Math.min(Math.abs(I.pos-this.view.state.selection.from),Math.abs(I.pos-this.view.state.selection.to))<=2)?(Vm(this.view,uI.near(this.view.state.doc.resolve(I.pos))),g.preventDefault()):Ls(this.view,"pointer")}move(g){this.updateAllowDefault(g),Ls(this.view,"pointer"),g.buttons==0&&this.done()}updateAllowDefault(g){!this.allowDefault&&(Math.abs(this.event.x-g.clientX)>4||Math.abs(this.event.y-g.clientY)>4)&&(this.allowDefault=!0)}}Tt.touchstart=e=>{e.input.lastTouch=Date.now(),tM(e),Ls(e,"pointer")},Tt.touchmove=e=>{e.input.lastTouch=Date.now(),Ls(e,"pointer")},Tt.contextmenu=e=>tM(e);function lF(e,g){return e.composing?!0:Lt&&Math.abs(g.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const bPg=Pl?5e3:-1;vt.compositionstart=vt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:g}=e,I=g.selection.$to;if(g.selection instanceof hI&&(g.storedMarks||!I.textOffset&&I.parentOffset&&I.nodeBefore.marks.some(C=>C.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||I.marks(),Tp(e,!0),e.markCursor=null;else if(Tp(e,!g.selection.empty),GA&&g.selection.empty&&I.parentOffset&&!I.textOffset&&I.nodeBefore.marks.length){let C=e.domSelectionRange();for(let t=C.focusNode,i=C.focusOffset;t&&t.nodeType==1&&i!=0;){let A=i<0?t.lastChild:t.childNodes[i-1];if(!A)break;if(A.nodeType==3){let n=e.domSelection();n&&n.collapse(A,A.nodeValue.length);break}else t=A,i=-1}}e.input.composing=!0}oF(e,bPg)},vt.compositionend=(e,g)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=g.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,oF(e,20))};function oF(e,g){clearTimeout(e.input.composingTimeout),g>-1&&(e.input.composingTimeout=setTimeout(()=>Tp(e),g))}function sF(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=GPg());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ZPg(e){let g=e.domSelectionRange();if(!g.focusNode)return null;let I=a7g(g.focusNode,g.focusOffset),C=d7g(g.focusNode,g.focusOffset);if(I&&C&&I!=C){let t=C.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(I==i||C==i)return i;if(!t||!t.isText(C.nodeValue))return C;if(e.input.compositionNode==C){let A=I.pmViewDesc;if(!(!A||!A.isText(I.nodeValue)))return C}}return I||C}function GPg(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Tp(e,g=!1){if(!(Pl&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sF(e),g||e.docView&&e.docView.dirty){let I=QN(e),C=e.state.selection;return I&&!I.eq(C)?e.dispatch(e.state.tr.setSelection(I)):(e.markCursor||g)&&!C.$from.node(C.$from.sharedDepth(C.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function wPg(e,g){if(!e.dom.parentNode)return;let I=e.dom.parentNode.appendChild(document.createElement("div"));I.appendChild(g),I.style.cssText="position: fixed; left: -10000px; top: 10px";let C=getSelection(),t=document.createRange();t.selectNodeContents(g),e.dom.blur(),C.removeAllRanges(),C.addRange(t),setTimeout(()=>{I.parentNode&&I.parentNode.removeChild(I),e.focus()},50)}const db=ci&&ks<15||Bm&&h7g<604;Tt.copy=vt.cut=(e,g)=>{let I=g,C=e.state.selection,t=I.type=="cut";if(C.empty)return;let i=db?null:I.clipboardData,A=C.content(),{dom:n,text:l}=$N(e,A);i?(I.preventDefault(),i.clearData(),i.setData("text/html",n.innerHTML),i.setData("text/plain",l)):wPg(e,n),t&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function WPg(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function pPg(e,g){if(!e.dom.parentNode)return;let I=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,C=e.dom.parentNode.appendChild(document.createElement(I?"textarea":"div"));I||(C.contentEditable="true"),C.style.cssText="position: fixed; left: -10000px; top: 10px",C.focus();let t=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),C.parentNode&&C.parentNode.removeChild(C),I?cb(e,C.value,null,t,g):cb(e,C.textContent,C.innerHTML,t,g)},50)}function cb(e,g,I,C,t){let i=q3(e,g,I,C,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,t,i||zg.empty)))return!0;if(!i)return!1;let A=WPg(i),n=A?e.state.tr.replaceSelectionWith(A,C):e.state.tr.replaceSelection(i);return e.dispatch(n.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function aF(e){let g=e.getData("text/plain")||e.getData("Text");if(g)return g;let I=e.getData("text/uri-list");return I?I.replace(/\r?\n/g," "):""}vt.paste=(e,g)=>{let I=g;if(e.composing&&!Pl)return;let C=db?null:I.clipboardData,t=e.input.shiftKey&&e.input.lastKeyCode!=45;C&&cb(e,aF(C),C.getData("text/html"),t,I)?I.preventDefault():pPg(e,I)};class dF{constructor(g,I,C){this.slice=g,this.move=I,this.node=C}}const BPg=wA?"altKey":"ctrlKey";function cF(e,g){let I=e.someProp("dragCopies",C=>!C(g));return I??!g[BPg]}Tt.dragstart=(e,g)=>{let I=g,C=e.input.mouseDown;if(C&&C.done(),!I.dataTransfer)return;let t=e.state.selection,i=t.empty?null:e.posAtCoords(Lp(I)),A;if(!(i&&i.pos>=t.from&&i.pos<=(t instanceof eI?t.to-1:t.to))){if(C&&C.mightDrag)A=eI.create(e.state.doc,C.mightDrag.pos);else if(I.target&&I.target.nodeType==1){let d=e.docView.nearestDesc(I.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(A=eI.create(e.state.doc,d.posBefore))}}let n=(A||e.state.selection).content(),{dom:l,text:s,slice:a}=$N(e,n);(!I.dataTransfer.files.length||!mt||Z3>120)&&I.dataTransfer.clearData(),I.dataTransfer.setData(db?"Text":"text/html",l.innerHTML),I.dataTransfer.effectAllowed="copyMove",db||I.dataTransfer.setData("text/plain",s),e.dragging=new dF(a,cF(e,I),A)},Tt.dragend=e=>{let g=e.dragging;window.setTimeout(()=>{e.dragging==g&&(e.dragging=null)},50)},vt.dragover=vt.dragenter=(e,g)=>g.preventDefault(),vt.drop=(e,g)=>{let I=g,C=e.dragging;if(e.dragging=null,!I.dataTransfer)return;let t=e.posAtCoords(Lp(I));if(!t)return;let i=e.state.doc.resolve(t.pos),A=C&&C.slice;A?e.someProp("transformPasted",h=>{A=h(A,e,!1)}):A=q3(e,aF(I.dataTransfer),db?null:I.dataTransfer.getData("text/html"),!1,i);let n=!!(C&&cF(e,I));if(e.someProp("handleDrop",h=>h(e,I,A||zg.empty,n))){I.preventDefault();return}if(!A)return;I.preventDefault();let l=A?qk(e.state.doc,i.pos,A):i.pos;l==null&&(l=i.pos);let s=e.state.tr;if(n){let{node:h}=C;h?h.replace(s):s.deleteSelection()}let a=s.mapping.map(l),d=A.openStart==0&&A.openEnd==0&&A.content.childCount==1,m=s.doc;if(d?s.replaceRangeWith(a,a,A.content.firstChild):s.replaceRange(a,a,A),s.doc.eq(m))return;let u=s.doc.resolve(a);if(d&&eI.isSelectable(A.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(A.content.firstChild))s.setSelection(new eI(u));else{let h=s.mapping.map(l);s.mapping.maps[s.mapping.maps.length-1].forEach((Z,G,w,p)=>h=p),s.setSelection(EN(e,u,s.doc.resolve(h)))}e.focus(),e.dispatch(s.setMeta("uiEvent","drop"))},Tt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&$l(e)},20))},Tt.blur=(e,g)=>{let I=g;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),I.relatedTarget&&e.dom.contains(I.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Tt.beforeinput=(e,g)=>{if(mt&&Pl&&g.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:C}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=C||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,Ld(8,"Backspace")))))return;let{$cursor:t}=e.state.selection;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())},50)}};for(let e in vt)Tt[e]=vt[e];function rb(e,g){if(e==g)return!0;for(let I in e)if(e[I]!==g[I])return!1;for(let I in g)if(!(I in e))return!1;return!0}class vp{constructor(g,I){this.toDOM=g,this.spec=I||xd,this.side=this.spec.side||0}map(g,I,C,t){let{pos:i,deleted:A}=g.mapResult(I.from+t,this.side<0?-1:1);return A?null:new jt(i-C,i-C,this)}valid(){return!0}eq(g){return this==g||g instanceof vp&&(this.spec.key&&this.spec.key==g.spec.key||this.toDOM==g.toDOM&&rb(this.spec,g.spec))}destroy(g){this.spec.destroy&&this.spec.destroy(g)}}class Ts{constructor(g,I){this.attrs=g,this.spec=I||xd}map(g,I,C,t){let i=g.map(I.from+t,this.spec.inclusiveStart?-1:1)-C,A=g.map(I.to+t,this.spec.inclusiveEnd?1:-1)-C;return i>=A?null:new jt(i,A,this)}valid(g,I){return I.from<I.to}eq(g){return this==g||g instanceof Ts&&rb(this.attrs,g.attrs)&&rb(this.spec,g.spec)}static is(g){return g.type instanceof Ts}destroy(){}}class iM{constructor(g,I){this.attrs=g,this.spec=I||xd}map(g,I,C,t){let i=g.mapResult(I.from+t,1);if(i.deleted)return null;let A=g.mapResult(I.to+t,-1);return A.deleted||A.pos<=i.pos?null:new jt(i.pos-C,A.pos-C,this)}valid(g,I){let{index:C,offset:t}=g.content.findIndex(I.from),i;return t==I.from&&!(i=g.child(C)).isText&&t+i.nodeSize==I.to}eq(g){return this==g||g instanceof iM&&rb(this.attrs,g.attrs)&&rb(this.spec,g.spec)}destroy(){}}class jt{constructor(g,I,C){this.from=g,this.to=I,this.type=C}copy(g,I){return new jt(g,I,this.type)}eq(g,I=0){return this.type.eq(g.type)&&this.from+I==g.from&&this.to+I==g.to}map(g,I,C){return this.type.map(g,this,I,C)}static widget(g,I,C){return new jt(g,g,new vp(I,C))}static inline(g,I,C,t){return new jt(g,I,new Ts(C,t))}static node(g,I,C,t){return new jt(g,I,new iM(C,t))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ts}get widget(){return this.type instanceof vp}}const Nm=[],xd={};class ke{constructor(g,I){this.local=g.length?g:Nm,this.children=I.length?I:Nm}static create(g,I){return I.length?jp(I,g,0,xd):ut}find(g,I,C){let t=[];return this.findInner(g??0,I??1e9,t,0,C),t}findInner(g,I,C,t,i){for(let A=0;A<this.local.length;A++){let n=this.local[A];n.from<=I&&n.to>=g&&(!i||i(n.spec))&&C.push(n.copy(n.from+t,n.to+t))}for(let A=0;A<this.children.length;A+=3)if(this.children[A]<I&&this.children[A+1]>g){let n=this.children[A]+1;this.children[A+2].findInner(g-n,I-n,C,t+n,i)}}map(g,I,C){return this==ut||g.maps.length==0?this:this.mapInner(g,I,0,0,C||xd)}mapInner(g,I,C,t,i){let A;for(let n=0;n<this.local.length;n++){let l=this.local[n].map(g,C,t);l&&l.type.valid(I,l)?(A||(A=[])).push(l):i.onRemove&&i.onRemove(this.local[n].spec)}return this.children.length?yPg(this.children,A||[],g,I,C,t,i):A?new ke(A.sort(Od),Nm):ut}add(g,I){return I.length?this==ut?ke.create(g,I):this.addInner(g,I,0):this}addInner(g,I,C){let t,i=0;g.forEach((n,l)=>{let s=l+C,a;if(a=mF(I,n,s)){for(t||(t=this.children.slice());i<t.length&&t[i]<l;)i+=3;t[i]==l?t[i+2]=t[i+2].addInner(n,a,s+1):t.splice(i,0,l,l+n.nodeSize,jp(a,n,s+1,xd)),i+=3}});let A=rF(i?uF(I):I,-C);for(let n=0;n<A.length;n++)A[n].type.valid(g,A[n])||A.splice(n--,1);return new ke(A.length?this.local.concat(A).sort(Od):this.local,t||this.children)}remove(g){return g.length==0||this==ut?this:this.removeInner(g,0)}removeInner(g,I){let C=this.children,t=this.local;for(let i=0;i<C.length;i+=3){let A,n=C[i]+I,l=C[i+1]+I;for(let a=0,d;a<g.length;a++)(d=g[a])&&d.from>n&&d.to<l&&(g[a]=null,(A||(A=[])).push(d));if(!A)continue;C==this.children&&(C=this.children.slice());let s=C[i+2].removeInner(A,n+1);s!=ut?C[i+2]=s:(C.splice(i,3),i-=3)}if(t.length){for(let i=0,A;i<g.length;i++)if(A=g[i])for(let n=0;n<t.length;n++)t[n].eq(A,I)&&(t==this.local&&(t=this.local.slice()),t.splice(n--,1))}return C==this.children&&t==this.local?this:t.length||C.length?new ke(t,C):ut}forChild(g,I){if(this==ut)return this;if(I.isLeaf)return ke.empty;let C,t;for(let n=0;n<this.children.length;n+=3)if(this.children[n]>=g){this.children[n]==g&&(C=this.children[n+2]);break}let i=g+1,A=i+I.content.size;for(let n=0;n<this.local.length;n++){let l=this.local[n];if(l.from<A&&l.to>i&&l.type instanceof Ts){let s=Math.max(i,l.from)-i,a=Math.min(A,l.to)-i;s<a&&(t||(t=[])).push(l.copy(s,a))}}if(t){let n=new ke(t.sort(Od),Nm);return C?new vs([n,C]):n}return C||ut}eq(g){if(this==g)return!0;if(!(g instanceof ke)||this.local.length!=g.local.length||this.children.length!=g.children.length)return!1;for(let I=0;I<this.local.length;I++)if(!this.local[I].eq(g.local[I]))return!1;for(let I=0;I<this.children.length;I+=3)if(this.children[I]!=g.children[I]||this.children[I+1]!=g.children[I+1]||!this.children[I+2].eq(g.children[I+2]))return!1;return!0}locals(g){return AM(this.localsInner(g))}localsInner(g){if(this==ut)return Nm;if(g.inlineContent||!this.local.some(Ts.is))return this.local;let I=[];for(let C=0;C<this.local.length;C++)this.local[C].type instanceof Ts||I.push(this.local[C]);return I}forEachSet(g){g(this)}}ke.empty=new ke([],[]),ke.removeOverlap=AM;const ut=ke.empty;class vs{constructor(g){this.members=g}map(g,I){const C=this.members.map(t=>t.map(g,I,xd));return vs.from(C)}forChild(g,I){if(I.isLeaf)return ke.empty;let C=[];for(let t=0;t<this.members.length;t++){let i=this.members[t].forChild(g,I);i!=ut&&(i instanceof vs?C=C.concat(i.members):C.push(i))}return vs.from(C)}eq(g){if(!(g instanceof vs)||g.members.length!=this.members.length)return!1;for(let I=0;I<this.members.length;I++)if(!this.members[I].eq(g.members[I]))return!1;return!0}locals(g){let I,C=!0;for(let t=0;t<this.members.length;t++){let i=this.members[t].localsInner(g);if(i.length)if(!I)I=i;else{C&&(I=I.slice(),C=!1);for(let A=0;A<i.length;A++)I.push(i[A])}}return I?AM(C?I:I.sort(Od)):Nm}static from(g){switch(g.length){case 0:return ut;case 1:return g[0];default:return new vs(g.every(I=>I instanceof ke)?g:g.reduce((I,C)=>I.concat(C instanceof ke?C:C.members),[]))}}forEachSet(g){for(let I=0;I<this.members.length;I++)this.members[I].forEachSet(g)}}function yPg(e,g,I,C,t,i,A){let n=e.slice();for(let s=0,a=i;s<I.maps.length;s++){let d=0;I.maps[s].forEach((m,u,h,Z)=>{let G=Z-h-(u-m);for(let w=0;w<n.length;w+=3){let p=n[w+1];if(p<0||m>p+a-d)continue;let B=n[w]+a-d;u>=B?n[w+1]=m<=B?-2:-1:m>=a&&G&&(n[w]+=G,n[w+1]+=G)}d+=G}),a=I.maps[s].map(a,-1)}let l=!1;for(let s=0;s<n.length;s+=3)if(n[s+1]<0){if(n[s+1]==-2){l=!0,n[s+1]=-1;continue}let a=I.map(e[s]+i),d=a-t;if(d<0||d>=C.content.size){l=!0;continue}let m=I.map(e[s+1]+i,-1),u=m-t,{index:h,offset:Z}=C.content.findIndex(d),G=C.maybeChild(h);if(G&&Z==d&&Z+G.nodeSize==u){let w=n[s+2].mapInner(I,G,a+1,e[s]+i+1,A);w!=ut?(n[s]=d,n[s+1]=u,n[s+2]=w):(n[s+1]=-2,l=!0)}else l=!0}if(l){let s=YPg(n,e,g,I,t,i,A),a=jp(s,C,0,A);g=a.local;for(let d=0;d<n.length;d+=3)n[d+1]<0&&(n.splice(d,3),d-=3);for(let d=0,m=0;d<a.children.length;d+=3){let u=a.children[d];for(;m<n.length&&n[m]<u;)m+=3;n.splice(m,0,a.children[d],a.children[d+1],a.children[d+2])}}return new ke(g.sort(Od),n)}function rF(e,g){if(!g||!e.length)return e;let I=[];for(let C=0;C<e.length;C++){let t=e[C];I.push(new jt(t.from+g,t.to+g,t.type))}return I}function YPg(e,g,I,C,t,i,A){function n(l,s){for(let a=0;a<l.local.length;a++){let d=l.local[a].map(C,t,s);d?I.push(d):A.onRemove&&A.onRemove(l.local[a].spec)}for(let a=0;a<l.children.length;a+=3)n(l.children[a+2],l.children[a]+s+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&n(e[l+2],g[l]+i+1);return I}function mF(e,g,I){if(g.isLeaf)return null;let C=I+g.nodeSize,t=null;for(let i=0,A;i<e.length;i++)(A=e[i])&&A.from>I&&A.to<C&&((t||(t=[])).push(A),e[i]=null);return t}function uF(e){let g=[];for(let I=0;I<e.length;I++)e[I]!=null&&g.push(e[I]);return g}function jp(e,g,I,C){let t=[],i=!1;g.forEach((n,l)=>{let s=mF(e,n,l+I);if(s){i=!0;let a=jp(s,n,I+l+1,C);a!=ut&&t.push(l,l+n.nodeSize,a)}});let A=rF(i?uF(e):e,-I).sort(Od);for(let n=0;n<A.length;n++)A[n].type.valid(g,A[n])||(C.onRemove&&C.onRemove(A[n].spec),A.splice(n--,1));return A.length||t.length?new ke(A,t):ut}function Od(e,g){return e.from-g.from||e.to-g.to}function AM(e){let g=e;for(let I=0;I<g.length-1;I++){let C=g[I];if(C.from!=C.to)for(let t=I+1;t<g.length;t++){let i=g[t];if(i.from==C.from){i.to!=C.to&&(g==e&&(g=e.slice()),g[t]=i.copy(i.from,C.to),hF(g,t+1,i.copy(C.to,i.to)));continue}else{i.from<C.to&&(g==e&&(g=e.slice()),g[I]=C.copy(C.from,i.from),hF(g,t,C.copy(i.from,C.to)));break}}}return g}function hF(e,g,I){for(;g<e.length&&Od(I,e[g])>0;)g++;e.splice(g,0,I)}function nM(e){let g=[];return e.someProp("decorations",I=>{let C=I(e.state);C&&C!=ut&&g.push(C)}),e.cursorWrapper&&g.push(ke.create(e.state.doc,[e.cursorWrapper.deco])),vs.from(g)}const VPg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},NPg=ci&&ks<=11;class MPg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(g){this.anchorNode=g.anchorNode,this.anchorOffset=g.anchorOffset,this.focusNode=g.focusNode,this.focusOffset=g.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(g){return g.anchorNode==this.anchorNode&&g.anchorOffset==this.anchorOffset&&g.focusNode==this.focusNode&&g.focusOffset==this.focusOffset}}class fPg{constructor(g,I){this.view=g,this.handleDOMChange=I,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new MPg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(C=>{for(let t=0;t<C.length;t++)this.queue.push(C[t]);ci&&ks<=11&&C.some(t=>t.type=="childList"&&t.removedNodes.length||t.type=="characterData"&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),NPg&&(this.onCharData=C=>{this.queue.push({target:C.target,type:"characterData",oldValue:C.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,VPg)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let g=this.observer.takeRecords();if(g.length){for(let I=0;I<g.length;I++)this.queue.push(g[I]);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(x3(this.view)){if(this.suppressingSelectionUpdates)return $l(this.view);if(ci&&ks<=11&&!this.view.state.selection.empty){let g=this.view.domSelectionRange();if(g.focusNode&&Jd(g.focusNode,g.focusOffset,g.anchorNode,g.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(g){if(!g.focusNode)return!0;let I=new Set,C;for(let i=g.focusNode;i;i=pm(i))I.add(i);for(let i=g.anchorNode;i;i=pm(i))if(I.has(i)){C=i;break}let t=C&&this.view.docView.nearestDesc(C);if(t&&t.ignoreMutation({type:"selection",target:C.nodeType==3?C.parentNode:C}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let g of this.observer.takeRecords())this.queue.push(g);return this.queue}flush(){let{view:g}=this;if(!g.docView||this.flushingSoon>-1)return;let I=this.pendingRecords();I.length&&(this.queue=[]);let C=g.domSelectionRange(),t=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(C)&&x3(g)&&!this.ignoreSelectionChange(C),i=-1,A=-1,n=!1,l=[];if(g.editable)for(let a=0;a<I.length;a++){let d=this.registerMutation(I[a],l);d&&(i=i<0?d.from:Math.min(d.from,i),A=A<0?d.to:Math.max(d.to,A),d.typeOver&&(n=!0))}if(GA&&l.length){let a=l.filter(d=>d.nodeName=="BR");if(a.length==2){let[d,m]=a;d.parentNode&&d.parentNode.parentNode==m.parentNode?m.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let m of a){let u=m.parentNode;u&&u.nodeName=="LI"&&(!d||HPg(g,d)!=u)&&m.remove()}}}let s=null;i<0&&t&&g.input.lastFocus>Date.now()-200&&Math.max(g.input.lastTouch,g.input.lastClick.time)<Date.now()-300&&kp(C)&&(s=QN(g))&&s.eq(uI.near(g.state.doc.resolve(0),1))?(g.input.lastFocus=0,$l(g),this.currentSelection.set(C),g.scrollToSelection()):(i>-1||t)&&(i>-1&&(g.docView.markDirty(i,A),RPg(g)),this.handleDOMChange(i,A,n,l),g.docView&&g.docView.dirty?g.updateState(g.state):this.currentSelection.eq(C)||$l(g),this.currentSelection.set(C))}registerMutation(g,I){if(I.indexOf(g.target)>-1)return null;let C=this.view.docView.nearestDesc(g.target);if(g.type=="attributes"&&(C==this.view.docView||g.attributeName=="contenteditable"||g.attributeName=="style"&&!g.oldValue&&!g.target.getAttribute("style"))||!C||C.ignoreMutation(g))return null;if(g.type=="childList"){for(let a=0;a<g.addedNodes.length;a++){let d=g.addedNodes[a];I.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(C.contentDOM&&C.contentDOM!=C.dom&&!C.contentDOM.contains(g.target))return{from:C.posBefore,to:C.posAfter};let t=g.previousSibling,i=g.nextSibling;if(ci&&ks<=11&&g.addedNodes.length)for(let a=0;a<g.addedNodes.length;a++){let{previousSibling:d,nextSibling:m}=g.addedNodes[a];(!d||Array.prototype.indexOf.call(g.addedNodes,d)<0)&&(t=d),(!m||Array.prototype.indexOf.call(g.addedNodes,m)<0)&&(i=m)}let A=t&&t.parentNode==g.target?PC(t)+1:0,n=C.localPosFromDOM(g.target,A,-1),l=i&&i.parentNode==g.target?PC(i):g.target.childNodes.length,s=C.localPosFromDOM(g.target,l,1);return{from:n,to:s}}else return g.type=="attributes"?{from:C.posAtStart-C.border,to:C.posAtEnd+C.border}:(this.lastChangedTextNode=g.target,{from:C.posAtStart,to:C.posAtEnd,typeOver:g.target.nodeValue==g.oldValue})}}let bF=new WeakMap,ZF=!1;function RPg(e){if(!bF.has(e)&&(bF.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=GA,ZF)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."),ZF=!0}}function GF(e,g){let I=g.startContainer,C=g.startOffset,t=g.endContainer,i=g.endOffset,A=e.domAtPos(e.state.selection.anchor);return Jd(A.node,A.offset,t,i)&&([I,C,t,i]=[t,i,I,C]),{anchorNode:I,anchorOffset:C,focusNode:t,focusOffset:i}}function XPg(e,g){if(g.getComposedRanges){let t=g.getComposedRanges(e.root)[0];if(t)return GF(e,t)}let I;function C(t){t.preventDefault(),t.stopImmediatePropagation(),I=t.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",C,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",C,!0),I?GF(e,I):null}function HPg(e,g){for(let I=g.parentNode;I&&I!=e.dom;I=I.parentNode){let C=e.docView.nearestDesc(I,!0);if(C&&C.node.isBlock)return I}return null}function DPg(e,g,I){let{node:C,fromOffset:t,toOffset:i,from:A,to:n}=e.docView.parseRange(g,I),l=e.domSelectionRange(),s,a=l.anchorNode;if(a&&e.dom.contains(a.nodeType==1?a:a.parentNode)&&(s=[{node:a,offset:l.anchorOffset}],kp(l)||s.push({node:l.focusNode,offset:l.focusOffset})),mt&&e.input.lastKeyCode===8)for(let G=i;G>t;G--){let w=C.childNodes[G-1],p=w.pmViewDesc;if(w.nodeName=="BR"&&!p){i=G;break}if(!p||p.size)break}let d=e.state.doc,m=e.someProp("domParser")||Hs.fromSchema(e.state.schema),u=d.resolve(A),h=null,Z=m.parse(C,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:t,to:i,preserveWhitespace:u.parent.type.whitespace=="pre"?"full":!0,findPositions:s,ruleFromNode:SPg,context:u});if(s&&s[0].pos!=null){let G=s[0].pos,w=s[1]&&s[1].pos;w==null&&(w=G),h={anchor:G+A,head:w+A}}return{doc:Z,sel:h,from:A,to:n}}function SPg(e){let g=e.pmViewDesc;if(g)return g.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Lt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let I=document.createElement("div");return I.appendChild(document.createElement("li")),{skip:I}}else if(e.parentNode.lastChild==e||Lt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const KPg=/^(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 kPg(e,g,I,C,t){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,g<0){let M=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,K=QN(e,M);if(K&&!e.state.selection.eq(K)){if(mt&&Pl&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",X=>X(e,Ld(13,"Enter"))))return;let F=e.state.tr.setSelection(K);M=="pointer"?F.setMeta("pointer",!0):M=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),e.dispatch(F)}return}let A=e.state.doc.resolve(g),n=A.sharedDepth(I);g=A.before(n+1),I=e.state.doc.resolve(I).after(n+1);let l=e.state.selection,s=DPg(e,g,I),a=e.state.doc,d=a.slice(s.from,s.to),m,u;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(m=e.state.selection.to,u="end"):(m=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let h=JPg(d.content,s.doc.content,s.from,m,u);if(h&&e.input.domChangeCount++,(Bm&&e.input.lastIOSEnter>Date.now()-225||Pl)&&t.some(M=>M.nodeType==1&&!KPg.test(M.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",M=>M(e,Ld(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(C&&l instanceof hI&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(s.sel){let M=wF(e,e.state.doc,s.sel);if(M&&!M.eq(e.state.selection)){let K=e.state.tr.setSelection(M);i&&K.setMeta("composition",i),e.dispatch(K)}}return}e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof hI&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),ci&&ks<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>s.from&&s.doc.textBetween(h.start-s.from-1,h.start-s.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let Z=s.doc.resolveNoCache(h.start-s.from),G=s.doc.resolveNoCache(h.endB-s.from),w=a.resolve(h.start),p=Z.sameParent(G)&&Z.parent.inlineContent&&w.end()>=h.endA;if((Bm&&e.input.lastIOSEnter>Date.now()-225&&(!p||t.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!p&&Z.pos<s.doc.content.size&&(!Z.sameParent(G)||!Z.parent.inlineContent)&&Z.pos<G.pos&&!/\S/.test(s.doc.textBetween(Z.pos,G.pos,"","")))&&e.someProp("handleKeyDown",M=>M(e,Ld(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&zPg(a,h.start,h.endA,Z,G)&&e.someProp("handleKeyDown",M=>M(e,Ld(8,"Backspace")))){Pl&&mt&&e.domObserver.suppressSelectionUpdates();return}mt&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Pl&&!p&&Z.start()!=G.start()&&G.parentOffset==0&&Z.depth==G.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==h.endA&&(h.endB-=2,G=s.doc.resolveNoCache(h.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(M){return M(e,Ld(13,"Enter"))})},20));let B=h.start,y=h.endA,Y=M=>{let K=M||e.state.tr.replace(B,y,s.doc.slice(h.start-s.from,h.endB-s.from));if(s.sel){let F=wF(e,K.doc,s.sel);F&&!(mt&&e.composing&&F.empty&&(h.start!=h.endB||e.input.lastChromeDelete<Date.now()-100)&&(F.head==B||F.head==K.mapping.map(y)-1)||ci&&F.empty&&F.head==B)&&K.setSelection(F)}return i&&K.setMeta("composition",i),K.scrollIntoView()},f;if(p){if(Z.pos==G.pos){ci&&ks<=11&&Z.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>$l(e),20));let M=Y(e.state.tr.delete(B,y)),K=a.resolve(h.start).marksAcross(a.resolve(h.endA));K&&M.ensureMarks(K),e.dispatch(M)}else if(h.endA==h.endB&&(f=FPg(Z.parent.content.cut(Z.parentOffset,G.parentOffset),w.parent.content.cut(w.parentOffset,h.endA-w.start())))){let M=Y(e.state.tr);f.type=="add"?M.addMark(B,y,f.mark):M.removeMark(B,y,f.mark),e.dispatch(M)}else if(Z.parent.child(Z.index()).isText&&Z.index()==G.index()-(G.textOffset?0:1)){let M=Z.parent.textBetween(Z.parentOffset,G.parentOffset),K=()=>Y(e.state.tr.insertText(M,B,y));e.someProp("handleTextInput",F=>F(e,B,y,M,K))||e.dispatch(K())}}else e.dispatch(Y())}function wF(e,g,I){return Math.max(I.anchor,I.head)>g.content.size?null:EN(e,g.resolve(I.anchor),g.resolve(I.head))}function FPg(e,g){let I=e.firstChild.marks,C=g.firstChild.marks,t=I,i=C,A,n,l;for(let a=0;a<C.length;a++)t=C[a].removeFromSet(t);for(let a=0;a<I.length;a++)i=I[a].removeFromSet(i);if(t.length==1&&i.length==0)n=t[0],A="add",l=a=>a.mark(n.addToSet(a.marks));else if(t.length==0&&i.length==1)n=i[0],A="remove",l=a=>a.mark(n.removeFromSet(a.marks));else return null;let s=[];for(let a=0;a<g.childCount;a++)s.push(l(g.child(a)));if(Bg.from(s).eq(e))return{mark:n,type:A}}function zPg(e,g,I,C,t){if(I-g<=t.pos-C.pos||lM(C,!0,!1)<t.pos)return!1;let i=e.resolve(g);if(!C.parent.isTextblock){let n=i.nodeAfter;return n!=null&&I==g+n.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let A=e.resolve(lM(i,!0,!0));return!A.parent.isTextblock||A.pos>I||lM(A,!0,!1)<I?!1:C.parent.content.cut(C.parentOffset).eq(A.parent.content)}function lM(e,g,I){let C=e.depth,t=g?e.end():e.pos;for(;C>0&&(g||e.indexAfter(C)==e.node(C).childCount);)C--,t++,g=!1;if(I){let i=e.node(C).maybeChild(e.indexAfter(C));for(;i&&!i.isLeaf;)i=i.firstChild,t++}return t}function JPg(e,g,I,C,t){let i=e.findDiffStart(g,I);if(i==null)return null;let{a:A,b:n}=e.findDiffEnd(g,I+e.size,I+g.size);if(t=="end"){let l=Math.max(0,i-Math.min(A,n));C-=A+l-i}if(A<i&&e.size<g.size){let l=C<=i&&C>=A?i-C:0;i-=l,i&&i<g.size&&WF(g.textBetween(i-1,i+1))&&(i+=l?1:-1),n=i+(n-A),A=i}else if(n<i){let l=C<=i&&C>=n?i-C:0;i-=l,i&&i<e.size&&WF(e.textBetween(i-1,i+1))&&(i+=l?1:-1),A=i+(A-n),n=i}return{start:i,endA:A,endB:n}}function WF(e){if(e.length!=2)return!1;let g=e.charCodeAt(0),I=e.charCodeAt(1);return g>=56320&&g<=57343&&I>=55296&&I<=56319}class pF{constructor(g,I){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 iPg,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=I,this.state=I.state,this.directPlugins=I.plugins||[],this.directPlugins.forEach(NF),this.dispatch=this.dispatch.bind(this),this.dom=g&&g.mount||document.createElement("div"),g&&(g.appendChild?g.appendChild(this.dom):typeof g=="function"?g(this.dom):g.mount&&(this.mounted=!0)),this.editable=YF(this),yF(this),this.nodeViews=VF(this),this.docView=H3(this.state.doc,BF(this),nM(this),this.dom,this),this.domObserver=new fPg(this,(C,t,i,A)=>kPg(this,C,t,i,A)),this.domObserver.start(),APg(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let g=this._props;this._props={};for(let I in g)this._props[I]=g[I];this._props.state=this.state}return this._props}update(g){g.handleDOMEvents!=this._props.handleDOMEvents&&IM(this);let I=this._props;this._props=g,g.plugins&&(g.plugins.forEach(NF),this.directPlugins=g.plugins),this.updateStateInner(g.state,I)}setProps(g){let I={};for(let C in this._props)I[C]=this._props[C];I.state=this.state;for(let C in g)I[C]=g[C];this.update(I)}updateState(g){this.updateStateInner(g,this._props)}updateStateInner(g,I){var C;let t=this.state,i=!1,A=!1;g.storedMarks&&this.composing&&(sF(this),A=!0),this.state=g;let n=t.plugins!=g.plugins||this._props.plugins!=I.plugins;if(n||this._props.plugins!=I.plugins||this._props.nodeViews!=I.nodeViews){let u=VF(this);TPg(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(n||I.handleDOMEvents!=this._props.handleDOMEvents)&&IM(this),this.editable=YF(this),yF(this);let l=nM(this),s=BF(this),a=t.plugins!=g.plugins&&!t.doc.eq(g.doc)?"reset":g.scrollToSelection>t.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(g.doc,s,l);(d||!g.selection.eq(t.selection))&&(A=!0);let m=a=="preserve"&&A&&this.dom.style.overflowAnchor==null&&G7g(this);if(A){this.domObserver.stop();let u=d&&(ci||mt)&&!this.composing&&!t.selection.empty&&!g.selection.empty&&LPg(t.selection,g.selection);if(d){let h=mt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ZPg(this)),(i||!this.docView.update(g.doc,s,l,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=H3(g.doc,s,l,this.dom,this)),h&&!this.trackWrites&&(u=!0)}u||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&j7g(this))?$l(this,u):(v3(this,g.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(t),!((C=this.dragging)===null||C===void 0)&&C.node&&!t.doc.eq(g.doc)&&this.updateDraggedNode(this.dragging,t),a=="reset"?this.dom.scrollTop=0:a=="to selection"?this.scrollToSelection():m&&w7g(m)}scrollToSelection(){let g=this.domSelectionRange().focusNode;if(!(!g||!this.dom.contains(g.nodeType==1?g:g.parentNode))){if(!this.someProp("handleScrollToSelection",I=>I(this)))if(this.state.selection instanceof eI){let I=this.docView.domAfterPos(this.state.selection.from);I.nodeType==1&&G3(this,I.getBoundingClientRect(),g)}else G3(this,this.coordsAtPos(this.state.selection.head,1),g)}}destroyPluginViews(){let g;for(;g=this.pluginViews.pop();)g.destroy&&g.destroy()}updatePluginViews(g){if(!g||g.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let I=0;I<this.directPlugins.length;I++){let C=this.directPlugins[I];C.spec.view&&this.pluginViews.push(C.spec.view(this))}for(let I=0;I<this.state.plugins.length;I++){let C=this.state.plugins[I];C.spec.view&&this.pluginViews.push(C.spec.view(this))}}else for(let I=0;I<this.pluginViews.length;I++){let C=this.pluginViews[I];C.update&&C.update(this,g)}}updateDraggedNode(g,I){let C=g.node,t=-1;if(this.state.doc.nodeAt(C.from)==C.node)t=C.from;else{let i=C.from+(this.state.doc.content.size-I.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==C.node&&(t=i)}this.dragging=new dF(g.slice,g.move,t<0?void 0:eI.create(this.state.doc,t))}someProp(g,I){let C=this._props&&this._props[g],t;if(C!=null&&(t=I?I(C):C))return t;for(let A=0;A<this.directPlugins.length;A++){let n=this.directPlugins[A].props[g];if(n!=null&&(t=I?I(n):n))return t}let i=this.state.plugins;if(i)for(let A=0;A<i.length;A++){let n=i[A].props[g];if(n!=null&&(t=I?I(n):n))return t}}hasFocus(){if(ci){let g=this.root.activeElement;if(g==this.dom)return!0;if(!g||!this.dom.contains(g))return!1;for(;g&&this.dom!=g&&this.dom.contains(g);){if(g.contentEditable=="false")return!1;g=g.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&W7g(this.dom),$l(this),this.domObserver.start()}get root(){let g=this._root;if(g==null){for(let I=this.dom.parentNode;I;I=I.parentNode)if(I.nodeType==9||I.nodeType==11&&I.host)return I.getSelection||(Object.getPrototypeOf(I).getSelection=()=>I.ownerDocument.getSelection()),this._root=I}return g||document}updateRoot(){this._root=null}posAtCoords(g){return V7g(this,g)}coordsAtPos(g,I=1){return Y3(this,g,I)}domAtPos(g,I=0){return this.docView.domFromPos(g,I)}nodeDOM(g){let I=this.docView.descAt(g);return I?I.nodeDOM:null}posAtDOM(g,I,C=-1){let t=this.docView.posFromDOM(g,I,C);if(t==null)throw new RangeError("DOM position not inside the editor");return t}endOfTextblock(g,I){return X7g(this,I||this.state,g)}pasteHTML(g,I){return cb(this,"",g,!1,I||new ClipboardEvent("paste"))}pasteText(g,I){return cb(this,g,null,!0,I||new ClipboardEvent("paste"))}serializeForClipboard(g){return $N(this,g)}destroy(){this.docView&&(nPg(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],nM(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,o7g())}get isDestroyed(){return this.docView==null}dispatchEvent(g){return oPg(this,g)}domSelectionRange(){let g=this.domSelection();return g?Lt&&this.root.nodeType===11&&r7g(this.dom.ownerDocument)==this.dom&&XPg(this,g)||g:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}pF.prototype.dispatch=function(e){let g=this._props.dispatchTransaction;g?g.call(this,e):this.updateState(this.state.apply(e))};function BF(e){let g=Object.create(null);return g.class="ProseMirror",g.contenteditable=String(e.editable),e.someProp("attributes",I=>{if(typeof I=="function"&&(I=I(e.state)),I)for(let C in I)C=="class"?g.class+=" "+I[C]:C=="style"?g.style=(g.style?g.style+";":"")+I[C]:!g[C]&&C!="contenteditable"&&C!="nodeName"&&(g[C]=String(I[C]))}),g.translate||(g.translate="no"),[jt.node(0,e.state.doc.content.size,g)]}function yF(e){if(e.markCursor){let g=document.createElement("img");g.className="ProseMirror-separator",g.setAttribute("mark-placeholder","true"),g.setAttribute("alt",""),e.cursorWrapper={dom:g,deco:jt.widget(e.state.selection.from,g,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function YF(e){return!e.someProp("editable",g=>g(e.state)===!1)}function LPg(e,g){let I=Math.min(e.$anchor.sharedDepth(e.head),g.$anchor.sharedDepth(g.head));return e.$anchor.start(I)!=g.$anchor.start(I)}function VF(e){let g=Object.create(null);function I(C){for(let t in C)Object.prototype.hasOwnProperty.call(g,t)||(g[t]=C[t])}return e.someProp("nodeViews",I),e.someProp("markViews",I),g}function TPg(e,g){let I=0,C=0;for(let t in e){if(e[t]!=g[t])return!0;I++}for(let t in g)C++;return I!=C}function NF(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var js={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:"'"},xp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vPg=typeof navigator<"u"&&/Mac/.test(navigator.platform),jPg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_C=0;_C<10;_C++)js[48+_C]=js[96+_C]=String(_C);for(var _C=1;_C<=24;_C++)js[_C+111]="F"+_C;for(var _C=65;_C<=90;_C++)js[_C]=String.fromCharCode(_C+32),xp[_C]=String.fromCharCode(_C);for(var oM in js)xp.hasOwnProperty(oM)||(xp[oM]=js[oM]);function xPg(e){var g=vPg&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jPg&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",I=!g&&e.key||(e.shiftKey?xp:js)[e.keyCode]||e.key||"Unidentified";return I=="Esc"&&(I="Escape"),I=="Del"&&(I="Delete"),I=="Left"&&(I="ArrowLeft"),I=="Up"&&(I="ArrowUp"),I=="Right"&&(I="ArrowRight"),I=="Down"&&(I="ArrowDown"),I}const OPg=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),QPg=typeof navigator<"u"&&/Win/.test(navigator.platform);function UPg(e){let g=e.split(/-(?!$)/),I=g[g.length-1];I=="Space"&&(I=" ");let C,t,i,A;for(let n=0;n<g.length-1;n++){let l=g[n];if(/^(cmd|meta|m)$/i.test(l))A=!0;else if(/^a(lt)?$/i.test(l))C=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))OPg?A=!0:t=!0;else throw new Error("Unrecognized modifier name: "+l)}return C&&(I="Alt-"+I),t&&(I="Ctrl-"+I),A&&(I="Meta-"+I),i&&(I="Shift-"+I),I}function EPg(e){let g=Object.create(null);for(let I in e)g[UPg(I)]=e[I];return g}function sM(e,g,I=!0){return g.altKey&&(e="Alt-"+e),g.ctrlKey&&(e="Ctrl-"+e),g.metaKey&&(e="Meta-"+e),I&&g.shiftKey&&(e="Shift-"+e),e}function PPg(e){return new je({props:{handleKeyDown:MF(e)}})}function MF(e){let g=EPg(e);return function(I,C){let t=xPg(C),i,A=g[sM(t,C)];if(A&&A(I.state,I.dispatch,I))return!0;if(t.length==1&&t!=" "){if(C.shiftKey){let n=g[sM(t,C,!1)];if(n&&n(I.state,I.dispatch,I))return!0}if((C.altKey||C.metaKey||C.ctrlKey)&&!(QPg&&C.ctrlKey&&C.altKey)&&(i=js[C.keyCode])&&i!=t){let n=g[sM(i,C)];if(n&&n(I.state,I.dispatch,I))return!0}}return!1}}const _Pg=(e,g)=>e.selection.empty?!1:(g&&g(e.tr.deleteSelection().scrollIntoView()),!0);function fF(e,g){let{$cursor:I}=e.selection;return!I||(g?!g.endOfTextblock("backward",e):I.parentOffset>0)?null:I}const $Pg=(e,g,I)=>{let C=fF(e,I);if(!C)return!1;let t=aM(C);if(!t){let A=C.blockRange(),n=A&&bm(A);return n==null?!1:(g&&g(e.tr.lift(A,n).scrollIntoView()),!0)}let i=t.nodeBefore;if(DF(e,t,g,-1))return!0;if(C.parent.content.size==0&&(Mm(i,"end")||eI.isSelectable(i)))for(let A=C.depth;;A--){let n=Sp(e.doc,C.before(A),C.after(A),zg.empty);if(n&&n.slice.size<n.to-n.from){if(g){let l=e.tr.step(n);l.setSelection(Mm(i,"end")?uI.findFrom(l.doc.resolve(l.mapping.map(t.pos,-1)),-1):eI.create(l.doc,t.pos-i.nodeSize)),g(l.scrollIntoView())}return!0}if(A==1||C.node(A-1).childCount>1)break}return i.isAtom&&t.depth==C.depth-1?(g&&g(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!1},qPg=(e,g,I)=>{let C=fF(e,I);if(!C)return!1;let t=aM(C);return t?RF(e,t,g):!1},g6g=(e,g,I)=>{let C=XF(e,I);if(!C)return!1;let t=dM(C);return t?RF(e,t,g):!1};function RF(e,g,I){let C=g.nodeBefore,t=C,i=g.pos-1;for(;!t.isTextblock;i--){if(t.type.spec.isolating)return!1;let a=t.lastChild;if(!a)return!1;t=a}let A=g.nodeAfter,n=A,l=g.pos+1;for(;!n.isTextblock;l++){if(n.type.spec.isolating)return!1;let a=n.firstChild;if(!a)return!1;n=a}let s=Sp(e.doc,i,l,zg.empty);if(!s||s.from!=i||s instanceof dn&&s.slice.size>=l-i)return!1;if(I){let a=e.tr.step(s);a.setSelection(hI.create(a.doc,i)),I(a.scrollIntoView())}return!0}function Mm(e,g,I=!1){for(let C=e;C;C=g=="start"?C.firstChild:C.lastChild){if(C.isTextblock)return!0;if(I&&C.childCount!=1)return!1}return!1}const I6g=(e,g,I)=>{let{$head:C,empty:t}=e.selection,i=C;if(!t)return!1;if(C.parent.isTextblock){if(I?!I.endOfTextblock("backward",e):C.parentOffset>0)return!1;i=aM(C)}let A=i&&i.nodeBefore;return!A||!eI.isSelectable(A)?!1:(g&&g(e.tr.setSelection(eI.create(e.doc,i.pos-A.nodeSize)).scrollIntoView()),!0)};function aM(e){if(!e.parent.type.spec.isolating)for(let g=e.depth-1;g>=0;g--){if(e.index(g)>0)return e.doc.resolve(e.before(g+1));if(e.node(g).type.spec.isolating)break}return null}function XF(e,g){let{$cursor:I}=e.selection;return!I||(g?!g.endOfTextblock("forward",e):I.parentOffset<I.parent.content.size)?null:I}const e6g=(e,g,I)=>{let C=XF(e,I);if(!C)return!1;let t=dM(C);if(!t)return!1;let i=t.nodeAfter;if(DF(e,t,g,1))return!0;if(C.parent.content.size==0&&(Mm(i,"start")||eI.isSelectable(i))){let A=Sp(e.doc,C.before(),C.after(),zg.empty);if(A&&A.slice.size<A.to-A.from){if(g){let n=e.tr.step(A);n.setSelection(Mm(i,"start")?uI.findFrom(n.doc.resolve(n.mapping.map(t.pos)),1):eI.create(n.doc,n.mapping.map(t.pos))),g(n.scrollIntoView())}return!0}}return i.isAtom&&t.depth==C.depth-1?(g&&g(e.tr.delete(t.pos,t.pos+i.nodeSize).scrollIntoView()),!0):!1},C6g=(e,g,I)=>{let{$head:C,empty:t}=e.selection,i=C;if(!t)return!1;if(C.parent.isTextblock){if(I?!I.endOfTextblock("forward",e):C.parentOffset<C.parent.content.size)return!1;i=dM(C)}let A=i&&i.nodeAfter;return!A||!eI.isSelectable(A)?!1:(g&&g(e.tr.setSelection(eI.create(e.doc,i.pos)).scrollIntoView()),!0)};function dM(e){if(!e.parent.type.spec.isolating)for(let g=e.depth-1;g>=0;g--){let I=e.node(g);if(e.index(g)+1<I.childCount)return e.doc.resolve(e.after(g+1));if(I.type.spec.isolating)break}return null}const t6g=(e,g)=>{let I=e.selection,C=I instanceof eI,t;if(C){if(I.node.isTextblock||!Ds(e.doc,I.from))return!1;t=I.from}else if(t=Dp(e.doc,I.from,-1),t==null)return!1;if(g){let i=e.tr.join(t);C&&i.setSelection(eI.create(i.doc,t-e.doc.resolve(t).nodeBefore.nodeSize)),g(i.scrollIntoView())}return!0},i6g=(e,g)=>{let I=e.selection,C;if(I instanceof eI){if(I.node.isTextblock||!Ds(e.doc,I.to))return!1;C=I.to}else if(C=Dp(e.doc,I.to,1),C==null)return!1;return g&&g(e.tr.join(C).scrollIntoView()),!0},A6g=(e,g)=>{let{$from:I,$to:C}=e.selection,t=I.blockRange(C),i=t&&bm(t);return i==null?!1:(g&&g(e.tr.lift(t,i).scrollIntoView()),!0)},n6g=(e,g)=>{let{$head:I,$anchor:C}=e.selection;return!I.parent.type.spec.code||!I.sameParent(C)?!1:(g&&g(e.tr.insertText(`
1465
+ `))),0,0),e.someProp("transformPasted",m=>{n=m(n,e,!0)}),n;let d=e.someProp("clipboardTextParser",m=>m(g,t,C,e));if(d)n=d;else{let m=t.marks(),{schema:u}=e.state,h=Fd.fromSchema(u);A=document.createElement("div"),g.split(/(?:\r\n?|\n)+/).forEach(Z=>{let G=A.appendChild(document.createElement("p"));Z&&G.appendChild(h.serializeNode(u.text(Z,m)))})}}else e.someProp("transformPastedHTML",d=>{I=d(I,e)}),A=IPg(I),nb&&ePg(A);let s=A&&A.querySelector("[data-pm-slice]"),a=s&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(s.getAttribute("data-pm-slice")||"");if(a&&a[3])for(let d=+a[3];d>0;d--){let m=A.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;A=m}if(n||(n=(e.someProp("clipboardParser")||e.someProp("domParser")||Hs.fromSchema(e.state.schema)).parseSlice(A,{preserveWhitespace:!!(l||a),context:t,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!$Eg.test(m.parentNode.nodeName)?{ignore:!0}:null}})),a)n=CPg(CF(n,+a[1],+a[2]),a[4]);else if(n=zg.maxOpen(qEg(n.content,t),!0),n.openStart||n.openEnd){let d=0,m=0;for(let u=n.content.firstChild;d<n.openStart&&!u.type.spec.isolating;d++,u=u.firstChild);for(let u=n.content.lastChild;m<n.openEnd&&!u.type.spec.isolating;m++,u=u.lastChild);n=CF(n,d,m)}return e.someProp("transformPasted",d=>{n=d(n,e,l)}),n}const $Eg=/^(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 qEg(e,g){if(e.childCount<2)return e;for(let I=g.depth;I>=0;I--){let t=g.node(I).contentMatchAt(g.index(I)),i,A=[];if(e.forEach(n=>{if(!A)return;let l=t.findWrapping(n.type),s;if(!l)return A=null;if(s=A.length&&i.length&&IF(l,i,n,A[A.length-1],0))A[A.length-1]=s;else{A.length&&(A[A.length-1]=eF(A[A.length-1],i.length));let a=gF(n,l);A.push(a),t=t.matchType(a.type),i=l}}),A)return Bg.from(A)}return e}function gF(e,g,I=0){for(let C=g.length-1;C>=I;C--)e=g[C].create(null,Bg.from(e));return e}function IF(e,g,I,C,t){if(t<e.length&&t<g.length&&e[t]==g[t]){let i=IF(e,g,I,C.lastChild,t+1);if(i)return C.copy(C.content.replaceChild(C.childCount-1,i));if(C.contentMatchAt(C.childCount).matchType(t==e.length-1?I.type:e[t+1]))return C.copy(C.content.append(Bg.from(gF(I,e,t+1))))}}function eF(e,g){if(g==0)return e;let I=e.content.replaceChild(e.childCount-1,eF(e.lastChild,g-1)),C=e.contentMatchAt(e.childCount).fillBefore(Bg.empty,!0);return e.copy(I.append(C))}function qN(e,g,I,C,t,i){let A=g<0?e.firstChild:e.lastChild,n=A.content;return e.childCount>1&&(i=0),t<C-1&&(n=qN(n,g,I,C,t+1,i)),t>=I&&(n=g<0?A.contentMatchAt(0).fillBefore(n,i<=t).append(n):n.append(A.contentMatchAt(A.childCount).fillBefore(Bg.empty,!0))),e.replaceChild(g<0?0:e.childCount-1,A.copy(n))}function CF(e,g,I){return g<e.openStart&&(e=new zg(qN(e.content,-1,g,e.openStart,0,e.openEnd),g,e.openEnd)),I<e.openEnd&&(e=new zg(qN(e.content,1,I,e.openEnd,0,0),e.openStart,I)),e}const tF={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 iF=null;function AF(){return iF||(iF=document.implementation.createHTMLDocument("title"))}let gM=null;function gPg(e){let g=window.trustedTypes;return g?(gM||(gM=g.defaultPolicy||g.createPolicy("ProseMirrorClipboard",{createHTML:I=>I})),gM.createHTML(e)):e}function IPg(e){let g=/^(\s*<meta [^>]*>)*/.exec(e);g&&(e=e.slice(g[0].length));let I=AF().createElement("div"),C=/<([a-z][^>\s]+)/i.exec(e),t;if((t=C&&tF[C[1].toLowerCase()])&&(e=t.map(i=>"<"+i+">").join("")+e+t.map(i=>"</"+i+">").reverse().join("")),I.innerHTML=gPg(e),t)for(let i=0;i<t.length;i++)I=I.querySelector(t[i])||I;return I}function ePg(e){let g=e.querySelectorAll(mt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let I=0;I<g.length;I++){let C=g[I];C.childNodes.length==1&&C.textContent==" "&&C.parentNode&&C.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),C)}}function CPg(e,g){if(!e.size)return e;let I=e.content.firstChild.type.schema,C;try{C=JSON.parse(g)}catch{return e}let{content:t,openStart:i,openEnd:A}=e;for(let n=C.length-2;n>=0;n-=2){let l=I.nodes[C[n]];if(!l||l.hasRequiredAttrs())break;t=Bg.from(l.create(C[n+1],t)),i++,A++}return new zg(t,i,A)}const Tt={},vt={},tPg={touchstart:!0,touchmove:!0};class iPg{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 APg(e){for(let g in Tt){let I=Tt[g];e.dom.addEventListener(g,e.input.eventHandlers[g]=C=>{lPg(e,C)&&!eM(e,C)&&(e.editable||!(C.type in vt))&&I(e,C)},tPg[g]?{passive:!0}:void 0)}Lt&&e.dom.addEventListener("input",()=>null),IM(e)}function Ls(e,g){e.input.lastSelectionOrigin=g,e.input.lastSelectionTime=Date.now()}function nPg(e){e.domObserver.stop();for(let g in e.input.eventHandlers)e.dom.removeEventListener(g,e.input.eventHandlers[g]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function IM(e){e.someProp("handleDOMEvents",g=>{for(let I in g)e.input.eventHandlers[I]||e.dom.addEventListener(I,e.input.eventHandlers[I]=C=>eM(e,C))})}function eM(e,g){return e.someProp("handleDOMEvents",I=>{let C=I[g.type];return C?C(e,g)||g.defaultPrevented:!1})}function lPg(e,g){if(!g.bubbles)return!0;if(g.defaultPrevented)return!1;for(let I=g.target;I!=e.dom;I=I.parentNode)if(!I||I.nodeType==11||I.pmViewDesc&&I.pmViewDesc.stopEvent(g))return!1;return!0}function oPg(e,g){!eM(e,g)&&Tt[g.type]&&(e.editable||!(g.type in vt))&&Tt[g.type](e,g)}vt.keydown=(e,g)=>{let I=g;if(e.input.shiftKey=I.keyCode==16||I.shiftKey,!lF(e,I)&&(e.input.lastKeyCode=I.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Pl&&mt&&I.keyCode==13)))if(I.keyCode!=229&&e.domObserver.forceFlush(),Bm&&I.keyCode==13&&!I.ctrlKey&&!I.altKey&&!I.metaKey){let C=Date.now();e.input.lastIOSEnter=C,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==C&&(e.someProp("handleKeyDown",t=>t(e,Ld(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",C=>C(e,I))||_Eg(e,I)?I.preventDefault():Ls(e,"key")},vt.keyup=(e,g)=>{g.keyCode==16&&(e.input.shiftKey=!1)},vt.keypress=(e,g)=>{let I=g;if(lF(e,I)||!I.charCode||I.ctrlKey&&!I.altKey||wA&&I.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,I))){I.preventDefault();return}let C=e.state.selection;if(!(C instanceof hI)||!C.$from.sameParent(C.$to)){let t=String.fromCharCode(I.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp("handleTextInput",A=>A(e,C.$from.pos,C.$to.pos,t,i))&&e.dispatch(i()),I.preventDefault()}};function Lp(e){return{left:e.clientX,top:e.clientY}}function sPg(e,g){let I=g.x-e.clientX,C=g.y-e.clientY;return I*I+C*C<100}function CM(e,g,I,C,t){if(C==-1)return!1;let i=e.state.doc.resolve(C);for(let A=i.depth+1;A>0;A--)if(e.someProp(g,n=>A>i.depth?n(e,I,i.nodeAfter,i.before(A),t,!0):n(e,I,i.node(A),i.before(A),t,!1)))return!0;return!1}function Vm(e,g,I){if(e.focused||e.focus(),e.state.selection.eq(g))return;let C=e.state.tr.setSelection(g);C.setMeta("pointer",!0),e.dispatch(C)}function aPg(e,g){if(g==-1)return!1;let I=e.state.doc.resolve(g),C=I.nodeAfter;return C&&C.isAtom&&eI.isSelectable(C)?(Vm(e,new eI(I)),!0):!1}function dPg(e,g){if(g==-1)return!1;let I=e.state.selection,C,t;I instanceof eI&&(C=I.node);let i=e.state.doc.resolve(g);for(let A=i.depth+1;A>0;A--){let n=A>i.depth?i.nodeAfter:i.node(A);if(eI.isSelectable(n)){C&&I.$from.depth>0&&A>=I.$from.depth&&i.before(I.$from.depth+1)==I.$from.pos?t=i.before(I.$from.depth):t=i.before(A);break}}return t!=null?(Vm(e,eI.create(e.state.doc,t)),!0):!1}function cPg(e,g,I,C,t){return CM(e,"handleClickOn",g,I,C)||e.someProp("handleClick",i=>i(e,g,C))||(t?dPg(e,I):aPg(e,I))}function rPg(e,g,I,C){return CM(e,"handleDoubleClickOn",g,I,C)||e.someProp("handleDoubleClick",t=>t(e,g,C))}function mPg(e,g,I,C){return CM(e,"handleTripleClickOn",g,I,C)||e.someProp("handleTripleClick",t=>t(e,g,C))||uPg(e,I,C)}function uPg(e,g,I){if(I.button!=0)return!1;let C=e.state.doc;if(g==-1)return C.inlineContent?(Vm(e,hI.create(C,0,C.content.size)),!0):!1;let t=C.resolve(g);for(let i=t.depth+1;i>0;i--){let A=i>t.depth?t.nodeAfter:t.node(i),n=t.before(i);if(A.inlineContent)Vm(e,hI.create(C,n+1,n+1+A.content.size));else if(eI.isSelectable(A))Vm(e,eI.create(C,n));else continue;return!0}}function tM(e){return Tp(e)}const nF=wA?"metaKey":"ctrlKey";Tt.mousedown=(e,g)=>{let I=g;e.input.shiftKey=I.shiftKey;let C=tM(e),t=Date.now(),i="singleClick";t-e.input.lastClick.time<500&&sPg(I,e.input.lastClick)&&!I[nF]&&e.input.lastClick.button==I.button&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:t,x:I.clientX,y:I.clientY,type:i,button:I.button};let A=e.posAtCoords(Lp(I));A&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new hPg(e,A,I,!!C)):(i=="doubleClick"?rPg:mPg)(e,A.pos,A.inside,I)?I.preventDefault():Ls(e,"pointer"))};class hPg{constructor(g,I,C,t){this.view=g,this.pos=I,this.event=C,this.flushed=t,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=g.state.doc,this.selectNode=!!C[nF],this.allowDefault=C.shiftKey;let i,A;if(I.inside>-1)i=g.state.doc.nodeAt(I.inside),A=I.inside;else{let a=g.state.doc.resolve(I.pos);i=a.parent,A=a.depth?a.before():0}const n=t?null:C.target,l=n?g.docView.nearestDesc(n,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:s}=g.state;(C.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||s instanceof eI&&s.from<=A&&s.to>A)&&(this.mightDrag={node:i,pos:A,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&GA&&!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()),g.root.addEventListener("mouseup",this.up=this.up.bind(this)),g.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ls(g,"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(()=>$l(this.view)),this.view.input.mouseDown=null}up(g){if(this.done(),!this.view.dom.contains(g.target))return;let I=this.pos;this.view.state.doc!=this.startDoc&&(I=this.view.posAtCoords(Lp(g))),this.updateAllowDefault(g),this.allowDefault||!I?Ls(this.view,"pointer"):cPg(this.view,I.pos,I.inside,g,this.selectNode)?g.preventDefault():g.button==0&&(this.flushed||Lt&&this.mightDrag&&!this.mightDrag.node.isAtom||mt&&!this.view.state.selection.visible&&Math.min(Math.abs(I.pos-this.view.state.selection.from),Math.abs(I.pos-this.view.state.selection.to))<=2)?(Vm(this.view,uI.near(this.view.state.doc.resolve(I.pos))),g.preventDefault()):Ls(this.view,"pointer")}move(g){this.updateAllowDefault(g),Ls(this.view,"pointer"),g.buttons==0&&this.done()}updateAllowDefault(g){!this.allowDefault&&(Math.abs(this.event.x-g.clientX)>4||Math.abs(this.event.y-g.clientY)>4)&&(this.allowDefault=!0)}}Tt.touchstart=e=>{e.input.lastTouch=Date.now(),tM(e),Ls(e,"pointer")},Tt.touchmove=e=>{e.input.lastTouch=Date.now(),Ls(e,"pointer")},Tt.contextmenu=e=>tM(e);function lF(e,g){return e.composing?!0:Lt&&Math.abs(g.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const bPg=Pl?5e3:-1;vt.compositionstart=vt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:g}=e,I=g.selection.$to;if(g.selection instanceof hI&&(g.storedMarks||!I.textOffset&&I.parentOffset&&I.nodeBefore.marks.some(C=>C.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||I.marks(),Tp(e,!0),e.markCursor=null;else if(Tp(e,!g.selection.empty),GA&&g.selection.empty&&I.parentOffset&&!I.textOffset&&I.nodeBefore.marks.length){let C=e.domSelectionRange();for(let t=C.focusNode,i=C.focusOffset;t&&t.nodeType==1&&i!=0;){let A=i<0?t.lastChild:t.childNodes[i-1];if(!A)break;if(A.nodeType==3){let n=e.domSelection();n&&n.collapse(A,A.nodeValue.length);break}else t=A,i=-1}}e.input.composing=!0}oF(e,bPg)},vt.compositionend=(e,g)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=g.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,oF(e,20))};function oF(e,g){clearTimeout(e.input.composingTimeout),g>-1&&(e.input.composingTimeout=setTimeout(()=>Tp(e),g))}function sF(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=GPg());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ZPg(e){let g=e.domSelectionRange();if(!g.focusNode)return null;let I=aEg(g.focusNode,g.focusOffset),C=dEg(g.focusNode,g.focusOffset);if(I&&C&&I!=C){let t=C.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(I==i||C==i)return i;if(!t||!t.isText(C.nodeValue))return C;if(e.input.compositionNode==C){let A=I.pmViewDesc;if(!(!A||!A.isText(I.nodeValue)))return C}}return I||C}function GPg(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Tp(e,g=!1){if(!(Pl&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sF(e),g||e.docView&&e.docView.dirty){let I=QN(e),C=e.state.selection;return I&&!I.eq(C)?e.dispatch(e.state.tr.setSelection(I)):(e.markCursor||g)&&!C.$from.node(C.$from.sharedDepth(C.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function wPg(e,g){if(!e.dom.parentNode)return;let I=e.dom.parentNode.appendChild(document.createElement("div"));I.appendChild(g),I.style.cssText="position: fixed; left: -10000px; top: 10px";let C=getSelection(),t=document.createRange();t.selectNodeContents(g),e.dom.blur(),C.removeAllRanges(),C.addRange(t),setTimeout(()=>{I.parentNode&&I.parentNode.removeChild(I),e.focus()},50)}const db=ci&&ks<15||Bm&&hEg<604;Tt.copy=vt.cut=(e,g)=>{let I=g,C=e.state.selection,t=I.type=="cut";if(C.empty)return;let i=db?null:I.clipboardData,A=C.content(),{dom:n,text:l}=$N(e,A);i?(I.preventDefault(),i.clearData(),i.setData("text/html",n.innerHTML),i.setData("text/plain",l)):wPg(e,n),t&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function WPg(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function pPg(e,g){if(!e.dom.parentNode)return;let I=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,C=e.dom.parentNode.appendChild(document.createElement(I?"textarea":"div"));I||(C.contentEditable="true"),C.style.cssText="position: fixed; left: -10000px; top: 10px",C.focus();let t=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),C.parentNode&&C.parentNode.removeChild(C),I?cb(e,C.value,null,t,g):cb(e,C.textContent,C.innerHTML,t,g)},50)}function cb(e,g,I,C,t){let i=q3(e,g,I,C,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,t,i||zg.empty)))return!0;if(!i)return!1;let A=WPg(i),n=A?e.state.tr.replaceSelectionWith(A,C):e.state.tr.replaceSelection(i);return e.dispatch(n.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function aF(e){let g=e.getData("text/plain")||e.getData("Text");if(g)return g;let I=e.getData("text/uri-list");return I?I.replace(/\r?\n/g," "):""}vt.paste=(e,g)=>{let I=g;if(e.composing&&!Pl)return;let C=db?null:I.clipboardData,t=e.input.shiftKey&&e.input.lastKeyCode!=45;C&&cb(e,aF(C),C.getData("text/html"),t,I)?I.preventDefault():pPg(e,I)};class dF{constructor(g,I,C){this.slice=g,this.move=I,this.node=C}}const BPg=wA?"altKey":"ctrlKey";function cF(e,g){let I=e.someProp("dragCopies",C=>!C(g));return I??!g[BPg]}Tt.dragstart=(e,g)=>{let I=g,C=e.input.mouseDown;if(C&&C.done(),!I.dataTransfer)return;let t=e.state.selection,i=t.empty?null:e.posAtCoords(Lp(I)),A;if(!(i&&i.pos>=t.from&&i.pos<=(t instanceof eI?t.to-1:t.to))){if(C&&C.mightDrag)A=eI.create(e.state.doc,C.mightDrag.pos);else if(I.target&&I.target.nodeType==1){let d=e.docView.nearestDesc(I.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(A=eI.create(e.state.doc,d.posBefore))}}let n=(A||e.state.selection).content(),{dom:l,text:s,slice:a}=$N(e,n);(!I.dataTransfer.files.length||!mt||Z3>120)&&I.dataTransfer.clearData(),I.dataTransfer.setData(db?"Text":"text/html",l.innerHTML),I.dataTransfer.effectAllowed="copyMove",db||I.dataTransfer.setData("text/plain",s),e.dragging=new dF(a,cF(e,I),A)},Tt.dragend=e=>{let g=e.dragging;window.setTimeout(()=>{e.dragging==g&&(e.dragging=null)},50)},vt.dragover=vt.dragenter=(e,g)=>g.preventDefault(),vt.drop=(e,g)=>{let I=g,C=e.dragging;if(e.dragging=null,!I.dataTransfer)return;let t=e.posAtCoords(Lp(I));if(!t)return;let i=e.state.doc.resolve(t.pos),A=C&&C.slice;A?e.someProp("transformPasted",h=>{A=h(A,e,!1)}):A=q3(e,aF(I.dataTransfer),db?null:I.dataTransfer.getData("text/html"),!1,i);let n=!!(C&&cF(e,I));if(e.someProp("handleDrop",h=>h(e,I,A||zg.empty,n))){I.preventDefault();return}if(!A)return;I.preventDefault();let l=A?qk(e.state.doc,i.pos,A):i.pos;l==null&&(l=i.pos);let s=e.state.tr;if(n){let{node:h}=C;h?h.replace(s):s.deleteSelection()}let a=s.mapping.map(l),d=A.openStart==0&&A.openEnd==0&&A.content.childCount==1,m=s.doc;if(d?s.replaceRangeWith(a,a,A.content.firstChild):s.replaceRange(a,a,A),s.doc.eq(m))return;let u=s.doc.resolve(a);if(d&&eI.isSelectable(A.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(A.content.firstChild))s.setSelection(new eI(u));else{let h=s.mapping.map(l);s.mapping.maps[s.mapping.maps.length-1].forEach((Z,G,w,p)=>h=p),s.setSelection(EN(e,u,s.doc.resolve(h)))}e.focus(),e.dispatch(s.setMeta("uiEvent","drop"))},Tt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&$l(e)},20))},Tt.blur=(e,g)=>{let I=g;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),I.relatedTarget&&e.dom.contains(I.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Tt.beforeinput=(e,g)=>{if(mt&&Pl&&g.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:C}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=C||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,Ld(8,"Backspace")))))return;let{$cursor:t}=e.state.selection;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())},50)}};for(let e in vt)Tt[e]=vt[e];function rb(e,g){if(e==g)return!0;for(let I in e)if(e[I]!==g[I])return!1;for(let I in g)if(!(I in e))return!1;return!0}class vp{constructor(g,I){this.toDOM=g,this.spec=I||xd,this.side=this.spec.side||0}map(g,I,C,t){let{pos:i,deleted:A}=g.mapResult(I.from+t,this.side<0?-1:1);return A?null:new jt(i-C,i-C,this)}valid(){return!0}eq(g){return this==g||g instanceof vp&&(this.spec.key&&this.spec.key==g.spec.key||this.toDOM==g.toDOM&&rb(this.spec,g.spec))}destroy(g){this.spec.destroy&&this.spec.destroy(g)}}class Ts{constructor(g,I){this.attrs=g,this.spec=I||xd}map(g,I,C,t){let i=g.map(I.from+t,this.spec.inclusiveStart?-1:1)-C,A=g.map(I.to+t,this.spec.inclusiveEnd?1:-1)-C;return i>=A?null:new jt(i,A,this)}valid(g,I){return I.from<I.to}eq(g){return this==g||g instanceof Ts&&rb(this.attrs,g.attrs)&&rb(this.spec,g.spec)}static is(g){return g.type instanceof Ts}destroy(){}}class iM{constructor(g,I){this.attrs=g,this.spec=I||xd}map(g,I,C,t){let i=g.mapResult(I.from+t,1);if(i.deleted)return null;let A=g.mapResult(I.to+t,-1);return A.deleted||A.pos<=i.pos?null:new jt(i.pos-C,A.pos-C,this)}valid(g,I){let{index:C,offset:t}=g.content.findIndex(I.from),i;return t==I.from&&!(i=g.child(C)).isText&&t+i.nodeSize==I.to}eq(g){return this==g||g instanceof iM&&rb(this.attrs,g.attrs)&&rb(this.spec,g.spec)}destroy(){}}class jt{constructor(g,I,C){this.from=g,this.to=I,this.type=C}copy(g,I){return new jt(g,I,this.type)}eq(g,I=0){return this.type.eq(g.type)&&this.from+I==g.from&&this.to+I==g.to}map(g,I,C){return this.type.map(g,this,I,C)}static widget(g,I,C){return new jt(g,g,new vp(I,C))}static inline(g,I,C,t){return new jt(g,I,new Ts(C,t))}static node(g,I,C,t){return new jt(g,I,new iM(C,t))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ts}get widget(){return this.type instanceof vp}}const Nm=[],xd={};class ke{constructor(g,I){this.local=g.length?g:Nm,this.children=I.length?I:Nm}static create(g,I){return I.length?jp(I,g,0,xd):ut}find(g,I,C){let t=[];return this.findInner(g??0,I??1e9,t,0,C),t}findInner(g,I,C,t,i){for(let A=0;A<this.local.length;A++){let n=this.local[A];n.from<=I&&n.to>=g&&(!i||i(n.spec))&&C.push(n.copy(n.from+t,n.to+t))}for(let A=0;A<this.children.length;A+=3)if(this.children[A]<I&&this.children[A+1]>g){let n=this.children[A]+1;this.children[A+2].findInner(g-n,I-n,C,t+n,i)}}map(g,I,C){return this==ut||g.maps.length==0?this:this.mapInner(g,I,0,0,C||xd)}mapInner(g,I,C,t,i){let A;for(let n=0;n<this.local.length;n++){let l=this.local[n].map(g,C,t);l&&l.type.valid(I,l)?(A||(A=[])).push(l):i.onRemove&&i.onRemove(this.local[n].spec)}return this.children.length?yPg(this.children,A||[],g,I,C,t,i):A?new ke(A.sort(Od),Nm):ut}add(g,I){return I.length?this==ut?ke.create(g,I):this.addInner(g,I,0):this}addInner(g,I,C){let t,i=0;g.forEach((n,l)=>{let s=l+C,a;if(a=mF(I,n,s)){for(t||(t=this.children.slice());i<t.length&&t[i]<l;)i+=3;t[i]==l?t[i+2]=t[i+2].addInner(n,a,s+1):t.splice(i,0,l,l+n.nodeSize,jp(a,n,s+1,xd)),i+=3}});let A=rF(i?uF(I):I,-C);for(let n=0;n<A.length;n++)A[n].type.valid(g,A[n])||A.splice(n--,1);return new ke(A.length?this.local.concat(A).sort(Od):this.local,t||this.children)}remove(g){return g.length==0||this==ut?this:this.removeInner(g,0)}removeInner(g,I){let C=this.children,t=this.local;for(let i=0;i<C.length;i+=3){let A,n=C[i]+I,l=C[i+1]+I;for(let a=0,d;a<g.length;a++)(d=g[a])&&d.from>n&&d.to<l&&(g[a]=null,(A||(A=[])).push(d));if(!A)continue;C==this.children&&(C=this.children.slice());let s=C[i+2].removeInner(A,n+1);s!=ut?C[i+2]=s:(C.splice(i,3),i-=3)}if(t.length){for(let i=0,A;i<g.length;i++)if(A=g[i])for(let n=0;n<t.length;n++)t[n].eq(A,I)&&(t==this.local&&(t=this.local.slice()),t.splice(n--,1))}return C==this.children&&t==this.local?this:t.length||C.length?new ke(t,C):ut}forChild(g,I){if(this==ut)return this;if(I.isLeaf)return ke.empty;let C,t;for(let n=0;n<this.children.length;n+=3)if(this.children[n]>=g){this.children[n]==g&&(C=this.children[n+2]);break}let i=g+1,A=i+I.content.size;for(let n=0;n<this.local.length;n++){let l=this.local[n];if(l.from<A&&l.to>i&&l.type instanceof Ts){let s=Math.max(i,l.from)-i,a=Math.min(A,l.to)-i;s<a&&(t||(t=[])).push(l.copy(s,a))}}if(t){let n=new ke(t.sort(Od),Nm);return C?new vs([n,C]):n}return C||ut}eq(g){if(this==g)return!0;if(!(g instanceof ke)||this.local.length!=g.local.length||this.children.length!=g.children.length)return!1;for(let I=0;I<this.local.length;I++)if(!this.local[I].eq(g.local[I]))return!1;for(let I=0;I<this.children.length;I+=3)if(this.children[I]!=g.children[I]||this.children[I+1]!=g.children[I+1]||!this.children[I+2].eq(g.children[I+2]))return!1;return!0}locals(g){return AM(this.localsInner(g))}localsInner(g){if(this==ut)return Nm;if(g.inlineContent||!this.local.some(Ts.is))return this.local;let I=[];for(let C=0;C<this.local.length;C++)this.local[C].type instanceof Ts||I.push(this.local[C]);return I}forEachSet(g){g(this)}}ke.empty=new ke([],[]),ke.removeOverlap=AM;const ut=ke.empty;class vs{constructor(g){this.members=g}map(g,I){const C=this.members.map(t=>t.map(g,I,xd));return vs.from(C)}forChild(g,I){if(I.isLeaf)return ke.empty;let C=[];for(let t=0;t<this.members.length;t++){let i=this.members[t].forChild(g,I);i!=ut&&(i instanceof vs?C=C.concat(i.members):C.push(i))}return vs.from(C)}eq(g){if(!(g instanceof vs)||g.members.length!=this.members.length)return!1;for(let I=0;I<this.members.length;I++)if(!this.members[I].eq(g.members[I]))return!1;return!0}locals(g){let I,C=!0;for(let t=0;t<this.members.length;t++){let i=this.members[t].localsInner(g);if(i.length)if(!I)I=i;else{C&&(I=I.slice(),C=!1);for(let A=0;A<i.length;A++)I.push(i[A])}}return I?AM(C?I:I.sort(Od)):Nm}static from(g){switch(g.length){case 0:return ut;case 1:return g[0];default:return new vs(g.every(I=>I instanceof ke)?g:g.reduce((I,C)=>I.concat(C instanceof ke?C:C.members),[]))}}forEachSet(g){for(let I=0;I<this.members.length;I++)this.members[I].forEachSet(g)}}function yPg(e,g,I,C,t,i,A){let n=e.slice();for(let s=0,a=i;s<I.maps.length;s++){let d=0;I.maps[s].forEach((m,u,h,Z)=>{let G=Z-h-(u-m);for(let w=0;w<n.length;w+=3){let p=n[w+1];if(p<0||m>p+a-d)continue;let B=n[w]+a-d;u>=B?n[w+1]=m<=B?-2:-1:m>=a&&G&&(n[w]+=G,n[w+1]+=G)}d+=G}),a=I.maps[s].map(a,-1)}let l=!1;for(let s=0;s<n.length;s+=3)if(n[s+1]<0){if(n[s+1]==-2){l=!0,n[s+1]=-1;continue}let a=I.map(e[s]+i),d=a-t;if(d<0||d>=C.content.size){l=!0;continue}let m=I.map(e[s+1]+i,-1),u=m-t,{index:h,offset:Z}=C.content.findIndex(d),G=C.maybeChild(h);if(G&&Z==d&&Z+G.nodeSize==u){let w=n[s+2].mapInner(I,G,a+1,e[s]+i+1,A);w!=ut?(n[s]=d,n[s+1]=u,n[s+2]=w):(n[s+1]=-2,l=!0)}else l=!0}if(l){let s=YPg(n,e,g,I,t,i,A),a=jp(s,C,0,A);g=a.local;for(let d=0;d<n.length;d+=3)n[d+1]<0&&(n.splice(d,3),d-=3);for(let d=0,m=0;d<a.children.length;d+=3){let u=a.children[d];for(;m<n.length&&n[m]<u;)m+=3;n.splice(m,0,a.children[d],a.children[d+1],a.children[d+2])}}return new ke(g.sort(Od),n)}function rF(e,g){if(!g||!e.length)return e;let I=[];for(let C=0;C<e.length;C++){let t=e[C];I.push(new jt(t.from+g,t.to+g,t.type))}return I}function YPg(e,g,I,C,t,i,A){function n(l,s){for(let a=0;a<l.local.length;a++){let d=l.local[a].map(C,t,s);d?I.push(d):A.onRemove&&A.onRemove(l.local[a].spec)}for(let a=0;a<l.children.length;a+=3)n(l.children[a+2],l.children[a]+s+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&n(e[l+2],g[l]+i+1);return I}function mF(e,g,I){if(g.isLeaf)return null;let C=I+g.nodeSize,t=null;for(let i=0,A;i<e.length;i++)(A=e[i])&&A.from>I&&A.to<C&&((t||(t=[])).push(A),e[i]=null);return t}function uF(e){let g=[];for(let I=0;I<e.length;I++)e[I]!=null&&g.push(e[I]);return g}function jp(e,g,I,C){let t=[],i=!1;g.forEach((n,l)=>{let s=mF(e,n,l+I);if(s){i=!0;let a=jp(s,n,I+l+1,C);a!=ut&&t.push(l,l+n.nodeSize,a)}});let A=rF(i?uF(e):e,-I).sort(Od);for(let n=0;n<A.length;n++)A[n].type.valid(g,A[n])||(C.onRemove&&C.onRemove(A[n].spec),A.splice(n--,1));return A.length||t.length?new ke(A,t):ut}function Od(e,g){return e.from-g.from||e.to-g.to}function AM(e){let g=e;for(let I=0;I<g.length-1;I++){let C=g[I];if(C.from!=C.to)for(let t=I+1;t<g.length;t++){let i=g[t];if(i.from==C.from){i.to!=C.to&&(g==e&&(g=e.slice()),g[t]=i.copy(i.from,C.to),hF(g,t+1,i.copy(C.to,i.to)));continue}else{i.from<C.to&&(g==e&&(g=e.slice()),g[I]=C.copy(C.from,i.from),hF(g,t,C.copy(i.from,C.to)));break}}}return g}function hF(e,g,I){for(;g<e.length&&Od(I,e[g])>0;)g++;e.splice(g,0,I)}function nM(e){let g=[];return e.someProp("decorations",I=>{let C=I(e.state);C&&C!=ut&&g.push(C)}),e.cursorWrapper&&g.push(ke.create(e.state.doc,[e.cursorWrapper.deco])),vs.from(g)}const VPg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},NPg=ci&&ks<=11;class MPg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(g){this.anchorNode=g.anchorNode,this.anchorOffset=g.anchorOffset,this.focusNode=g.focusNode,this.focusOffset=g.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(g){return g.anchorNode==this.anchorNode&&g.anchorOffset==this.anchorOffset&&g.focusNode==this.focusNode&&g.focusOffset==this.focusOffset}}class fPg{constructor(g,I){this.view=g,this.handleDOMChange=I,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new MPg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(C=>{for(let t=0;t<C.length;t++)this.queue.push(C[t]);ci&&ks<=11&&C.some(t=>t.type=="childList"&&t.removedNodes.length||t.type=="characterData"&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),NPg&&(this.onCharData=C=>{this.queue.push({target:C.target,type:"characterData",oldValue:C.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,VPg)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let g=this.observer.takeRecords();if(g.length){for(let I=0;I<g.length;I++)this.queue.push(g[I]);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(x3(this.view)){if(this.suppressingSelectionUpdates)return $l(this.view);if(ci&&ks<=11&&!this.view.state.selection.empty){let g=this.view.domSelectionRange();if(g.focusNode&&Jd(g.focusNode,g.focusOffset,g.anchorNode,g.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(g){if(!g.focusNode)return!0;let I=new Set,C;for(let i=g.focusNode;i;i=pm(i))I.add(i);for(let i=g.anchorNode;i;i=pm(i))if(I.has(i)){C=i;break}let t=C&&this.view.docView.nearestDesc(C);if(t&&t.ignoreMutation({type:"selection",target:C.nodeType==3?C.parentNode:C}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let g of this.observer.takeRecords())this.queue.push(g);return this.queue}flush(){let{view:g}=this;if(!g.docView||this.flushingSoon>-1)return;let I=this.pendingRecords();I.length&&(this.queue=[]);let C=g.domSelectionRange(),t=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(C)&&x3(g)&&!this.ignoreSelectionChange(C),i=-1,A=-1,n=!1,l=[];if(g.editable)for(let a=0;a<I.length;a++){let d=this.registerMutation(I[a],l);d&&(i=i<0?d.from:Math.min(d.from,i),A=A<0?d.to:Math.max(d.to,A),d.typeOver&&(n=!0))}if(GA&&l.length){let a=l.filter(d=>d.nodeName=="BR");if(a.length==2){let[d,m]=a;d.parentNode&&d.parentNode.parentNode==m.parentNode?m.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let m of a){let u=m.parentNode;u&&u.nodeName=="LI"&&(!d||HPg(g,d)!=u)&&m.remove()}}}let s=null;i<0&&t&&g.input.lastFocus>Date.now()-200&&Math.max(g.input.lastTouch,g.input.lastClick.time)<Date.now()-300&&kp(C)&&(s=QN(g))&&s.eq(uI.near(g.state.doc.resolve(0),1))?(g.input.lastFocus=0,$l(g),this.currentSelection.set(C),g.scrollToSelection()):(i>-1||t)&&(i>-1&&(g.docView.markDirty(i,A),RPg(g)),this.handleDOMChange(i,A,n,l),g.docView&&g.docView.dirty?g.updateState(g.state):this.currentSelection.eq(C)||$l(g),this.currentSelection.set(C))}registerMutation(g,I){if(I.indexOf(g.target)>-1)return null;let C=this.view.docView.nearestDesc(g.target);if(g.type=="attributes"&&(C==this.view.docView||g.attributeName=="contenteditable"||g.attributeName=="style"&&!g.oldValue&&!g.target.getAttribute("style"))||!C||C.ignoreMutation(g))return null;if(g.type=="childList"){for(let a=0;a<g.addedNodes.length;a++){let d=g.addedNodes[a];I.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(C.contentDOM&&C.contentDOM!=C.dom&&!C.contentDOM.contains(g.target))return{from:C.posBefore,to:C.posAfter};let t=g.previousSibling,i=g.nextSibling;if(ci&&ks<=11&&g.addedNodes.length)for(let a=0;a<g.addedNodes.length;a++){let{previousSibling:d,nextSibling:m}=g.addedNodes[a];(!d||Array.prototype.indexOf.call(g.addedNodes,d)<0)&&(t=d),(!m||Array.prototype.indexOf.call(g.addedNodes,m)<0)&&(i=m)}let A=t&&t.parentNode==g.target?PC(t)+1:0,n=C.localPosFromDOM(g.target,A,-1),l=i&&i.parentNode==g.target?PC(i):g.target.childNodes.length,s=C.localPosFromDOM(g.target,l,1);return{from:n,to:s}}else return g.type=="attributes"?{from:C.posAtStart-C.border,to:C.posAtEnd+C.border}:(this.lastChangedTextNode=g.target,{from:C.posAtStart,to:C.posAtEnd,typeOver:g.target.nodeValue==g.oldValue})}}let bF=new WeakMap,ZF=!1;function RPg(e){if(!bF.has(e)&&(bF.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=GA,ZF)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."),ZF=!0}}function GF(e,g){let I=g.startContainer,C=g.startOffset,t=g.endContainer,i=g.endOffset,A=e.domAtPos(e.state.selection.anchor);return Jd(A.node,A.offset,t,i)&&([I,C,t,i]=[t,i,I,C]),{anchorNode:I,anchorOffset:C,focusNode:t,focusOffset:i}}function XPg(e,g){if(g.getComposedRanges){let t=g.getComposedRanges(e.root)[0];if(t)return GF(e,t)}let I;function C(t){t.preventDefault(),t.stopImmediatePropagation(),I=t.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",C,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",C,!0),I?GF(e,I):null}function HPg(e,g){for(let I=g.parentNode;I&&I!=e.dom;I=I.parentNode){let C=e.docView.nearestDesc(I,!0);if(C&&C.node.isBlock)return I}return null}function DPg(e,g,I){let{node:C,fromOffset:t,toOffset:i,from:A,to:n}=e.docView.parseRange(g,I),l=e.domSelectionRange(),s,a=l.anchorNode;if(a&&e.dom.contains(a.nodeType==1?a:a.parentNode)&&(s=[{node:a,offset:l.anchorOffset}],kp(l)||s.push({node:l.focusNode,offset:l.focusOffset})),mt&&e.input.lastKeyCode===8)for(let G=i;G>t;G--){let w=C.childNodes[G-1],p=w.pmViewDesc;if(w.nodeName=="BR"&&!p){i=G;break}if(!p||p.size)break}let d=e.state.doc,m=e.someProp("domParser")||Hs.fromSchema(e.state.schema),u=d.resolve(A),h=null,Z=m.parse(C,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:t,to:i,preserveWhitespace:u.parent.type.whitespace=="pre"?"full":!0,findPositions:s,ruleFromNode:SPg,context:u});if(s&&s[0].pos!=null){let G=s[0].pos,w=s[1]&&s[1].pos;w==null&&(w=G),h={anchor:G+A,head:w+A}}return{doc:Z,sel:h,from:A,to:n}}function SPg(e){let g=e.pmViewDesc;if(g)return g.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Lt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let I=document.createElement("div");return I.appendChild(document.createElement("li")),{skip:I}}else if(e.parentNode.lastChild==e||Lt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const KPg=/^(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 kPg(e,g,I,C,t){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,g<0){let M=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,K=QN(e,M);if(K&&!e.state.selection.eq(K)){if(mt&&Pl&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",X=>X(e,Ld(13,"Enter"))))return;let F=e.state.tr.setSelection(K);M=="pointer"?F.setMeta("pointer",!0):M=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),e.dispatch(F)}return}let A=e.state.doc.resolve(g),n=A.sharedDepth(I);g=A.before(n+1),I=e.state.doc.resolve(I).after(n+1);let l=e.state.selection,s=DPg(e,g,I),a=e.state.doc,d=a.slice(s.from,s.to),m,u;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(m=e.state.selection.to,u="end"):(m=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let h=JPg(d.content,s.doc.content,s.from,m,u);if(h&&e.input.domChangeCount++,(Bm&&e.input.lastIOSEnter>Date.now()-225||Pl)&&t.some(M=>M.nodeType==1&&!KPg.test(M.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",M=>M(e,Ld(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(C&&l instanceof hI&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(s.sel){let M=wF(e,e.state.doc,s.sel);if(M&&!M.eq(e.state.selection)){let K=e.state.tr.setSelection(M);i&&K.setMeta("composition",i),e.dispatch(K)}}return}e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof hI&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),ci&&ks<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>s.from&&s.doc.textBetween(h.start-s.from-1,h.start-s.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let Z=s.doc.resolveNoCache(h.start-s.from),G=s.doc.resolveNoCache(h.endB-s.from),w=a.resolve(h.start),p=Z.sameParent(G)&&Z.parent.inlineContent&&w.end()>=h.endA;if((Bm&&e.input.lastIOSEnter>Date.now()-225&&(!p||t.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!p&&Z.pos<s.doc.content.size&&(!Z.sameParent(G)||!Z.parent.inlineContent)&&Z.pos<G.pos&&!/\S/.test(s.doc.textBetween(Z.pos,G.pos,"","")))&&e.someProp("handleKeyDown",M=>M(e,Ld(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&zPg(a,h.start,h.endA,Z,G)&&e.someProp("handleKeyDown",M=>M(e,Ld(8,"Backspace")))){Pl&&mt&&e.domObserver.suppressSelectionUpdates();return}mt&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Pl&&!p&&Z.start()!=G.start()&&G.parentOffset==0&&Z.depth==G.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==h.endA&&(h.endB-=2,G=s.doc.resolveNoCache(h.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(M){return M(e,Ld(13,"Enter"))})},20));let B=h.start,y=h.endA,Y=M=>{let K=M||e.state.tr.replace(B,y,s.doc.slice(h.start-s.from,h.endB-s.from));if(s.sel){let F=wF(e,K.doc,s.sel);F&&!(mt&&e.composing&&F.empty&&(h.start!=h.endB||e.input.lastChromeDelete<Date.now()-100)&&(F.head==B||F.head==K.mapping.map(y)-1)||ci&&F.empty&&F.head==B)&&K.setSelection(F)}return i&&K.setMeta("composition",i),K.scrollIntoView()},f;if(p){if(Z.pos==G.pos){ci&&ks<=11&&Z.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>$l(e),20));let M=Y(e.state.tr.delete(B,y)),K=a.resolve(h.start).marksAcross(a.resolve(h.endA));K&&M.ensureMarks(K),e.dispatch(M)}else if(h.endA==h.endB&&(f=FPg(Z.parent.content.cut(Z.parentOffset,G.parentOffset),w.parent.content.cut(w.parentOffset,h.endA-w.start())))){let M=Y(e.state.tr);f.type=="add"?M.addMark(B,y,f.mark):M.removeMark(B,y,f.mark),e.dispatch(M)}else if(Z.parent.child(Z.index()).isText&&Z.index()==G.index()-(G.textOffset?0:1)){let M=Z.parent.textBetween(Z.parentOffset,G.parentOffset),K=()=>Y(e.state.tr.insertText(M,B,y));e.someProp("handleTextInput",F=>F(e,B,y,M,K))||e.dispatch(K())}}else e.dispatch(Y())}function wF(e,g,I){return Math.max(I.anchor,I.head)>g.content.size?null:EN(e,g.resolve(I.anchor),g.resolve(I.head))}function FPg(e,g){let I=e.firstChild.marks,C=g.firstChild.marks,t=I,i=C,A,n,l;for(let a=0;a<C.length;a++)t=C[a].removeFromSet(t);for(let a=0;a<I.length;a++)i=I[a].removeFromSet(i);if(t.length==1&&i.length==0)n=t[0],A="add",l=a=>a.mark(n.addToSet(a.marks));else if(t.length==0&&i.length==1)n=i[0],A="remove",l=a=>a.mark(n.removeFromSet(a.marks));else return null;let s=[];for(let a=0;a<g.childCount;a++)s.push(l(g.child(a)));if(Bg.from(s).eq(e))return{mark:n,type:A}}function zPg(e,g,I,C,t){if(I-g<=t.pos-C.pos||lM(C,!0,!1)<t.pos)return!1;let i=e.resolve(g);if(!C.parent.isTextblock){let n=i.nodeAfter;return n!=null&&I==g+n.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let A=e.resolve(lM(i,!0,!0));return!A.parent.isTextblock||A.pos>I||lM(A,!0,!1)<I?!1:C.parent.content.cut(C.parentOffset).eq(A.parent.content)}function lM(e,g,I){let C=e.depth,t=g?e.end():e.pos;for(;C>0&&(g||e.indexAfter(C)==e.node(C).childCount);)C--,t++,g=!1;if(I){let i=e.node(C).maybeChild(e.indexAfter(C));for(;i&&!i.isLeaf;)i=i.firstChild,t++}return t}function JPg(e,g,I,C,t){let i=e.findDiffStart(g,I);if(i==null)return null;let{a:A,b:n}=e.findDiffEnd(g,I+e.size,I+g.size);if(t=="end"){let l=Math.max(0,i-Math.min(A,n));C-=A+l-i}if(A<i&&e.size<g.size){let l=C<=i&&C>=A?i-C:0;i-=l,i&&i<g.size&&WF(g.textBetween(i-1,i+1))&&(i+=l?1:-1),n=i+(n-A),A=i}else if(n<i){let l=C<=i&&C>=n?i-C:0;i-=l,i&&i<e.size&&WF(e.textBetween(i-1,i+1))&&(i+=l?1:-1),A=i+(A-n),n=i}return{start:i,endA:A,endB:n}}function WF(e){if(e.length!=2)return!1;let g=e.charCodeAt(0),I=e.charCodeAt(1);return g>=56320&&g<=57343&&I>=55296&&I<=56319}class pF{constructor(g,I){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 iPg,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=I,this.state=I.state,this.directPlugins=I.plugins||[],this.directPlugins.forEach(NF),this.dispatch=this.dispatch.bind(this),this.dom=g&&g.mount||document.createElement("div"),g&&(g.appendChild?g.appendChild(this.dom):typeof g=="function"?g(this.dom):g.mount&&(this.mounted=!0)),this.editable=YF(this),yF(this),this.nodeViews=VF(this),this.docView=H3(this.state.doc,BF(this),nM(this),this.dom,this),this.domObserver=new fPg(this,(C,t,i,A)=>kPg(this,C,t,i,A)),this.domObserver.start(),APg(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let g=this._props;this._props={};for(let I in g)this._props[I]=g[I];this._props.state=this.state}return this._props}update(g){g.handleDOMEvents!=this._props.handleDOMEvents&&IM(this);let I=this._props;this._props=g,g.plugins&&(g.plugins.forEach(NF),this.directPlugins=g.plugins),this.updateStateInner(g.state,I)}setProps(g){let I={};for(let C in this._props)I[C]=this._props[C];I.state=this.state;for(let C in g)I[C]=g[C];this.update(I)}updateState(g){this.updateStateInner(g,this._props)}updateStateInner(g,I){var C;let t=this.state,i=!1,A=!1;g.storedMarks&&this.composing&&(sF(this),A=!0),this.state=g;let n=t.plugins!=g.plugins||this._props.plugins!=I.plugins;if(n||this._props.plugins!=I.plugins||this._props.nodeViews!=I.nodeViews){let u=VF(this);TPg(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(n||I.handleDOMEvents!=this._props.handleDOMEvents)&&IM(this),this.editable=YF(this),yF(this);let l=nM(this),s=BF(this),a=t.plugins!=g.plugins&&!t.doc.eq(g.doc)?"reset":g.scrollToSelection>t.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(g.doc,s,l);(d||!g.selection.eq(t.selection))&&(A=!0);let m=a=="preserve"&&A&&this.dom.style.overflowAnchor==null&&GEg(this);if(A){this.domObserver.stop();let u=d&&(ci||mt)&&!this.composing&&!t.selection.empty&&!g.selection.empty&&LPg(t.selection,g.selection);if(d){let h=mt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ZPg(this)),(i||!this.docView.update(g.doc,s,l,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=H3(g.doc,s,l,this.dom,this)),h&&!this.trackWrites&&(u=!0)}u||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&jEg(this))?$l(this,u):(v3(this,g.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(t),!((C=this.dragging)===null||C===void 0)&&C.node&&!t.doc.eq(g.doc)&&this.updateDraggedNode(this.dragging,t),a=="reset"?this.dom.scrollTop=0:a=="to selection"?this.scrollToSelection():m&&wEg(m)}scrollToSelection(){let g=this.domSelectionRange().focusNode;if(!(!g||!this.dom.contains(g.nodeType==1?g:g.parentNode))){if(!this.someProp("handleScrollToSelection",I=>I(this)))if(this.state.selection instanceof eI){let I=this.docView.domAfterPos(this.state.selection.from);I.nodeType==1&&G3(this,I.getBoundingClientRect(),g)}else G3(this,this.coordsAtPos(this.state.selection.head,1),g)}}destroyPluginViews(){let g;for(;g=this.pluginViews.pop();)g.destroy&&g.destroy()}updatePluginViews(g){if(!g||g.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let I=0;I<this.directPlugins.length;I++){let C=this.directPlugins[I];C.spec.view&&this.pluginViews.push(C.spec.view(this))}for(let I=0;I<this.state.plugins.length;I++){let C=this.state.plugins[I];C.spec.view&&this.pluginViews.push(C.spec.view(this))}}else for(let I=0;I<this.pluginViews.length;I++){let C=this.pluginViews[I];C.update&&C.update(this,g)}}updateDraggedNode(g,I){let C=g.node,t=-1;if(this.state.doc.nodeAt(C.from)==C.node)t=C.from;else{let i=C.from+(this.state.doc.content.size-I.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==C.node&&(t=i)}this.dragging=new dF(g.slice,g.move,t<0?void 0:eI.create(this.state.doc,t))}someProp(g,I){let C=this._props&&this._props[g],t;if(C!=null&&(t=I?I(C):C))return t;for(let A=0;A<this.directPlugins.length;A++){let n=this.directPlugins[A].props[g];if(n!=null&&(t=I?I(n):n))return t}let i=this.state.plugins;if(i)for(let A=0;A<i.length;A++){let n=i[A].props[g];if(n!=null&&(t=I?I(n):n))return t}}hasFocus(){if(ci){let g=this.root.activeElement;if(g==this.dom)return!0;if(!g||!this.dom.contains(g))return!1;for(;g&&this.dom!=g&&this.dom.contains(g);){if(g.contentEditable=="false")return!1;g=g.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&WEg(this.dom),$l(this),this.domObserver.start()}get root(){let g=this._root;if(g==null){for(let I=this.dom.parentNode;I;I=I.parentNode)if(I.nodeType==9||I.nodeType==11&&I.host)return I.getSelection||(Object.getPrototypeOf(I).getSelection=()=>I.ownerDocument.getSelection()),this._root=I}return g||document}updateRoot(){this._root=null}posAtCoords(g){return VEg(this,g)}coordsAtPos(g,I=1){return Y3(this,g,I)}domAtPos(g,I=0){return this.docView.domFromPos(g,I)}nodeDOM(g){let I=this.docView.descAt(g);return I?I.nodeDOM:null}posAtDOM(g,I,C=-1){let t=this.docView.posFromDOM(g,I,C);if(t==null)throw new RangeError("DOM position not inside the editor");return t}endOfTextblock(g,I){return XEg(this,I||this.state,g)}pasteHTML(g,I){return cb(this,"",g,!1,I||new ClipboardEvent("paste"))}pasteText(g,I){return cb(this,g,null,!0,I||new ClipboardEvent("paste"))}serializeForClipboard(g){return $N(this,g)}destroy(){this.docView&&(nPg(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],nM(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,oEg())}get isDestroyed(){return this.docView==null}dispatchEvent(g){return oPg(this,g)}domSelectionRange(){let g=this.domSelection();return g?Lt&&this.root.nodeType===11&&rEg(this.dom.ownerDocument)==this.dom&&XPg(this,g)||g:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}pF.prototype.dispatch=function(e){let g=this._props.dispatchTransaction;g?g.call(this,e):this.updateState(this.state.apply(e))};function BF(e){let g=Object.create(null);return g.class="ProseMirror",g.contenteditable=String(e.editable),e.someProp("attributes",I=>{if(typeof I=="function"&&(I=I(e.state)),I)for(let C in I)C=="class"?g.class+=" "+I[C]:C=="style"?g.style=(g.style?g.style+";":"")+I[C]:!g[C]&&C!="contenteditable"&&C!="nodeName"&&(g[C]=String(I[C]))}),g.translate||(g.translate="no"),[jt.node(0,e.state.doc.content.size,g)]}function yF(e){if(e.markCursor){let g=document.createElement("img");g.className="ProseMirror-separator",g.setAttribute("mark-placeholder","true"),g.setAttribute("alt",""),e.cursorWrapper={dom:g,deco:jt.widget(e.state.selection.from,g,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function YF(e){return!e.someProp("editable",g=>g(e.state)===!1)}function LPg(e,g){let I=Math.min(e.$anchor.sharedDepth(e.head),g.$anchor.sharedDepth(g.head));return e.$anchor.start(I)!=g.$anchor.start(I)}function VF(e){let g=Object.create(null);function I(C){for(let t in C)Object.prototype.hasOwnProperty.call(g,t)||(g[t]=C[t])}return e.someProp("nodeViews",I),e.someProp("markViews",I),g}function TPg(e,g){let I=0,C=0;for(let t in e){if(e[t]!=g[t])return!0;I++}for(let t in g)C++;return I!=C}function NF(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var js={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:"'"},xp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vPg=typeof navigator<"u"&&/Mac/.test(navigator.platform),jPg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_C=0;_C<10;_C++)js[48+_C]=js[96+_C]=String(_C);for(var _C=1;_C<=24;_C++)js[_C+111]="F"+_C;for(var _C=65;_C<=90;_C++)js[_C]=String.fromCharCode(_C+32),xp[_C]=String.fromCharCode(_C);for(var oM in js)xp.hasOwnProperty(oM)||(xp[oM]=js[oM]);function xPg(e){var g=vPg&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jPg&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",I=!g&&e.key||(e.shiftKey?xp:js)[e.keyCode]||e.key||"Unidentified";return I=="Esc"&&(I="Escape"),I=="Del"&&(I="Delete"),I=="Left"&&(I="ArrowLeft"),I=="Up"&&(I="ArrowUp"),I=="Right"&&(I="ArrowRight"),I=="Down"&&(I="ArrowDown"),I}const OPg=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),QPg=typeof navigator<"u"&&/Win/.test(navigator.platform);function UPg(e){let g=e.split(/-(?!$)/),I=g[g.length-1];I=="Space"&&(I=" ");let C,t,i,A;for(let n=0;n<g.length-1;n++){let l=g[n];if(/^(cmd|meta|m)$/i.test(l))A=!0;else if(/^a(lt)?$/i.test(l))C=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))OPg?A=!0:t=!0;else throw new Error("Unrecognized modifier name: "+l)}return C&&(I="Alt-"+I),t&&(I="Ctrl-"+I),A&&(I="Meta-"+I),i&&(I="Shift-"+I),I}function EPg(e){let g=Object.create(null);for(let I in e)g[UPg(I)]=e[I];return g}function sM(e,g,I=!0){return g.altKey&&(e="Alt-"+e),g.ctrlKey&&(e="Ctrl-"+e),g.metaKey&&(e="Meta-"+e),I&&g.shiftKey&&(e="Shift-"+e),e}function PPg(e){return new je({props:{handleKeyDown:MF(e)}})}function MF(e){let g=EPg(e);return function(I,C){let t=xPg(C),i,A=g[sM(t,C)];if(A&&A(I.state,I.dispatch,I))return!0;if(t.length==1&&t!=" "){if(C.shiftKey){let n=g[sM(t,C,!1)];if(n&&n(I.state,I.dispatch,I))return!0}if((C.altKey||C.metaKey||C.ctrlKey)&&!(QPg&&C.ctrlKey&&C.altKey)&&(i=js[C.keyCode])&&i!=t){let n=g[sM(i,C)];if(n&&n(I.state,I.dispatch,I))return!0}}return!1}}const _Pg=(e,g)=>e.selection.empty?!1:(g&&g(e.tr.deleteSelection().scrollIntoView()),!0);function fF(e,g){let{$cursor:I}=e.selection;return!I||(g?!g.endOfTextblock("backward",e):I.parentOffset>0)?null:I}const $Pg=(e,g,I)=>{let C=fF(e,I);if(!C)return!1;let t=aM(C);if(!t){let A=C.blockRange(),n=A&&bm(A);return n==null?!1:(g&&g(e.tr.lift(A,n).scrollIntoView()),!0)}let i=t.nodeBefore;if(DF(e,t,g,-1))return!0;if(C.parent.content.size==0&&(Mm(i,"end")||eI.isSelectable(i)))for(let A=C.depth;;A--){let n=Sp(e.doc,C.before(A),C.after(A),zg.empty);if(n&&n.slice.size<n.to-n.from){if(g){let l=e.tr.step(n);l.setSelection(Mm(i,"end")?uI.findFrom(l.doc.resolve(l.mapping.map(t.pos,-1)),-1):eI.create(l.doc,t.pos-i.nodeSize)),g(l.scrollIntoView())}return!0}if(A==1||C.node(A-1).childCount>1)break}return i.isAtom&&t.depth==C.depth-1?(g&&g(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!1},qPg=(e,g,I)=>{let C=fF(e,I);if(!C)return!1;let t=aM(C);return t?RF(e,t,g):!1},g6g=(e,g,I)=>{let C=XF(e,I);if(!C)return!1;let t=dM(C);return t?RF(e,t,g):!1};function RF(e,g,I){let C=g.nodeBefore,t=C,i=g.pos-1;for(;!t.isTextblock;i--){if(t.type.spec.isolating)return!1;let a=t.lastChild;if(!a)return!1;t=a}let A=g.nodeAfter,n=A,l=g.pos+1;for(;!n.isTextblock;l++){if(n.type.spec.isolating)return!1;let a=n.firstChild;if(!a)return!1;n=a}let s=Sp(e.doc,i,l,zg.empty);if(!s||s.from!=i||s instanceof dn&&s.slice.size>=l-i)return!1;if(I){let a=e.tr.step(s);a.setSelection(hI.create(a.doc,i)),I(a.scrollIntoView())}return!0}function Mm(e,g,I=!1){for(let C=e;C;C=g=="start"?C.firstChild:C.lastChild){if(C.isTextblock)return!0;if(I&&C.childCount!=1)return!1}return!1}const I6g=(e,g,I)=>{let{$head:C,empty:t}=e.selection,i=C;if(!t)return!1;if(C.parent.isTextblock){if(I?!I.endOfTextblock("backward",e):C.parentOffset>0)return!1;i=aM(C)}let A=i&&i.nodeBefore;return!A||!eI.isSelectable(A)?!1:(g&&g(e.tr.setSelection(eI.create(e.doc,i.pos-A.nodeSize)).scrollIntoView()),!0)};function aM(e){if(!e.parent.type.spec.isolating)for(let g=e.depth-1;g>=0;g--){if(e.index(g)>0)return e.doc.resolve(e.before(g+1));if(e.node(g).type.spec.isolating)break}return null}function XF(e,g){let{$cursor:I}=e.selection;return!I||(g?!g.endOfTextblock("forward",e):I.parentOffset<I.parent.content.size)?null:I}const e6g=(e,g,I)=>{let C=XF(e,I);if(!C)return!1;let t=dM(C);if(!t)return!1;let i=t.nodeAfter;if(DF(e,t,g,1))return!0;if(C.parent.content.size==0&&(Mm(i,"start")||eI.isSelectable(i))){let A=Sp(e.doc,C.before(),C.after(),zg.empty);if(A&&A.slice.size<A.to-A.from){if(g){let n=e.tr.step(A);n.setSelection(Mm(i,"start")?uI.findFrom(n.doc.resolve(n.mapping.map(t.pos)),1):eI.create(n.doc,n.mapping.map(t.pos))),g(n.scrollIntoView())}return!0}}return i.isAtom&&t.depth==C.depth-1?(g&&g(e.tr.delete(t.pos,t.pos+i.nodeSize).scrollIntoView()),!0):!1},C6g=(e,g,I)=>{let{$head:C,empty:t}=e.selection,i=C;if(!t)return!1;if(C.parent.isTextblock){if(I?!I.endOfTextblock("forward",e):C.parentOffset<C.parent.content.size)return!1;i=dM(C)}let A=i&&i.nodeAfter;return!A||!eI.isSelectable(A)?!1:(g&&g(e.tr.setSelection(eI.create(e.doc,i.pos)).scrollIntoView()),!0)};function dM(e){if(!e.parent.type.spec.isolating)for(let g=e.depth-1;g>=0;g--){let I=e.node(g);if(e.index(g)+1<I.childCount)return e.doc.resolve(e.after(g+1));if(I.type.spec.isolating)break}return null}const t6g=(e,g)=>{let I=e.selection,C=I instanceof eI,t;if(C){if(I.node.isTextblock||!Ds(e.doc,I.from))return!1;t=I.from}else if(t=Dp(e.doc,I.from,-1),t==null)return!1;if(g){let i=e.tr.join(t);C&&i.setSelection(eI.create(i.doc,t-e.doc.resolve(t).nodeBefore.nodeSize)),g(i.scrollIntoView())}return!0},i6g=(e,g)=>{let I=e.selection,C;if(I instanceof eI){if(I.node.isTextblock||!Ds(e.doc,I.to))return!1;C=I.to}else if(C=Dp(e.doc,I.to,1),C==null)return!1;return g&&g(e.tr.join(C).scrollIntoView()),!0},A6g=(e,g)=>{let{$from:I,$to:C}=e.selection,t=I.blockRange(C),i=t&&bm(t);return i==null?!1:(g&&g(e.tr.lift(t,i).scrollIntoView()),!0)},n6g=(e,g)=>{let{$head:I,$anchor:C}=e.selection;return!I.parent.type.spec.code||!I.sameParent(C)?!1:(g&&g(e.tr.insertText(`
1464
1466
  `).scrollIntoView()),!0)};function HF(e){for(let g=0;g<e.edgeCount;g++){let{type:I}=e.edge(g);if(I.isTextblock&&!I.hasRequiredAttrs())return I}return null}const l6g=(e,g)=>{let{$head:I,$anchor:C}=e.selection;if(!I.parent.type.spec.code||!I.sameParent(C))return!1;let t=I.node(-1),i=I.indexAfter(-1),A=HF(t.contentMatchAt(i));if(!A||!t.canReplaceWith(i,i,A))return!1;if(g){let n=I.after(),l=e.tr.replaceWith(n,n,A.createAndFill());l.setSelection(uI.near(l.doc.resolve(n),1)),g(l.scrollIntoView())}return!0},o6g=(e,g)=>{let I=e.selection,{$from:C,$to:t}=I;if(I instanceof Ss||C.parent.inlineContent||t.parent.inlineContent)return!1;let i=HF(t.parent.contentMatchAt(t.indexAfter()));if(!i||!i.isTextblock)return!1;if(g){let A=(!C.parentOffset&&t.index()<t.parent.childCount?C:t).pos,n=e.tr.insert(A,i.createAndFill());n.setSelection(hI.create(n.doc,A+1)),g(n.scrollIntoView())}return!0},s6g=(e,g)=>{let{$cursor:I}=e.selection;if(!I||I.parent.content.size)return!1;if(I.depth>1&&I.after()!=I.end(-1)){let i=I.before();if(Zm(e.doc,i))return g&&g(e.tr.split(i).scrollIntoView()),!0}let C=I.blockRange(),t=C&&bm(C);return t==null?!1:(g&&g(e.tr.lift(C,t).scrollIntoView()),!0)},a6g=(e,g)=>{let{$from:I,to:C}=e.selection,t,i=I.sharedDepth(C);return i==0?!1:(t=I.before(i),g&&g(e.tr.setSelection(eI.create(e.doc,t))),!0)};function d6g(e,g,I){let C=g.nodeBefore,t=g.nodeAfter,i=g.index();return!C||!t||!C.type.compatibleContent(t.type)?!1:!C.content.size&&g.parent.canReplace(i-1,i)?(I&&I(e.tr.delete(g.pos-C.nodeSize,g.pos).scrollIntoView()),!0):!g.parent.canReplace(i,i+1)||!(t.isTextblock||Ds(e.doc,g.pos))?!1:(I&&I(e.tr.join(g.pos).scrollIntoView()),!0)}function DF(e,g,I,C){let t=g.nodeBefore,i=g.nodeAfter,A,n,l=t.type.spec.isolating||i.type.spec.isolating;if(!l&&d6g(e,g,I))return!0;let s=!l&&g.parent.canReplace(g.index(),g.index()+1);if(s&&(A=(n=t.contentMatchAt(t.childCount)).findWrapping(i.type))&&n.matchType(A[0]||i.type).validEnd){if(I){let u=g.pos+i.nodeSize,h=Bg.empty;for(let w=A.length-1;w>=0;w--)h=Bg.from(A[w].create(null,h));h=Bg.from(t.copy(h));let Z=e.tr.step(new di(g.pos-1,u,g.pos,u,new zg(h,1,0),A.length,!0)),G=Z.doc.resolve(u+2*A.length);G.nodeAfter&&G.nodeAfter.type==t.type&&Ds(Z.doc,G.pos)&&Z.join(G.pos),I(Z.scrollIntoView())}return!0}let a=i.type.spec.isolating||C>0&&l?null:uI.findFrom(g,1),d=a&&a.$from.blockRange(a.$to),m=d&&bm(d);if(m!=null&&m>=g.depth)return I&&I(e.tr.lift(d,m).scrollIntoView()),!0;if(s&&Mm(i,"start",!0)&&Mm(t,"end")){let u=t,h=[];for(;h.push(u),!u.isTextblock;)u=u.lastChild;let Z=i,G=1;for(;!Z.isTextblock;Z=Z.firstChild)G++;if(u.canReplace(u.childCount,u.childCount,Z.content)){if(I){let w=Bg.empty;for(let B=h.length-1;B>=0;B--)w=Bg.from(h[B].copy(w));let p=e.tr.step(new di(g.pos-h.length,g.pos+i.nodeSize,g.pos+G,g.pos+i.nodeSize-G,new zg(w,h.length,0),0,!0));I(p.scrollIntoView())}return!0}}return!1}function SF(e){return function(g,I){let C=g.selection,t=e<0?C.$from:C.$to,i=t.depth;for(;t.node(i).isInline;){if(!i)return!1;i--}return t.node(i).isTextblock?(I&&I(g.tr.setSelection(hI.create(g.doc,e<0?t.start(i):t.end(i)))),!0):!1}}const c6g=SF(-1),r6g=SF(1);function m6g(e,g=null){return function(I,C){let{$from:t,$to:i}=I.selection,A=t.blockRange(i),n=A&&HN(A,e,g);return n?(C&&C(I.tr.wrap(A,n).scrollIntoView()),!0):!1}}function KF(e,g=null){return function(I,C){let t=!1;for(let i=0;i<I.selection.ranges.length&&!t;i++){let{$from:{pos:A},$to:{pos:n}}=I.selection.ranges[i];I.doc.nodesBetween(A,n,(l,s)=>{if(t)return!1;if(!(!l.isTextblock||l.hasMarkup(e,g)))if(l.type==e)t=!0;else{let a=I.doc.resolve(s),d=a.index();t=a.parent.canReplaceWith(d,d+1,e)}})}if(!t)return!1;if(C){let i=I.tr;for(let A=0;A<I.selection.ranges.length;A++){let{$from:{pos:n},$to:{pos:l}}=I.selection.ranges[A];i.setBlockType(n,l,e,g)}C(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function u6g(e,g=null){return function(I,C){let{$from:t,$to:i}=I.selection,A=t.blockRange(i);if(!A)return!1;let n=C?I.tr:null;return h6g(n,A,e,g)?(C&&C(n.scrollIntoView()),!0):!1}}function h6g(e,g,I,C=null){let t=!1,i=g,A=g.$from.doc;if(g.depth>=2&&g.$from.node(g.depth-1).type.compatibleContent(I)&&g.startIndex==0){if(g.$from.index(g.depth-1)==0)return!1;let l=A.resolve(g.start-2);i=new Vp(l,l,g.depth),g.endIndex<g.parent.childCount&&(g=new Vp(g.$from,A.resolve(g.$to.end(g.depth)),g.depth)),t=!0}let n=HN(i,I,C,g);return n?(e&&b6g(e,g,n,t,I),!0):!1}function b6g(e,g,I,C,t){let i=Bg.empty;for(let a=I.length-1;a>=0;a--)i=Bg.from(I[a].type.create(I[a].attrs,i));e.step(new di(g.start-(C?2:0),g.end,g.start,g.end,new zg(i,0,0),I.length,!0));let A=0;for(let a=0;a<I.length;a++)I[a].type==t&&(A=a+1);let n=I.length-A,l=g.start+I.length-(C?2:0),s=g.parent;for(let a=g.startIndex,d=g.endIndex,m=!0;a<d;a++,m=!1)!m&&Zm(e.doc,l,n)&&(e.split(l,n),l+=2*n),l+=s.child(a).nodeSize;return e}function Z6g(e){return function(g,I){let{$from:C,$to:t}=g.selection,i=C.blockRange(t,A=>A.childCount>0&&A.firstChild.type==e);return i?I?C.node(i.depth-1).type==e?G6g(g,I,e,i):w6g(g,I,i):!0:!1}}function G6g(e,g,I,C){let t=e.tr,i=C.end,A=C.$to.end(C.depth);i<A&&(t.step(new di(i-1,A,i,A,new zg(Bg.from(I.create(null,C.parent.copy())),1,0),1,!0)),C=new Vp(t.doc.resolve(C.$from.pos),t.doc.resolve(A),C.depth));const n=bm(C);if(n==null)return!1;t.lift(C,n);let l=t.doc.resolve(t.mapping.map(i,-1)-1);return Ds(t.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&t.join(l.pos),g(t.scrollIntoView()),!0}function w6g(e,g,I){let C=e.tr,t=I.parent;for(let u=I.end,h=I.endIndex-1,Z=I.startIndex;h>Z;h--)u-=t.child(h).nodeSize,C.delete(u-1,u+1);let i=C.doc.resolve(I.start),A=i.nodeAfter;if(C.mapping.map(I.end)!=I.start+i.nodeAfter.nodeSize)return!1;let n=I.startIndex==0,l=I.endIndex==t.childCount,s=i.node(-1),a=i.index(-1);if(!s.canReplace(a+(n?0:1),a+1,A.content.append(l?Bg.empty:Bg.from(t))))return!1;let d=i.pos,m=d+A.nodeSize;return C.step(new di(d-(n?1:0),m+(l?1:0),d+1,m-1,new zg((n?Bg.empty:Bg.from(t.copy(Bg.empty))).append(l?Bg.empty:Bg.from(t.copy(Bg.empty))),n?0:1,l?0:1),n?0:1)),g(C.scrollIntoView()),!0}function W6g(e){return function(g,I){let{$from:C,$to:t}=g.selection,i=C.blockRange(t,s=>s.childCount>0&&s.firstChild.type==e);if(!i)return!1;let A=i.startIndex;if(A==0)return!1;let n=i.parent,l=n.child(A-1);if(l.type!=e)return!1;if(I){let s=l.lastChild&&l.lastChild.type==n.type,a=Bg.from(s?e.create():null),d=new zg(Bg.from(e.create(null,Bg.from(n.type.create(null,a)))),s?3:1,0),m=i.start,u=i.end;I(g.tr.step(new di(m-(s?3:1),u,m,u,d,1,!0)).scrollIntoView())}return!0}}var p6g=Object.defineProperty,kF=(e,g)=>{for(var I in g)p6g(e,I,{get:g[I],enumerable:!0})};function Op(e){const{state:g,transaction:I}=e;let{selection:C}=I,{doc:t}=I,{storedMarks:i}=I;return{...g,apply:g.apply.bind(g),applyTransaction:g.applyTransaction.bind(g),plugins:g.plugins,schema:g.schema,reconfigure:g.reconfigure.bind(g),toJSON:g.toJSON.bind(g),get storedMarks(){return i},get selection(){return C},get doc(){return t},get tr(){return C=I.selection,t=I.doc,i=I.storedMarks,I}}}var Qp=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:g,state:I}=this,{view:C}=g,{tr:t}=I,i=this.buildProps(t);return Object.fromEntries(Object.entries(e).map(([A,n])=>[A,(...s)=>{const a=n(...s)(i);return!t.getMeta("preventDispatch")&&!this.hasCustomState&&C.dispatch(t),a}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,g=!0){const{rawCommands:I,editor:C,state:t}=this,{view:i}=C,A=[],n=!!e,l=e||t.tr,s=()=>(!n&&g&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),A.every(d=>d===!0)),a={...Object.fromEntries(Object.entries(I).map(([d,m])=>[d,(...h)=>{const Z=this.buildProps(l,g),G=m(...h)(Z);return A.push(G),a}])),run:s};return a}createCan(e){const{rawCommands:g,state:I}=this,C=!1,t=e||I.tr,i=this.buildProps(t,C);return{...Object.fromEntries(Object.entries(g).map(([n,l])=>[n,(...s)=>l(...s)({...i,dispatch:void 0})])),chain:()=>this.createChain(t,C)}}buildProps(e,g=!0){const{rawCommands:I,editor:C,state:t}=this,{view:i}=C,A={tr:e,editor:C,view:i,state:Op({state:t,transaction:e}),dispatch:g?()=>{}:void 0,chain:()=>this.createChain(e,g),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(I).map(([n,l])=>[n,(...s)=>l(...s)(A)]))}};return A}},B6g=class{constructor(){this.callbacks={}}on(e,g){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(g),this}emit(e,...g){const I=this.callbacks[e];return I&&I.forEach(C=>C.apply(this,g)),this}off(e,g){const I=this.callbacks[e];return I&&(g?this.callbacks[e]=I.filter(C=>C!==g):delete this.callbacks[e]),this}once(e,g){const I=(...C)=>{this.off(e,I),g.apply(this,C)};return this.on(e,I)}removeAllListeners(){this.callbacks={}}};function FF(e,g){const I=new A3(e);return g.forEach(C=>{C.steps.forEach(t=>{I.step(t)})}),I}var zF=e=>{const g=e.childNodes;for(let I=g.length-1;I>=0;I-=1){const C=g[I];C.nodeType===3&&C.nodeValue&&/^(\n\s\s|\n)$/.test(C.nodeValue)?e.removeChild(C):C.nodeType===1&&zF(C)}return e};function Up(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const g=`<body>${e}</body>`,I=new window.DOMParser().parseFromString(g,"text/html").body;return zF(I)}function mb(e,g,I){if(e instanceof Xs||e instanceof Bg)return e;I={slice:!0,parseOptions:{},...I};const C=typeof e=="object"&&e!==null,t=typeof e=="string";if(C)try{if(Array.isArray(e)&&e.length>0)return Bg.fromArray(e.map(n=>g.nodeFromJSON(n)));const A=g.nodeFromJSON(e);return I.errorOnInvalidContent&&A.check(),A}catch(i){if(I.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),mb("",g,I)}if(t){if(I.errorOnInvalidContent){let A=!1,n="";const l=new Hk({topNode:g.spec.topNode,marks:g.spec.marks,nodes:g.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:s=>(A=!0,n=typeof s=="string"?s:s.outerHTML,null)}]}})});if(I.slice?Hs.fromSchema(l).parseSlice(Up(e),I.parseOptions):Hs.fromSchema(l).parse(Up(e),I.parseOptions),I.errorOnInvalidContent&&A)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${n}`)})}const i=Hs.fromSchema(g);return I.slice?i.parseSlice(Up(e),I.parseOptions).content:i.parse(Up(e),I.parseOptions)}return mb("",g,I)}function cM(e,g,I={},C={}){return mb(e,g,{slice:!1,parseOptions:I,errorOnInvalidContent:C.errorOnInvalidContent})}function y6g(e){for(let g=0;g<e.edgeCount;g+=1){const{type:I}=e.edge(g);if(I.isTextblock&&!I.hasRequiredAttrs())return I}return null}function Y6g(e,g,I){const C=[];return e.nodesBetween(g.from,g.to,(t,i)=>{I(t)&&C.push({node:t,pos:i})}),C}function V6g(e,g){for(let I=e.depth;I>0;I-=1){const C=e.node(I);if(g(C))return{pos:I>0?e.before(I):0,start:e.start(I),depth:I,node:C}}}function Ep(e){return g=>V6g(g.$from,e)}function Pg(e,g,I){return e.config[g]===void 0&&e.parent?Pg(e.parent,g,I):typeof e.config[g]=="function"?e.config[g].bind({...I,parent:e.parent?Pg(e.parent,g,I):null}):e.config[g]}function rM(e){return e.map(g=>{const I={name:g.name,options:g.options,storage:g.storage},C=Pg(g,"addExtensions",I);return C?[g,...rM(C())]:g}).flat(10)}function mM(e,g){const I=Fd.fromSchema(g).serializeFragment(e),t=document.implementation.createHTMLDocument().createElement("div");return t.appendChild(I),t.innerHTML}function JF(e){return typeof e=="function"}function EI(e,g=void 0,...I){return JF(e)?g?e.bind(g)(...I):e(...I):e}function N6g(e={}){return Object.keys(e).length===0&&e.constructor===Object}function ub(e){const g=e.filter(t=>t.type==="extension"),I=e.filter(t=>t.type==="node"),C=e.filter(t=>t.type==="mark");return{baseExtensions:g,nodeExtensions:I,markExtensions:C}}function LF(e){const g=[],{nodeExtensions:I,markExtensions:C}=ub(e),t=[...I,...C],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(A=>{const n={name:A.name,options:A.options,storage:A.storage,extensions:t},l=Pg(A,"addGlobalAttributes",n);if(!l)return;l().forEach(a=>{a.types.forEach(d=>{Object.entries(a.attributes).forEach(([m,u])=>{g.push({type:d,name:m,attribute:{...i,...u}})})})})}),t.forEach(A=>{const n={name:A.name,options:A.options,storage:A.storage},l=Pg(A,"addAttributes",n);if(!l)return;const s=l();Object.entries(s).forEach(([a,d])=>{const m={...i,...d};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,g.push({type:A.name,name:a,attribute:m})})}),g}function qe(...e){return e.filter(g=>!!g).reduce((g,I)=>{const C={...g};return Object.entries(I).forEach(([t,i])=>{if(!C[t]){C[t]=i;return}if(t==="class"){const n=i?String(i).split(" "):[],l=C[t]?C[t].split(" "):[],s=n.filter(a=>!l.includes(a));C[t]=[...l,...s].join(" ")}else if(t==="style"){const n=i?i.split(";").map(a=>a.trim()).filter(Boolean):[],l=C[t]?C[t].split(";").map(a=>a.trim()).filter(Boolean):[],s=new Map;l.forEach(a=>{const[d,m]=a.split(":").map(u=>u.trim());s.set(d,m)}),n.forEach(a=>{const[d,m]=a.split(":").map(u=>u.trim());s.set(d,m)}),C[t]=Array.from(s.entries()).map(([a,d])=>`${a}: ${d}`).join("; ")}else C[t]=i}),C},{})}function Pp(e,g){return g.filter(I=>I.type===e.type.name).filter(I=>I.attribute.rendered).map(I=>I.attribute.renderHTML?I.attribute.renderHTML(e.attrs)||{}:{[I.name]:e.attrs[I.name]}).reduce((I,C)=>qe(I,C),{})}function M6g(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function TF(e,g){return"style"in e?e:{...e,getAttrs:I=>{const C=e.getAttrs?e.getAttrs(I):e.attrs;if(C===!1)return!1;const t=g.reduce((i,A)=>{const n=A.attribute.parseHTML?A.attribute.parseHTML(I):M6g(I.getAttribute(A.name));return n==null?i:{...i,[A.name]:n}},{});return{...C,...t}}}}function vF(e){return Object.fromEntries(Object.entries(e).filter(([g,I])=>g==="attrs"&&N6g(I)?!1:I!=null))}function f6g(e,g){var I;const C=LF(e),{nodeExtensions:t,markExtensions:i}=ub(e),A=(I=t.find(s=>Pg(s,"topNode")))==null?void 0:I.name,n=Object.fromEntries(t.map(s=>{const a=C.filter(w=>w.type===s.name),d={name:s.name,options:s.options,storage:s.storage,editor:g},m=e.reduce((w,p)=>{const B=Pg(p,"extendNodeSchema",d);return{...w,...B?B(s):{}}},{}),u=vF({...m,content:EI(Pg(s,"content",d)),marks:EI(Pg(s,"marks",d)),group:EI(Pg(s,"group",d)),inline:EI(Pg(s,"inline",d)),atom:EI(Pg(s,"atom",d)),selectable:EI(Pg(s,"selectable",d)),draggable:EI(Pg(s,"draggable",d)),code:EI(Pg(s,"code",d)),whitespace:EI(Pg(s,"whitespace",d)),linebreakReplacement:EI(Pg(s,"linebreakReplacement",d)),defining:EI(Pg(s,"defining",d)),isolating:EI(Pg(s,"isolating",d)),attrs:Object.fromEntries(a.map(w=>{var p,B;return[w.name,{default:(p=w==null?void 0:w.attribute)==null?void 0:p.default,validate:(B=w==null?void 0:w.attribute)==null?void 0:B.validate}]}))}),h=EI(Pg(s,"parseHTML",d));h&&(u.parseDOM=h.map(w=>TF(w,a)));const Z=Pg(s,"renderHTML",d);Z&&(u.toDOM=w=>Z({node:w,HTMLAttributes:Pp(w,a)}));const G=Pg(s,"renderText",d);return G&&(u.toText=G),[s.name,u]})),l=Object.fromEntries(i.map(s=>{const a=C.filter(G=>G.type===s.name),d={name:s.name,options:s.options,storage:s.storage,editor:g},m=e.reduce((G,w)=>{const p=Pg(w,"extendMarkSchema",d);return{...G,...p?p(s):{}}},{}),u=vF({...m,inclusive:EI(Pg(s,"inclusive",d)),excludes:EI(Pg(s,"excludes",d)),group:EI(Pg(s,"group",d)),spanning:EI(Pg(s,"spanning",d)),code:EI(Pg(s,"code",d)),attrs:Object.fromEntries(a.map(G=>{var w,p;return[G.name,{default:(w=G==null?void 0:G.attribute)==null?void 0:w.default,validate:(p=G==null?void 0:G.attribute)==null?void 0:p.validate}]}))}),h=EI(Pg(s,"parseHTML",d));h&&(u.parseDOM=h.map(G=>TF(G,a)));const Z=Pg(s,"renderHTML",d);return Z&&(u.toDOM=G=>Z({mark:G,HTMLAttributes:Pp(G,a)})),[s.name,u]}));return new Hk({topNode:A,nodes:n,marks:l})}function R6g(e){const g=e.filter((I,C)=>e.indexOf(I)!==C);return Array.from(new Set(g))}function uM(e){return e.sort((I,C)=>{const t=Pg(I,"priority")||100,i=Pg(C,"priority")||100;return t>i?-1:t<i?1:0})}function jF(e){const g=uM(rM(e)),I=R6g(g.map(C=>C.name));return I.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${I.map(C=>`'${C}'`).join(", ")}]. This can lead to issues.`),g}function xF(e,g,I){const{from:C,to:t}=g,{blockSeparator:i=`
1465
1467
 
1466
1468
  `,textSerializers:A={}}=I||{};let n="";return e.nodesBetween(C,t,(l,s,a,d)=>{var m;l.isBlock&&s>C&&(n+=i);const u=A==null?void 0:A[l.type.name];if(u)return a&&(n+=u({node:l,pos:s,parent:a,index:d,range:g})),!1;l.isText&&(n+=(m=l==null?void 0:l.text)==null?void 0:m.slice(Math.max(C,s)-s,t-s))}),n}function X6g(e,g){const I={from:0,to:e.content.size};return xF(e,I,g)}function OF(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,g])=>g.spec.toText).map(([g,I])=>[g,I.spec.toText]))}function ql(e,g){if(typeof e=="string"){if(!g.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return g.marks[e]}return e}function QF(e,g){const I=ql(g,e.schema),{from:C,to:t,empty:i}=e.selection,A=[];i?(e.storedMarks&&A.push(...e.storedMarks),A.push(...e.selection.$head.marks())):e.doc.nodesBetween(C,t,l=>{A.push(...l.marks)});const n=A.find(l=>l.type.name===I.name);return n?{...n.attrs}:{}}function aC(e,g){if(typeof e=="string"){if(!g.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return g.nodes[e]}return e}function H6g(e,g){const I=aC(g,e.schema),{from:C,to:t}=e.selection,i=[];e.doc.nodesBetween(C,t,n=>{i.push(n)});const A=i.reverse().find(n=>n.type.name===I.name);return A?{...A.attrs}:{}}function _p(e,g){return g.nodes[e]?"node":g.marks[e]?"mark":null}function UF(e,g){const I=_p(typeof g=="string"?g:g.name,e.schema);return I==="node"?H6g(e,g):I==="mark"?QF(e,g):{}}function D6g(e,g=JSON.stringify){const I={};return e.filter(C=>{const t=g(C);return Object.prototype.hasOwnProperty.call(I,t)?!1:I[t]=!0})}function S6g(e){const g=D6g(e);return g.length===1?g:g.filter((I,C)=>!g.filter((i,A)=>A!==C).some(i=>I.oldRange.from>=i.oldRange.from&&I.oldRange.to<=i.oldRange.to&&I.newRange.from>=i.newRange.from&&I.newRange.to<=i.newRange.to))}function EF(e){const{mapping:g,steps:I}=e,C=[];return g.maps.forEach((t,i)=>{const A=[];if(t.ranges.length)t.forEach((n,l)=>{A.push({from:n,to:l})});else{const{from:n,to:l}=I[i];if(n===void 0||l===void 0)return;A.push({from:n,to:l})}A.forEach(({from:n,to:l})=>{const s=g.slice(i).map(n,-1),a=g.slice(i).map(l),d=g.invert().map(s,-1),m=g.invert().map(a);C.push({oldRange:{from:d,to:m},newRange:{from:s,to:a}})})}),S6g(C)}function hM(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function $p(e,g,I={strict:!0}){const C=Object.keys(g);return C.length?C.every(t=>I.strict?g[t]===e[t]:hM(g[t])?g[t].test(e[t]):g[t]===e[t]):!0}function PF(e,g,I={}){return e.find(C=>C.type===g&&$p(Object.fromEntries(Object.keys(I).map(t=>[t,C.attrs[t]])),I))}function _F(e,g,I={}){return!!PF(e,g,I)}function bM(e,g,I){var C;if(!e||!g)return;let t=e.parent.childAfter(e.parentOffset);if((!t.node||!t.node.marks.some(a=>a.type===g))&&(t=e.parent.childBefore(e.parentOffset)),!t.node||!t.node.marks.some(a=>a.type===g)||(I=I||((C=t.node.marks[0])==null?void 0:C.attrs),!PF([...t.node.marks],g,I)))return;let A=t.index,n=e.start()+t.offset,l=A+1,s=n+t.node.nodeSize;for(;A>0&&_F([...e.parent.child(A-1).marks],g,I);)A-=1,n-=e.parent.child(A).nodeSize;for(;l<e.parent.childCount&&_F([...e.parent.child(l).marks],g,I);)s+=e.parent.child(l).nodeSize,l+=1;return{from:n,to:s}}function ZM(e,g,I){const C=[];return e===g?I.resolve(e).marks().forEach(t=>{const i=I.resolve(e),A=bM(i,t.type);A&&C.push({mark:t,...A})}):I.nodesBetween(e,g,(t,i)=>{!t||(t==null?void 0:t.nodeSize)===void 0||C.push(...t.marks.map(A=>({from:i,to:i+t.nodeSize,mark:A})))}),C}var K6g=(e,g,I,C=20)=>{const t=e.doc.resolve(I);let i=C,A=null;for(;i>0&&A===null;){const n=t.node(i);(n==null?void 0:n.type.name)===g?A=n:i-=1}return[A,i]};function GM(e,g){return g.nodes[e]||g.marks[e]||null}function qp(e,g,I){return Object.fromEntries(Object.entries(I).filter(([C])=>{const t=e.find(i=>i.type===g&&i.name===C);return t?t.attribute.keepOnSplit:!1}))}var k6g=(e,g=500)=>{let I="";const C=e.parentOffset;return e.parent.nodesBetween(Math.max(0,C-g),C,(t,i,A,n)=>{var l,s;const a=((s=(l=t.type.spec).toText)==null?void 0:s.call(l,{node:t,pos:i,parent:A,index:n}))||t.textContent||"%leaf%";I+=t.isAtom&&!t.isText?a:a.slice(0,Math.max(0,C-i))}),I};function wM(e,g,I={}){const{empty:C,ranges:t}=e.selection,i=g?ql(g,e.schema):null;if(C)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>$p(d.attrs,I,{strict:!1}));let A=0;const n=[];if(t.forEach(({$from:d,$to:m})=>{const u=d.pos,h=m.pos;e.doc.nodesBetween(u,h,(Z,G)=>{if(!Z.isText&&!Z.marks.length)return;const w=Math.max(u,G),p=Math.min(h,G+Z.nodeSize),B=p-w;A+=B,n.push(...Z.marks.map(y=>({mark:y,from:w,to:p})))})}),A===0)return!1;const l=n.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>$p(d.mark.attrs,I,{strict:!1})).reduce((d,m)=>d+m.to-m.from,0),s=n.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,m)=>d+m.to-m.from,0);return(l>0?l+s:l)>=A}function xs(e,g,I={}){const{from:C,to:t,empty:i}=e.selection,A=g?aC(g,e.schema):null,n=[];e.doc.nodesBetween(C,t,(d,m)=>{if(d.isText)return;const u=Math.max(C,m),h=Math.min(t,m+d.nodeSize);n.push({node:d,from:u,to:h})});const l=t-C,s=n.filter(d=>A?A.name===d.node.type.name:!0).filter(d=>$p(d.node.attrs,I,{strict:!1}));return i?!!s.length:s.reduce((d,m)=>d+m.to-m.from,0)>=l}function F6g(e,g,I={}){if(!g)return xs(e,null,I)||wM(e,null,I);const C=_p(g,e.schema);return C==="node"?xs(e,g,I):C==="mark"?wM(e,g,I):!1}var z6g=(e,g)=>{const{$from:I,$to:C,$anchor:t}=e.selection;if(g){const i=Ep(n=>n.type.name===g)(e.selection);if(!i)return!1;const A=e.doc.resolve(i.pos+1);return t.pos+1===A.end()}return!(C.parentOffset<C.parent.nodeSize-2||I.pos!==C.pos)},J6g=e=>{const{$from:g,$to:I}=e.selection;return!(g.parentOffset>0||g.pos!==I.pos)};function $F(e,g){return Array.isArray(g)?g.some(I=>(typeof I=="string"?I:I.name)===e.name):g}function qF(e,g){const{nodeExtensions:I}=ub(g),C=I.find(A=>A.name===e);if(!C)return!1;const t={name:C.name,options:C.options,storage:C.storage},i=EI(Pg(C,"group",t));return typeof i!="string"?!1:i.split(" ").includes("list")}function gB(e,{checkChildren:g=!0,ignoreWhitespace:I=!1}={}){var C;if(I){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((C=e.text)!=null?C:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(g){let t=!0;return e.content.forEach(i=>{t!==!1&&(gB(i,{ignoreWhitespace:I,checkChildren:g})||(t=!1))}),t}return!1}function gz(e){return e instanceof eI}function Iz(e){return e instanceof hI}function go(e=0,g=0,I=0){return Math.min(Math.max(e,g),I)}function L6g(e,g,I){const t=e.state.doc.content.size,i=go(g,0,t),A=go(I,0,t),n=e.coordsAtPos(i),l=e.coordsAtPos(A,-1),s=Math.min(n.top,l.top),a=Math.max(n.bottom,l.bottom),d=Math.min(n.left,l.left),m=Math.max(n.right,l.right),u=m-d,h=a-s,w={top:s,bottom:a,left:d,right:m,width:u,height:h,x:d,y:s};return{...w,toJSON:()=>w}}function ez(e,g=null){if(!g)return null;const I=uI.atStart(e),C=uI.atEnd(e);if(g==="start"||g===!0)return I;if(g==="end")return C;const t=I.from,i=C.to;return g==="all"?hI.create(e,go(0,t,i),go(e.content.size,t,i)):hI.create(e,go(g,t,i),go(g,t,i))}function T6g(e,g,I){const C=e.steps.length-1;if(C<g)return;const t=e.steps[C];if(!(t instanceof dn||t instanceof di))return;const i=e.mapping.maps[C];let A=0;i.forEach((n,l,s,a)=>{A===0&&(A=a)}),e.setSelection(uI.near(e.doc.resolve(A),I))}var hb=class{constructor(e){var g;this.find=e.find,this.handler=e.handler,this.undoable=(g=e.undoable)!=null?g:!0}},v6g=(e,g)=>{if(hM(g))return g.exec(e);const I=g(e);if(!I)return null;const C=[I.text];return C.index=I.index,C.input=e,C.data=I.data,I.replaceWith&&(I.text.includes(I.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),C.push(I.replaceWith)),C};function IB(e){var g;const{editor:I,from:C,to:t,text:i,rules:A,plugin:n}=e,{view:l}=I;if(l.composing)return!1;const s=l.state.doc.resolve(C);if(s.parent.type.spec.code||(g=s.nodeBefore||s.nodeAfter)!=null&&g.marks.find(m=>m.type.spec.code))return!1;let a=!1;const d=k6g(s)+i;return A.forEach(m=>{if(a)return;const u=v6g(d,m.find);if(!u)return;const h=l.state.tr,Z=Op({state:l.state,transaction:h}),G={from:C-(u[0].length-i.length),to:t},{commands:w,chain:p,can:B}=new Qp({editor:I,state:Z});m.handler({state:Z,range:G,match:u,commands:w,chain:p,can:B})===null||!h.steps.length||(m.undoable&&h.setMeta(n,{transform:h,from:C,to:t,text:i}),l.dispatch(h),a=!0)}),a}function j6g(e){const{editor:g,rules:I}=e,C=new je({state:{init(){return null},apply(t,i,A){const n=t.getMeta(C);if(n)return n;const l=t.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:a}=l;typeof a=="string"?a=a:a=mM(Bg.from(a),A.schema);const{from:d}=l,m=d+a.length;IB({editor:g,from:d,to:m,text:a,rules:I,plugin:C})}),t.selectionSet||t.docChanged?null:i}},props:{handleTextInput(t,i,A,n){return IB({editor:g,from:i,to:A,text:n,rules:I,plugin:C})},handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:i}=t.state.selection;i&&IB({editor:g,from:i.pos,to:i.pos,text:"",rules:I,plugin:C})}),!1)},handleKeyDown(t,i){if(i.key!=="Enter")return!1;const{$cursor:A}=t.state.selection;return A?IB({editor:g,from:A.pos,to:A.pos,text:`
@@ -1559,4 +1561,4 @@ img.ProseMirror-separator {
1559
1561
  `,`
1560
1562
  `).split(/\r?\n/).map(dg=>dg.trim()).filter(Boolean),Y=()=>{var E;return((E=I.value)==null?void 0:E.offsetWidth)??0},f=()=>{var E;return((E=I.value)==null?void 0:E.offsetHeight)??0},M=()=>{t.value=window.innerWidth<=xII,t.value||(i.value=!1)},K=()=>({position:"fixed",left:"0px",top:"0px",transform:"none",visibility:"hidden",pointerEvents:"none",zIndex:"1000"}),F=E=>{var eg;if(!E||E.isDestroyed)return null;try{return((eg=E.view)==null?void 0:eg.dom)??null}catch{return null}},X=(E,eg)=>{if(!eg)return!1;const dg=F(E);if(!dg)return!1;const Qg=eg instanceof Element?eg:eg.parentElement;return!!Qg&&dg.contains(Qg)},z=E=>{const eg=L(E);return eg?Array.from(eg.getRangeAt(0).getClientRects()).filter(dg=>dg.width>0||dg.height>0):[]},L=E=>{const eg=F(E),dg=eg==null?void 0:eg.ownerDocument.getSelection();return!dg||dg.rangeCount===0||dg.isCollapsed||!X(E,dg.anchorNode)||!X(E,dg.focusNode)?null:dg},O=E=>{const eg=z(E);if(eg.length>0){const Ng=Math.min(...eg.map(ne=>ne.left)),Dg=Math.max(...eg.map(ne=>ne.right)),Lg=Math.min(...eg.map(ne=>ne.top)),pI=Math.max(...eg.map(ne=>ne.bottom));return new DOMRect(Ng,Lg,Dg-Ng,pI-Lg)}const dg=F(E),Qg=dg==null?void 0:dg.ownerDocument.getSelection();if(!Qg||Qg.rangeCount===0)return null;const lg=Qg.getRangeAt(0).getBoundingClientRect();return lg.width>0||lg.height>0?lg:null},Ig=E=>{const{doc:eg,selection:dg}=E.state;return dg.from<=1&&dg.to>=eg.content.size-1},Ag=E=>{const[eg]=z(E).sort((Qg,Cg)=>Qg.top-Cg.top||Qg.left-Cg.left);if(eg)return new DOMRect(eg.left,eg.top,eg.width,eg.height);const{selection:dg}=E.state;try{const Qg=E.view.coordsAtPos(dg.from);return new DOMRect(Qg.left,Qg.top,Math.max(Qg.right-Qg.left,1),Qg.bottom-Qg.top)}catch{return null}},Q=E=>(Ig(E)?Ag(E):null)??O(E)??L6g(E.view,E.state.selection.from,E.state.selection.to),$=E=>{const eg=L(E);if(!eg)return!1;try{if(!eg.anchorNode||!eg.focusNode)return!1;const dg=E.view.posAtDOM(eg.anchorNode,eg.anchorOffset),Qg=E.view.posAtDOM(eg.focusNode,eg.focusOffset),Cg=Math.min(dg,Qg),lg=Math.max(dg,Qg);return Cg===lg?!1:(E.state.selection.from===Cg&&E.state.selection.to===lg||E.view.dispatch(E.state.tr.setSelection(Fi.create(E.state.doc,Cg,lg))),!0)}catch{return!1}},mg=E=>{const eg=Y();if(!eg)return E;const dg=window.innerWidth-eg-ol;return dg<=ol?Math.max((window.innerWidth-eg)/2,0):Math.min(Math.max(E,ol),dg)},og=E=>{var lg;const eg=((lg=I.value)==null?void 0:lg.offsetWidth)??0;if(!eg)return E;const dg=eg/2,Qg=ol+dg,Cg=window.innerWidth-ol-dg;return Qg>Cg?window.innerWidth/2:Math.min(Math.max(E,Qg),Cg)},Gg=E=>{const eg=Y();if(!eg)return"center";const dg=E.left-ol,Qg=window.innerWidth-E.right-ol,Cg=eg/2;return Qg<Cg&&dg>Qg?"right":dg<Cg&&Qg>dg?"left":"center"},Rg=(E,eg)=>eg==="left"?{left:mg(E.left),transform:"none"}:eg==="right"?{left:mg(E.right-Y()),transform:"none"}:{left:og(E.left+E.width/2),transform:"translateX(-50%)"},Yg=(E,eg)=>eg==="center"?og(E):mg(E),hg=E=>{if(!t.value||!i.value)return Math.max(E.top-52,12);const eg=f(),dg=E.bottom+8,Qg=window.innerHeight-eg-ol;return!eg||dg<=Qg?Math.max(dg,ol):Math.max(E.top-eg-8,ol)},Vg=()=>{var E;return(E=g.editor)==null?void 0:E.chain().focus()},pg=(E=u.value)=>{!g.editor||!E||g.editor.chain().focus().setTextSelection(E).run()},CI=(E={})=>{const eg=g.editor,dg=F(eg);if(!eg||!eg.view||!dg){C.value=!1,i.value=!1;return}const{view:Qg,isEditable:Cg}=eg,lg=t.value&&!!L(eg);lg&&$(eg);const{selection:Ng}=eg.state;if(!Cg||Ng.empty||!Qg.hasFocus()&&!lg||Z.value){C.value=!1,i.value=!1,a.value=K(),d.value=null,m.value="center";return}const Dg=Q(eg);if(!C.value){a.value=K(),C.value=!0,o.nextTick(()=>Og(E));return}const Lg=E.preserveHorizontal?m.value:Gg(Dg),pI=E.preserveHorizontal?{left:Yg(d.value??Rg(Dg,Lg).left,Lg),transform:Lg==="center"?"translateX(-50%)":"none"}:Rg(Dg,Lg);m.value=Lg,d.value=pI.left,a.value={position:"fixed",left:`${pI.left}px`,top:`${hg(Dg)}px`,transform:pI.transform,visibility:"visible",pointerEvents:"auto",zIndex:"1000"}},Og=(E={})=>{G!==null&&cancelAnimationFrame(G),G=requestAnimationFrame(()=>{G=null,CI(E)})},kI=()=>{M(),Og({preserveHorizontal:!0})},Ge=()=>{Og()},FI=()=>{Og()},ZI=()=>{Og()},TI=()=>{C.value=!1,i.value=!1},CC=E=>{t.value&&E.preventDefault()},we=E=>{E.button!==0||A.value||(Z.value=!0,C.value=!1,i.value=!1)},yC=()=>{if(!Z.value){Xe();return}Z.value=!1,Og(),Xe()},pt=()=>{w.forEach(E=>window.clearTimeout(E)),w=[]},Xe=()=>{t.value&&(pt(),[50,180,360].forEach(E=>{const eg=window.setTimeout(()=>{Z.value=!1,Og()},E);w.push(eg)}))},YC=()=>{Xe()},_t=()=>{Xe()},mC=()=>{i.value=!0,o.nextTick(()=>{Og({preserveHorizontal:!0})})},ye=()=>{i.value=!1,o.nextTick(()=>{Og({preserveHorizontal:!0})})},it=E=>{var eg;E.run(),E.key==="link"&&!((eg=g.editor)!=null&&eg.isActive("link"))&&(i.value=!1),Og({preserveHorizontal:!0})},VC=E=>{const{from:eg,to:dg,empty:Qg}=E.state.selection;return Qg?null:{from:eg,to:dg}},Yi=(E,eg)=>E.state.doc.textBetween(eg.from,eg.to,`
1561
1563
  `),vC=async E=>{var Qg;if(!E)return!1;try{const Cg=(Qg=navigator.clipboard)==null?void 0:Qg.writeText;if(Cg)return await Cg.call(navigator.clipboard,E),!0}catch{}const eg=document.createElement("textarea");eg.value=E,eg.readOnly=!0,eg.style.position="fixed",eg.style.top="-9999px",eg.style.opacity="0",document.body.appendChild(eg),eg.select(),eg.setSelectionRange(0,eg.value.length);const dg=document.execCommand("copy");return document.body.removeChild(eg),dg},At=async()=>{var E;try{const eg=(E=navigator.clipboard)==null?void 0:E.readText;return eg?await eg.call(navigator.clipboard):""}catch{return""}},$t=E=>{const eg=VC(E),dg=document.createElement("textarea");dg.readOnly=!1,dg.style.position="fixed",dg.style.top="-9999px",dg.style.opacity="0",document.body.appendChild(dg),dg.focus(),document.execCommand("paste");const Qg=dg.value;return document.body.removeChild(dg),eg?pg(eg):E.chain().focus().run(),Qg},qt=(E,eg)=>{E.chain().focus().setTextSelection(eg.to).run(),C.value=!1,i.value=!1},Rn=async E=>{const eg=g.editor;if(!eg)return;if(E==="paste"){const Cg=await At()||$t(eg);if(Cg){eg.chain().focus().insertContent(Cg).run(),Og({preserveHorizontal:!0});return}Og({preserveHorizontal:!0});return}const dg=VC(eg);if(!dg)return;const Qg=await vC(Yi(eg,dg));Qg&&E==="cut"?eg.chain().focus().deleteRange(dg).run():Qg?qt(eg,dg):pg(dg),Og({preserveHorizontal:!0})},Xn=[{key:"bold",icon:ug.bold,hint:"Жирный",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("bold"))??!1},run:()=>{var E;return(E=Vg())==null?void 0:E.toggleBold().run()}},{key:"italic",icon:ug.italic,hint:"Курсив",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("italic"))??!1},run:()=>{var E;return(E=Vg())==null?void 0:E.toggleItalic().run()}},{key:"underline",icon:ug.underline,hint:"Подчёркнутый",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("underline"))??!1},run:()=>{var E;return(E=Vg())==null?void 0:E.toggleUnderline().run()}},{key:"strike",icon:ug.strikethrough,hint:"Зачёркнутый",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("strike"))??!1},run:()=>{var E;return(E=Vg())==null?void 0:E.toggleStrike().run()}}],Uo=async()=>{var lg,Ng,Dg;const E=g.editor;if(!E)return;const{from:eg,to:dg,empty:Qg}=E.state.selection;if(Qg)return;u.value={from:eg,to:dg},h.value=B(E,{from:eg,to:dg}),n.value=h.value;const Cg=(lg=E.getAttributes("link"))==null?void 0:lg.href;l.value=typeof Cg=="string"&&Cg.trim().length>0?Cg:h.value,A.value=!0,i.value=!1,await o.nextTick(),(Ng=s.value)==null||Ng.focus(),(Dg=s.value)==null||Dg.select()},Hn=()=>{const E=g.editor;if(!E)return;if(E.isActive("orderedList")){E.chain().focus().toggleOrderedList().run();return}const{from:eg,to:dg,empty:Qg}=E.state.selection;if(Qg){E.chain().focus().toggleOrderedList().run();return}const Cg=y(E,{from:eg,to:dg});Cg.length&&E.chain().focus().insertContentAt({from:eg,to:dg},{type:"orderedList",attrs:{start:1},content:Cg.map(lg=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:lg}]}]}))}).run()},TA=[{key:"code",icon:ug.code,hint:"Код",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("code"))??!1},run:()=>{var E;return(E=Vg())==null?void 0:E.toggleCode().run()}},{key:"link",icon:ug.link,hint:"Ссылка",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("link"))??!1},run:()=>{var E;if((E=g.editor)!=null&&E.isActive("link")){g.editor.chain().focus().extendMarkRange("link").unsetLink().run(),CI({preserveHorizontal:!0});return}Uo()}},{key:"blockquote",icon:ug.blockquote,hint:"Цитата",isActive:()=>{var E;return((E=g.editor)==null?void 0:E.isActive("orderedList"))??!1},run:Hn}],Eo=E=>{const eg=E.trim();return eg?/^(https?:\/\/|mailto:|tel:)/i.test(eg)?eg:`https://${eg}`:""},vA=()=>{const E=g.editor,eg=u.value;if(!E||!eg)return;const dg=n.value.trim()||h.value.trim(),Qg=Eo(l.value);if(!dg){Bt();return}E.chain().focus().insertContentAt(eg,Qg?{type:"text",text:dg,marks:[{type:"link",attrs:{href:Qg,class:"link"}}]}:dg).run();const Cg={from:eg.from,to:eg.from+dg.length};p(),pg(Cg),CI({preserveHorizontal:!0})},Bt=()=>{const E=u.value;p(),pg(E),CI({preserveHorizontal:!0})},jA=E=>{const eg=F(E);!E||!eg||(E.on("selectionUpdate",Ge),E.on("focus",FI),E.on("blur",TI),E.on("transaction",ZI),eg.addEventListener("pointerdown",we),eg.addEventListener("touchend",_t,!0),eg.addEventListener("contextmenu",_t),eg.ownerDocument.addEventListener("selectionchange",YC))},Jg=E=>{var dg;if(!E)return;E.off("selectionUpdate",Ge),E.off("focus",FI),E.off("blur",TI),E.off("transaction",ZI),(dg=F(E))==null||dg.removeEventListener("pointerdown",we);const eg=F(E);eg==null||eg.removeEventListener("touchend",_t,!0),eg==null||eg.removeEventListener("contextmenu",_t),eg==null||eg.ownerDocument.removeEventListener("selectionchange",YC)};return o.onMounted(()=>{M(),jA(g.editor),window.addEventListener("resize",kI),window.addEventListener("scroll",kI,!0),window.addEventListener("pointerup",yC,!0)}),o.onBeforeUnmount(()=>{Jg(g.editor),window.removeEventListener("resize",kI),window.removeEventListener("scroll",kI,!0),window.removeEventListener("pointerup",yC,!0),G!==null&&cancelAnimationFrame(G),pt()}),o.watch(()=>g.editor,(E,eg)=>{eg!==E&&(Jg(eg),jA(E),Og())}),(E,eg)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[C.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"toolbarRef",ref:I,class:o.normalizeClass(["formatting-toolbar",{"formatting-toolbar--mobile":t.value,"formatting-toolbar--mobile-menu":t.value&&i.value}]),style:o.normalizeStyle(a.value),onPointerdown:CC,onMousedown:eg[3]||(eg[3]=o.withModifiers(()=>{},["prevent"]))},[t.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.value?(o.openBlock(),o.createElementBlock("div",fII,[o.createElementVNode("button",{type:"button",class:"formatting-toolbar__mobile-header",onClick:ye},[o.createVNode(Mg,{name:o.unref(ug).arrowLeft,width:20,height:20},null,8,["name"]),eg[8]||(eg[8]=o.createElementVNode("span",null,"Форматирование",-1))]),o.createElementVNode("div",RII,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(Xn,dg=>o.createElementVNode("button",{key:dg.key,type:"button",class:o.normalizeClass(["formatting-toolbar__mobile-action",{"formatting-toolbar__mobile-action--active":dg.isActive()}]),"aria-label":dg.hint,"aria-pressed":dg.isActive(),role:"menuitemcheckbox",onClick:Qg=>it(dg)},[o.createVNode(Mg,{class:"formatting-toolbar__mobile-action-icon",name:dg.icon,width:24,height:24},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(dg.hint),1)],10,XII)),64))]),eg[9]||(eg[9]=o.createElementVNode("div",{class:"formatting-toolbar__mobile-divider"},null,-1)),o.createElementVNode("div",HII,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(TA,dg=>o.createElementVNode("button",{key:dg.key,type:"button",class:o.normalizeClass(["formatting-toolbar__mobile-action",{"formatting-toolbar__mobile-action--active":dg.isActive()}]),"aria-label":dg.hint,"aria-pressed":dg.isActive(),role:"menuitemcheckbox",onClick:Qg=>it(dg)},[o.createVNode(Mg,{class:"formatting-toolbar__mobile-action-icon",name:dg.icon,width:24,height:24},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(dg.hint),1)],10,DII)),64))])])):(o.openBlock(),o.createElementBlock("div",MII,[o.createElementVNode("button",{type:"button",class:"formatting-toolbar__mobile-edit-action",onClick:eg[0]||(eg[0]=dg=>Rn("cut"))}," Вырезать "),eg[6]||(eg[6]=o.createElementVNode("div",{class:"formatting-toolbar__mobile-selection-divider"},null,-1)),o.createElementVNode("button",{type:"button",class:"formatting-toolbar__mobile-edit-action",onClick:eg[1]||(eg[1]=dg=>Rn("copy"))}," Скопировать "),eg[7]||(eg[7]=o.createElementVNode("div",{class:"formatting-toolbar__mobile-selection-divider"},null,-1)),o.createElementVNode("button",{type:"button",class:"formatting-toolbar__mobile-edit-action",onClick:eg[2]||(eg[2]=dg=>Rn("paste"))}," Вставить "),o.createElementVNode("button",{type:"button",class:"formatting-toolbar__mobile-trigger","aria-label":"Форматирование",onClick:mC},[o.createVNode(Mg,{name:o.unref(ug).plus,width:18,height:18},null,8,["name"])])]))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",SII,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(Xn,dg=>o.createVNode(Hd,{key:dg.key,hint:dg.hint,position:"top-center"},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:o.normalizeClass(["formatting-toolbar__button",{"formatting-toolbar__button--active":dg.isActive()}]),"aria-label":dg.hint,onClick:dg.run},[o.createVNode(Mg,{name:dg.icon},null,8,["name"])],10,KII)]),_:2},1032,["hint"])),64))]),eg[10]||(eg[10]=o.createElementVNode("div",{class:"formatting-toolbar__divider"},null,-1)),o.createElementVNode("div",kII,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(TA,dg=>o.createVNode(Hd,{key:dg.key,hint:dg.hint,position:"top-center"},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:o.normalizeClass(["formatting-toolbar__button",{"formatting-toolbar__button--active":dg.isActive()}]),"aria-label":dg.hint,onClick:dg.run},[o.createVNode(Mg,{name:dg.icon},null,8,["name"])],10,FII)]),_:2},1032,["hint"])),64))])],64))],38)):o.createCommentVNode("",!0),A.value?(o.openBlock(),o.createBlock(Ap,{key:1,open:A.value,position:"center",width:"min(370px, -45px + 100vw)",height:"auto",class:"formatting-toolbar__link-modal-container",onClose:Bt},{default:o.withCtx(()=>[o.createElementVNode("div",zII,[o.createElementVNode("div",JII,[eg[11]||(eg[11]=o.createElementVNode("div",{class:"formatting-toolbar__link-modal-title"},"Ссылка",-1)),o.createElementVNode("button",{type:"button",class:"formatting-toolbar__link-modal-close","aria-label":"Закрыть",onClick:Bt},[o.createVNode(Mg,{name:o.unref(ug).crossLarge},null,8,["name"])])]),o.createElementVNode("label",LII,[eg[12]||(eg[12]=o.createElementVNode("span",{class:"formatting-toolbar__field-label"},"Текст:",-1)),o.withDirectives(o.createElementVNode("input",{ref_key:"linkTextInputRef",ref:s,"onUpdate:modelValue":eg[4]||(eg[4]=dg=>n.value=dg),class:"formatting-toolbar__field-input",type:"text",placeholder:"Важная ссылка",onKeydown:[o.withKeys(o.withModifiers(vA,["prevent"]),["enter"]),o.withKeys(o.withModifiers(Bt,["prevent"]),["esc"])]},null,40,TII),[[o.vModelText,n.value]])]),o.createElementVNode("label",vII,[eg[13]||(eg[13]=o.createElementVNode("span",{class:"formatting-toolbar__field-label"},"Ссылка:",-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":eg[5]||(eg[5]=dg=>l.value=dg),class:"formatting-toolbar__field-input",type:"text",placeholder:"https://example.com",onKeydown:[o.withKeys(o.withModifiers(vA,["prevent"]),["enter"]),o.withKeys(o.withModifiers(Bt,["prevent"]),["esc"])]},null,40,jII),[[o.vModelText,l.value]])]),o.createElementVNode("div",{class:"formatting-toolbar__link-modal-actions"},[o.createElementVNode("button",{type:"button",class:"formatting-toolbar__link-modal-save",onClick:vA}," Сохранить ")])])]),_:1},8,["open"])):o.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-88eac404"]]),QII={key:0,class:"editor-component-slot"},UII={key:5,class:"right-buttons"},EII={key:6,class:"toolbar"},PII={class:"attach-modal"},_II={class:"attach-modal__header"},$II={key:0,class:"attach-modal__attachments__all"},qII={class:"attach-modal__media-groups"},geI=["src"],IeI=["src","alt"],eeI={key:0,class:"attach-modal__attachments"},CeI={class:"attach-modal__attachment-icon"},teI={class:"attach-modal__attachment-body"},ieI={class:"attach-modal__attachment-name"},AeI={class:"attach-modal__attachment-name-base"},neI={key:0,class:"attach-modal__attachment-name-ext"},leI={class:"attach-modal__attachment-size"},oeI={key:0,class:"editor-component-slot"},seI={class:"attach-modal__toolbar"},aeI={class:"attach-modal__toolbar-left"},deI={class:"camera-selection"},ceI={class:"camera-selection-options"},$s="[ContentEditor]",Yf=o.defineComponent({__name:"ContentEditor",props:o.mergeModels({activeAttachFile:{type:Boolean},activeSelectUser:{type:Boolean},activeSend:{type:Boolean},disableSendOnEnter:{type:Boolean},isMentionModalOpen:{type:Boolean},mentionItems:{},mentionConfig:{},mentionItemKey:{type:Function},mentionItemLabel:{type:Function},mentionItemSubtitle:{type:Function},mentionItemAvatarUrl:{type:Function},mentionItemAvatarInitials:{type:Function},mentionItemIsOnline:{type:Function},mentionInsertLabel:{type:Function},mentionInsertAttrs:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:o.mergeModels(["unmount-send","unmount-attach-file","mention-change"],["update:modelValue"]),setup(e,{expose:g,emit:I}){const C=e,t=o.useModel(e,"modelValue"),i=o.ref(!1),A=o.ref({vertical:"bottom",horizontal:"left"}),n=I,l=o.ref(null),s=o.ref(null),a=o.ref(null),d=o.ref(null),m=o.ref({}),u=o.ref(!1),h=o.ref(!1),Z=o.ref([]),G=o.ref([]),w=o.ref(null),p=o.ref([]),B=o.ref(null),y=o.ref(null),Y=o.ref(0),f=o.computed(()=>Z.value.length>0||G.value.length>0),M=o.computed(()=>{var j;return!C.activeSend&&((j=Jg.value)==null?void 0:j.isEmpty)&&!f.value}),K=o.computed(()=>C.mentionItems??[]),F=o.computed(()=>!!C.activeSelectUser&&B.value!==null&&y.value!==B.value),X=(j,P)=>{var ig,Wg,Ug;return((Wg=(ig=C.mentionConfig)==null?void 0:ig.getKey)==null?void 0:Wg.call(ig,j,P))??((Ug=C.mentionItemKey)==null?void 0:Ug.call(C,j,P))??P},z=j=>{var P,ig,Wg;return((ig=(P=C.mentionConfig)==null?void 0:P.getLabel)==null?void 0:ig.call(P,j))??((Wg=C.mentionItemLabel)==null?void 0:Wg.call(C,j))??""},L=j=>{var P,ig,Wg;return((ig=(P=C.mentionConfig)==null?void 0:P.getSubtitle)==null?void 0:ig.call(P,j))??((Wg=C.mentionItemSubtitle)==null?void 0:Wg.call(C,j))??""},O=j=>{var P,ig,Wg;return((ig=(P=C.mentionConfig)==null?void 0:P.getAvatarUrl)==null?void 0:ig.call(P,j))??((Wg=C.mentionItemAvatarUrl)==null?void 0:Wg.call(C,j))??""},Ig=j=>{var P,ig,Wg;return((ig=(P=C.mentionConfig)==null?void 0:P.getAvatarInitials)==null?void 0:ig.call(P,j))??((Wg=C.mentionItemAvatarInitials)==null?void 0:Wg.call(C,j))??z(j)},Ag=j=>{var P,ig,Wg;return((ig=(P=C.mentionConfig)==null?void 0:P.getIsOnline)==null?void 0:ig.call(P,j))??((Wg=C.mentionItemIsOnline)==null?void 0:Wg.call(C,j))??!1},Q=o.computed(()=>["emoji-picker",`emoji-picker-${A.value.vertical}`,`emoji-picker-${A.value.horizontal}`,M.value?"":"translateX"]),$=o.computed(()=>[{value:"Фото или видео",function:()=>eg(!0),iconName:ug.image},{value:"Файл",function:()=>eg(!1),iconName:ug.file}]),mg=o.computed(()=>[{value:"Камера",function:()=>u.value=!0,iconName:ug.camera},...$.value]),og=o.computed(()=>[...G.value.map((j,P)=>({id:`media-${j.name}-${j.lastModified}-${P}`,file:j,kind:"media",index:P})),...Z.value.map((j,P)=>({id:`file-${j.name}-${j.lastModified}-${P}`,file:j,kind:"file",index:P}))]),Gg=o.computed(()=>og.value.filter(j=>j.kind==="file")),Rg=o.computed(()=>G.value.map((j,P)=>({id:`media-preview-${j.name}-${j.lastModified}-${P}`,file:j,index:P,url:p.value[P]||"",isVideo:pt(j).startsWith("video/")})).filter(j=>!!j.url)),Yg=(j,P)=>{const ig=[];for(let Wg=0;Wg<j.length;Wg+=P)ig.push(j.slice(Wg,Wg+P));return ig},hg=o.computed(()=>Yg(Rg.value,10)),Vg=o.computed(()=>(h.value?a.value:s.value)??null),pg=o.computed(()=>{const j=Vg.value;return(j==null?void 0:j.closest("dialog"))??"body"}),CI=()=>{if(!F.value||!K.value.length)return;const j=Vg.value;if(!j)return;const P=j.getBoundingClientRect(),ig=12,Wg=h.value?10:3,Ug=Math.min(P.width,window.innerWidth-ig*2),oI=window.innerWidth-Ug-ig,yt=Math.min(Math.max(P.left,ig),oI);m.value={left:`${yt}px`,bottom:`${window.innerHeight-P.top+Wg}px`,width:`${Ug}px`,zIndex:"1001"}},Og=()=>{o.nextTick(()=>{const j=d.value;if(!j)return;const P=j.querySelector('[data-mention-active="true"]');P instanceof HTMLElement&&P.scrollIntoView({block:"nearest"})})},kI=()=>window.innerWidth<=480,Ge=()=>window.innerWidth<=480&&window.matchMedia("(hover: none) and (pointer: coarse)").matches,FI=j=>{u.value=!1,eg(!0,j)};let ZI=!1,TI=null;const CC={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",heic:"image/heic",heif:"image/heif",mov:"video/quicktime",mp4:"video/mp4",m4v:"video/x-m4v",webm:"video/webm"},we={"image/png":"png","image/x-png":"png","image/jpeg":"jpg","image/jpg":"jpg","image/pjpeg":"jpg","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/x-ms-bmp":"bmp","image/heic":"heic","image/heif":"heif","video/quicktime":"mov","video/mp4":"mp4","video/x-m4v":"m4v","video/webm":"webm"},yC=j=>{var ig;const P=j.match(/\.([^.]+)$/);return((ig=P==null?void 0:P[1])==null?void 0:ig.toLowerCase())??""},pt=j=>{if(j.type)return j.type.toLowerCase();const P=yC(j.name);return CC[P]??""},Xe=(j,P)=>{const ig=j.name.trim(),Wg=we[P],Ug=!!yC(ig);if(!ig){const oI=P.startsWith("image/")?"image":P.startsWith("video/")?"video":"file";return Wg?`${oI}-${Date.now()}.${Wg}`:`${oI}-${Date.now()}`}return Ug||!Wg?ig:`${ig}.${Wg}`},YC=(j,P=pt(j))=>({fileName:j.name,fileType:j.type,normalizedMimeType:P,fileSize:j.size,lastModified:j.lastModified}),_t=j=>j.startsWith("image/")||j.startsWith("video/"),mC=async j=>{const P=pt(j),ig=Xe(j,P);if(console.warn(`${$s} normalize file`,{...YC(j,P),normalizedFileName:ig,shouldDetach:_t(P)}),P===j.type&&ig===j.name&&!_t(P))return console.warn(`${$s} keep original file`,YC(j,P)),j;try{const Wg=await j.arrayBuffer();return console.warn(`${$s} detached file copy created`,{...YC(j,P),normalizedFileName:ig,bufferSize:Wg.byteLength}),new File([Wg],ig,{type:P||j.type,lastModified:j.lastModified})}catch(Wg){return console.warn(`${$s} failed to detach file, using original`,{...YC(j,P),normalizedFileName:ig,error:Wg}),j}},ye=j=>{const P=new DataTransfer;return j.forEach(ig=>P.items.add(ig)),P.files},it=async(j,P)=>{console.warn(`${$s} emitAttachFiles called`,{inputCount:Array.from(j).length,onlyMedia:P});const ig=await Promise.all(Array.from(j,mC));if(!ig.length){console.warn(`${$s} no files after normalization`);return}const Wg=P??ig.every(Ug=>{const oI=pt(Ug);return oI.startsWith("image/")||oI.startsWith("video/")});console.warn(`${$s} emit normalized files`,{files:ig.map(Ug=>YC(Ug)),isOnlyMedia:Wg}),n("unmount-attach-file",ye(ig),Wg)},VC=async(j,P)=>{const ig=await Promise.all(Array.from(j,mC));if(ig.length){if(P){const Wg=ig.filter(oI=>_t(pt(oI))),Ug=ig.filter(oI=>!_t(pt(oI)));Wg.length&&(G.value=[...G.value,...Wg]),Ug.length&&(Z.value=[...Z.value,...Ug])}else Z.value=[...Z.value,...ig];h.value=!0}},Yi=()=>{Z.value=[],G.value=[]},vC=()=>{jC(),h.value=!1,Yi()},At=(j,P)=>{if(j==="media"){const Wg=G.value.filter((Ug,oI)=>oI!==P);G.value=Wg,!Wg.length&&!Z.value.length&&vC();return}const ig=Z.value.filter((Wg,Ug)=>Ug!==P);Z.value=ig,!ig.length&&!G.value.length&&vC()},$t=async(j,P)=>{var Wg;const ig=j.target;(Wg=ig.files)!=null&&Wg.length&&(await VC(ig.files,P),ig.value="")},qt=j=>j<1024?`${j} B`:j<1024*1024?`${(j/1024).toFixed(1)} KB`:`${(j/(1024*1024)).toFixed(1)} MB`,Rn=j=>{if(!j)return"";const P=j.lastIndexOf(".");return P<=0?j:j.slice(0,P)},Xn=j=>{if(!j)return"";const P=j.lastIndexOf(".");return P<=0||P===j.length-1?"":j.slice(P)};o.watch(()=>G.value,j=>{p.value.forEach(P=>URL.revokeObjectURL(P)),p.value=j.map(P=>URL.createObjectURL(P))},{deep:!0}),o.watch(()=>G.value[0],(j,P)=>{w.value&&(URL.revokeObjectURL(w.value),w.value=null),!(!j||j===P)&&(w.value=URL.createObjectURL(j))});const Uo=ri.create({name:"spanNode",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{class:{default:"link"},content:{default:""},userId:{default:null,parseHTML:j=>j.getAttribute("data-user-id"),renderHTML:j=>j.userId?{"data-user-id":j.userId}:{}}}},parseHTML(){return[{tag:"span[data-span]"}]},renderHTML({node:j,HTMLAttributes:P}){return["span",qe(P,{"data-span":"",contenteditable:"false",class:j==null?void 0:j.attrs.class}),j==null?void 0:j.attrs.content]}}),Hn=/^\s*([-\u2013\u2014])\s$/,TA=/^([-\u2013\u2014])\s$/,Eo=/^(\d+)\.\s$/,vA=(j,P)=>{const ig=j.lastIndexOf(`
1562
- `);if(ig===-1)return null;const Wg=j.slice(ig+1),Ug=Wg.match(P);return Ug?{index:ig+1,text:Wg,data:{match:Ug}}:null},Bt=({listTypeName:j,find:P,getAttributes:ig})=>new hb({find:P,handler:({state:Wg,range:Ug,match:oI})=>{var w2,RG;const yt=Wg.schema.nodes[j];if(!yt)return null;const Sl=Ug.from,$o=Sl-1;if(((w2=Wg.doc.resolve(Sl).nodeBefore)==null?void 0:w2.type.name)!=="hardBreak")return null;const qo=(ig==null?void 0:ig((RG=oI.data)==null?void 0:RG.match))??{};let uC=Wg.tr.delete(Ug.from,Ug.to);uC=uC.delete($o,$o+1);try{uC=uC.split($o)}catch{return null}const Kf=Math.min($o+2,uC.doc.content.size),Oa=uC.doc.resolve(Kf).blockRange(),G2=Oa&&Z_g(Oa,yt,qo);if(!G2)return null;uC=uC.wrap(Oa,G2);const kf=Math.min($o+4,uC.doc.content.size);uC=uC.setSelection(Fi.near(uC.doc.resolve(kf)))}}),jA=gC.create({name:"contentEditorListInputRules",addInputRules(){const j=this.editor.schema.nodes.bulletList;return j?[Ud({find:Hn,type:j}),Bt({listTypeName:"bulletList",find:P=>vA(P,TA)}),Bt({listTypeName:"orderedList",find:P=>vA(P,Eo),getAttributes:P=>({start:Number(P[1])})})]:[]}}),Jg=m_g({extensions:[eqg.configure({link:!1,heading:!1,blockquote:!1,codeBlock:!1}),u$g.configure({openOnClick:!1,HTMLAttributes:{class:"link"}}),Cqg.configure({placeholder:"Начните печатать...",emptyEditorClass:"is-editor-empty"}),Uo,jA],content:t.value,editorProps:{handlePaste(j,P){const ig=P.clipboardData;return ig&&ig.files.length>0&&C.activeAttachFile?(P.preventDefault(),P.stopPropagation(),ZI||(ZI=!0,VC(ig.files,!0),setTimeout(()=>{ZI=!1},200)),!0):!1}},onUpdate:({editor:j})=>{if(t.value=j.getHTML(),C.activeSelectUser){const{$from:P}=j.state.selection,ig=Math.max(0,P.parentOffset-50),Ug=P.parent.textBetween(ig,P.parentOffset,null,"").match(/@([^\s]*)$/);if(Ug){const oI=Ug[1].toLowerCase();B.value!==oI&&(Y.value=0),B.value=oI,n("mention-change",oI)}else B.value=null,y.value=null,n("mention-change",null)}},parseOptions:{preserveWhitespace:!0}});o.watch(t,j=>{Jg!=null&&Jg.value&&j!==Jg.value.getHTML()&&Jg.value.commands.setContent(j??"",{parseOptions:{preserveWhitespace:!0}})}),o.watch(K,j=>{if(!j.length){Y.value=0,m.value={};return}Y.value>=j.length&&(Y.value=j.length-1),F.value&&o.nextTick(()=>{CI(),Og()})}),o.watch(Y,()=>{F.value&&o.nextTick(()=>{CI(),Og()})}),o.watch(F,j=>{if(!j){Y.value=0,m.value={};return}y.value=null,o.nextTick(()=>{CI(),Og()})}),o.watch(()=>h.value,()=>{F.value&&o.nextTick(()=>CI())});const E=j=>{Jg!=null&&Jg.value&&Jg.value.chain().focus().insertContent(j.i).run()},eg=async(j=!1,P)=>{if(!(Jg!=null&&Jg.value))return;const ig=document.createElement("input");ig.type="file",P?(P==="video"?ig.accept="video/*":P==="image"?ig.accept="image/*":ig.accept="image/*,video/*",ig.capture="environment",ig.multiple=!1):(ig.multiple=!0,j&&(ig.accept="image/*,video/*")),ig.onchange=()=>{if(ig!=null&&ig.files){if(kI()){it(ig.files,j||!!P);return}VC(ig.files,j)}},ig.click()},dg=j=>{console.warn(`${$s} fileDropped event received`,j.files.map(P=>YC(P))),VC(j.files,j.onlyMedia)},Qg=()=>{Jg!=null&&Jg.value&&(n("unmount-send",{content:Jg.value.getHTML(),files:Z.value.length?ye(Z.value):void 0,mediaFiles:G.value.length?ye(G.value):void 0}),h.value=!1,Yi(),jC(),Jg.value.chain().focus())},Cg=()=>{if(Jg!=null&&Jg.value){if(f.value){Qg();return}n("unmount-send",{content:Jg.value.getHTML()}),Jg.value.chain().focus()}},lg=(j,P)=>{if(!(Jg!=null&&Jg.value))return;const{$from:ig}=Jg.value.state.selection,Wg=Math.max(0,ig.parentOffset-50),oI=ig.parent.textBetween(Wg,ig.parentOffset,null,"").match(/@([^\s]*)$/);if(oI){const yt=ig.start()+Wg+(oI.index||0);Jg.value.chain().focus().insertContentAt({from:yt,to:ig.pos},{type:"spanNode",attrs:{content:j,class:"link",...P}}).run()}else Jg.value.chain().focus().insertContent({type:"spanNode",attrs:{content:j,class:"link",...P}}).run()},Ng=()=>{B.value=null,y.value=null,Y.value=0,n("mention-change",null)},Dg=j=>{var Wg,Ug,oI;const P=((Wg=C.mentionConfig)==null?void 0:Wg.getInsertLabel)??C.mentionInsertLabel;if(!P)return;const ig=P(j);ig&&(lg(ig,(oI=((Ug=C.mentionConfig)==null?void 0:Ug.getInsertAttrs)??C.mentionInsertAttrs)==null?void 0:oI(j)),Ng())},Lg=()=>{if(!(Jg!=null&&Jg.value))return;const{$from:j}=Jg.value.state.selection,P=Math.max(0,j.parentOffset-50),Wg=j.parent.textBetween(P,j.parentOffset,null,"").match(/@([^\s]*)$/);if(Wg){const Ug=j.start()+P+(Wg.index||0);Jg.value.chain().focus().deleteRange({from:Ug,to:j.pos}).run()}else Jg.value.chain().focus().insertContent("@").run()},pI=()=>{Jg!=null&&Jg.value&&Jg.value.chain().focus()},ne=(j,P=300,ig=260)=>{if(!j)return;const Wg=j.getBoundingClientRect(),Ug=window.innerWidth,oI=window.innerHeight;A.value.vertical=Wg.bottom+ig>oI?"top":"bottom",A.value.horizontal=Wg.left+P>Ug?"right":"left"},xA=j=>{if(i.value=!i.value,i.value){const P=j.currentTarget;o.nextTick(()=>{ne(P)})}},jC=()=>{i.value=!1},AA=()=>{const j=document.querySelector(".toolbar-button.smile-button");i.value&&j&&ne(j),F.value&&CI()},nA=()=>{if(!Jg.value)return null;const{selection:j,doc:P}=Jg.value.state;if(!j.empty)return null;const{$from:ig}=j;let Wg=-1,Ug=-1;for(let qo=ig.depth;qo>0;qo-=1){const uC=ig.node(qo);if(Wg===-1&&uC.type.name==="listItem"&&(Wg=qo),uC.type.name==="orderedList"){Ug=qo;break}}if(Wg===-1||Ug===-1)return null;const oI=ig.node(Ug),yt=ig.node(Wg),Sl=ig.index(Ug),$o=ig.after(Ug),Z2=ig.parent.isTextblock&&ig.parentOffset===ig.parent.content.size&&ig.index(Wg)===yt.childCount-1;return{cursorPos:ig.pos,docSize:P.content.size,isLastItem:Sl===oI.childCount-1,isAtEndOfItem:Z2,orderedListAfter:$o}},Hl=()=>{if(!Jg.value)return;const j=nA();if(!j)return;const{state:P,view:ig}=Jg.value,Wg=j.orderedListAfter,Ug=P.doc.resolve(Wg).nodeAfter;let oI=P.tr;if(!Ug||Ug.type.name!=="paragraph"){const yt=P.schema.nodes.paragraph.create();oI=oI.insert(Wg,yt)}oI=oI.setSelection(Fi.near(oI.doc.resolve(Wg+1))),ig.dispatch(oI.scrollIntoView()),ig.focus()},Dl=()=>{var j,P;return!!((j=Jg.value)!=null&&j.isActive("orderedList")||(P=Jg.value)!=null&&P.isActive("bulletList"))},Po=j=>{var P;if(!(window.innerWidth<=480)){if(j.key!=="ArrowDown"&&(TI=null),F.value){if(j.key==="Escape"){j.preventDefault(),j.stopPropagation(),y.value=B.value;return}if(j.key==="Enter"){j.preventDefault(),j.stopPropagation(),Y.value>=0&&Y.value<K.value.length&&Dg(K.value[Y.value]);return}if(K.value.length&&(j.key==="ArrowDown"||j.key==="ArrowUp")){j.preventDefault(),j.stopPropagation();const ig=j.key==="ArrowDown"?1:-1;Y.value=(Y.value+ig+K.value.length)%K.value.length;return}}if(j.key==="Enter"&&j.shiftKey&&!(j.ctrlKey||j.metaKey)&&Dl()){j.preventDefault(),j.stopPropagation(),TI=null,(P=Jg.value)==null||P.commands.splitListItem("listItem");return}if(j.key==="ArrowDown"){const ig=nA();if(ig!=null&&ig.isLastItem&&ig.isAtEndOfItem&&ig.orderedListAfter>=ig.docSize){j.preventDefault(),j.stopPropagation();const Wg=Date.now();TI&&TI.pos===ig.cursorPos&&Wg-TI.timestamp<1200?(TI=null,Hl()):TI={pos:ig.cursorPos,timestamp:Wg};return}TI=null}!C.disableSendOnEnter&&j.key==="Enter"&&j.code&&!(j.shiftKey||j.ctrlKey||j.metaKey)&&(j.preventDefault(),j.stopPropagation(),Cg())}},_o=j=>{Ge()&&j.preventDefault()};return o.onMounted(()=>{var j,P;(P=(j=Jg==null?void 0:Jg.value)==null?void 0:j.view)!=null&&P.dom&&(l.value=Jg.value.view.dom,window.addEventListener("resize",AA),window.addEventListener("scroll",AA,!0),l.value.addEventListener("keydown",Po,{capture:!0}),l.value.addEventListener("contextmenu",_o))}),o.onBeforeUnmount(()=>{var j;(j=Jg==null?void 0:Jg.value)==null||j.destroy(),l.value&&(l.value.removeEventListener("keydown",Po,{capture:!0}),l.value.removeEventListener("contextmenu",_o)),w.value&&URL.revokeObjectURL(w.value),p.value.forEach(P=>URL.revokeObjectURL(P)),window.removeEventListener("resize",AA),window.removeEventListener("scroll",AA,!0)}),g({addSpanLink:lg,focus:pI,editor:Jg,emitAttachFiles:it}),(j,P)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{ref_key:"mainMentionAnchorRef",ref:s,class:o.normalizeClass(["editor-component",{"editor-component--mentions-open":F.value}])},[j.$slots.action&&!h.value?(o.openBlock(),o.createElementBlock("div",QII,[o.renderSlot(j.$slots,"action")])):o.createCommentVNode("",!0),C.activeAttachFile?(o.openBlock(),o.createBlock(Dd,{key:1,isWCUse:"",options:mg.value,translateY:"calc(-100% - 47px)",class:"mobile-item attach-file-popover"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button mobile-buttons"},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip},null,8,["name"])]),_:1},8,["type","size"])]),_:1},8,["options"])):o.createCommentVNode("",!0),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Zz),{key:2,class:"editor-content",editor:o.unref(Jg)},null,8,["editor"])),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(OII,{key:3,editor:o.unref(Jg)||null},null,8,["editor"])),C.activeAttachFile&&!h.value?(o.openBlock(),o.createBlock(EJ,{key:4,onFilesDropped:dg})):o.createCommentVNode("",!0),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",UII,[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button mobile-buttons smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[0]||(P[0]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.createVNode(o.unref(yf),{native:!0,onSelect:E})],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),o.withDirectives(o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button right mobile-buttons",onClick:Cg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRightFill,width:22,height:22,class:"content-editor__save"},null,8,["name"])]),_:1},8,["type","size"]),[[o.vShow,!M.value]])])),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",EII,[C.activeAttachFile?(o.openBlock(),o.createBlock(Dd,{key:0,isWCUse:"",options:$.value,translateY:"calc(-100% - 47px)"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button"},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])]),_:1},8,["options"])):o.createCommentVNode("",!0),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile,width:16,height:16},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[1]||(P[1]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.withDirectives(o.createVNode(o.unref(yf),{native:!0,onSelect:E},null,512),[[o.unref(Cd),jC,void 0,{bubble:!0}]])],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),C.activeSelectUser?(o.openBlock(),o.createBlock(JI,{key:1,type:o.unref(NI).ghost,class:"toolbar-button",size:o.unref(Le).small,onClick:Lg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).atSign,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])):o.createCommentVNode("",!0),o.createCommentVNode("",!0),o.createVNode(JI,{disabled:M.value,class:"toolbar-button right",size:o.unref(Le).small,onClick:Cg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRight,color:o.unref(Lb).white,width:16,height:16},null,8,["name","color"])]),_:1},8,["disabled","size"])])),h.value?(o.openBlock(),o.createBlock(Ap,{key:7,open:h.value,onClose:vC,"disable-close-on-outside-click":"",position:"center",width:"min(430px, calc(100vw - 32px))",height:"auto",class:"attach-modal-container"},{default:o.withCtx(()=>[o.createElementVNode("div",PII,[o.createVNode(EJ,{onFilesDropped:dg}),o.createElementVNode("div",_II,[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__close",onClick:vC},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).crossLarge},null,8,["name"])]),_:1},8,["type","size"])]),hg.value.length>0||Gg.value.length>0?(o.openBlock(),o.createElementBlock("div",$II,[o.createElementVNode("div",qII,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(hg.value,(ig,Wg)=>(o.openBlock(),o.createElementBlock("div",{key:`media-chunk-${Wg}`,class:o.normalizeClass(["attach-modal__media-grid",`attach-modal__media-grid-${ig.length}-item`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ig,Ug=>(o.openBlock(),o.createElementBlock("div",{key:Ug.id,class:"attach-modal__media-tile"},[Ug.isVideo?(o.openBlock(),o.createElementBlock("video",{key:0,draggable:"false",src:Ug.url,muted:"",playsinline:""},null,8,geI)):(o.openBlock(),o.createElementBlock("img",{key:1,draggable:"false",src:Ug.url,alt:Ug.file.name},null,8,IeI)),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__media-tile-remove",onClick:o.withModifiers(oI=>At("media",Ug.index),["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).trash,width:24,height:24},null,8,["name"])]),_:1},8,["type","size","onClick"])]))),128))],2))),128)),Gg.value.length?(o.openBlock(),o.createElementBlock("div",eeI,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Gg.value,ig=>(o.openBlock(),o.createElementBlock("div",{key:ig.id,class:"attach-modal__attachment"},[o.createElementVNode("div",CeI,[o.createVNode(Mg,{name:o.unref(ug).fileItem,width:18,height:18},null,8,["name"])]),o.createElementVNode("div",teI,[o.createElementVNode("div",ieI,[o.createElementVNode("span",AeI,o.toDisplayString(Rn(ig.file.name)),1),Xn(ig.file.name)?(o.openBlock(),o.createElementBlock("span",neI,o.toDisplayString(Xn(ig.file.name)),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",leI,o.toDisplayString(qt(ig.file.size)),1)]),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__attachment-remove",onClick:Wg=>At(ig.kind,ig.index)},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).trash,width:24,height:24},null,8,["name"])]),_:1},8,["type","size","onClick"])]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"modalMentionAnchorRef",ref:a,class:"attach-modal__editor"},[j.$slots.action?(o.openBlock(),o.createElementBlock("div",oeI,[o.renderSlot(j.$slots,"action")])):o.createCommentVNode("",!0),o.createVNode(o.unref(Zz),{class:"editor-content",editor:o.unref(Jg)},null,8,["editor"]),o.createElementVNode("div",seI,[o.createElementVNode("div",aeI,[o.createVNode(Dd,{isWCUse:"",disabled:!C.activeAttachFile,options:$.value,translateY:"calc(-100% - 47px)"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button",disabled:!C.activeAttachFile},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip,width:16,height:16},null,8,["name"])]),_:1},8,["type","size","disabled"])]),_:1},8,["disabled","options"]),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile,width:16,height:16},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[2]||(P[2]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.withDirectives(o.createVNode(o.unref(yf),{native:!0,onSelect:E},null,512),[[o.unref(Cd),jC,void 0,{bubble:!0}]])],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),C.activeSelectUser?(o.openBlock(),o.createBlock(JI,{key:0,type:o.unref(NI).ghost,class:"toolbar-button",size:o.unref(Le).small,onClick:Lg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).atSign,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])):o.createCommentVNode("",!0)]),o.createVNode(JI,{disabled:M.value,class:"toolbar-button right",size:o.unref(Le).small,onClick:Qg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRight,color:o.unref(Lb).white,width:16,height:16},null,8,["name","color"])]),_:1},8,["disabled","size"])])],512)])]),_:3},8,["open"])):o.createCommentVNode("",!0),u.value?(o.openBlock(),o.createBlock(Ap,{key:8,open:u.value,onClose:P[5]||(P[5]=ig=>u.value=!1),position:"center",width:"320px",height:"auto"},{default:o.withCtx(()=>[o.createElementVNode("div",deI,[P[10]||(P[10]=o.createElementVNode("div",{class:"camera-selection-header"},"Выберите действие",-1)),o.createElementVNode("div",ceI,[o.createVNode(JI,{type:o.unref(NI).outline,onClick:P[3]||(P[3]=ig=>FI("image")),class:"camera-selection-item"},{default:o.withCtx(()=>[...P[8]||(P[8]=[o.createTextVNode(" Сделать фото ",-1)])]),_:1},8,["type"]),o.createVNode(JI,{type:o.unref(NI).outline,onClick:P[4]||(P[4]=ig=>FI("video")),class:"camera-selection-item"},{default:o.withCtx(()=>[...P[9]||(P[9]=[o.createTextVNode(" Записать видео ",-1)])]),_:1},8,["type"])])])]),_:1},8,["open"])):o.createCommentVNode("",!0),o.createElementVNode("input",{ref:"pendingFileInputRef",type:"file",multiple:"",class:"attach-hidden-input",onChange:P[6]||(P[6]=ig=>$t(ig,!1))},null,544),o.createElementVNode("input",{ref:"pendingMediaInputRef",type:"file",accept:"image/*,video/*",multiple:"",class:"attach-hidden-input",onChange:P[7]||(P[7]=ig=>$t(ig,!0))},null,544)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:pg.value},[F.value&&K.value.length?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"mentionListRef",ref:d,class:"editor-component__mentions-portal"},[o.createVNode(NII,{items:K.value,"selected-index":Y.value,"is-fixed":"","position-style":m.value,"get-key":X,"get-label":z,"get-subtitle":L,"get-avatar-url":O,"get-avatar-initials":Ig,"get-is-online":Ag,onSelect:Dg},null,8,["items","selected-index","position-style"])],512)):o.createCommentVNode("",!0)],8,["to"]))],64))}}),reI=["data-testid"],meI=["data-testid"],qs="[Cropper][BaseCropper]",ueI=Tg(o.defineComponent({name:"BaseCropper",__name:"BaseCropper",props:{image:{},max:{default:3},min:{default:1},step:{default:.5}},emits:["unmount-scale"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.useTemplateRef("canvas"),A=o.useTemplateRef("container"),n=o.reactive({ctx:null,image:null,id:o.useId(),scale:1,position:{x:0,y:0},isDragging:!1,startX:0,startY:0,minScale:C.min,maxScale:C.max,stepScale:C.step});o.watch(()=>C.image,()=>{C.image&&h(C.image)});const l=()=>{i.value&&(n.ctx=i.value.getContext("2d")),s(),window.addEventListener("resize",s)},s=()=>{if(A.value){const{width:F,height:X}=A.value.getBoundingClientRect();i.value&&(i.value.width=F,i.value.height=X),n.image&&a()}},a=()=>{if(n.image){const F=n.ctx,X=i.value;F&&X&&(F.clearRect(0,0,X.width,X.height),F.drawImage(n.image,n.position.x,n.position.y,n.image.width*n.scale,n.image.height*n.scale))}},d=F=>new Promise(X=>setTimeout(X,F)),m=F=>["image/png","image/jpeg"].includes(F.type.toLowerCase()),u=F=>({fileName:F.name,fileType:F.type,fileSize:F.size,lastModified:F.lastModified,isScreenshotLike:m(F)}),h=F=>{const X=m(F)?6:3;let z=0;console.warn(`${qs} loadImage start`,{...u(F),maxRetries:X});const L=new FileReader;L.onload=async O=>{var Ig;console.warn(`${qs} FileReader load success`,{...u(F),attempt:z+1}),typeof((Ig=O.target)==null?void 0:Ig.result)=="string"&&(n.image=new Image,n.image.src=O.target.result,n.image.onload=async()=>{if(console.warn(`${qs} image decode success`,u(F)),await o.nextTick(),i.value&&n.image){const Ag=i.value.width,Q=i.value.height,$=n.image.width/n.image.height,mg=Ag/Q;$>mg?(n.image.width=Ag,n.image.height=Ag/$):(n.image.height=Q,n.image.width=Q*$),s(),n.position.x=(i.value.width-n.image.width)/2,n.position.y=(i.value.height-n.image.height)/2,a()}})},L.onerror=async()=>{if(console.warn(`${qs} FileReader load error`,{...u(F),attempt:z+1,maxRetries:X,error:L.error}),z>=X){try{console.warn(`${qs} fallback to detached file`,u(F));const Ig=await F.arrayBuffer(),Ag=new File([Ig],F.name,{type:F.type||"application/octet-stream",lastModified:F.lastModified});z+=1,console.warn(`${qs} retry readAsDataURL with detached file`,{...u(Ag),attempt:z+1}),L.readAsDataURL(Ag)}catch(Ig){console.error("Failed to load cropper image",{fileName:F.name,error:Ig})}return}z+=1;const O=(m(F)?180:120)*z;console.warn(`${qs} schedule FileReader retry`,{...u(F),attempt:z+1,retryDelay:O}),await d(O),L.readAsDataURL(F)},console.warn(`${qs} initial readAsDataURL`,u(F)),L.readAsDataURL(F)},Z=F=>{n.isDragging=!0,n.startX=F.clientX-n.position.x,n.startY=F.clientY-n.position.y,window.addEventListener("mousemove",G),window.addEventListener("mouseup",w)},G=F=>{if(!n.isDragging&&!i.value)return;let X=F.clientX-n.startX,z=F.clientY-n.startY;if(i.value&&n.image){const L=i.value.width-n.image.width*n.scale;n.image.width*n.scale<i.value.width?X=Math.min(Math.max(X,0),i.value.width-n.image.width*n.scale):(X>0&&(X=0),X<L&&(X=L));const O=i.value.height-n.image.height*n.scale;n.image.height*n.scale<i.value.height?z=Math.min(Math.max(z,0),i.value.height-n.image.height*n.scale):(z>0&&(z=0),z<O&&(z=O)),n.position.x=X,n.position.y=z}a()},w=()=>{n.isDragging=!1,window.removeEventListener("mousemove",G),window.removeEventListener("mouseup",w)},p=F=>Math.max(n.minScale,Math.min(F,n.maxScale)),B=F=>{if(i.value){const X=i.value.width/2,z=i.value.height/2;n.position.x=X-(X-n.position.x)*F,n.position.y=z-(z-n.position.y)*F}},y=F=>{const X=n.scale,z=n.scale+F.deltaY*-.001;if(X===p(z))return;n.scale=p(z);const L=z/X;B(L),t("unmount-scale",n.scale),a()};return g({cropImage:()=>{if(A.value){const{width:F,height:X}=A.value.getBoundingClientRect(),z=document.createElement("canvas");z.width=F,z.height=X;const L=z.getContext("2d");L&&n.image&&L.drawImage(n.image,n.position.x,n.position.y,n.image.width*n.scale,n.image.height*n.scale);const O=z.toDataURL("image/png"),Ig=atob(O.split(",")[1]),Ag=new ArrayBuffer(Ig.length),Q=new Uint8Array(Ag);for(let mg=0;mg<Ig.length;mg++)Q[mg]=Ig.charCodeAt(mg);const $=new Blob([Q],{type:"image/png"});return C.image?new File([$],C.image.name,{type:"image/png"}):null}return null},scalePlus:()=>{const F=n.scale+n.stepScale;n.scale=p(F),a()},scaleMinus:()=>{const F=n.scale-n.stepScale;n.scale=p(F),a()},setScale:F=>{const X=n.scale,L=F/X;n.scale=p(F),B(L),a()},startMove:Z,scaleImage:y}),o.onMounted(()=>{l(),C.image&&h(C.image)}),(F,X)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"container",ref:A,class:"base-cropper","data-testid":`BaseCropper-${n.id}`},[o.createElementVNode("canvas",{ref_key:"canvas",ref:i,class:"base-cropper__canvas","data-testid":`BaseCropper-${n.id}-canvas`,onMousedown:Z,onWheel:o.withModifiers(y,["prevent"])},null,40,meI)],8,reI))}}),[["__scopeId","data-v-8390bd52"]]),heI=e=>{const g=o.ref(e==null?void 0:e.defaultValue),I=e==null?void 0:e.min,C=e==null?void 0:e.max,t=e==null?void 0:e.step;o.watch(g,A=>{g.value=i(A)});const i=A=>Math.max(I,Math.min(A,C));return{value:g,min:I,max:C,step:t,getCorrectValue:i}},beI=(e,g)=>new File([e],g,{type:e.type}),ZeI=["data-testid"],GeI=["data-testid"],weI=["data-testid"],WeI=["data-testid"],peI=["data-testid"],BeI=["data-testid"],Vf=Tg(o.defineComponent({name:"ModalCroppedAvatar",__name:"ModalCroppedAvatar",props:{image:{},open:{type:Boolean},position:{default:"center"},width:{default:"650px"},height:{default:"auto"},disableCloseOnOutsideClick:{type:Boolean},isResetFocus:{type:Boolean},dataTestid:{}},emits:["unmount-close","unmount-save"],setup(e,{emit:g}){const I=e,C=g,{max:t,min:i,step:A,value:n}=heI({defaultValue:1,max:3,min:1,step:.1}),l=o.useId(),s=o.useTemplateRef("cropper"),a=o.reactive({openModal:!1});o.watch(n,()=>{s.value&&s.value.setScale(n.value)});const d=()=>{a.openModal=!1,C("unmount-close")},m=G=>{n.value=G},u=()=>{n.value=n.value-A},h=()=>{n.value=n.value+A},Z=()=>{if(s.value){const G=s.value.cropImage();if(G){const w=G.name,p=beI(G,w);C("unmount-save",p),d()}}};return o.onUnmounted(()=>{d()}),o.onMounted(()=>{I.open===void 0&&(a.openModal=I.open)}),(G,w)=>(o.openBlock(),o.createBlock(L0,o.mergeProps(I,{class:"modal-cropped-avatar","data-testid":`ModalCroppedAvatar-${o.unref(l)}`,onClose:d}),{default:o.withCtx(()=>[o.createElementVNode("div",{class:"modal-cropped-avatar__content","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content`},[o.createElementVNode("div",{class:"modal-cropped-avatar__title","data-testid":`ModalCroppedAvatar-${o.unref(l)}-title`}," Изменение фото профиля ",8,GeI),o.createElementVNode("div",{class:"modal-cropped-avatar__main","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-main`},[o.createElementVNode("div",{class:"modal-cropped-avatar__cropped","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-main-cropped`},[o.createVNode(ueI,{ref_key:"cropper",ref:s,image:e.image,max:o.unref(t),min:o.unref(i),step:o.unref(A),class:"modal-cropped-avatar__cropper",onUnmountScale:m},null,8,["image","max","min","step"]),o.createElementVNode("div",{class:"modal-cropped-avatar__tools","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-tools`},[o.createVNode(Mg,{name:o.unref(ug).minus,class:"modal-cropped-avatar__icon","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-iconMinus`,onClick:u},null,8,["name","data-testid"]),o.createVNode(wp,{max:o.unref(t),min:o.unref(i),step:o.unref(A),modelValue:o.unref(n),"onUpdate:modelValue":w[0]||(w[0]=p=>o.isRef(n)?n.value=p:null),"data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-Range`},null,8,["max","min","step","modelValue","data-testid"]),o.createVNode(Mg,{name:o.unref(ug).plus,class:"modal-cropped-avatar__icon","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-IconPlus`,onClick:h},null,8,["name","data-testid"])],8,peI)],8,WeI),o.createElementVNode("div",{class:"modal-cropped-avatar__buttons","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-buttons`},[o.createVNode(JI,{type:o.unref(NI).outline,class:"modal-cropped-avatar__button","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-ButtonCancel`,onClick:d},{default:o.withCtx(()=>[...w[1]||(w[1]=[o.createTextVNode(" Отменить ",-1)])]),_:1},8,["type","data-testid"]),o.createVNode(JI,{class:"modal-cropped-avatar__button","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-buttonSave`,onClick:Z},{default:o.withCtx(()=>[...w[2]||(w[2]=[o.createTextVNode(" Сохранить ",-1)])]),_:1},8,["data-testid"])],8,BeI)],8,weI)],8,ZeI)]),_:1},16,["data-testid"]))}}),[["__scopeId","data-v-65b5d91e"]]),Nf={install(e,g={enabled:!0}){if(!(g.enabled??!1)){console.info("[removeDataTestidPlugin] Plugin is disabled.");return}const C=t=>{t.removeAttribute("data-testid"),Array.from(t.children).forEach(C)};e.mixin({mounted(){C(this.$el)}})}},yeI=["src"],Mf=o.defineComponent({name:"ImagePreview",__name:"ImagePreview",props:{src:{}},emits:["error"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.reactive({isError:!1,rotate:0});o.watch(()=>C.src,()=>{i.isError=!1,i.rotate=0,o.nextTick(()=>{n()})});const A=o.ref(null),n=async()=>{try{if(!A.value||!C.src)return;const s=new Image;s.src=C.src,s.addEventListener("load",()=>{var Z;if(!A.value)return;const a=(Z=A.value)==null?void 0:Z.getContext("2d");if(!a)return;const d=s.width,m=s.height;let u=d,h=m;i.rotate%180!==0&&(u=m,h=d),A.value.width=u,A.value.height=h,a.save(),a.clearRect(0,0,u,h),a.translate(u/2,h/2),a.rotate(i.rotate*Math.PI/180),a.drawImage(s,-d/2,-m/2,d,m),a.restore()}),s.addEventListener("error",a=>{i.isError=!0,t("error",a)})}catch{t("error",new Event("error")),i.isError=!0}},l=async s=>{const a=Math.round(s/90)*90;i.rotate+=a,o.nextTick(()=>{n()})};return o.onMounted(()=>{o.nextTick(()=>{n()})}),g({rotateImage:l}),(s,a)=>i.isError?(o.openBlock(),o.createElementBlock("img",{key:1,src:o.unref(En)},null,8,yeI)):(o.openBlock(),o.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:A,class:"image-preview"},null,512))}}),PJ={Accordion:x1,Badges:ot,BreadCrumbs:Oy,Dialog:bW,DragAndDrop:O1,Card:Q1,Combobox:E1,Calendar:j1,Button:JI,Switch:bw,SelectList:Dr,Dropdown:oY,Textarea:nN,Filter:U1,Icon:Mg,Input:_1,InputNumber:i0,Picture:oN,PushNotification:sN,Scroll:eN,Search:b0,Modal:L0,Slider:IN,Checkbox:CN,Toggle:ap,UserMenu:AN,CopyIcon:aN,Loader:j0,FilterTag:dN,CircularProgress:cN,Popover:Dd,Table:rN,TableNew:bN,TableSimple:GN,TableRow:Gp,TableRowNew:ZN,TableTd:_0,TableTh:um,SectionTableRow:mN,HeadTableRow:E0,HeadTableRowNew:Wp,ScrollWrapper:P0,ScrollWrapperNew:iEg,Radio:uN,Tooltip:Hd,BaseFilter:hN,Range:wp,Tabs:wN,ContentEditor:Yf,ModalCroppedAvatar:Vf,Avatar:U0,TimePicker:ZW,SliderModal:sp,PdfPreview:Ol,ImagePreview:Mf,VideoPreview:T0,Skeleton:Zp},_J=Object.freeze(Object.defineProperty({__proto__:null,Accordion:x1,Avatar:U0,Badges:ot,BadgesTypeEnum:zI,BaseFilter:hN,BreadCrumbs:Oy,Button:JI,ButtonTypeEnum:NI,Calendar:j1,Card:Q1,Checkbox:CN,CheckboxCircularEnum:up,CheckboxSizeEnum:mp,CircularProgress:cN,ColorsEnum:Lb,Combobox:E1,ContentEditor:Yf,CopyIcon:aN,Dialog:bW,DragAndDrop:O1,Dropdown:oY,Filter:U1,FilterTag:dN,HeadTableRow:E0,HeadTableRowNew:Wp,Icon:Mg,IconNameEnum:ug,ImageExtensionsEnum:G0,ImagePreview:Mf,Input:_1,InputNumber:i0,InputTypeEnum:P1,Loader:j0,MenuTypeEnum:oe,MessageTypeEnum:bp,Modal:L0,ModalCroppedAvatar:Vf,PdfPreview:Ol,Picture:oN,Popover:Dd,PushNotification:sN,Radio:uN,Range:wp,Scroll:eN,ScrollWrapper:P0,Search:b0,SectionTableRow:mN,SelectList:Dr,SizesEnum:Le,Skeleton:Zp,Slider:IN,SliderModal:sp,Switch:bw,Table:rN,TableNew:bN,TableRow:Gp,TableRowNew:ZN,TableSimple:GN,TableTd:_0,TableTh:um,Tabs:wN,TextFieldEnum:MW,Textarea:nN,TextareaTypeEnum:hp,TimePicker:ZW,Toggle:ap,Tooltip:Hd,UserMenu:AN,VideoExtensionsEnum:w0,VideoPreview:T0,default:{install:e=>{Object.keys(PJ).forEach(g=>{e.component("Y"+g,PJ[g])})}},getFirstTime:JS,getLastTime:VW,vuePluginRemoveTestid:Nf},Symbol.toStringTag,{value:"Module"})),YeI={install(e){for(const g in _J){const I=_J[g];e.use(I).use(Nf,{enabled:!1})}}};gg.Accordion=x1,gg.Avatar=U0,gg.Badges=ot,gg.BadgesTypeEnum=zI,gg.BaseFilter=hN,gg.BreadCrumbs=Oy,gg.Button=JI,gg.ButtonTypeEnum=NI,gg.Calendar=j1,gg.Card=Q1,gg.Checkbox=CN,gg.CheckboxCircularEnum=up,gg.CheckboxSizeEnum=mp,gg.CircularProgress=cN,gg.ColorsEnum=Lb,gg.Combobox=E1,gg.ContentEditor=Yf,gg.CopyIcon=aN,gg.Dialog=bW,gg.DragAndDrop=O1,gg.Dropdown=oY,gg.Filter=U1,gg.FilterTag=dN,gg.HeadTableRow=E0,gg.HeadTableRowNew=Wp,gg.Icon=Mg,gg.IconNameEnum=ug,gg.ImageExtensionsEnum=G0,gg.ImagePreview=Mf,gg.Input=_1,gg.InputNumber=i0,gg.InputTypeEnum=P1,gg.Loader=j0,gg.MenuTypeEnum=oe,gg.MessageTypeEnum=bp,gg.Modal=L0,gg.ModalCroppedAvatar=Vf,gg.OnClickOutside=lU,gg.OnLongPress=cU,gg.PdfPreview=Ol,gg.Picture=oN,gg.Popover=Dd,gg.PushNotification=sN,gg.Radio=uN,gg.Range=wp,gg.Scroll=eN,gg.ScrollWrapper=P0,gg.Search=b0,gg.SectionTableRow=mN,gg.SelectList=Dr,gg.SizesEnum=Le,gg.Skeleton=Zp,gg.Slider=IN,gg.SliderModal=sp,gg.Switch=bw,gg.Table=rN,gg.TableNew=bN,gg.TableRow=Gp,gg.TableRowNew=ZN,gg.TableSimple=GN,gg.TableTd=_0,gg.TableTh=um,gg.Tabs=wN,gg.TextFieldEnum=MW,gg.Textarea=nN,gg.TextareaTypeEnum=hp,gg.TimePicker=ZW,gg.Toggle=ap,gg.Tooltip=Hd,gg.UseActiveElement=rU,gg.UseBattery=mU,gg.UseBrowserLocation=uU,gg.UseClipboard=hU,gg.UseColorMode=NU,gg.UseDark=MU,gg.UseDeviceMotion=fU,gg.UseDeviceOrientation=RU,gg.UseDevicePixelRatio=XU,gg.UseDevicesList=HU,gg.UseDocumentVisibility=DU,gg.UseDraggable=SU,gg.UseElementBounding=KU,gg.UseElementSize=FU,gg.UseElementVisibility=LU,gg.UseEyeDropper=vU,gg.UseFullscreen=jU,gg.UseGeolocation=xU,gg.UseIdle=OU,gg.UseImage=PU,gg.UseMouse=qU,gg.UseMouseInElement=gE,gg.UseMousePressed=IE,gg.UseNetwork=eE,gg.UseNow=CE,gg.UseObjectUrl=tE,gg.UseOffsetPagination=iE,gg.UseOnline=AE,gg.UsePageLeave=nE,gg.UsePointer=lE,gg.UsePointerLock=oE,gg.UsePreferredColorScheme=sE,gg.UsePreferredContrast=aE,gg.UsePreferredDark=dE,gg.UsePreferredLanguages=cE,gg.UsePreferredReducedMotion=rE,gg.UseScreenSafeArea=bE,gg.UseTimeAgo=BE,gg.UseTimestamp=yE,gg.UseVirtualList=YE,gg.UseWindowFocus=VE,gg.UseWindowSize=NE,gg.UserMenu=AN,gg.VOnClickOutside=Cd,gg.VOnLongPress=XX,gg.VideoExtensionsEnum=w0,gg.VideoPreview=T0,gg.VueToolsCore=bTg,gg.arrow=Xvg,gg.autoPlacement=DS,gg.autoUpdate=XS,gg.computePosition=SS,gg.default=YeI,gg.detectOverflow=pvg,gg.flip=yvg,gg.getFirstTime=JS,gg.getLastTime=VW,gg.getOverflowAncestors=em,gg.hide=Vvg,gg.inline=Mvg,gg.limitShift=fvg,gg.offset=HS,gg.platform=fS,gg.shift=Bvg,gg.size=Yvg,gg.useFloating=FS,gg.useSearch=LS,gg.vElementHover=kU,gg.vElementSize=JU,gg.vElementVisibility=TU,gg.vInfiniteScroll=_U,gg.vIntersectionObserver=$U,gg.vOnClickOutside=Cd,gg.vOnKeyStroke=sU,gg.vOnLongPress=XX,gg.vResizeObserver=mE,gg.vScroll=ZE,gg.vScrollLock=pE,gg.vuePluginRemoveTestid=Nf,Object.defineProperties(gg,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1564
+ `);if(ig===-1)return null;const Wg=j.slice(ig+1),Ug=Wg.match(P);return Ug?{index:ig+1,text:Wg,data:{match:Ug}}:null},Bt=({listTypeName:j,find:P,getAttributes:ig})=>new hb({find:P,handler:({state:Wg,range:Ug,match:oI})=>{var w2,RG;const yt=Wg.schema.nodes[j];if(!yt)return null;const Sl=Ug.from,$o=Sl-1;if(((w2=Wg.doc.resolve(Sl).nodeBefore)==null?void 0:w2.type.name)!=="hardBreak")return null;const qo=(ig==null?void 0:ig((RG=oI.data)==null?void 0:RG.match))??{};let uC=Wg.tr.delete(Ug.from,Ug.to);uC=uC.delete($o,$o+1);try{uC=uC.split($o)}catch{return null}const Kf=Math.min($o+2,uC.doc.content.size),Oa=uC.doc.resolve(Kf).blockRange(),G2=Oa&&Z_g(Oa,yt,qo);if(!G2)return null;uC=uC.wrap(Oa,G2);const kf=Math.min($o+4,uC.doc.content.size);uC=uC.setSelection(Fi.near(uC.doc.resolve(kf)))}}),jA=gC.create({name:"contentEditorListInputRules",addInputRules(){const j=this.editor.schema.nodes.bulletList;return j?[Ud({find:Hn,type:j}),Bt({listTypeName:"bulletList",find:P=>vA(P,TA)}),Bt({listTypeName:"orderedList",find:P=>vA(P,Eo),getAttributes:P=>({start:Number(P[1])})})]:[]}}),Jg=m_g({extensions:[eqg.configure({link:!1,heading:!1,blockquote:!1,codeBlock:!1}),u$g.configure({openOnClick:!1,HTMLAttributes:{class:"link"}}),Cqg.configure({placeholder:"Начните печатать...",emptyEditorClass:"is-editor-empty"}),Uo,jA],content:t.value,editorProps:{handlePaste(j,P){const ig=P.clipboardData;return ig&&ig.files.length>0&&C.activeAttachFile?(P.preventDefault(),P.stopPropagation(),ZI||(ZI=!0,VC(ig.files,!0),setTimeout(()=>{ZI=!1},200)),!0):!1}},onUpdate:({editor:j})=>{if(t.value=j.getHTML(),C.activeSelectUser){const{$from:P}=j.state.selection,ig=Math.max(0,P.parentOffset-50),Ug=P.parent.textBetween(ig,P.parentOffset,null,"").match(/@([^\s]*)$/);if(Ug){const oI=Ug[1].toLowerCase();B.value!==oI&&(Y.value=0),B.value=oI,n("mention-change",oI)}else B.value=null,y.value=null,n("mention-change",null)}},parseOptions:{preserveWhitespace:!0}});o.watch(t,j=>{Jg!=null&&Jg.value&&j!==Jg.value.getHTML()&&Jg.value.commands.setContent(j??"",{parseOptions:{preserveWhitespace:!0}})}),o.watch(K,j=>{if(!j.length){Y.value=0,m.value={};return}Y.value>=j.length&&(Y.value=j.length-1),F.value&&o.nextTick(()=>{CI(),Og()})}),o.watch(Y,()=>{F.value&&o.nextTick(()=>{CI(),Og()})}),o.watch(F,j=>{if(!j){Y.value=0,m.value={};return}y.value=null,o.nextTick(()=>{CI(),Og()})}),o.watch(()=>h.value,()=>{F.value&&o.nextTick(()=>CI())});const E=j=>{Jg!=null&&Jg.value&&Jg.value.chain().focus().insertContent(j.i).run()},eg=async(j=!1,P)=>{if(!(Jg!=null&&Jg.value))return;const ig=document.createElement("input");ig.type="file",P?(P==="video"?ig.accept="video/*":P==="image"?ig.accept="image/*":ig.accept="image/*,video/*",ig.capture="environment",ig.multiple=!1):(ig.multiple=!0,j&&(ig.accept="image/*,video/*")),ig.onchange=()=>{if(ig!=null&&ig.files){if(kI()){it(ig.files,j||!!P);return}VC(ig.files,j)}},ig.click()},dg=j=>{console.warn(`${$s} fileDropped event received`,j.files.map(P=>YC(P))),VC(j.files,j.onlyMedia)},Qg=()=>{Jg!=null&&Jg.value&&(n("unmount-send",{content:Jg.value.getHTML(),files:Z.value.length?ye(Z.value):void 0,mediaFiles:G.value.length?ye(G.value):void 0}),h.value=!1,Yi(),jC(),Jg.value.chain().focus())},Cg=()=>{if(Jg!=null&&Jg.value){if(f.value){Qg();return}n("unmount-send",{content:Jg.value.getHTML()}),Jg.value.chain().focus()}},lg=(j,P)=>{if(!(Jg!=null&&Jg.value))return;const{$from:ig}=Jg.value.state.selection,Wg=Math.max(0,ig.parentOffset-50),oI=ig.parent.textBetween(Wg,ig.parentOffset,null,"").match(/@([^\s]*)$/);if(oI){const yt=ig.start()+Wg+(oI.index||0);Jg.value.chain().focus().insertContentAt({from:yt,to:ig.pos},{type:"spanNode",attrs:{content:j,class:"link",...P}}).run()}else Jg.value.chain().focus().insertContent({type:"spanNode",attrs:{content:j,class:"link",...P}}).run()},Ng=()=>{B.value=null,y.value=null,Y.value=0,n("mention-change",null)},Dg=j=>{var Wg,Ug,oI;const P=((Wg=C.mentionConfig)==null?void 0:Wg.getInsertLabel)??C.mentionInsertLabel;if(!P)return;const ig=P(j);ig&&(lg(ig,(oI=((Ug=C.mentionConfig)==null?void 0:Ug.getInsertAttrs)??C.mentionInsertAttrs)==null?void 0:oI(j)),Ng())},Lg=()=>{if(!(Jg!=null&&Jg.value))return;const{$from:j}=Jg.value.state.selection,P=Math.max(0,j.parentOffset-50),Wg=j.parent.textBetween(P,j.parentOffset,null,"").match(/@([^\s]*)$/);if(Wg){const Ug=j.start()+P+(Wg.index||0);Jg.value.chain().focus().deleteRange({from:Ug,to:j.pos}).run()}else Jg.value.chain().focus().insertContent("@").run()},pI=()=>{Jg!=null&&Jg.value&&Jg.value.chain().focus()},ne=(j,P=300,ig=260)=>{if(!j)return;const Wg=j.getBoundingClientRect(),Ug=window.innerWidth,oI=window.innerHeight;A.value.vertical=Wg.bottom+ig>oI?"top":"bottom",A.value.horizontal=Wg.left+P>Ug?"right":"left"},xA=j=>{if(i.value=!i.value,i.value){const P=j.currentTarget;o.nextTick(()=>{ne(P)})}},jC=()=>{i.value=!1},AA=()=>{const j=document.querySelector(".toolbar-button.smile-button");i.value&&j&&ne(j),F.value&&CI()},nA=()=>{if(!Jg.value)return null;const{selection:j,doc:P}=Jg.value.state;if(!j.empty)return null;const{$from:ig}=j;let Wg=-1,Ug=-1;for(let qo=ig.depth;qo>0;qo-=1){const uC=ig.node(qo);if(Wg===-1&&uC.type.name==="listItem"&&(Wg=qo),uC.type.name==="orderedList"){Ug=qo;break}}if(Wg===-1||Ug===-1)return null;const oI=ig.node(Ug),yt=ig.node(Wg),Sl=ig.index(Ug),$o=ig.after(Ug),Z2=ig.parent.isTextblock&&ig.parentOffset===ig.parent.content.size&&ig.index(Wg)===yt.childCount-1;return{cursorPos:ig.pos,docSize:P.content.size,isLastItem:Sl===oI.childCount-1,isAtEndOfItem:Z2,orderedListAfter:$o}},Hl=()=>{if(!Jg.value)return;const j=nA();if(!j)return;const{state:P,view:ig}=Jg.value,Wg=j.orderedListAfter,Ug=P.doc.resolve(Wg).nodeAfter;let oI=P.tr;if(!Ug||Ug.type.name!=="paragraph"){const yt=P.schema.nodes.paragraph.create();oI=oI.insert(Wg,yt)}oI=oI.setSelection(Fi.near(oI.doc.resolve(Wg+1))),ig.dispatch(oI.scrollIntoView()),ig.focus()},Dl=()=>{var j,P;return!!((j=Jg.value)!=null&&j.isActive("orderedList")||(P=Jg.value)!=null&&P.isActive("bulletList"))},Po=j=>{var P;if(!(window.innerWidth<=480)){if(j.key!=="ArrowDown"&&(TI=null),F.value){if(j.key==="Escape"){j.preventDefault(),j.stopPropagation(),y.value=B.value;return}if(j.key==="Enter"){j.preventDefault(),j.stopPropagation(),Y.value>=0&&Y.value<K.value.length&&Dg(K.value[Y.value]);return}if(K.value.length&&(j.key==="ArrowDown"||j.key==="ArrowUp")){j.preventDefault(),j.stopPropagation();const ig=j.key==="ArrowDown"?1:-1;Y.value=(Y.value+ig+K.value.length)%K.value.length;return}}if(j.key==="Enter"&&j.shiftKey&&!(j.ctrlKey||j.metaKey)&&Dl()){j.preventDefault(),j.stopPropagation(),TI=null,(P=Jg.value)==null||P.commands.splitListItem("listItem");return}if(j.key==="ArrowDown"){const ig=nA();if(ig!=null&&ig.isLastItem&&ig.isAtEndOfItem&&ig.orderedListAfter>=ig.docSize){j.preventDefault(),j.stopPropagation();const Wg=Date.now();TI&&TI.pos===ig.cursorPos&&Wg-TI.timestamp<1200?(TI=null,Hl()):TI={pos:ig.cursorPos,timestamp:Wg};return}TI=null}!C.disableSendOnEnter&&j.key==="Enter"&&j.code&&!(j.shiftKey||j.ctrlKey||j.metaKey)&&(j.preventDefault(),j.stopPropagation(),Cg())}},_o=j=>{Ge()&&j.preventDefault()};return o.onMounted(()=>{var j,P;(P=(j=Jg==null?void 0:Jg.value)==null?void 0:j.view)!=null&&P.dom&&(l.value=Jg.value.view.dom,window.addEventListener("resize",AA),window.addEventListener("scroll",AA,!0),l.value.addEventListener("keydown",Po,{capture:!0}),l.value.addEventListener("contextmenu",_o))}),o.onBeforeUnmount(()=>{var j;(j=Jg==null?void 0:Jg.value)==null||j.destroy(),l.value&&(l.value.removeEventListener("keydown",Po,{capture:!0}),l.value.removeEventListener("contextmenu",_o)),w.value&&URL.revokeObjectURL(w.value),p.value.forEach(P=>URL.revokeObjectURL(P)),window.removeEventListener("resize",AA),window.removeEventListener("scroll",AA,!0)}),g({addSpanLink:lg,focus:pI,editor:Jg,emitAttachFiles:it}),(j,P)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{ref_key:"mainMentionAnchorRef",ref:s,class:o.normalizeClass(["editor-component",{"editor-component--mentions-open":F.value}])},[j.$slots.action&&!h.value?(o.openBlock(),o.createElementBlock("div",QII,[o.renderSlot(j.$slots,"action")])):o.createCommentVNode("",!0),C.activeAttachFile?(o.openBlock(),o.createBlock(Dd,{key:1,isWCUse:"",options:mg.value,translateY:"calc(-100% - 47px)",class:"mobile-item attach-file-popover"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button mobile-buttons"},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip},null,8,["name"])]),_:1},8,["type","size"])]),_:1},8,["options"])):o.createCommentVNode("",!0),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Zz),{key:2,class:"editor-content",editor:o.unref(Jg)},null,8,["editor"])),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(OII,{key:3,editor:o.unref(Jg)||null},null,8,["editor"])),C.activeAttachFile&&!h.value?(o.openBlock(),o.createBlock(EJ,{key:4,onFilesDropped:dg})):o.createCommentVNode("",!0),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",UII,[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button mobile-buttons smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[0]||(P[0]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.createVNode(o.unref(yf),{native:!0,onSelect:E})],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),o.withDirectives(o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button right mobile-buttons",onClick:Cg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRightFill,width:22,height:22,class:"content-editor__save"},null,8,["name"])]),_:1},8,["type","size"]),[[o.vShow,!M.value]])])),h.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",EII,[C.activeAttachFile?(o.openBlock(),o.createBlock(Dd,{key:0,isWCUse:"",options:$.value,translateY:"calc(-100% - 47px)"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button"},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])]),_:1},8,["options"])):o.createCommentVNode("",!0),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile,width:16,height:16},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[1]||(P[1]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.withDirectives(o.createVNode(o.unref(yf),{native:!0,onSelect:E},null,512),[[o.unref(Cd),jC,void 0,{bubble:!0}]])],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),C.activeSelectUser?(o.openBlock(),o.createBlock(JI,{key:1,type:o.unref(NI).ghost,class:"toolbar-button",size:o.unref(Le).small,onClick:Lg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).atSign,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])):o.createCommentVNode("",!0),o.createCommentVNode("",!0),o.createVNode(JI,{disabled:M.value,class:"toolbar-button right",size:o.unref(Le).small,onClick:Cg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRight,color:o.unref(Lb).white,width:16,height:16},null,8,["name","color"])]),_:1},8,["disabled","size"])])),h.value?(o.openBlock(),o.createBlock(Ap,{key:7,open:h.value,onClose:vC,"disable-close-on-outside-click":"",position:"center",width:"min(430px, calc(100vw - 32px))",height:"auto",class:"attach-modal-container"},{default:o.withCtx(()=>[o.createElementVNode("div",PII,[o.createVNode(EJ,{onFilesDropped:dg}),o.createElementVNode("div",_II,[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__close",onClick:vC},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).crossLarge},null,8,["name"])]),_:1},8,["type","size"])]),hg.value.length>0||Gg.value.length>0?(o.openBlock(),o.createElementBlock("div",$II,[o.createElementVNode("div",qII,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(hg.value,(ig,Wg)=>(o.openBlock(),o.createElementBlock("div",{key:`media-chunk-${Wg}`,class:o.normalizeClass(["attach-modal__media-grid",`attach-modal__media-grid-${ig.length}-item`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ig,Ug=>(o.openBlock(),o.createElementBlock("div",{key:Ug.id,class:"attach-modal__media-tile"},[Ug.isVideo?(o.openBlock(),o.createElementBlock("video",{key:0,draggable:"false",src:Ug.url,muted:"",playsinline:""},null,8,geI)):(o.openBlock(),o.createElementBlock("img",{key:1,draggable:"false",src:Ug.url,alt:Ug.file.name},null,8,IeI)),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__media-tile-remove",onClick:o.withModifiers(oI=>At("media",Ug.index),["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).trash,width:24,height:24},null,8,["name"])]),_:1},8,["type","size","onClick"])]))),128))],2))),128)),Gg.value.length?(o.openBlock(),o.createElementBlock("div",eeI,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Gg.value,ig=>(o.openBlock(),o.createElementBlock("div",{key:ig.id,class:"attach-modal__attachment"},[o.createElementVNode("div",CeI,[o.createVNode(Mg,{name:o.unref(ug).fileItem,width:18,height:18},null,8,["name"])]),o.createElementVNode("div",teI,[o.createElementVNode("div",ieI,[o.createElementVNode("span",AeI,o.toDisplayString(Rn(ig.file.name)),1),Xn(ig.file.name)?(o.openBlock(),o.createElementBlock("span",neI,o.toDisplayString(Xn(ig.file.name)),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",leI,o.toDisplayString(qt(ig.file.size)),1)]),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"attach-modal__attachment-remove",onClick:Wg=>At(ig.kind,ig.index)},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).trash,width:24,height:24},null,8,["name"])]),_:1},8,["type","size","onClick"])]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"modalMentionAnchorRef",ref:a,class:"attach-modal__editor"},[j.$slots.action?(o.openBlock(),o.createElementBlock("div",oeI,[o.renderSlot(j.$slots,"action")])):o.createCommentVNode("",!0),o.createVNode(o.unref(Zz),{class:"editor-content",editor:o.unref(Jg)},null,8,["editor"]),o.createElementVNode("div",seI,[o.createElementVNode("div",aeI,[o.createVNode(Dd,{isWCUse:"",disabled:!C.activeAttachFile,options:$.value,translateY:"calc(-100% - 47px)"},{trigger:o.withCtx(()=>[o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button attach-file-button",disabled:!C.activeAttachFile},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).paperClip,width:16,height:16},null,8,["name"])]),_:1},8,["type","size","disabled"])]),_:1},8,["disabled","options"]),o.createVNode(JI,{type:o.unref(NI).ghost,size:o.unref(Le).small,class:"toolbar-button smile-button",onClick:o.withModifiers(xA,["stop"])},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).smile,width:16,height:16},null,8,["name"]),o.withDirectives(o.createElementVNode("div",{onClick:P[2]||(P[2]=o.withModifiers(()=>{},["stop"])),class:o.normalizeClass(Q.value)},[o.withDirectives(o.createVNode(o.unref(yf),{native:!0,onSelect:E},null,512),[[o.unref(Cd),jC,void 0,{bubble:!0}]])],2),[[o.vShow,i.value]])]),_:1},8,["type","size"]),C.activeSelectUser?(o.openBlock(),o.createBlock(JI,{key:0,type:o.unref(NI).ghost,class:"toolbar-button",size:o.unref(Le).small,onClick:Lg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).atSign,width:16,height:16},null,8,["name"])]),_:1},8,["type","size"])):o.createCommentVNode("",!0)]),o.createVNode(JI,{disabled:M.value,class:"toolbar-button right",size:o.unref(Le).small,onClick:Qg},{default:o.withCtx(()=>[o.createVNode(Mg,{name:o.unref(ug).planeRight,color:o.unref(Lb).white,width:16,height:16},null,8,["name","color"])]),_:1},8,["disabled","size"])])],512)])]),_:3},8,["open"])):o.createCommentVNode("",!0),u.value?(o.openBlock(),o.createBlock(Ap,{key:8,open:u.value,onClose:P[5]||(P[5]=ig=>u.value=!1),position:"center",width:"320px",height:"auto"},{default:o.withCtx(()=>[o.createElementVNode("div",deI,[P[10]||(P[10]=o.createElementVNode("div",{class:"camera-selection-header"},"Выберите действие",-1)),o.createElementVNode("div",ceI,[o.createVNode(JI,{type:o.unref(NI).outline,onClick:P[3]||(P[3]=ig=>FI("image")),class:"camera-selection-item"},{default:o.withCtx(()=>[...P[8]||(P[8]=[o.createTextVNode(" Сделать фото ",-1)])]),_:1},8,["type"]),o.createVNode(JI,{type:o.unref(NI).outline,onClick:P[4]||(P[4]=ig=>FI("video")),class:"camera-selection-item"},{default:o.withCtx(()=>[...P[9]||(P[9]=[o.createTextVNode(" Записать видео ",-1)])]),_:1},8,["type"])])])]),_:1},8,["open"])):o.createCommentVNode("",!0),o.createElementVNode("input",{ref:"pendingFileInputRef",type:"file",multiple:"",class:"attach-hidden-input",onChange:P[6]||(P[6]=ig=>$t(ig,!1))},null,544),o.createElementVNode("input",{ref:"pendingMediaInputRef",type:"file",accept:"image/*,video/*",multiple:"",class:"attach-hidden-input",onChange:P[7]||(P[7]=ig=>$t(ig,!0))},null,544)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:pg.value},[F.value&&K.value.length?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"mentionListRef",ref:d,class:"editor-component__mentions-portal"},[o.createVNode(NII,{items:K.value,"selected-index":Y.value,"is-fixed":"","position-style":m.value,"get-key":X,"get-label":z,"get-subtitle":L,"get-avatar-url":O,"get-avatar-initials":Ig,"get-is-online":Ag,onSelect:Dg},null,8,["items","selected-index","position-style"])],512)):o.createCommentVNode("",!0)],8,["to"]))],64))}}),reI=["data-testid"],meI=["data-testid"],qs="[Cropper][BaseCropper]",ueI=Tg(o.defineComponent({name:"BaseCropper",__name:"BaseCropper",props:{image:{},max:{default:3},min:{default:1},step:{default:.5}},emits:["unmount-scale"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.useTemplateRef("canvas"),A=o.useTemplateRef("container"),n=o.reactive({ctx:null,image:null,id:o.useId(),scale:1,position:{x:0,y:0},isDragging:!1,startX:0,startY:0,minScale:C.min,maxScale:C.max,stepScale:C.step});o.watch(()=>C.image,()=>{C.image&&h(C.image)});const l=()=>{i.value&&(n.ctx=i.value.getContext("2d")),s(),window.addEventListener("resize",s)},s=()=>{if(A.value){const{width:F,height:X}=A.value.getBoundingClientRect();i.value&&(i.value.width=F,i.value.height=X),n.image&&a()}},a=()=>{if(n.image){const F=n.ctx,X=i.value;F&&X&&(F.clearRect(0,0,X.width,X.height),F.drawImage(n.image,n.position.x,n.position.y,n.image.width*n.scale,n.image.height*n.scale))}},d=F=>new Promise(X=>setTimeout(X,F)),m=F=>["image/png","image/jpeg"].includes(F.type.toLowerCase()),u=F=>({fileName:F.name,fileType:F.type,fileSize:F.size,lastModified:F.lastModified,isScreenshotLike:m(F)}),h=F=>{const X=m(F)?6:3;let z=0;console.warn(`${qs} loadImage start`,{...u(F),maxRetries:X});const L=new FileReader;L.onload=async O=>{var Ig;console.warn(`${qs} FileReader load success`,{...u(F),attempt:z+1}),typeof((Ig=O.target)==null?void 0:Ig.result)=="string"&&(n.image=new Image,n.image.src=O.target.result,n.image.onload=async()=>{if(console.warn(`${qs} image decode success`,u(F)),await o.nextTick(),i.value&&n.image){const Ag=i.value.width,Q=i.value.height,$=n.image.width/n.image.height,mg=Ag/Q;$>mg?(n.image.width=Ag,n.image.height=Ag/$):(n.image.height=Q,n.image.width=Q*$),s(),n.position.x=(i.value.width-n.image.width)/2,n.position.y=(i.value.height-n.image.height)/2,a()}})},L.onerror=async()=>{if(console.warn(`${qs} FileReader load error`,{...u(F),attempt:z+1,maxRetries:X,error:L.error}),z>=X){try{console.warn(`${qs} fallback to detached file`,u(F));const Ig=await F.arrayBuffer(),Ag=new File([Ig],F.name,{type:F.type||"application/octet-stream",lastModified:F.lastModified});z+=1,console.warn(`${qs} retry readAsDataURL with detached file`,{...u(Ag),attempt:z+1}),L.readAsDataURL(Ag)}catch(Ig){console.error("Failed to load cropper image",{fileName:F.name,error:Ig})}return}z+=1;const O=(m(F)?180:120)*z;console.warn(`${qs} schedule FileReader retry`,{...u(F),attempt:z+1,retryDelay:O}),await d(O),L.readAsDataURL(F)},console.warn(`${qs} initial readAsDataURL`,u(F)),L.readAsDataURL(F)},Z=F=>{n.isDragging=!0,n.startX=F.clientX-n.position.x,n.startY=F.clientY-n.position.y,window.addEventListener("mousemove",G),window.addEventListener("mouseup",w)},G=F=>{if(!n.isDragging&&!i.value)return;let X=F.clientX-n.startX,z=F.clientY-n.startY;if(i.value&&n.image){const L=i.value.width-n.image.width*n.scale;n.image.width*n.scale<i.value.width?X=Math.min(Math.max(X,0),i.value.width-n.image.width*n.scale):(X>0&&(X=0),X<L&&(X=L));const O=i.value.height-n.image.height*n.scale;n.image.height*n.scale<i.value.height?z=Math.min(Math.max(z,0),i.value.height-n.image.height*n.scale):(z>0&&(z=0),z<O&&(z=O)),n.position.x=X,n.position.y=z}a()},w=()=>{n.isDragging=!1,window.removeEventListener("mousemove",G),window.removeEventListener("mouseup",w)},p=F=>Math.max(n.minScale,Math.min(F,n.maxScale)),B=F=>{if(i.value){const X=i.value.width/2,z=i.value.height/2;n.position.x=X-(X-n.position.x)*F,n.position.y=z-(z-n.position.y)*F}},y=F=>{const X=n.scale,z=n.scale+F.deltaY*-.001;if(X===p(z))return;n.scale=p(z);const L=z/X;B(L),t("unmount-scale",n.scale),a()};return g({cropImage:()=>{if(A.value){const{width:F,height:X}=A.value.getBoundingClientRect(),z=document.createElement("canvas");z.width=F,z.height=X;const L=z.getContext("2d");L&&n.image&&L.drawImage(n.image,n.position.x,n.position.y,n.image.width*n.scale,n.image.height*n.scale);const O=z.toDataURL("image/png"),Ig=atob(O.split(",")[1]),Ag=new ArrayBuffer(Ig.length),Q=new Uint8Array(Ag);for(let mg=0;mg<Ig.length;mg++)Q[mg]=Ig.charCodeAt(mg);const $=new Blob([Q],{type:"image/png"});return C.image?new File([$],C.image.name,{type:"image/png"}):null}return null},scalePlus:()=>{const F=n.scale+n.stepScale;n.scale=p(F),a()},scaleMinus:()=>{const F=n.scale-n.stepScale;n.scale=p(F),a()},setScale:F=>{const X=n.scale,L=F/X;n.scale=p(F),B(L),a()},startMove:Z,scaleImage:y}),o.onMounted(()=>{l(),C.image&&h(C.image)}),(F,X)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"container",ref:A,class:"base-cropper","data-testid":`BaseCropper-${n.id}`},[o.createElementVNode("canvas",{ref_key:"canvas",ref:i,class:"base-cropper__canvas","data-testid":`BaseCropper-${n.id}-canvas`,onMousedown:Z,onWheel:o.withModifiers(y,["prevent"])},null,40,meI)],8,reI))}}),[["__scopeId","data-v-8390bd52"]]),heI=e=>{const g=o.ref(e==null?void 0:e.defaultValue),I=e==null?void 0:e.min,C=e==null?void 0:e.max,t=e==null?void 0:e.step;o.watch(g,A=>{g.value=i(A)});const i=A=>Math.max(I,Math.min(A,C));return{value:g,min:I,max:C,step:t,getCorrectValue:i}},beI=(e,g)=>new File([e],g,{type:e.type}),ZeI=["data-testid"],GeI=["data-testid"],weI=["data-testid"],WeI=["data-testid"],peI=["data-testid"],BeI=["data-testid"],Vf=Tg(o.defineComponent({name:"ModalCroppedAvatar",__name:"ModalCroppedAvatar",props:{image:{},open:{type:Boolean},position:{default:"center"},width:{default:"650px"},height:{default:"auto"},disableCloseOnOutsideClick:{type:Boolean},isResetFocus:{type:Boolean},dataTestid:{}},emits:["unmount-close","unmount-save"],setup(e,{emit:g}){const I=e,C=g,{max:t,min:i,step:A,value:n}=heI({defaultValue:1,max:3,min:1,step:.1}),l=o.useId(),s=o.useTemplateRef("cropper"),a=o.reactive({openModal:!1});o.watch(n,()=>{s.value&&s.value.setScale(n.value)});const d=()=>{a.openModal=!1,C("unmount-close")},m=G=>{n.value=G},u=()=>{n.value=n.value-A},h=()=>{n.value=n.value+A},Z=()=>{if(s.value){const G=s.value.cropImage();if(G){const w=G.name,p=beI(G,w);C("unmount-save",p),d()}}};return o.onUnmounted(()=>{d()}),o.onMounted(()=>{I.open===void 0&&(a.openModal=I.open)}),(G,w)=>(o.openBlock(),o.createBlock(L0,o.mergeProps(I,{class:"modal-cropped-avatar","data-testid":`ModalCroppedAvatar-${o.unref(l)}`,onClose:d}),{default:o.withCtx(()=>[o.createElementVNode("div",{class:"modal-cropped-avatar__content","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content`},[o.createElementVNode("div",{class:"modal-cropped-avatar__title","data-testid":`ModalCroppedAvatar-${o.unref(l)}-title`}," Изменение фото профиля ",8,GeI),o.createElementVNode("div",{class:"modal-cropped-avatar__main","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-main`},[o.createElementVNode("div",{class:"modal-cropped-avatar__cropped","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-main-cropped`},[o.createVNode(ueI,{ref_key:"cropper",ref:s,image:e.image,max:o.unref(t),min:o.unref(i),step:o.unref(A),class:"modal-cropped-avatar__cropper",onUnmountScale:m},null,8,["image","max","min","step"]),o.createElementVNode("div",{class:"modal-cropped-avatar__tools","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-tools`},[o.createVNode(Mg,{name:o.unref(ug).minus,class:"modal-cropped-avatar__icon","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-iconMinus`,onClick:u},null,8,["name","data-testid"]),o.createVNode(wp,{max:o.unref(t),min:o.unref(i),step:o.unref(A),modelValue:o.unref(n),"onUpdate:modelValue":w[0]||(w[0]=p=>o.isRef(n)?n.value=p:null),"data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-Range`},null,8,["max","min","step","modelValue","data-testid"]),o.createVNode(Mg,{name:o.unref(ug).plus,class:"modal-cropped-avatar__icon","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-IconPlus`,onClick:h},null,8,["name","data-testid"])],8,peI)],8,WeI),o.createElementVNode("div",{class:"modal-cropped-avatar__buttons","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-buttons`},[o.createVNode(JI,{type:o.unref(NI).outline,class:"modal-cropped-avatar__button","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-ButtonCancel`,onClick:d},{default:o.withCtx(()=>[...w[1]||(w[1]=[o.createTextVNode(" Отменить ",-1)])]),_:1},8,["type","data-testid"]),o.createVNode(JI,{class:"modal-cropped-avatar__button","data-testid":`ModalCroppedAvatar-${o.unref(l)}-content-buttonSave`,onClick:Z},{default:o.withCtx(()=>[...w[2]||(w[2]=[o.createTextVNode(" Сохранить ",-1)])]),_:1},8,["data-testid"])],8,BeI)],8,weI)],8,ZeI)]),_:1},16,["data-testid"]))}}),[["__scopeId","data-v-65b5d91e"]]),Nf={install(e,g={enabled:!0}){if(!(g.enabled??!1)){console.info("[removeDataTestidPlugin] Plugin is disabled.");return}const C=t=>{t.removeAttribute("data-testid"),Array.from(t.children).forEach(C)};e.mixin({mounted(){C(this.$el)}})}},yeI=["src"],Mf=o.defineComponent({name:"ImagePreview",__name:"ImagePreview",props:{src:{}},emits:["error"],setup(e,{expose:g,emit:I}){const C=e,t=I,i=o.reactive({isError:!1,rotate:0});o.watch(()=>C.src,()=>{i.isError=!1,i.rotate=0,o.nextTick(()=>{n()})});const A=o.ref(null),n=async()=>{try{if(!A.value||!C.src)return;const s=new Image;s.src=C.src,s.addEventListener("load",()=>{var Z;if(!A.value)return;const a=(Z=A.value)==null?void 0:Z.getContext("2d");if(!a)return;const d=s.width,m=s.height;let u=d,h=m;i.rotate%180!==0&&(u=m,h=d),A.value.width=u,A.value.height=h,a.save(),a.clearRect(0,0,u,h),a.translate(u/2,h/2),a.rotate(i.rotate*Math.PI/180),a.drawImage(s,-d/2,-m/2,d,m),a.restore()}),s.addEventListener("error",a=>{i.isError=!0,t("error",a)})}catch{t("error",new Event("error")),i.isError=!0}},l=async s=>{const a=Math.round(s/90)*90;i.rotate+=a,o.nextTick(()=>{n()})};return o.onMounted(()=>{o.nextTick(()=>{n()})}),g({rotateImage:l}),(s,a)=>i.isError?(o.openBlock(),o.createElementBlock("img",{key:1,src:o.unref(En)},null,8,yeI)):(o.openBlock(),o.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:A,class:"image-preview"},null,512))}}),PJ={Accordion:x1,Badges:ot,BreadCrumbs:Oy,Dialog:bW,DragAndDrop:O1,Card:Q1,Combobox:E1,Calendar:j1,Button:JI,Switch:bw,SelectList:Dr,Dropdown:oY,Textarea:nN,Filter:U1,Icon:Mg,Input:_1,InputNumber:i0,Picture:oN,PushNotification:sN,Scroll:eN,Search:b0,Modal:L0,Slider:IN,Checkbox:CN,Toggle:ap,UserMenu:AN,CopyIcon:aN,Loader:j0,FilterTag:dN,CircularProgress:cN,Popover:Dd,Table:rN,TableNew:bN,TableSimple:GN,TableRow:Gp,TableRowNew:ZN,TableTd:_0,TableTh:um,SectionTableRow:mN,HeadTableRow:E0,HeadTableRowNew:Wp,ScrollWrapper:P0,ScrollWrapperNew:i7g,Radio:uN,Tooltip:Hd,BaseFilter:hN,Range:wp,Tabs:wN,ContentEditor:Yf,ModalCroppedAvatar:Vf,Avatar:U0,TimePicker:ZW,SliderModal:sp,PdfPreview:Ol,ImagePreview:Mf,VideoPreview:T0,Skeleton:Zp},_J=Object.freeze(Object.defineProperty({__proto__:null,Accordion:x1,Avatar:U0,Badges:ot,BadgesTypeEnum:zI,BaseFilter:hN,BreadCrumbs:Oy,Button:JI,ButtonTypeEnum:NI,Calendar:j1,Card:Q1,Checkbox:CN,CheckboxCircularEnum:up,CheckboxSizeEnum:mp,CircularProgress:cN,ColorsEnum:Lb,Combobox:E1,ContentEditor:Yf,CopyIcon:aN,Dialog:bW,DragAndDrop:O1,Dropdown:oY,Filter:U1,FilterTag:dN,HeadTableRow:E0,HeadTableRowNew:Wp,Icon:Mg,IconNameEnum:ug,ImageExtensionsEnum:G0,ImagePreview:Mf,Input:_1,InputNumber:i0,InputTypeEnum:P1,Loader:j0,MenuTypeEnum:oe,MessageTypeEnum:bp,Modal:L0,ModalCroppedAvatar:Vf,PdfPreview:Ol,Picture:oN,Popover:Dd,PushNotification:sN,Radio:uN,Range:wp,Scroll:eN,ScrollWrapper:P0,Search:b0,SectionTableRow:mN,SelectList:Dr,SizesEnum:Le,Skeleton:Zp,Slider:IN,SliderModal:sp,Switch:bw,Table:rN,TableNew:bN,TableRow:Gp,TableRowNew:ZN,TableSimple:GN,TableTd:_0,TableTh:um,Tabs:wN,TextFieldEnum:MW,Textarea:nN,TextareaTypeEnum:hp,TimePicker:ZW,Toggle:ap,Tooltip:Hd,UserMenu:AN,VideoExtensionsEnum:w0,VideoPreview:T0,default:{install:e=>{Object.keys(PJ).forEach(g=>{e.component("Y"+g,PJ[g])})}},getFirstTime:JS,getLastTime:VW,vuePluginRemoveTestid:Nf},Symbol.toStringTag,{value:"Module"})),YeI={install(e){for(const g in _J){const I=_J[g];e.use(I).use(Nf,{enabled:!1})}}};gg.Accordion=x1,gg.Avatar=U0,gg.Badges=ot,gg.BadgesTypeEnum=zI,gg.BaseFilter=hN,gg.BreadCrumbs=Oy,gg.Button=JI,gg.ButtonTypeEnum=NI,gg.Calendar=j1,gg.Card=Q1,gg.Checkbox=CN,gg.CheckboxCircularEnum=up,gg.CheckboxSizeEnum=mp,gg.CircularProgress=cN,gg.ColorsEnum=Lb,gg.Combobox=E1,gg.ContentEditor=Yf,gg.CopyIcon=aN,gg.Dialog=bW,gg.DragAndDrop=O1,gg.Dropdown=oY,gg.Filter=U1,gg.FilterTag=dN,gg.HeadTableRow=E0,gg.HeadTableRowNew=Wp,gg.Icon=Mg,gg.IconNameEnum=ug,gg.ImageExtensionsEnum=G0,gg.ImagePreview=Mf,gg.Input=_1,gg.InputNumber=i0,gg.InputTypeEnum=P1,gg.Loader=j0,gg.MenuTypeEnum=oe,gg.MessageTypeEnum=bp,gg.Modal=L0,gg.ModalCroppedAvatar=Vf,gg.OnClickOutside=lU,gg.OnLongPress=cU,gg.PdfPreview=Ol,gg.Picture=oN,gg.Popover=Dd,gg.PushNotification=sN,gg.Radio=uN,gg.Range=wp,gg.Scroll=eN,gg.ScrollWrapper=P0,gg.Search=b0,gg.SectionTableRow=mN,gg.SelectList=Dr,gg.SizesEnum=Le,gg.Skeleton=Zp,gg.Slider=IN,gg.SliderModal=sp,gg.Switch=bw,gg.Table=rN,gg.TableNew=bN,gg.TableRow=Gp,gg.TableRowNew=ZN,gg.TableSimple=GN,gg.TableTd=_0,gg.TableTh=um,gg.Tabs=wN,gg.TextFieldEnum=MW,gg.Textarea=nN,gg.TextareaTypeEnum=hp,gg.TimePicker=ZW,gg.Toggle=ap,gg.Tooltip=Hd,gg.UseActiveElement=rU,gg.UseBattery=mU,gg.UseBrowserLocation=uU,gg.UseClipboard=hU,gg.UseColorMode=NU,gg.UseDark=MU,gg.UseDeviceMotion=fU,gg.UseDeviceOrientation=RU,gg.UseDevicePixelRatio=XU,gg.UseDevicesList=HU,gg.UseDocumentVisibility=DU,gg.UseDraggable=SU,gg.UseElementBounding=KU,gg.UseElementSize=FU,gg.UseElementVisibility=LU,gg.UseEyeDropper=vU,gg.UseFullscreen=jU,gg.UseGeolocation=xU,gg.UseIdle=OU,gg.UseImage=PU,gg.UseMouse=qU,gg.UseMouseInElement=g7,gg.UseMousePressed=I7,gg.UseNetwork=e7,gg.UseNow=C7,gg.UseObjectUrl=t7,gg.UseOffsetPagination=i7,gg.UseOnline=A7,gg.UsePageLeave=n7,gg.UsePointer=l7,gg.UsePointerLock=o7,gg.UsePreferredColorScheme=s7,gg.UsePreferredContrast=a7,gg.UsePreferredDark=d7,gg.UsePreferredLanguages=c7,gg.UsePreferredReducedMotion=r7,gg.UseScreenSafeArea=b7,gg.UseTimeAgo=B7,gg.UseTimestamp=y7,gg.UseVirtualList=Y7,gg.UseWindowFocus=V7,gg.UseWindowSize=N7,gg.UserMenu=AN,gg.VOnClickOutside=Cd,gg.VOnLongPress=XX,gg.VideoExtensionsEnum=w0,gg.VideoPreview=T0,gg.VueToolsCore=bTg,gg.arrow=Xvg,gg.autoPlacement=DS,gg.autoUpdate=XS,gg.computePosition=SS,gg.default=YeI,gg.detectOverflow=pvg,gg.flip=yvg,gg.getFirstTime=JS,gg.getLastTime=VW,gg.getOverflowAncestors=em,gg.hide=Vvg,gg.inline=Mvg,gg.limitShift=fvg,gg.offset=HS,gg.platform=fS,gg.shift=Bvg,gg.size=Yvg,gg.useFloating=FS,gg.useSearch=LS,gg.vElementHover=kU,gg.vElementSize=JU,gg.vElementVisibility=TU,gg.vInfiniteScroll=_U,gg.vIntersectionObserver=$U,gg.vOnClickOutside=Cd,gg.vOnKeyStroke=sU,gg.vOnLongPress=XX,gg.vResizeObserver=m7,gg.vScroll=Z7,gg.vScrollLock=p7,gg.vuePluginRemoveTestid=Nf,Object.defineProperties(gg,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});