@esvndev/es-react-table-interface 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -291,4 +291,4 @@ object-assign
291
291
  * Released under the MIT License.
292
292
  */function Q8e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function J8e(e,t){return e.get(Q8e(e,t))}"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[X8e]||(window[X8e]=0),1===window[X8e]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[X8e]+=1);const e9e={},t9e="swal2-",n9e=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce(((e,t)=>(e[t]=t9e+t,e)),{}),r9e=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=t9e+t,e)),{}),o9e="SweetAlert2:",a9e=e=>e.charAt(0).toUpperCase()+e.slice(1),i9e=e=>{console.warn(`${o9e} ${"object"==typeof e?e.join(" "):e}`)},l9e=e=>{console.error(`${o9e} ${e}`)},s9e=[],c9e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,s9e.includes(n)||(s9e.push(n),i9e(n))},u9e=e=>"function"==typeof e?e():e,d9e=e=>e&&"function"==typeof e.toPromise,h9e=e=>d9e(e)?e.toPromise():Promise.resolve(e),p9e=e=>e&&Promise.resolve(e)===e,f9e=()=>document.body.querySelector(`.${n9e.container}`),m9e=e=>{const t=f9e();return t?t.querySelector(e):null},v9e=e=>m9e(`.${e}`),g9e=()=>v9e(n9e.popup),b9e=()=>v9e(n9e.icon),y9e=()=>v9e(n9e.title),w9e=()=>v9e(n9e["html-container"]),x9e=()=>v9e(n9e.image),E9e=()=>v9e(n9e["progress-steps"]),k9e=()=>v9e(n9e["validation-message"]),S9e=()=>m9e(`.${n9e.actions} .${n9e.confirm}`),C9e=()=>m9e(`.${n9e.actions} .${n9e.cancel}`),M9e=()=>m9e(`.${n9e.actions} .${n9e.deny}`),_9e=()=>m9e(`.${n9e.loader}`),N9e=()=>v9e(n9e.actions),A9e=()=>v9e(n9e.footer),O9e=()=>v9e(n9e["timer-progress-bar"]),I9e=()=>v9e(n9e.close),D9e=()=>{const e=g9e();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),r=parseInt(t.getAttribute("tabindex")||"0");return n>r?1:n<r?-1:0})),r=e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'),o=Array.from(r).filter((e=>"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(o))].filter((e=>G9e(e)))},P9e=()=>L9e(document.body,n9e.shown)&&!L9e(document.body,n9e["toast-shown"])&&!L9e(document.body,n9e["no-backdrop"]),T9e=()=>{const e=g9e();return!!e&&L9e(e,n9e.toast)},H9e=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),r=n.querySelector("head");r&&Array.from(r.childNodes).forEach((t=>{e.appendChild(t)}));const o=n.querySelector("body");o&&Array.from(o.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},L9e=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},z9e=(e,t,n)=>{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(n9e).includes(n)||Object.values(r9e).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),!t.customClass)return;const r=t.customClass[n];r&&("string"==typeof r||r.forEach?Z9e(e,r):i9e(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`))},R9e=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${n9e.popup} > .${n9e[t]}`);case"checkbox":return e.querySelector(`.${n9e.popup} > .${n9e.checkbox} input`);case"radio":return e.querySelector(`.${n9e.popup} > .${n9e.radio} input:checked`)||e.querySelector(`.${n9e.popup} > .${n9e.radio} input:first-child`);case"range":return e.querySelector(`.${n9e.popup} > .${n9e.range} input`);default:return e.querySelector(`.${n9e.popup} > .${n9e.input}`)}},B9e=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},$9e=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Z9e=(e,t)=>{$9e(e,t,!0)},V9e=(e,t)=>{$9e(e,t,!1)},j9e=(e,t)=>{const n=Array.from(e.children);for(let e=0;e<n.length;e++){const r=n[e];if(r instanceof HTMLElement&&L9e(r,t))return r}},W9e=(e,t,n)=>{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},F9e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},q9e=e=>{e&&(e.style.display="none")},Y9e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{K9e(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},U9e=(e,t,n,r)=>{const o=e.querySelector(t);o&&o.style.setProperty(n,r)},K9e=function(e,t){t?F9e(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):q9e(e)},G9e=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),X9e=e=>!!(e.scrollHeight>e.clientHeight),Q9e=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},J9e=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=O9e();n&&G9e(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},eet=`\n <div aria-labelledby="${n9e.title}" aria-describedby="${n9e["html-container"]}" class="${n9e.popup}" tabindex="-1">\n <button type="button" class="${n9e.close}"></button>\n <ul class="${n9e["progress-steps"]}"></ul>\n <div class="${n9e.icon}"></div>\n <img class="${n9e.image}" />\n <h2 class="${n9e.title}" id="${n9e.title}"></h2>\n <div class="${n9e["html-container"]}" id="${n9e["html-container"]}"></div>\n <input class="${n9e.input}" id="${n9e.input}" />\n <input type="file" class="${n9e.file}" />\n <div class="${n9e.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${n9e.select}" id="${n9e.select}"></select>\n <div class="${n9e.radio}"></div>\n <label class="${n9e.checkbox}">\n <input type="checkbox" id="${n9e.checkbox}" />\n <span class="${n9e.label}"></span>\n </label>\n <textarea class="${n9e.textarea}" id="${n9e.textarea}"></textarea>\n <div class="${n9e["validation-message"]}" id="${n9e["validation-message"]}"></div>\n <div class="${n9e.actions}">\n <div class="${n9e.loader}"></div>\n <button type="button" class="${n9e.confirm}"></button>\n <button type="button" class="${n9e.deny}"></button>\n <button type="button" class="${n9e.cancel}"></button>\n </div>\n <div class="${n9e.footer}"></div>\n <div class="${n9e["timer-progress-bar-container"]}">\n <div class="${n9e["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),tet=()=>{e9e.currentInstance.resetValidationMessage()},net=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ret(e,t):e&&H9e(t,e)},ret=(e,t)=>{e.jquery?oet(t,e):H9e(t,e.toString())},oet=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))};function aet(e,t,n){const r=a9e(t);K9e(e,n[`show${r}Button`],"inline-block"),H9e(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=n9e[t],z9e(e,n,`${t}Button`)}var iet={innerParams:new WeakMap,domCache:new WeakMap};const set=["input","file","range","select","radio","checkbox","textarea"],cet=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},uet=(e,t,n)=>{if(n.inputLabel){const r=document.createElement("label"),o=n9e["input-label"];r.setAttribute("for",e.id),r.className=o,"object"==typeof n.customClass&&Z9e(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},det=e=>{const t=g9e();if(t)return j9e(t,n9e[e]||n9e.input)},het=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:p9e(t)||i9e(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},pet={};pet.text=pet.email=pet.password=pet.number=pet.tel=pet.url=pet.search=pet.date=pet["datetime-local"]=pet.time=pet.week=pet.month=(e,t)=>(het(e,t.inputValue),uet(e,e,t),cet(e,t),e.type=t.input,e),pet.file=(e,t)=>(uet(e,e,t),cet(e,t),e),pet.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return het(n,t.inputValue),n.type=t.input,het(r,t.inputValue),uet(n,e,t),e},pet.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");H9e(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return uet(e,e,t),e},pet.radio=e=>(e.textContent="",e),pet.checkbox=(e,t)=>{const n=R9e(g9e(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const r=e.querySelector("span");return H9e(r,t.inputPlaceholder||t.inputLabel),n},pet.textarea=(e,t)=>(het(e,t.inputValue),cet(e,t),uet(e,e,t),setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(g9e()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+(o=e,parseInt(window.getComputedStyle(o).marginLeft)+parseInt(window.getComputedStyle(o).marginRight));var o;r>n?g9e().style.width=`${r}px`:W9e(g9e(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e);const fet=(e,t)=>{const n=w9e();n&&(Y9e(n),z9e(n,t,"htmlContainer"),t.html?(net(t.html,n),F9e(n,"block")):t.text?(n.textContent=t.text,F9e(n,"block")):q9e(n),((e,t)=>{const n=g9e();if(!n)return;const r=iet.innerParams.get(e),o=!r||t.input!==r.input;set.forEach((e=>{const r=j9e(n,n9e[e]);r&&(((e,t)=>{const n=g9e();if(!n)return;const r=R9e(n,e);if(r){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["id","type","value","style"].includes(n)||e.removeAttribute(n)}})(r);for(const e in t)r.setAttribute(e,t[e])}})(e,t.inputAttributes),r.className=n9e[e],o&&q9e(r))})),t.input&&(o&&(e=>{if(!e.input)return;if(!pet[e.input])return void l9e(`Unexpected type of input! Expected ${Object.keys(pet).join(" | ")}, got "${e.input}"`);const t=det(e.input);if(!t)return;const n=pet[e.input](t,e);F9e(t),e.inputAutoFocus&&setTimeout((()=>{B9e(n)}))})(t),(e=>{if(!e.input)return;const t=det(e.input);t&&z9e(t,e,"input")})(t))})(e,t))},met=(e,t)=>{for(const[n,r]of Object.entries(r9e))t.icon!==n&&V9e(e,r);Z9e(e,t.icon&&r9e[t.icon]),bet(e,t),vet(),z9e(e,t,"icon")},vet=()=>{const e=g9e();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},get=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,r="";t.iconHtml?r=yet(t.iconHtml):"success"===t.icon?(r='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?r='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':t.icon&&(r=yet({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==r.trim()&&H9e(e,r)},bet=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])U9e(e,n,"background-color",t.iconColor);U9e(e,".swal2-success-ring","border-color",t.iconColor)}},yet=e=>`<div class="${n9e["icon-content"]}">${e}</div>`;let wet=!1,xet=0,Eet=0,ket=0,Cet=0;const Met=e=>{const t=g9e();if(e.target===t||b9e().contains(e.target)){wet=!0;const n=Aet(e);xet=n.clientX,Eet=n.clientY,ket=parseInt(t.style.insetInlineStart)||0,Cet=parseInt(t.style.insetBlockStart)||0,Z9e(t,"swal2-dragging")}},_et=e=>{const t=g9e();if(wet){let{clientX:n,clientY:r}=Aet(e);t.style.insetInlineStart=`${ket+(n-xet)}px`,t.style.insetBlockStart=`${Cet+(r-Eet)}px`}},Net=()=>{const e=g9e();wet=!1,V9e(e,"swal2-dragging")},Aet=e=>{let t=0,n=0;return e.type.startsWith("mouse")?(t=e.clientX,n=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,n=e.touches[0].clientY),{clientX:t,clientY:n}},Oet=(e,t)=>{const n=t.showClass||{};e.className=`${n9e.popup} ${G9e(e)?n.popup:""}`,t.toast?(Z9e([document.documentElement,document.body],n9e["toast-shown"]),Z9e(e,n9e.toast)):Z9e(e,n9e.modal),z9e(e,t,"popup"),"string"==typeof t.customClass&&Z9e(e,t.customClass),t.icon&&Z9e(e,n9e[`icon-${t.icon}`])},Iet=(e,t)=>{((e,t)=>{const n=f9e(),r=g9e();if(n&&r){if(t.toast){W9e(n,"width",t.width),r.style.width="100%";const e=_9e();e&&r.insertBefore(e,b9e())}else W9e(r,"width",t.width);W9e(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),q9e(k9e()),Oet(r,t),t.draggable&&!t.toast?(Z9e(r,n9e.draggable),(e=>{e.addEventListener("mousedown",Met),document.body.addEventListener("mousemove",_et),e.addEventListener("mouseup",Net),e.addEventListener("touchstart",Met),document.body.addEventListener("touchmove",_et),e.addEventListener("touchend",Net)})(r)):(V9e(r,n9e.draggable),(e=>{e.removeEventListener("mousedown",Met),document.body.removeEventListener("mousemove",_et),e.removeEventListener("mouseup",Net),e.removeEventListener("touchstart",Met),document.body.removeEventListener("touchmove",_et),e.removeEventListener("touchend",Net)})(r))}})(0,t),((e,t)=>{const n=f9e();n&&(function(e,t){"string"==typeof t?e.style.background=t:t||Z9e([document.documentElement,document.body],n9e["no-backdrop"])}(n,t.backdrop),function(e,t){t&&(t in n9e?Z9e(e,n9e[t]):(i9e('The "position" parameter is not valid, defaulting to "center"'),Z9e(e,n9e.center)))}(n,t.position),function(e,t){t&&Z9e(e,n9e[`grow-${t}`])}(n,t.grow),z9e(n,t,"container"))})(0,t),((e,t)=>{const n=E9e();if(!n)return;const{progressSteps:r,currentProgressStep:o}=t;r&&0!==r.length&&void 0!==o?(F9e(n),n.textContent="",o>=r.length&&i9e("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),r.forEach(((e,a)=>{const i=(e=>{const t=document.createElement("li");return Z9e(t,n9e["progress-step"]),H9e(t,e),t})(e);if(n.appendChild(i),a===o&&Z9e(i,n9e["active-progress-step"]),a!==r.length-1){const e=(e=>{const t=document.createElement("li");return Z9e(t,n9e["progress-step-line"]),e.progressStepsDistance&&W9e(t,"width",e.progressStepsDistance),t})(t);n.appendChild(e)}}))):q9e(n)})(0,t),((e,t)=>{const n=iet.innerParams.get(e),r=b9e();if(r){if(n&&t.icon===n.icon)return get(r,t),void met(r,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(r9e).indexOf(t.icon))return l9e(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void q9e(r);F9e(r),get(r,t),met(r,t),Z9e(r,t.showClass&&t.showClass.icon)}else q9e(r)}})(e,t),((e,t)=>{const n=x9e();n&&(t.imageUrl?(F9e(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),W9e(n,"width",t.imageWidth),W9e(n,"height",t.imageHeight),n.className=n9e.image,z9e(n,t,"image")):q9e(n))})(0,t),((e,t)=>{const n=y9e();n&&(Y9e(n),K9e(n,t.title||t.titleText,"block"),t.title&&net(t.title,n),t.titleText&&(n.innerText=t.titleText),z9e(n,t,"title"))})(0,t),((e,t)=>{const n=I9e();n&&(H9e(n,t.closeButtonHtml||""),z9e(n,t,"closeButton"),K9e(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),fet(e,t),((e,t)=>{const n=N9e(),r=_9e();n&&r&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?F9e(n):q9e(n),z9e(n,t,"actions"),function(e,t,n){const r=S9e(),o=M9e(),a=C9e();r&&o&&a&&(aet(r,"confirm",n),aet(o,"deny",n),aet(a,"cancel",n),function(e,t,n,r){r.buttonsStyling?(Z9e([e,t,n],n9e.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,Z9e(e,n9e["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,Z9e(t,n9e["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,Z9e(n,n9e["default-outline"]))):V9e([e,t,n],n9e.styled)}(r,o,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,r),e.insertBefore(o,r)):(e.insertBefore(a,t),e.insertBefore(o,t),e.insertBefore(r,t))))}(n,r,t),H9e(r,t.loaderHtml||""),z9e(r,t,"loader"))})(0,t),((e,t)=>{const n=A9e();n&&(Y9e(n),K9e(n,t.footer,"block"),t.footer&&net(t.footer,n),z9e(n,t,"footer"))})(0,t);const n=g9e();"function"==typeof t.didRender&&n&&t.didRender(n),e9e.eventEmitter.emit("didRender",n)},Det=()=>{var e;return null===(e=S9e())||void 0===e?void 0:e.click()},Pet=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Tet=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Het=(e,t)=>{var n;const r=D9e();if(r.length)return(e+=t)===r.length?e=0:-1===e&&(e=r.length-1),void r[e].focus();null===(n=g9e())||void 0===n||n.focus()},Let=["ArrowRight","ArrowDown"],zet=["ArrowLeft","ArrowUp"],Ret=(e,t)=>{if(!u9e(t.allowEnterKey))return;const n=R9e(g9e(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Det(),e.preventDefault()}},Bet=e=>{const t=e.target,n=D9e();let r=-1;for(let e=0;e<n.length;e++)if(t===n[e]){r=e;break}e.shiftKey?Het(r,-1):Het(r,1),e.stopPropagation(),e.preventDefault()},$et=e=>{const t=N9e(),n=S9e(),r=M9e(),o=C9e();if(!(t&&n&&r&&o))return;const a=[n,r,o];if(document.activeElement instanceof HTMLElement&&!a.includes(document.activeElement))return;const i=Let.includes(e)?"nextElementSibling":"previousElementSibling";let l=document.activeElement;if(l){for(let e=0;e<t.children.length;e++){if(l=l[i],!l)return;if(l instanceof HTMLButtonElement&&G9e(l))break}l instanceof HTMLButtonElement&&l.focus()}},Zet=(e,t,n)=>{u9e(t.allowEscapeKey)&&(e.preventDefault(),n(Pet.esc))};var Vet={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const jet=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Wet="undefined"!=typeof window&&!!window.GestureEvent,Fet=e=>{const t=e.target,n=f9e(),r=w9e();return!(!n||!r||qet(e)||Yet(e)||t!==n&&(X9e(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||X9e(r)&&r.contains(t)))},qet=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Yet=e=>e.touches&&e.touches.length>1;let Uet=null;function Ket(e,t,n,r){T9e()?rtt(e,r):((e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;e9e.restoreFocusTimeout=setTimeout((()=>{e9e.previousActiveElement instanceof HTMLElement?(e9e.previousActiveElement.focus(),e9e.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,r)})))(n).then((()=>rtt(e,r))),Tet(e9e)),Wet?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),P9e()&&(null!==Uet&&(document.body.style.paddingRight=`${Uet}px`,Uet=null),(()=>{if(L9e(document.body,n9e.iosfix)){const e=parseInt(document.body.style.top,10);V9e(document.body,n9e.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),jet()),V9e([document.documentElement,document.body],[n9e.shown,n9e["height-auto"],n9e["no-backdrop"],n9e["toast-shown"]])}function Get(e){e=ett(e);const t=Vet.swalPromiseResolve.get(this),n=Xet(this);this.isAwaitingPromise?e.isDismissed||(Jet(this),t(e)):n&&t(e)}const Xet=e=>{const t=g9e();if(!t)return!1;const n=iet.innerParams.get(e);if(!n||L9e(t,n.hideClass.popup))return!1;V9e(t,n.showClass.popup),Z9e(t,n.hideClass.popup);const r=f9e();return V9e(r,n.showClass.backdrop),Z9e(r,n.hideClass.backdrop),ttt(e,t,n),!0};function Qet(e){const t=Vet.swalPromiseReject.get(this);Jet(this),t&&t(e)}const Jet=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,iet.innerParams.get(e)||e._destroy())},ett=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ttt=(e,t,n)=>{var r;const o=f9e(),a=Q9e(t);"function"==typeof n.willClose&&n.willClose(t),null===(r=e9e.eventEmitter)||void 0===r||r.emit("willClose",t),a?ntt(e,t,o,n.returnFocus,n.didClose):Ket(e,o,n.returnFocus,n.didClose)},ntt=(e,t,n,r,o)=>{e9e.swalCloseEventFinishedCallback=Ket.bind(null,e,n,r,o);const a=function(e){var n;e.target===t&&(null===(n=e9e.swalCloseEventFinishedCallback)||void 0===n||n.call(e9e),delete e9e.swalCloseEventFinishedCallback,t.removeEventListener("animationend",a),t.removeEventListener("transitionend",a))};t.addEventListener("animationend",a),t.addEventListener("transitionend",a)},rtt=(e,t)=>{setTimeout((()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=e9e.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()}))},ott=e=>{let t=g9e();if(t||new bnt,t=g9e(),!t)return;const n=_9e();T9e()?q9e(b9e()):att(t,e),F9e(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},att=(e,t)=>{const n=N9e(),r=_9e();n&&r&&(!t&&G9e(S9e())&&(t=S9e()),F9e(n),t&&(q9e(t),r.setAttribute("data-button-to-replace",t.className),n.insertBefore(r,t)),Z9e([e,n],n9e.loading))},itt=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let r=e;"object"==typeof r&&(r=itt(r)),t.push([n,r])})):Object.keys(e).forEach((n=>{let r=e[n];"object"==typeof r&&(r=itt(r)),t.push([n,r])})),t},ltt=(e,t)=>!!t&&t.toString()===e.toString(),stt=(e,t)=>{const n=iet.innerParams.get(e);if(!n.input)return void l9e(`The "input" parameter is needed to be set when using returnInputValueOn${a9e(t)}`);const r=e.getInput(),o=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return(e=>e.checked?1:0)(n);case"radio":return(e=>e.checked?e.value:null)(n);case"file":return(e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null)(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?ctt(e,o,t):r&&!r.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||r.validationMessage)):"deny"===t?utt(e,o):ptt(e,o)},ctt=(e,t,n)=>{const r=iet.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>h9e(r.inputValidator(t,r.validationMessage)))).then((r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):"deny"===n?utt(e,t):ptt(e,t)}))},utt=(e,t)=>{const n=iet.innerParams.get(e||void 0);n.showLoaderOnDeny&&ott(M9e()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>h9e(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),Jet(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>htt(e||void 0,t)))):e.close({isDenied:!0,value:t})},dtt=(e,t)=>{e.close({isConfirmed:!0,value:t})},htt=(e,t)=>{e.rejectPromise(t)},ptt=(e,t)=>{const n=iet.innerParams.get(e||void 0);n.showLoaderOnConfirm&&ott(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>h9e(n.preConfirm(t,n.validationMessage)))).then((n=>{G9e(k9e())||!1===n?(e.hideLoading(),Jet(e)):dtt(e,void 0===n?t:n)})).catch((t=>htt(e||void 0,t)))):dtt(e,t)};function ftt(){const e=iet.innerParams.get(this);if(!e)return;const t=iet.domCache.get(this);q9e(t.loader),T9e()?e.icon&&F9e(b9e()):mtt(t),V9e([t.popup,t.actions],n9e.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const mtt=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?F9e(t[0],"inline-block"):G9e(S9e())||G9e(M9e())||G9e(C9e())||q9e(e.actions)};function vtt(){const e=iet.innerParams.get(this),t=iet.domCache.get(this);return t?R9e(t.popup,e.input):null}function gtt(e,t,n){const r=iet.domCache.get(e);t.forEach((e=>{r[e].disabled=n}))}function btt(e,t){const n=g9e();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${n9e.radio}"]`);for(let n=0;n<e.length;n++)e[n].disabled=t}else e.disabled=t}function ytt(){gtt(this,["confirmButton","denyButton","cancelButton"],!1)}function wtt(){gtt(this,["confirmButton","denyButton","cancelButton"],!0)}function xtt(){btt(this.getInput(),!1)}function Ett(){btt(this.getInput(),!0)}function ktt(e){const t=iet.domCache.get(this),n=iet.innerParams.get(this);H9e(t.validationMessage,e),t.validationMessage.className=n9e["validation-message"],n.customClass&&n.customClass.validationMessage&&Z9e(t.validationMessage,n.customClass.validationMessage),F9e(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby",n9e["validation-message"]),B9e(r),Z9e(r,n9e.inputerror))}function Stt(){const e=iet.domCache.get(this);e.validationMessage&&q9e(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),V9e(t,n9e.inputerror))}const Ctt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Mtt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],_tt={allowEnterKey:void 0},Ntt=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Att=e=>Object.prototype.hasOwnProperty.call(Ctt,e),Ott=e=>-1!==Mtt.indexOf(e),Itt=e=>_tt[e],Dtt=e=>{Att(e)||i9e(`Unknown parameter "${e}"`)},Ptt=e=>{Ntt.includes(e)&&i9e(`The parameter "${e}" is incompatible with toasts`)},Ttt=e=>{const t=Itt(e);t&&c9e(e,t)};function Htt(e){const t=g9e(),n=iet.innerParams.get(this);if(!t||L9e(t,n.hideClass.popup))return void i9e("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=Ltt(e),o=Object.assign({},n,r);Iet(this,o),iet.innerParams.set(this,o),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Ltt=e=>{const t={};return Object.keys(e).forEach((n=>{Ott(n)?t[n]=e[n]:i9e(`Invalid parameter to update: ${n}`)})),t};function ztt(){const e=iet.domCache.get(this),t=iet.innerParams.get(this);t?(e.popup&&e9e.swalCloseEventFinishedCallback&&(e9e.swalCloseEventFinishedCallback(),delete e9e.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),e9e.eventEmitter.emit("didDestroy"),Rtt(this)):Btt(this)}const Rtt=e=>{Btt(e),delete e.params,delete e9e.keydownHandler,delete e9e.keydownTarget,delete e9e.currentInstance},Btt=e=>{e.isAwaitingPromise?($tt(iet,e),e.isAwaitingPromise=!0):($tt(Vet,e),$tt(iet,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},$tt=(e,t)=>{for(const n in e)e[n].delete(t)};var Ztt=Object.freeze({__proto__:null,_destroy:ztt,close:Get,closeModal:Get,closePopup:Get,closeToast:Get,disableButtons:wtt,disableInput:Ett,disableLoading:ftt,enableButtons:ytt,enableInput:xtt,getInput:vtt,handleAwaitingPromise:Jet,hideLoading:ftt,rejectPromise:Qet,resetValidationMessage:Stt,showValidationMessage:ktt,update:Htt});const Vtt=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let jtt=!1;const Wtt=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e),Ftt=()=>{if(e9e.timeout)return(()=>{const e=O9e();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),e9e.timeout.stop()},qtt=()=>{if(e9e.timeout){const e=e9e.timeout.start();return J9e(e),e}};let Ytt=!1;const Utt={},Ktt=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in Utt){const n=t.getAttribute(e);if(n)return void Utt[e].fire({template:n})}};e9e.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const r=function(){n.removeListener(e,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];t.apply(n,a)};this.on(e,r)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this._getHandlersByEventName(e).forEach((e=>{try{e.apply(this,n)}catch(e){console.error(e)}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),r=n.indexOf(t);r>-1&&n.splice(r,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var Gtt=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||Wtt(e[0])?["title","html","icon"].forEach(((n,r)=>{const o=e[r];"string"==typeof o||Wtt(o)?t[n]=o:void 0!==o&&l9e(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof o}`)})):Object.assign(t,e[0]),t},bindClickHandler:function(){Utt[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ytt||(document.body.addEventListener("click",Ktt),Ytt=!0)},clickCancel:()=>{var e;return null===(e=C9e())||void 0===e?void 0:e.click()},clickConfirm:Det,clickDeny:()=>{var e;return null===(e=M9e())||void 0===e?void 0:e.click()},enableLoading:ott,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},getActions:N9e,getCancelButton:C9e,getCloseButton:I9e,getConfirmButton:S9e,getContainer:f9e,getDenyButton:M9e,getFocusableElements:D9e,getFooter:A9e,getHtmlContainer:w9e,getIcon:b9e,getIconContent:()=>v9e(n9e["icon-content"]),getImage:x9e,getInputLabel:()=>v9e(n9e["input-label"]),getLoader:_9e,getPopup:g9e,getProgressSteps:E9e,getTimerLeft:()=>e9e.timeout&&e9e.timeout.getTimerLeft(),getTimerProgressBar:O9e,getTitle:y9e,getValidationMessage:k9e,increaseTimer:e=>{if(e9e.timeout){const t=e9e.timeout.increase(e);return J9e(t,!0),t}},isDeprecatedParameter:Itt,isLoading:()=>{const e=g9e();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!e9e.timeout||!e9e.timeout.isRunning()),isUpdatableParameter:Ott,isValidParameter:Att,isVisible:()=>G9e(g9e()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?e9e.eventEmitter.removeListener(e,t):e9e.eventEmitter.removeAllListeners(e):e9e.eventEmitter.reset()},on:(e,t)=>{e9e.eventEmitter.on(e,t)},once:(e,t)=>{e9e.eventEmitter.once(e,t)},resumeTimer:qtt,showLoading:ott,stopTimer:Ftt,toggleTimer:()=>{const e=e9e.timeout;return e&&(e.running?Ftt():qtt())}});class Xtt{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Qtt=["swal-title","swal-html","swal-footer"],Jtt=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&i9e([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},ent=e=>{const t=g9e();if(e.target!==t)return;const n=f9e();t.removeEventListener("animationend",ent),t.removeEventListener("transitionend",ent),n.style.overflowY="auto"},tnt=(e,t)=>{Q9e(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",ent),t.addEventListener("transitionend",ent)):e.style.overflowY="auto"},nnt=(e,t,n)=>{(()=>{if(Wet&&!L9e(document.body,n9e.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Z9e(document.body,n9e.iosfix),(()=>{const e=f9e();if(!e)return;let t;e.ontouchstart=e=>{t=Fet(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}})()}})(),t&&"hidden"!==n&&(e=>{null===Uet&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Uet=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Uet+(()=>{const e=document.createElement("div");e.className=n9e["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)})(n),setTimeout((()=>{e.scrollTop=0}))},rnt=(e,t,n)=>{Z9e(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),F9e(t,"grid"),setTimeout((()=>{Z9e(t,n.showClass.popup),t.style.removeProperty("opacity")}),10)):F9e(t,"grid"),Z9e([document.documentElement,document.body],n9e.shown),n.heightAuto&&n.backdrop&&!n.toast&&Z9e([document.documentElement,document.body],n9e["height-auto"])};var ont=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),ant=(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL");function int(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=ont),"url"===e.input&&(e.inputValidator=ant))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&i9e("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(i9e('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),(e=>{const t=(()=>{const e=f9e();return!!e&&(e.remove(),V9e([document.documentElement,document.body],[n9e["no-backdrop"],n9e["toast-shown"],n9e["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void l9e("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=n9e.container,t&&Z9e(n,n9e["no-transition"]),H9e(n,eet);const r="string"==typeof(o=e.target)?document.querySelector(o):o;var o;r.appendChild(n),(e=>{const t=g9e();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Z9e(f9e(),n9e.rtl)})(r),(()=>{const e=g9e(),t=j9e(e,n9e.input),n=j9e(e,n9e.file),r=e.querySelector(`.${n9e.range} input`),o=e.querySelector(`.${n9e.range} output`),a=j9e(e,n9e.select),i=e.querySelector(`.${n9e.checkbox} input`),l=j9e(e,n9e.textarea);t.oninput=tet,n.onchange=tet,a.onchange=tet,i.onchange=tet,l.oninput=tet,r.oninput=()=>{tet(),o.value=r.value},r.onchange=()=>{tet(),o.value=r.value}})()})(e)}let lnt;var snt=new WeakMap;class cnt{constructor(){if(function(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}(this,snt,void 0),"undefined"==typeof window)return;lnt=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=Object.freeze(this.constructor.argsToParams(t));this.params=r,this.isAwaitingPromise=!1,function(e,t,n){e.set(Q8e(e,t),n)}(snt,this,this._main(lnt.params))}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((e=>{!1===e.backdrop&&e.allowOutsideClick&&i9e('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Dtt(t),e.toast&&Ptt(t),Ttt(t)})(Object.assign({},t,e)),e9e.currentInstance){const e=Vet.swalPromiseResolve.get(e9e.currentInstance),{isAwaitingPromise:t}=e9e.currentInstance;e9e.currentInstance._destroy(),t||e({isDismissed:!0}),P9e()&&jet()}e9e.currentInstance=lnt;const n=dnt(e,t);int(n),Object.freeze(n),e9e.timeout&&(e9e.timeout.stop(),delete e9e.timeout),clearTimeout(e9e.restoreFocusTimeout);const r=hnt(lnt);return Iet(lnt,n),iet.innerParams.set(lnt,n),unt(lnt,r,n)}then(e){return J8e(snt,this).then(e)}finally(e){return J8e(snt,this).finally(e)}}const unt=(e,t,n)=>new Promise(((r,o)=>{const a=t=>{e.close({isDismissed:!0,dismiss:t})};Vet.swalPromiseResolve.set(e,r),Vet.swalPromiseReject.set(e,o),t.confirmButton.onclick=()=>{(e=>{const t=iet.innerParams.get(e);e.disableButtons(),t.input?stt(e,"confirm"):ptt(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=iet.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?stt(e,"deny"):utt(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Pet.cancel)})(e,a)},t.closeButton.onclick=()=>{a(Pet.close)},((e,t,n)=>{e.toast?((e,t,n)=>{t.popup.onclick=()=>{e&&(Vtt(e)||e.timer||e.input)||n(Pet.close)}})(e,t,n):((e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(jtt=!0)}}})(t),(e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(jtt=!0)}}})(t),((e,t,n)=>{t.container.onclick=r=>{jtt?jtt=!1:r.target===t.container&&u9e(e.allowOutsideClick)&&n(Pet.backdrop)}})(e,t,n))})(n,t,a),((e,t,n)=>{Tet(e),t.toast||(e.keydownHandler=e=>((e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Ret(t,e):"Tab"===t.key?Bet(t):[...Let,...zet].includes(t.key)?$et(t.key):"Escape"===t.key&&Zet(t,e,n)))})(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:g9e(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(e9e,n,a),((e,t)=>{"select"===t.input||"radio"===t.input?((e,t)=>{const n=g9e();if(!n)return;const r=e=>{"select"===t.input?function(e,t,n){const r=j9e(e,n9e.select);if(!r)return;const o=(e,t,r)=>{const o=document.createElement("option");o.value=r,H9e(o,t),o.selected=ltt(r,n.inputValue),e.appendChild(o)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,r.appendChild(e),n.forEach((t=>o(e,t[1],t[0])))}else o(r,n,t)})),r.focus()}(n,itt(e),t):"radio"===t.input&&function(e,t,n){const r=j9e(e,n9e.radio);if(!r)return;t.forEach((e=>{const t=e[0],o=e[1],a=document.createElement("input"),i=document.createElement("label");a.type="radio",a.name=n9e.radio,a.value=t,ltt(t,n.inputValue)&&(a.checked=!0);const l=document.createElement("span");H9e(l,o),l.className=n9e.label,i.appendChild(a),i.appendChild(l),r.appendChild(i)}));const o=r.querySelectorAll("input");o.length&&o[0].focus()}(n,itt(e),t)};d9e(t.inputOptions)||p9e(t.inputOptions)?(ott(S9e()),h9e(t.inputOptions).then((t=>{e.hideLoading(),r(t)}))):"object"==typeof t.inputOptions?r(t.inputOptions):l9e("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)})(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(d9e(t.inputValue)||p9e(t.inputValue))&&(ott(S9e()),((e,t)=>{const n=e.getInput();n&&(q9e(n),h9e(t.inputValue).then((r=>{n.value="number"===t.input?`${parseFloat(r)||0}`:`${r}`,F9e(n),n.focus(),e.hideLoading()})).catch((t=>{l9e(`Error in inputValue promise: ${t}`),n.value="",F9e(n),n.focus(),e.hideLoading()})))})(e,t))})(e,n),(e=>{const t=f9e(),n=g9e();"function"==typeof e.willOpen&&e.willOpen(n),e9e.eventEmitter.emit("willOpen",n);const r=window.getComputedStyle(document.body).overflowY;rnt(t,n,e),setTimeout((()=>{tnt(t,n)}),10),P9e()&&(nnt(t,e.scrollbarPadding,r),(()=>{const e=f9e();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))})()),T9e()||e9e.previousActiveElement||(e9e.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),e9e.eventEmitter.emit("didOpen",n),V9e(t,n9e["no-transition"])})(n),pnt(e9e,n,a),fnt(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),dnt=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return(e=>{const t=Qtt.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||i9e(`Unrecognized element <${n}>`)}))})(n),Object.assign((e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Jtt(e,["name","value"]);const n=e.getAttribute("name"),r=e.getAttribute("value");n&&r&&(t[n]="boolean"==typeof Ctt[n]?"false"!==r:"object"==typeof Ctt[n]?JSON.parse(r):r)})),t})(n),(e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),r=e.getAttribute("value");n&&r&&(t[n]=new Function(`return ${r}`)())})),t})(n),(e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Jtt(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${a9e(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t})(n),(e=>{const t={},n=e.querySelector("swal-image");return n&&(Jtt(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t})(n),(e=>{const t={},n=e.querySelector("swal-icon");return n&&(Jtt(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t})(n),(e=>{const t={},n=e.querySelector("swal-input");n&&(Jtt(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const r=Array.from(e.querySelectorAll("swal-input-option"));return r.length&&(t.inputOptions={},r.forEach((e=>{Jtt(e,["value"]);const n=e.getAttribute("value");if(!n)return;const r=e.innerHTML;t.inputOptions[n]=r}))),t})(n),((e,t)=>{const n={};for(const r in t){const o=t[r],a=e.querySelector(o);a&&(Jtt(a,[]),n[o.replace(/^swal-/,"")]=a.innerHTML.trim())}return n})(n,Qtt))})(e),r=Object.assign({},Ctt,t,n,e);return r.showClass=Object.assign({},Ctt.showClass,r.showClass),r.hideClass=Object.assign({},Ctt.hideClass,r.hideClass),!1===r.animation&&(r.showClass={backdrop:"swal2-noanimation"},r.hideClass={}),r},hnt=e=>{const t={popup:g9e(),container:f9e(),actions:N9e(),confirmButton:S9e(),denyButton:M9e(),cancelButton:C9e(),loader:_9e(),closeButton:I9e(),validationMessage:k9e(),progressSteps:E9e()};return iet.domCache.set(e,t),t},pnt=(e,t,n)=>{const r=O9e();q9e(r),t.timer&&(e.timeout=new Xtt((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(F9e(r),z9e(r,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&J9e(t.timer)}))))},fnt=(e,t)=>{if(!t.toast)return u9e(t.allowEnterKey)?void(mnt(e)||vnt(e,t)||Het(-1,1)):(c9e("allowEnterKey"),void gnt())},mnt=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&G9e(e))return e.focus(),!0;return!1},vnt=(e,t)=>t.focusDeny&&G9e(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&G9e(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!G9e(e.confirmButton)||(e.confirmButton.focus(),0)),gnt=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}cnt.prototype.disableButtons=wtt,cnt.prototype.enableButtons=ytt,cnt.prototype.getInput=vtt,cnt.prototype.disableInput=Ett,cnt.prototype.enableInput=xtt,cnt.prototype.hideLoading=ftt,cnt.prototype.disableLoading=ftt,cnt.prototype.showValidationMessage=ktt,cnt.prototype.resetValidationMessage=Stt,cnt.prototype.close=Get,cnt.prototype.closePopup=Get,cnt.prototype.closeModal=Get,cnt.prototype.closeToast=Get,cnt.prototype.rejectPromise=Qet,cnt.prototype.update=Htt,cnt.prototype._destroy=ztt,Object.assign(cnt,Gtt),Object.keys(Ztt).forEach((e=>{cnt[e]=function(){return lnt&&lnt[e]?lnt[e](...arguments):null}})),cnt.DismissReason=Pet,cnt.version="11.15.10";const bnt=cnt;bnt.default=bnt,"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');var ynt,wnt,xnt=hbe(bnt),Ent=function(t){return Jbe.success(x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:"toastify-header"},x.default.createElement("div",{className:"title-wrapper"},x.default.createElement("h6",{className:"toast-title"},t))),x.default.createElement("div",{className:"toastify-body"},x.default.createElement("ul",{className:"list-unstyled mb-0"},x.default.createElement("li",null)))))},knt=function(t){return Jbe.error(x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:"toastify-header"},x.default.createElement("div",{className:"title-wrapper"},x.default.createElement("h6",{className:"toast-title"},t))),x.default.createElement("div",{className:"toastify-body"},x.default.createElement("ul",{className:"list-unstyled mb-0"},x.default.createElement("li",null)))))},Snt=function(e,t){var n;(null===(n=e.errors)||void 0===n?void 0:n.length)>0&&xnt.fire({title:t("Notification"),text:e.errors[0].errorMessage,allowOutsideClick:!1,showCancelButton:!0,showConfirmButton:!1,cancelButtonText:t("Ok"),customClass:{cancelButton:"btn btn-danger ms-1"},buttonsStyling:!1})},Cnt=G8e.div(ynt||(ynt=x0e(["\n .box-image-preview{\n position: relative;\n .action-reset {\n position: absolute;\n top: -8px;\n right: -8px;\n width: fit-content;\n height: fit-content;\n }\n .btn-reset {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0;\n }\n }\n"],["\n .box-image-preview{\n position: relative;\n .action-reset {\n position: absolute;\n top: -8px;\n right: -8px;\n width: fit-content;\n height: fit-content;\n }\n .btn-reset {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0;\n }\n }\n"]))),Mnt=G8e.div(wnt||(wnt=x0e(["\n .e-upload {\n border-style: dashed;\n border-radius: 4px;\n\n .e-upload-files{\n display: none;\n }\n }\n"],["\n .e-upload {\n border-style: dashed;\n border-radius: 4px;\n\n .e-upload-files{\n display: none;\n }\n }\n"]))),_nt=function(t){var n=t.t,r=t.callback,o=t.token,a=t.saveUrl,i=e.useRef(null),l={saveUrl:a};return x.default.createElement(e.Fragment,null,x.default.createElement(Cnt,null,x.default.createElement(Mnt,null,x.default.createElement(p0e,{id:"fileUpload",locale:"vi",autoUpload:!0,type:"file",ref:i,multiple:!0,asyncSettings:l,uploading:function(e){e.currentRequest.setRequestHeader("Authorization","Bearer ".concat(o))},failure:function(){knt(n("UploadFail"))},success:function(e){return function(e){var t=e.e.currentTarget.response;if(t&&JSON.parse(t).status){var o=JSON.parse(t).infoFiles;r(o)}else knt(n("UploadFail"))}(e)},showFileList:!0}))))},Nnt=hbe(bnt),Ant=function(t){var n=t.t,r=t.CDN_URL_VIEW,o=t.listFile,a=t.setListFile,i=t.token,l=t.saveUrl,s=e.useState({}),c=s[0],u=s[1],d=[{field:"title",editType:"text",editEnable:!0,headerText:"Title",width:"40%"},{field:"name",headerText:"File name",visible:!0,width:"30%"},{field:"size",headerText:"Size",width:"22%",template:function(t){var n=t.size/Math.pow(1024,2);return x.default.createElement(e.Fragment,null,n.toFixed(2),"MB")}},{field:"command",visible:!0,headerText:"",width:"6%",minWidth:"3%",maxWidth:"8%",textAlign:"center",fixedType:"right",commandItems:[{id:"DOWNLOAD",title:n("Download"),icon:"Download",tooltip:n("Download")},{id:"DELETE",title:n("Delete"),icon:"Trash2",tooltip:n("Delete")}]}];return e.useEffect((function(){var e,t,i,l;"DELETE"===c.id?Nnt.fire({title:n("Confirm"),text:n("ConfirmDelete"),allowOutsideClick:!1,showCancelButton:!0,confirmButtonText:n("Delete"),cancelButtonText:n("Cancel"),customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ms-1"},buttonsStyling:!1}).then((function(e){return b0e(void 0,void 0,void 0,(function(){return y0e(this,(function(t){return e.value?(o.splice(c.index,1),a(w0e([],o,!0))):(e.dismiss,Nnt.DismissReason.cancel),[2]}))}))})):"DOWNLOAD"===c.id&&(i=null===(e=c.rowData)||void 0===e?void 0:e.path,l=null===(t=c.rowData)||void 0===t?void 0:t.name,b0e(void 0,void 0,void 0,(function(){var e,t,n,o,a;return y0e(this,(function(s){switch(s.label){case 0:e="".concat(r,"/").concat(i),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,IUe.get(e,{responseType:"blob"})];case 2:return t=s.sent(),n=URL.createObjectURL(new Blob([t.data])),(o=document.createElement("a")).href=n,o.download=l,document.body.appendChild(o),o.click(),o.remove(),[3,4];case 3:return a=s.sent(),console.error("Error downloading file:",a),[3,4];case 4:return[2]}}))})))}),[c]),x.default.createElement(e.Fragment,null,x.default.createElement(eZe,{key:"TableFile",dataSource:o,toolbarSetting:{showBottomToolbar:!1,showTopToolbar:!1},setDataSource:a,defaultValue:{id:"",name:"",path:"",size:0,status:!1,title:"",type:"",virtualPath:""},columns:d,commandClick:u,addDisable:!0,editDisable:!1}),x.default.createElement("div",{style:{marginTop:"1rem",width:"50%"}},x.default.createElement(_nt,{t:n,token:i,saveUrl:l,callback:function(e){setTimeout((function(){a((function(t){return w0e(w0e([],t,!0),e,!0)}))}),100)}})))},Ont=function(){return Ont=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ont.apply(this,arguments)};function Int(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}var Dnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left_svg__feather chevron-left_svg__feather-chevron-left","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"m15 18-6-6 6-6"}))},Pnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right_svg__feather chevron-right_svg__feather-chevron-right","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"m9 18 6-6-6-6"}))},Tnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"edit_svg__feather edit_svg__feather-edit","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),E.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))},Hnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"image_svg__feather image_svg__feather-image","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("rect",{x:3,y:3,width:18,height:18,rx:2,ry:2}),E.createElement("circle",{cx:8.5,cy:8.5,r:1.5}),E.createElement("path",{d:"m21 15-5-5L5 21"}))},Lnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"info_svg__feather info_svg__feather-info","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("circle",{cx:12,cy:12,r:10}),E.createElement("path",{d:"M12 16v-4M12 8h.01"}))},znt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"paperclip_svg__feather paperclip_svg__feather-paperclip","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"}))},Rnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"plus_svg__feather plus_svg__feather-plus","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"M12 5v14M5 12h14"}))},Bnt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"send_svg__feather send_svg__feather-send","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"M22 2 11 13M22 2l-7 20-4-9-9-4 20-7z"}))},$nt=function(e){var t=e.title,n=e.titleId,r=Int(e,["title","titleId"]);return E.createElement("svg",Ont({xmlns:"http://www.w3.org/2000/svg",width:r.fontSize||24,height:r.fontSize||24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:r.strokeWidth||1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"x_svg__feather x_svg__feather-x","aria-labelledby":n},r),t?E.createElement("title",{id:n},t):null,E.createElement("path",{d:"M18 6 6 18M6 6l12 12"}))},Znt=function(e){var t=e.title,n=e.handleModal,r=e.typeModal,o=void 0===r?"Edit":r,a=e.component,i=e.style;return x.default.createElement("div",{className:"modal-header d-flex align-items-center justify-content-between mb-1",style:v0e({},i)},x.default.createElement("div",{className:"d-flex align-items-center justify-content-start"},x.default.createElement("h5",{className:"modal-title"},"Edit"===o||"Approval"===o?x.default.createElement(Tnt,{fontSize:17,className:"me-1"}):"View"===o||"Detail"===o?x.default.createElement(Lnt,{fontSize:17,className:"me-1"}):"Order"===o?x.default.createElement("span",{className:"e-icons e-sorting-1 me-1",style:{fontSize:"17px"}}):"Process"===o?x.default.createElement("span",{className:"e-flat e-icons e-paste-match-destination me-1",style:{fontSize:"17px"}}):"View_Process"===o?x.default.createElement("span",{className:"e-flat e-icons e-comments me-1",style:{fontSize:"17px"}}):"SendEmail"===o?x.default.createElement("span",{className:"e-flat e-icons e-send-1 me-1",style:{fontSize:"17px"}}):x.default.createElement(Rnt,{fontSize:17,className:"me-1"})," ",t),a?a():x.default.createElement(x.default.Fragment,null)),x.default.createElement("div",{className:"todo-item-action d-flex align-items-center"},x.default.createElement($nt,{className:w1e("fw-normal mt-25 cursor-pointer",{"d-none":!n}),fontSize:20,onClick:n})))},Vnt={exports:{}};!function(e){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(i(e,t))return!1;return!0}function s(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,r=[],o=e.length;for(n=0;n<o;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)i(t,n)&&(e[n]=t[n]);return i(t,"toString")&&(e.toString=t.toString),i(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Ht(e,t,n,r,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){var t=null,r=!1,o=e._d&&!isNaN(e._d.getTime());return o&&(t=f(e),r=n.call(t.parsedDateParts,(function(e){return null!=e})),o=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(o=o&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?o:(e._isValid=o,e._isValid)}function v(e){var t=p(NaN);return null!=e?h(f(t),e):f(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var g=r.momentProperties=[],b=!1;function y(e,t){var n,r,o,a=g.length;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=f(t)),s(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)s(o=t[r=g[n]])||(e[r]=o);return e}function w(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,r.updateOffset(this),b=!1)}function x(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function E(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return h((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var o,a,l,s=[],c=arguments.length;for(a=0;a<c;a++){if(o="","object"==typeof arguments[a]){for(l in o+="\n["+a+"] ",arguments[0])i(arguments[0],l)&&(o+=l+": "+arguments[0][l]+", ");o=o.slice(0,-2)}else o=arguments[a];s.push(o)}E(e+"\nArguments: "+Array.prototype.slice.call(s).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var S,C={};function M(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),C[e]||(E(t),C[e]=!0)}function _(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function N(e,t){var n,r=h({},e);for(n in t)i(t,n)&&(a(e[n])&&a(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)i(e,n)&&!i(t,n)&&a(e[n])&&(r[n]=h({},r[n]));return r}function A(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)i(e,t)&&n.push(t);return n};function O(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,D=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,P={},T={};function H(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(T[e]=o),t&&(T[t[0]]=function(){return O(o.apply(this,arguments),t[1],t[2])}),n&&(T[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function L(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e,t){return e.isValid()?(t=R(t,e.localeData()),P[t]=P[t]||function(e){var t,n,r=e.match(I);for(t=0,n=r.length;t<n;t++)T[r[t]]?r[t]=T[r[t]]:r[t]=L(r[t]);return function(t){var o,a="";for(o=0;o<n;o++)a+=_(r[o])?r[o].call(t,e):r[o];return a}}(t),P[t](e)):e.localeData().invalidDate()}function R(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(D.lastIndex=0;n>=0&&D.test(e);)e=e.replace(D,r),D.lastIndex=0,n-=1;return e}var B={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function $(e){return"string"==typeof e?B[e]||B[e.toLowerCase()]:void 0}function Z(e){var t,n,r={};for(n in e)i(e,n)&&(t=$(n))&&(r[t]=e[n]);return r}var V={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var j,W=/\d/,F=/\d\d/,q=/\d{3}/,Y=/\d{4}/,U=/[+-]?\d{6}/,K=/\d\d?/,G=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,Q=/\d{1,3}/,J=/\d{1,4}/,ee=/[+-]?\d{1,6}/,te=/\d+/,ne=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ie=/^[1-9]\d?/,le=/^([1-9]\d|\d)/;function se(e,t,n){j[e]=_(t)?t:function(e,r){return e&&n?n:t}}function ce(e,t){return i(j,e)?j[e](t._strict,t._locale):new RegExp(function(e){return ue(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,o){return t||n||r||o})))}(e))}function ue(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function he(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=de(t)),n}j={};var pe={};function fe(e,t){var n,r,o=t;for("string"==typeof e&&(e=[e]),c(t)&&(o=function(e,n){n[t]=he(e)}),r=e.length,n=0;n<r;n++)pe[e[n]]=o}function me(e,t){fe(e,(function(e,n,r,o){r._w=r._w||{},t(e,r._w,r,o)}))}function ve(e,t,n){null!=t&&i(pe,e)&&pe[e](t,n._a,n,e)}function ge(e){return e%4==0&&e%100!=0||e%400==0}var be=0,ye=1,we=2,xe=3,Ee=4,ke=5,Se=6,Ce=7,Me=8;function _e(e){return ge(e)?366:365}H("Y",0,0,(function(){var e=this.year();return e<=9999?O(e,4):"+"+e})),H(0,["YY",2],0,(function(){return this.year()%100})),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),se("Y",ne),se("YY",K,F),se("YYYY",J,Y),se("YYYYY",ee,U),se("YYYYYY",ee,U),fe(["YYYYY","YYYYYY"],be),fe("YYYY",(function(e,t){t[be]=2===e.length?r.parseTwoDigitYear(e):he(e)})),fe("YY",(function(e,t){t[be]=r.parseTwoDigitYear(e)})),fe("Y",(function(e,t){t[be]=parseInt(e,10)})),r.parseTwoDigitYear=function(e){return he(e)+(he(e)>68?1900:2e3)};var Ne,Ae=Oe("FullYear",!0);function Oe(e,t){return function(n){return null!=n?(De(this,e,n),r.updateOffset(this,t),this):Ie(this,e)}}function Ie(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function De(e,t,n){var r,o,a,i,l;if(e.isValid()&&!isNaN(n)){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,i=e.month(),l=29!==(l=e.date())||1!==i||ge(a)?l:28,o?r.setUTCFullYear(a,i,l):r.setFullYear(a,i,l)}}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=function(e,t){return(e%t+t)%t}(t,12);return e+=(t-n)/12,1===n?ge(e)?29:28:31-n%7%2}Ne=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",(function(){return this.month()+1})),H("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),H("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),se("M",K,ie),se("MM",K,F),se("MMM",(function(e,t){return t.monthsShortRegex(e)})),se("MMMM",(function(e,t){return t.monthsRegex(e)})),fe(["M","MM"],(function(e,t){t[ye]=he(e)-1})),fe(["MMM","MMMM"],(function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);null!=o?t[ye]=o:f(n).invalidMonth=e}));var Te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),He="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Le=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ze=ae,Re=ae;function Be(e,t,n){var r,o,a,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(o=Ne.call(this._shortMonthsParse,i))?o:null:-1!==(o=Ne.call(this._longMonthsParse,i))?o:null:"MMM"===t?-1!==(o=Ne.call(this._shortMonthsParse,i))||-1!==(o=Ne.call(this._longMonthsParse,i))?o:null:-1!==(o=Ne.call(this._longMonthsParse,i))||-1!==(o=Ne.call(this._shortMonthsParse,i))?o:null}function $e(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=he(t);else if(!c(t=e.localeData().monthsParse(t)))return e;var n=t,r=e.date();return r=r<29?r:Math.min(r,Pe(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Ze(e){return null!=e?($e(this,e),r.updateOffset(this,!0),this):Ie(this,"Month")}function Ve(){function e(e,t){return t.length-e.length}var t,n,r,o,a=[],i=[],l=[];for(t=0;t<12;t++)n=p([2e3,t]),r=ue(this.monthsShort(n,"")),o=ue(this.months(n,"")),a.push(r),i.push(o),l.push(o),l.push(r);a.sort(e),i.sort(e),l.sort(e),this._monthsRegex=new RegExp("^("+l.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+a.join("|")+")","i")}function je(e,t,n,r,o,a,i){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,r,o,a,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,r,o,a,i),l}function We(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Fe(e,t,n){var r=7+t-n;return-(7+We(e,0,r).getUTCDay()-t)%7+r-1}function qe(e,t,n,r,o){var a,i,l=1+7*(t-1)+(7+n-r)%7+Fe(e,r,o);return l<=0?i=_e(a=e-1)+l:l>_e(e)?(a=e+1,i=l-_e(e)):(a=e,i=l),{year:a,dayOfYear:i}}function Ye(e,t,n){var r,o,a=Fe(e.year(),t,n),i=Math.floor((e.dayOfYear()-a-1)/7)+1;return i<1?r=i+Ue(o=e.year()-1,t,n):i>Ue(e.year(),t,n)?(r=i-Ue(e.year(),t,n),o=e.year()+1):(o=e.year(),r=i),{week:r,year:o}}function Ue(e,t,n){var r=Fe(e,t,n),o=Fe(e+1,t,n);return(_e(e)-r+o)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),se("w",K,ie),se("ww",K,F),se("W",K,ie),se("WW",K,F),me(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=he(e)}));function Ke(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("d",0,"do","day"),H("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),H("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),H("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),se("d",K),se("e",K),se("E",K),se("dd",(function(e,t){return t.weekdaysMinRegex(e)})),se("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),se("dddd",(function(e,t){return t.weekdaysRegex(e)})),me(["dd","ddd","dddd"],(function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:f(n).invalidWeekday=e})),me(["d","e","E"],(function(e,t,n,r){t[r]=he(e)}));var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Je=ae,et=ae,tt=ae;function nt(e,t,n){var r,o,a,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(o=Ne.call(this._weekdaysParse,i))?o:null:"ddd"===t?-1!==(o=Ne.call(this._shortWeekdaysParse,i))?o:null:-1!==(o=Ne.call(this._minWeekdaysParse,i))?o:null:"dddd"===t?-1!==(o=Ne.call(this._weekdaysParse,i))||-1!==(o=Ne.call(this._shortWeekdaysParse,i))||-1!==(o=Ne.call(this._minWeekdaysParse,i))?o:null:"ddd"===t?-1!==(o=Ne.call(this._shortWeekdaysParse,i))||-1!==(o=Ne.call(this._weekdaysParse,i))||-1!==(o=Ne.call(this._minWeekdaysParse,i))?o:null:-1!==(o=Ne.call(this._minWeekdaysParse,i))||-1!==(o=Ne.call(this._weekdaysParse,i))||-1!==(o=Ne.call(this._shortWeekdaysParse,i))?o:null}function rt(){function e(e,t){return t.length-e.length}var t,n,r,o,a,i=[],l=[],s=[],c=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=ue(this.weekdaysMin(n,"")),o=ue(this.weekdaysShort(n,"")),a=ue(this.weekdays(n,"")),i.push(r),l.push(o),s.push(a),c.push(r),c.push(o),c.push(a);i.sort(e),l.sort(e),s.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function ot(){return this.hours()%12||12}function at(e,t){H(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function it(e,t){return t._meridiemParse}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,ot),H("k",["kk",2],0,(function(){return this.hours()||24})),H("hmm",0,0,(function(){return""+ot.apply(this)+O(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+ot.apply(this)+O(this.minutes(),2)+O(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+O(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+O(this.minutes(),2)+O(this.seconds(),2)})),at("a",!0),at("A",!1),se("a",it),se("A",it),se("H",K,le),se("h",K,ie),se("k",K,ie),se("HH",K,F),se("hh",K,F),se("kk",K,F),se("hmm",G),se("hmmss",X),se("Hmm",G),se("Hmmss",X),fe(["H","HH"],xe),fe(["k","kk"],(function(e,t,n){var r=he(e);t[xe]=24===r?0:r})),fe(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),fe(["h","hh"],(function(e,t,n){t[xe]=he(e),f(n).bigHour=!0})),fe("hmm",(function(e,t,n){var r=e.length-2;t[xe]=he(e.substr(0,r)),t[Ee]=he(e.substr(r)),f(n).bigHour=!0})),fe("hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[xe]=he(e.substr(0,r)),t[Ee]=he(e.substr(r,2)),t[ke]=he(e.substr(o)),f(n).bigHour=!0})),fe("Hmm",(function(e,t,n){var r=e.length-2;t[xe]=he(e.substr(0,r)),t[Ee]=he(e.substr(r))})),fe("Hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[xe]=he(e.substr(0,r)),t[Ee]=he(e.substr(r,2)),t[ke]=he(e.substr(o))}));var lt=Oe("Hours",!0);var st,ct={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:He,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Qe,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},ut={},dt={};function ht(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function pt(e){return e?e.toLowerCase().replace("_","-"):e}function ft(t){var n=null;if(void 0===ut[t]&&e&&e.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(t))try{n=st._abbr,function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}("./locale/"+t),mt(n)}catch(e){ut[t]=null}return ut[t]}function mt(e,t){var n;return e&&((n=s(t)?gt(e):vt(e,t))?st=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),st._abbr}function vt(e,t){if(null!==t){var n,r=ct;if(t.abbr=e,null!=ut[e])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ut[e]._config;else if(null!=t.parentLocale)if(null!=ut[t.parentLocale])r=ut[t.parentLocale]._config;else{if(null==(n=ft(t.parentLocale)))return dt[t.parentLocale]||(dt[t.parentLocale]=[]),dt[t.parentLocale].push({name:e,config:t}),null;r=n._config}return ut[e]=new A(N(r,t)),dt[e]&&dt[e].forEach((function(e){vt(e.name,e.config)})),mt(e),ut[e]}return delete ut[e],null}function gt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return st;if(!o(e)){if(t=ft(e))return t;e=[e]}return function(e){for(var t,n,r,o,a=0;a<e.length;){for(t=(o=pt(e[a]).split("-")).length,n=(n=pt(e[a+1]))?n.split("-"):null;t>0;){if(r=ft(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&ht(o,n)>=t-1)break;t--}a++}return st}(e)}function bt(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[ye]<0||n[ye]>11?ye:n[we]<1||n[we]>Pe(n[be],n[ye])?we:n[xe]<0||n[xe]>24||24===n[xe]&&(0!==n[Ee]||0!==n[ke]||0!==n[Se])?xe:n[Ee]<0||n[Ee]>59?Ee:n[ke]<0||n[ke]>59?ke:n[Se]<0||n[Se]>999?Se:-1,f(e)._overflowDayOfYear&&(t<be||t>we)&&(t=we),f(e)._overflowWeeks&&-1===t&&(t=Ce),f(e)._overflowWeekday&&-1===t&&(t=Me),f(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xt=/Z|[+-]\d\d(?::?\d\d)?/,Et=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],St=/^\/?Date\((-?\d+)/i,Ct=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Mt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function _t(e){var t,n,r,o,a,i,l=e._i,s=yt.exec(l)||wt.exec(l),c=Et.length,u=kt.length;if(s){for(f(e).iso=!0,t=0,n=c;t<n;t++)if(Et[t][1].exec(s[1])){o=Et[t][0],r=!1!==Et[t][2];break}if(null==o)return void(e._isValid=!1);if(s[3]){for(t=0,n=u;t<n;t++)if(kt[t][1].exec(s[3])){a=(s[2]||" ")+kt[t][0];break}if(null==a)return void(e._isValid=!1)}if(!r&&null!=a)return void(e._isValid=!1);if(s[4]){if(!xt.exec(s[4]))return void(e._isValid=!1);i="Z"}e._f=o+(a||"")+(i||""),Pt(e)}else e._isValid=!1}function Nt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function At(e){var t,n=Ct.exec(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(n){if(t=function(e,t,n,r,o,a){var i=[Nt(e),He.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(o,10)];return a&&i.push(parseInt(a,10)),i}(n[4],n[3],n[2],n[5],n[6],n[7]),!function(e,t,n){return!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(n[1],t,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return Mt[e];if(t)return 0;var r=parseInt(n,10),o=r%100;return(r-o)/100*60+o}(n[8],n[9],n[10]),e._d=We.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function Ot(e,t,n){return null!=e?e:null!=t?t:n}function It(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Dt(e){var t,n,r,o,a,i=[];if(!e._d){for(r=It(e),e._w&&null==e._a[we]&&null==e._a[ye]&&function(e){var t,n,r,o,a,i,l,s,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,i=4,n=Ot(t.GG,e._a[be],Ye(Lt(),1,4).year),r=Ot(t.W,1),((o=Ot(t.E,1))<1||o>7)&&(s=!0)):(a=e._locale._week.dow,i=e._locale._week.doy,c=Ye(Lt(),a,i),n=Ot(t.gg,e._a[be],c.year),r=Ot(t.w,c.week),null!=t.d?((o=t.d)<0||o>6)&&(s=!0):null!=t.e?(o=t.e+a,(t.e<0||t.e>6)&&(s=!0)):o=a),r<1||r>Ue(n,a,i)?f(e)._overflowWeeks=!0:null!=s?f(e)._overflowWeekday=!0:(l=qe(n,r,o,a,i),e._a[be]=l.year,e._dayOfYear=l.dayOfYear)}(e),null!=e._dayOfYear&&(a=Ot(e._a[be],r[be]),(e._dayOfYear>_e(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),n=We(a,0,e._dayOfYear),e._a[ye]=n.getUTCMonth(),e._a[we]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=i[t]=r[t];for(;t<7;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[xe]&&0===e._a[Ee]&&0===e._a[ke]&&0===e._a[Se]&&(e._nextDay=!0,e._a[xe]=0),e._d=(e._useUTC?We:je).apply(null,i),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[xe]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(f(e).weekdayMismatch=!0)}}function Pt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],f(e).empty=!0;var t,n,o,a,i,l,s,c=""+e._i,u=c.length,d=0;for(s=(o=R(e._f,e._locale).match(I)||[]).length,t=0;t<s;t++)a=o[t],(n=(c.match(ce(a,e))||[])[0])&&((i=c.substr(0,c.indexOf(n))).length>0&&f(e).unusedInput.push(i),c=c.slice(c.indexOf(n)+n.length),d+=n.length),T[a]?(n?f(e).empty=!1:f(e).unusedTokens.push(a),ve(a,n,e)):e._strict&&!n&&f(e).unusedTokens.push(a);f(e).charsLeftOver=u-d,c.length>0&&f(e).unusedInput.push(c),e._a[xe]<=12&&!0===f(e).bigHour&&e._a[xe]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[xe]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[xe],e._meridiem),null!==(l=f(e).era)&&(e._a[be]=e._locale.erasConvertYear(l,e._a[be])),Dt(e),bt(e)}else At(e);else _t(e)}function Tt(e){var t=e._i,n=e._f;return e._locale=e._locale||gt(e._l),null===t||void 0===n&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),x(t)?new w(bt(t)):(u(t)?e._d=t:o(n)?function(e){var t,n,r,o,a,i,l=!1,s=e._f.length;if(0===s)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<s;o++)a=0,i=!1,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Pt(t),m(t)&&(i=!0),a+=f(t).charsLeftOver,a+=10*f(t).unusedTokens.length,f(t).score=a,l?a<r&&(r=a,n=t):(null==r||a<r||i)&&(r=a,n=t,i&&(l=!0));h(e,n||t)}(e):n?Pt(e):function(e){var t=e._i;s(t)?e._d=new Date(r.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,At(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):o(t)?(e._a=d(t.slice(0),(function(e){return parseInt(e,10)})),Dt(e)):a(t)?function(e){if(!e._d){var t=Z(e._i),n=void 0===t.day?t.date:t.day;e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Dt(e)}}(e):c(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),m(e)||(e._d=null),e))}function Ht(e,t,n,r,i){var s={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(a(e)&&l(e)||o(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=n,s._i=e,s._f=t,s._strict=r,function(e){var t=new w(bt(Tt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}(s)}function Lt(e,t,n,r){return Ht(e,t,n,r,!1)}r.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var zt=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Lt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()})),Rt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Lt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:v()}));function Bt(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Lt();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var $t=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Zt(e){var t,n,r=!1,o=$t.length;for(t in e)if(i(e,t)&&(-1===Ne.call($t,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<o;++n)if(e[$t[n]]){if(r)return!1;parseFloat(e[$t[n]])!==he(e[$t[n]])&&(r=!0)}return!0}function Vt(e){var t=Z(e),n=t.year||0,r=t.quarter||0,o=t.month||0,a=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,s=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=Zt(t),this._milliseconds=+u+1e3*c+6e4*s+1e3*l*60*60,this._days=+i+7*a,this._months=+o+3*r+12*n,this._data={},this._locale=gt(),this._bubble()}function jt(e){return e instanceof Vt}function Wt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,t){H(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+O(~~(e/60),2)+t+O(~~e%60,2)}))}Ft("Z",":"),Ft("ZZ",""),se("Z",oe),se("ZZ",oe),fe(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Yt(oe,e)}));var qt=/([\+\-]|\d\d)/gi;function Yt(e,t){var n,r,o=(t||"").match(e);return null===o?null:0===(r=60*(n=((o[o.length-1]||[])+"").match(qt)||["-",0,0])[1]+he(n[2]))?0:"+"===n[0]?r:-r}function Ut(e,t){var n,o;return t._isUTC?(n=t.clone(),o=(x(e)||u(e)?e.valueOf():Lt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),r.updateOffset(n,!1),n):Lt(e).local()}function Kt(e){return-Math.round(e._d.getTimezoneOffset())}function Gt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Xt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Qt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Jt(e,t){var n,r,o,a=e,l=null;return jt(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(l=Xt.exec(e))?(n="-"===l[1]?-1:1,a={y:0,d:he(l[we])*n,h:he(l[xe])*n,m:he(l[Ee])*n,s:he(l[ke])*n,ms:he(Wt(1e3*l[Se]))*n}):(l=Qt.exec(e))?(n="-"===l[1]?-1:1,a={y:en(l[2],n),M:en(l[3],n),w:en(l[4],n),d:en(l[5],n),h:en(l[6],n),m:en(l[7],n),s:en(l[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(o=function(e,t){var n;return e.isValid()&&t.isValid()?(t=Ut(t,e),e.isBefore(t)?n=tn(e,t):((n=tn(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}(Lt(a.from),Lt(a.to)),(a={}).ms=o.milliseconds,a.M=o.months),r=new Vt(a),jt(e)&&i(e,"_locale")&&(r._locale=e._locale),jt(e)&&i(e,"_isValid")&&(r._isValid=e._isValid),r}function en(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function tn(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function nn(e,t){return function(n,r){var o;return null===r||isNaN(+r)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),rn(this,Jt(n,r),e),this}}function rn(e,t,n,o){var a=t._milliseconds,i=Wt(t._days),l=Wt(t._months);e.isValid()&&(o=null==o||o,l&&$e(e,Ie(e,"Month")+l*n),i&&De(e,"Date",Ie(e,"Date")+i*n),a&&e._d.setTime(e._d.valueOf()+a*n),o&&r.updateOffset(e,i||l))}Jt.fn=Vt.prototype,Jt.invalid=function(){return Jt(NaN)};var on=nn(1,"add"),an=nn(-1,"subtract");function ln(e){return"string"==typeof e||e instanceof String}function sn(e){return x(e)||u(e)||ln(e)||c(e)||function(e){var t=o(e),n=!1;return t&&(n=0===e.filter((function(t){return!c(t)&&ln(e)})).length),t&&n}(e)||function(e){var t,n,r=a(e)&&!l(e),o=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=s.length;for(t=0;t<c;t+=1)n=s[t],o=o||i(e,n);return r&&o}(e)||null==e}function cn(e){var t,n=a(e)&&!l(e),r=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<o.length;t+=1)r=r||i(e,o[t]);return n&&r}function un(e,t){if(e.date()<t.date())return-un(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function dn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=gt(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var hn=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function pn(){return this._locale}var fn=1e3,mn=6e4,vn=60*mn,gn=3506328*vn;function bn(e,t){return(e%t+t)%t}function yn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-gn:new Date(e,t,n).valueOf()}function wn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-gn:Date.UTC(e,t,n)}function xn(e,t){return t.erasAbbrRegex(e)}function En(){var e,t,n,r,o,a=[],i=[],l=[],s=[],c=this.eras();for(e=0,t=c.length;e<t;++e)n=ue(c[e].name),r=ue(c[e].abbr),o=ue(c[e].narrow),i.push(n),a.push(r),l.push(o),s.push(n),s.push(r),s.push(o);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+l.join("|")+")","i")}function kn(e,t){H(0,[e,e.length],0,t)}function Sn(e,t,n,r,o){var a;return null==e?Ye(this,r,o).year:(t>(a=Ue(e,r,o))&&(t=a),Cn.call(this,e,t,n,r,o))}function Cn(e,t,n,r,o){var a=qe(e,t,n,r,o),i=We(a.year,0,a.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),se("N",xn),se("NN",xn),se("NNN",xn),se("NNNN",(function(e,t){return t.erasNameRegex(e)})),se("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),fe(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?f(n).era=o:f(n).invalidEra=e})),se("y",te),se("yy",te),se("yyy",te),se("yyyy",te),se("yo",(function(e,t){return t._eraYearOrdinalRegex||te})),fe(["y","yy","yyy","yyyy"],be),fe(["yo"],(function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[be]=n._locale.eraYearOrdinalParse(e,o):t[be]=parseInt(e,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),kn("gggg","weekYear"),kn("ggggg","weekYear"),kn("GGGG","isoWeekYear"),kn("GGGGG","isoWeekYear"),se("G",ne),se("g",ne),se("GG",K,F),se("gg",K,F),se("GGGG",J,Y),se("gggg",J,Y),se("GGGGG",ee,U),se("ggggg",ee,U),me(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=he(e)})),me(["gg","GG"],(function(e,t,n,o){t[o]=r.parseTwoDigitYear(e)})),H("Q",0,"Qo","quarter"),se("Q",W),fe("Q",(function(e,t){t[ye]=3*(he(e)-1)})),H("D",["DD",2],"Do","date"),se("D",K,ie),se("DD",K,F),se("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),fe(["D","DD"],we),fe("Do",(function(e,t){t[we]=he(e.match(K)[0])}));var Mn=Oe("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),se("DDD",Q),se("DDDD",q),fe(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=he(e)})),H("m",["mm",2],0,"minute"),se("m",K,le),se("mm",K,F),fe(["m","mm"],Ee);var _n=Oe("Minutes",!1);H("s",["ss",2],0,"second"),se("s",K,le),se("ss",K,F),fe(["s","ss"],ke);var Nn,An,On=Oe("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),se("S",Q,W),se("SS",Q,F),se("SSS",Q,q),Nn="SSSS";Nn.length<=9;Nn+="S")se(Nn,te);function In(e,t){t[Se]=he(1e3*("0."+e))}for(Nn="S";Nn.length<=9;Nn+="S")fe(Nn,In);An=Oe("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Dn=w.prototype;function Pn(e){return e}Dn.add=on,Dn.calendar=function(e,t){1===arguments.length&&(arguments[0]?sn(arguments[0])?(e=arguments[0],t=void 0):cn(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Lt(),o=Ut(n,this).startOf("day"),a=r.calendarFormat(this,o)||"sameElse",i=t&&(_(t[a])?t[a].call(this,n):t[a]);return this.format(i||this.localeData().calendar(a,this,Lt(n)))},Dn.clone=function(){return new w(this)},Dn.diff=function(e,t,n){var r,o,a;if(!this.isValid())return NaN;if(!(r=Ut(e,this)).isValid())return NaN;switch(o=6e4*(r.utcOffset()-this.utcOffset()),t=$(t)){case"year":a=un(this,r)/12;break;case"month":a=un(this,r);break;case"quarter":a=un(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-o)/864e5;break;case"week":a=(this-r-o)/6048e5;break;default:a=this-r}return n?a:de(a)},Dn.endOf=function(e){var t,n;if(void 0===(e=$(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?wn:yn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=vn-bn(t+(this._isUTC?0:this.utcOffset()*mn),vn)-1;break;case"minute":t=this._d.valueOf(),t+=mn-bn(t,mn)-1;break;case"second":t=this._d.valueOf(),t+=fn-bn(t,fn)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},Dn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)},Dn.from=function(e,t){return this.isValid()&&(x(e)&&e.isValid()||Lt(e).isValid())?Jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.fromNow=function(e){return this.from(Lt(),e)},Dn.to=function(e,t){return this.isValid()&&(x(e)&&e.isValid()||Lt(e).isValid())?Jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.toNow=function(e){return this.to(Lt(),e)},Dn.get=function(e){return _(this[e=$(e)])?this[e]():this},Dn.invalidAt=function(){return f(this).overflow},Dn.isAfter=function(e,t){var n=x(e)?e:Lt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Dn.isBefore=function(e,t){var n=x(e)?e:Lt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Dn.isBetween=function(e,t,n,r){var o=x(e)?e:Lt(e),a=x(t)?t:Lt(t);return!!(this.isValid()&&o.isValid()&&a.isValid())&&("("===(r=r||"()")[0]?this.isAfter(o,n):!this.isBefore(o,n))&&(")"===r[1]?this.isBefore(a,n):!this.isAfter(a,n))},Dn.isSame=function(e,t){var n,r=x(e)?e:Lt(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Dn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Dn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Dn.isValid=function(){return m(this)},Dn.lang=hn,Dn.locale=dn,Dn.localeData=pn,Dn.max=Rt,Dn.min=zt,Dn.parsingFlags=function(){return h({},f(this))},Dn.set=function(e,t){if("object"==typeof e){var n,r=function(e){var t,n=[];for(t in e)i(e,t)&&n.push({unit:t,priority:V[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}(e=Z(e)),o=r.length;for(n=0;n<o;n++)this[r[n].unit](e[r[n].unit])}else if(_(this[e=$(e)]))return this[e](t);return this},Dn.startOf=function(e){var t,n;if(void 0===(e=$(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?wn:yn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=bn(t+(this._isUTC?0:this.utcOffset()*mn),vn);break;case"minute":t=this._d.valueOf(),t-=bn(t,mn);break;case"second":t=this._d.valueOf(),t-=bn(t,fn)}return this._d.setTime(t),r.updateOffset(this,!0),this},Dn.subtract=an,Dn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Dn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Dn.toDate=function(){return new Date(this.valueOf())},Dn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?z(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):_(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(n,"Z")):z(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Dn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",o="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=o+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Dn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Dn.toJSON=function(){return this.isValid()?this.toISOString():null},Dn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Dn.unix=function(){return Math.floor(this.valueOf()/1e3)},Dn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Dn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Dn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""},Dn.eraNarrow=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""},Dn.eraAbbr=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""},Dn.eraYear=function(){var e,t,n,o,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,o=this.clone().startOf("day").valueOf(),a[e].since<=o&&o<=a[e].until||a[e].until<=o&&o<=a[e].since)return(this.year()-r(a[e].since).year())*n+a[e].offset;return this.year()},Dn.year=Ae,Dn.isLeapYear=function(){return ge(this.year())},Dn.weekYear=function(e){return Sn.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Dn.isoWeekYear=function(e){return Sn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Dn.quarter=Dn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Dn.month=Ze,Dn.daysInMonth=function(){return Pe(this.year(),this.month())},Dn.week=Dn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Dn.isoWeek=Dn.isoWeeks=function(e){var t=Ye(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Dn.weeksInYear=function(){var e=this.localeData()._week;return Ue(this.year(),e.dow,e.doy)},Dn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ue(this.weekYear(),e.dow,e.doy)},Dn.isoWeeksInYear=function(){return Ue(this.year(),1,4)},Dn.isoWeeksInISOWeekYear=function(){return Ue(this.isoWeekYear(),1,4)},Dn.date=Mn,Dn.day=Dn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=Ie(this,"Day");return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Dn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Dn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Dn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Dn.hour=Dn.hours=lt,Dn.minute=Dn.minutes=_n,Dn.second=Dn.seconds=On,Dn.millisecond=Dn.milliseconds=An,Dn.utcOffset=function(e,t,n){var o,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Yt(oe,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(o=Kt(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),a!==e&&(!t||this._changeInProgress?rn(this,Jt(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?a:Kt(this)},Dn.utc=function(e){return this.utcOffset(0,e)},Dn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kt(this),"m")),this},Dn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Yt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Dn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Lt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Dn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Dn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Dn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Dn.isUtc=Gt,Dn.isUTC=Gt,Dn.zoneAbbr=function(){return this._isUTC?"UTC":""},Dn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Dn.dates=k("dates accessor is deprecated. Use date instead.",Mn),Dn.months=k("months accessor is deprecated. Use month instead",Ze),Dn.years=k("years accessor is deprecated. Use year instead",Ae),Dn.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),Dn.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return y(t,this),(t=Tt(t))._a?(e=t._isUTC?p(t._a):Lt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,o=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<o;r++)(n&&e[r]!==t[r]||!n&&he(e[r])!==he(t[r]))&&i++;return i+a}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}));var Tn=A.prototype;function Hn(e,t,n,r){var o=gt(),a=p().set(r,t);return o[n](a,e)}function Ln(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return Hn(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=Hn(e,r,n,"month");return o}function zn(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var o,a=gt(),i=e?a._week.dow:0,l=[];if(null!=n)return Hn(t,(n+i)%7,r,"day");for(o=0;o<7;o++)l[o]=Hn(t,(o+i)%7,r,"day");return l}Tn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return _(r)?r.call(t,n):r},Tn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(I).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},Tn.invalidDate=function(){return this._invalidDate},Tn.ordinal=function(e){return this._ordinal.replace("%d",e)},Tn.preparse=Pn,Tn.postformat=Pn,Tn.relativeTime=function(e,t,n,r){var o=this._relativeTime[n];return _(o)?o(e,t,n,r):o.replace(/%d/i,e)},Tn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return _(n)?n(t):n.replace(/%s/i,t)},Tn.set=function(e){var t,n;for(n in e)i(e,n)&&(_(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Tn.eras=function(e,t){var n,o,a,i=this._eras||gt("en")._eras;for(n=0,o=i.length;n<o;++n)switch("string"==typeof i[n].since&&(a=r(i[n].since).startOf("day"),i[n].since=a.valueOf()),typeof i[n].until){case"undefined":i[n].until=1/0;break;case"string":a=r(i[n].until).startOf("day").valueOf(),i[n].until=a.valueOf()}return i},Tn.erasParse=function(e,t,n){var r,o,a,i,l,s=this.eras();for(e=e.toUpperCase(),r=0,o=s.length;r<o;++r)if(a=s[r].name.toUpperCase(),i=s[r].abbr.toUpperCase(),l=s[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(i===e)return s[r];break;case"NNNN":if(a===e)return s[r];break;case"NNNNN":if(l===e)return s[r]}else if([a,i,l].indexOf(e)>=0)return s[r]},Tn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},Tn.erasAbbrRegex=function(e){return i(this,"_erasAbbrRegex")||En.call(this),e?this._erasAbbrRegex:this._erasRegex},Tn.erasNameRegex=function(e){return i(this,"_erasNameRegex")||En.call(this),e?this._erasNameRegex:this._erasRegex},Tn.erasNarrowRegex=function(e){return i(this,"_erasNarrowRegex")||En.call(this),e?this._erasNarrowRegex:this._erasRegex},Tn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Le).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},Tn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Le.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Tn.monthsParse=function(e,t,n){var r,o,a;if(this._monthsParseExact)return Be.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},Tn.monthsRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||Ve.call(this),e?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=Re),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Tn.monthsShortRegex=function(e){return this._monthsParseExact?(i(this,"_monthsRegex")||Ve.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ze),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Tn.week=function(e){return Ye(e,this._week.dow,this._week.doy).week},Tn.firstDayOfYear=function(){return this._week.doy},Tn.firstDayOfWeek=function(){return this._week.dow},Tn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ke(n,this._week.dow):e?n[e.day()]:n},Tn.weekdaysMin=function(e){return!0===e?Ke(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Tn.weekdaysShort=function(e){return!0===e?Ke(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Tn.weekdaysParse=function(e,t,n){var r,o,a;if(this._weekdaysParseExact)return nt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},Tn.weekdaysRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=Je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Tn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Tn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Tn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Tn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},mt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===he(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",mt),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",gt);var Rn=Math.abs;function Bn(e,t,n,r){var o=Jt(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function $n(e){return e<0?Math.floor(e):Math.ceil(e)}function Zn(e){return 4800*e/146097}function Vn(e){return 146097*e/4800}function jn(e){return function(){return this.as(e)}}var Wn=jn("ms"),Fn=jn("s"),qn=jn("m"),Yn=jn("h"),Un=jn("d"),Kn=jn("w"),Gn=jn("M"),Xn=jn("Q"),Qn=jn("y"),Jn=Wn;function er(e){return function(){return this.isValid()?this._data[e]:NaN}}var tr=er("milliseconds"),nr=er("seconds"),rr=er("minutes"),or=er("hours"),ar=er("days"),ir=er("months"),lr=er("years");var sr=Math.round,cr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ur(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}var dr=Math.abs;function hr(e){return(e>0)-(e<0)||+e}function pr(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,o,a,i,l,s=dr(this._milliseconds)/1e3,c=dr(this._days),u=dr(this._months),d=this.asSeconds();return d?(e=de(s/60),t=de(e/60),s%=60,e%=60,n=de(u/12),u%=12,r=s?s.toFixed(3).replace(/\.?0+$/,""):"",o=d<0?"-":"",a=hr(this._months)!==hr(d)?"-":"",i=hr(this._days)!==hr(d)?"-":"",l=hr(this._milliseconds)!==hr(d)?"-":"",o+"P"+(n?a+n+"Y":"")+(u?a+u+"M":"")+(c?i+c+"D":"")+(t||e||s?"T":"")+(t?l+t+"H":"")+(e?l+e+"M":"")+(s?l+r+"S":"")):"P0D"}var fr=Vt.prototype;return fr.isValid=function(){return this._isValid},fr.abs=function(){var e=this._data;return this._milliseconds=Rn(this._milliseconds),this._days=Rn(this._days),this._months=Rn(this._months),e.milliseconds=Rn(e.milliseconds),e.seconds=Rn(e.seconds),e.minutes=Rn(e.minutes),e.hours=Rn(e.hours),e.months=Rn(e.months),e.years=Rn(e.years),this},fr.add=function(e,t){return Bn(this,e,t,1)},fr.subtract=function(e,t){return Bn(this,e,t,-1)},fr.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=$(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Zn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Vn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},fr.asMilliseconds=Wn,fr.asSeconds=Fn,fr.asMinutes=qn,fr.asHours=Yn,fr.asDays=Un,fr.asWeeks=Kn,fr.asMonths=Gn,fr.asQuarters=Xn,fr.asYears=Qn,fr.valueOf=Jn,fr._bubble=function(){var e,t,n,r,o,a=this._milliseconds,i=this._days,l=this._months,s=this._data;return a>=0&&i>=0&&l>=0||a<=0&&i<=0&&l<=0||(a+=864e5*$n(Vn(l)+i),i=0,l=0),s.milliseconds=a%1e3,e=de(a/1e3),s.seconds=e%60,t=de(e/60),s.minutes=t%60,n=de(t/60),s.hours=n%24,i+=de(n/24),l+=o=de(Zn(i)),i-=$n(Vn(o)),r=de(l/12),l%=12,s.days=i,s.months=l,s.years=r,this},fr.clone=function(){return Jt(this)},fr.get=function(e){return e=$(e),this.isValid()?this[e+"s"]():NaN},fr.milliseconds=tr,fr.seconds=nr,fr.minutes=rr,fr.hours=or,fr.days=ar,fr.weeks=function(){return de(this.days()/7)},fr.months=ir,fr.years=lr,fr.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,o=!1,a=cr;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(o=e),"object"==typeof t&&(a=Object.assign({},cr,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=function(e,t,n,r){var o=Jt(e).abs(),a=sr(o.as("s")),i=sr(o.as("m")),l=sr(o.as("h")),s=sr(o.as("d")),c=sr(o.as("M")),u=sr(o.as("w")),d=sr(o.as("y")),h=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||i<=1&&["m"]||i<n.m&&["mm",i]||l<=1&&["h"]||l<n.h&&["hh",l]||s<=1&&["d"]||s<n.d&&["dd",s];return null!=n.w&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),(h=h||c<=1&&["M"]||c<n.M&&["MM",c]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=r,ur.apply(null,h)}(this,!o,a,n=this.localeData()),o&&(r=n.pastFuture(+this,r)),n.postformat(r)},fr.toISOString=pr,fr.toString=pr,fr.toJSON=pr,fr.locale=dn,fr.localeData=pn,fr.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pr),fr.lang=hn,H("X",0,0,"unix"),H("x",0,0,"valueOf"),se("x",ne),se("X",/[+-]?\d+(\.\d{1,3})?/),fe("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),fe("x",(function(e,t,n){n._d=new Date(he(e))})),
293
293
  //! moment.js
294
- r.version="2.30.1",function(e){t=e}(Lt),r.fn=Dn,r.min=function(){return Bt("isBefore",[].slice.call(arguments,0))},r.max=function(){return Bt("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return Lt(1e3*e)},r.months=function(e,t){return Ln(e,t,"months")},r.isDate=u,r.locale=mt,r.invalid=v,r.duration=Jt,r.isMoment=x,r.weekdays=function(e,t,n){return zn(e,t,n,"weekdays")},r.parseZone=function(){return Lt.apply(null,arguments).parseZone()},r.localeData=gt,r.isDuration=jt,r.monthsShort=function(e,t){return Ln(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return zn(e,t,n,"weekdaysMin")},r.defineLocale=vt,r.updateLocale=function(e,t){if(null!=t){var n,r,o=ct;null!=ut[e]&&null!=ut[e].parentLocale?ut[e].set(N(ut[e]._config,t)):(null!=(r=ft(e))&&(o=r._config),t=N(o,t),null==r&&(t.abbr=e),(n=new A(t)).parentLocale=ut[e],ut[e]=n),mt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?(ut[e]=ut[e].parentLocale,e===mt()&&mt(e)):null!=ut[e]&&delete ut[e]);return ut[e]},r.locales=function(){return S(ut)},r.weekdaysShort=function(e,t,n){return zn(e,t,n,"weekdaysShort")},r.normalizeUnits=$,r.relativeTimeRounding=function(e){return void 0===e?sr:"function"==typeof e&&(sr=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==cr[e]&&(void 0===t?cr[e]:(cr[e]=t,"s"===e&&(cr.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=Dn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}(Vnt);var jnt=Vnt.exports,Wnt=function(e){return jnt(e).isValid()&&e?jnt(e).format("DD/MM/yyyy HH:mm"):void 0},Fnt=function(e){return null==e},qnt=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Array.isArray(e[n])||(t[n]=e[n]));return t},Ynt=function(t){var n,r=t.control,o=t.id,a=t.name,i=t.type,l=t.label,s=t.labelSize,c=t.required,u=t.widthInput,d=t.errors,h=t.height,p=t.disabled,f=t.alignRight,m=t.row,v=t.isLabel,g=t.placeholder,b=t.autoFocus,y=t.inLine,w=t.callback,E=t.readOnly,k=t.classes,S=t.onBlur,C=g0e(t,["control","id","name","type","label","labelSize","required","widthInput","errors","height","disabled","alignRight","row","isLabel","placeholder","autoFocus","inLine","callback","readOnly","classes","onBlur"]);return x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:w1e(" align",(n={},n[s||""]=s,n[k||""]=k,n["form-row-inline-error"]=d,n),!1===y?"form-group ":"form-row-inline d-flex")},x.default.createElement(e.Fragment,null,!1===v?"":x.default.createElement(X5e,{className:"form-label",for:a},l||""," ",c?x.default.createElement("span",{className:"text-danger"},"*"):""," ")),x.default.createElement("div",{className:w1e("form-input-content",{"hidden-label":!1===v}),style:{}},x.default.createElement(e.Fragment,null,x.default.createElement(O4e,{name:a,control:r,render:function(e){var t=e.field,n=t.value,r=t.onChange;return x.default.createElement(V5e,v0e({id:o,value:Fnt(n)?"":n,onChange:function(e){r(e.target.value),w&&w(e)},onBlur:S,style:{width:"number"==typeof u||"string"==typeof u?u:"",height:"".concat(h,"px"),textAlign:f?"right":"left"},autoFocus:b,disabled:p,placeholder:g,type:i||"text",invalid:d&&!0,rows:m},C,{readOnly:E,checked:n}))}}),d&&x.default.createElement(P5e,null,null==d?void 0:d.message)))))},Unt=function(t){var n,r=t.isMulti,o=t.isLabel,a=t.confirmHandle,i=t.fieldValue,l=t.fieldLabel,s=t.labelComponent,c=t.options,u=t.loadOptions,d=t.control,h=t.placeholder,p=t.disabled,f=t.allowCreate,m=t.onPaste,v=t.onOpenMenu,g=t.onCloseMenu,b=t.name,y=t.label,w=t.labelSize,E=t.required,k=t.errors,S=t.inLine,C=t.callback,M=t.isClearable,_=t.defaultValue,N=t.handleAddNew,A=t.columns,O=t.showFooter,I=t.footerComponent,D=t.maxHeight,P=g0e(t,["isMulti","isLabel","confirmHandle","fieldValue","fieldLabel","labelComponent","options","loadOptions","control","placeholder","disabled","allowCreate","onPaste","onOpenMenu","onCloseMenu","name","label","labelSize","required","errors","inLine","callback","isClearable","defaultValue","handleAddNew","columns","showFooter","footerComponent","maxHeight"]),T=function(e){var t,n=e.onChange,o=e.val;n(r?(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0?o.map((function(e){return e[null!=i?i:"value"]})):[]:Fnt(o)?void 0:o[null!=i?i:"value"]),C&&C(o)};return x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:w1e(!1===S?"form-group ":"form-row-inline d-flex","align",(n={},n[w||""]=w,n["form-row-inline-error"]=k,n))},!1===o?"":x.default.createElement(X5e,{className:"form-label",for:b},y||""," ",E?x.default.createElement("span",{className:"text-danger"},"*"):""," "),x.default.createElement("div",{className:w1e("form-input-content",{"hidden-label":!1===o})},x.default.createElement(O4e,{name:b,control:d,render:function(e){var t,n=e.field,o=n.value,d=n.onChange;return x.default.createElement(JIe,v0e({},P,{value:(r?Array.isArray(o)&&o.length>0:null!=o)?r?c.filter((function(e){return Array.isArray(o)&&o.some((function(t){return e[null!=i?i:"value"]===t}))})):null!==(t=c.find((function(e){return e[null!=i?i:"value"]===o})))&&void 0!==t?t:null!=_?_:"":r?[]:void 0,onChange:function(e){var t;(r||(i&&e?e[i]:null==e?void 0:e.value)!==o)&&(a?a(T,d,e):(d(r?(null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)>0?e.map((function(e){return e[null!=i?i:"value"]})):[]:Fnt(e)?void 0:e[null!=i?i:"value"]),e&&u&&(r?e.forEach((function(e){c.some((function(t){return t[null!=i?i:"value"]===e[null!=i?i:"value"]}))||c.unshift(e)})):_||c.some((function(t){return t[null!=i?i:"value"]===e[null!=i?i:"value"]}))||c.unshift(e)),C&&C(e)))},isClearable:M,isMulti:r,placeholder:h,invalid:k,loadOptions:u,options:c,isDisabled:p,columns:A,fieldValue:i,fieldLabel:l,showFooter:O,handleAdd:N,footerComponent:I,allowCreate:f,formatOptionLabel:s,onCloseMenu:g,onOpenMenu:v,onPaste:m,maxHeight:D}))}}),k&&x.default.createElement(P5e,null,null==k?void 0:k.message))))},Knt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Gnt=function(t){var n=t.data,r=t.listData,o=t.type,a=t.setType,i=t.t,l=t.checkInitProcess,s=t.getProcessApi,c=t.approveProcessApi,u=t.approveMultiProcessApi,d=t.pagingUserApi,h=t.CDN_URL_VIEW,p=t.token,f=t.saveUrl,m=t.approverId,v=t.approverName,g=t.onApproveCompleted,b=e.useState([]),y=b[0],w=b[1],E=e.useState([]),k=E[0],S=E[1],C=e.useState([]),M=C[0],_=C[1],N=e.useState({}),A=N[0],O=N[1],I="approve"===o||"multiApprove"===o,D=function(){a("")},P=function(){return{innerWidth:window.innerWidth,innerHeight:window.innerHeight}},T=e.useState(P()),H=T[0],L=T[1];e.useEffect((function(){var e=function(){L(P())};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var z,R,B=function(e={}){const t=x.default.useRef(),[n,r]=x.default.useState({isDirty:!1,isValidating:!1,isLoading:R4e(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:R4e(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...h7e(e,(()=>r((e=>({...e}))))),formState:n});const o=t.current.control;return o._options=e,S4e({subject:o._subjects.state,next:e=>{x4e(e,o._proxyFormState,o._updateFormState,!0)&&r({...o._formState})}}),x.default.useEffect((()=>{e.values&&!e7e(e.values,o._defaultValues)?o._reset(e.values,o._options.resetOptions):o._resetDefaultValues()}),[e.values,o]),x.default.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),t.current.formState=y4e(n,o),t.current}({defaultValues:{ticketId:null==n?void 0:n.id,userId:[],userName:[],watcher:[]},mode:"onChange"}),$=B.control,Z=B.clearErrors,V=B.reset,j=B.setValue,W=B.handleSubmit;return B.formState,e.useEffect((function(){l&&("approve"===o&&(s?s({ticketId:null==n?void 0:n.id,status:0}).unwrap().then((function(e){var t=null==e?void 0:e.find((function(e){return 0===e.status}));if(O(t),t)if("Handle"===(null==t?void 0:t.workflowStateCode))_([{Id:void 0,Name:i("TransferProcessing")}]);else{var n=JSON.parse((null==t?void 0:t.logWorkflow)||"{}"),r=JSON.parse(n.WorkflowAction||"[]");r&&_(r.sort((function(e,t){return e.Name&&t.Name?e.Name.localeCompare(t.Name):0})))}})).catch((function(){return knt(i("getDataError"))})):knt(i("getProcessApi không hợp lệ!"))),d&&d({$filter:"status==1",$order:"firstName;asc",$pageIndex:1,$pageSize:500}).unwrap().then((function(e){var t,n=null===(t=e.items)||void 0===t?void 0:t.map((function(e){return v0e(v0e({},e),{value:e.loginID,label:e.fullName})}));S(n)})).catch((function(){return knt(i("getDataError"))})))}),[o]),x.default.createElement(h5e,{isOpen:I,backdrop:"static",keyboard:!1,toggle:D,className:"modal-dialog-centered modal-lg",contentClassName:"p-0",onOpened:function(){return b0e(void 0,void 0,void 0,(function(){return y0e(this,(function(e){return j("ticketId",null==n?void 0:n.id),j("ticketInfo",JSON.stringify(qnt(n))),j("userId",m?[m]:[]),j("userName",v?[v]:[]),[2]}))}))},onClosed:function(){Z(),V(),O({}),_([]),w([])}},x.default.createElement(A5e,{id:"form-modal-globalzone",className:"todo-modal modal-form-content",onSubmit:W((function(e){var t,n,a;e.files=JSON.stringify(y),e.userId=null===(t=null==e?void 0:e.userId)||void 0===t?void 0:t.join(","),e.userName=null===(n=null==e?void 0:e.userName)||void 0===n?void 0:n.join(","),e.watcher=null===(a=null==e?void 0:e.watcher)||void 0===a?void 0:a.join(","),"approve"===o?c?c(e).unwrap().then((function(t){g&&g(t),t.isValid?(D(),Ent("".concat(i(null==e?void 0:e.action)," ").concat(i("success")))):Snt(t,i)})).catch((function(){knt("".concat(i(null==e?void 0:e.action)," ").concat(i("fail")))})):knt(i("approveProcessApi không hợp lệ!")):"multiApprove"===o&&(u?r?(e.listTicket=r.filter((function(e){return e.hasPermissionApprove})).map((function(e){return{id:e.id,data:JSON.stringify(qnt(e))}})),u(e).unwrap().then((function(t){g&&g(t),t.isValid?(D(),Ent("".concat(i(null==e?void 0:e.action)," ").concat(i("success")))):Snt(t,i)})).catch((function(){knt("".concat(i(null==e?void 0:e.action)," ").concat(i("fail")))}))):knt(i("listData không hợp lệ!")):knt(i("approveMultiProcessApi không hợp lệ!")))}))},x.default.createElement(Znt,{handleModal:D,typeModal:"Process",title:i("HandleProcess")}),x.default.createElement(d3e.Scrollbars,{autoHide:!0,autoHeight:!0,autoHeightMax:H.innerHeight-180},x.default.createElement(v5e,null,x.default.createElement("section",null,x.default.createElement(W1e,{className:"mb-1 gy-50"},x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Ynt,{control:$,type:"textarea",name:"comment",label:i("Comment"),inLine:!1,required:!1,placeholder:i("Comment")})),(!0===(null==A?void 0:A.isAssignedApprover)||m)&&x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Unt,{options:k,control:$,name:"userId",isMulti:!0,placeholder:i("Select"),label:i("AssignApprovers"),inLine:!1,allowCreate:!1,maxHeight:350,callback:function(e){j("userName",e.map((function(e){return e.fullName})))},columns:[{headerText:"Approver",field:"fullName",width:300,template:function(e){return x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(h,"/").concat(null==e?void 0:e.photo):Knt,alt:"avatar",height:26,width:26,style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}}),x.default.createElement("span",{className:"ms-50"}," ",e.fullName," "))}},{headerText:"Email",field:"email",width:250}],labelSize:"label-small"})),x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Unt,{options:k,control:$,name:"watcher",isMulti:!0,placeholder:i("Select"),label:i("Watcher"),inLine:!1,allowCreate:!1,maxHeight:350,columns:[{headerText:"Watcher",field:"fullName",width:300,template:function(e){return x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(h,"/").concat(null==e?void 0:e.photo):Knt,alt:"avatar",height:26,width:26,style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}}),x.default.createElement("span",{className:"ms-50"}," ",e.fullName," "))}},{headerText:"Email",field:"email",width:250}],labelSize:"label-small"}))),x.default.createElement("div",{style:{marginTop:"10px"}},x.default.createElement("h5",null,i("Attached")),x.default.createElement(Ant,{t:i,CDN_URL_VIEW:h,token:p,saveUrl:f,listFile:y,setListFile:w}))))),x.default.createElement("div",{className:"d-flex justify-content-end p-1",style:{boxShadow:"0 4px 24px 0 rgb(34 41 47 / 10%)"}},(z="multiApprove"===o,R=null==r?void 0:r.every((function(e){return"Handle"===e.currentProcessCode})),x.default.createElement(x.default.Fragment,null,z?R?x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!0),j("action",i("TransferProcessing"))},className:"d-flex btn btn-primary"},i("TransferProcessing"))):x.default.createElement(x.default.Fragment,null,x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!0),j("action",i("Approve"))},className:"d-flex btn btn-primary"},i("Approve"))),x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!1),j("action",i("Refuse"))},className:"d-flex btn btn-primary"},i("Return")))):null==M?void 0:M.map((function(e,t){return x.default.createElement(M2e,{key:t,className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("workflowTransitionId",null==e?void 0:e.Id),j("action",null==e?void 0:e.Name)},className:"d-flex btn btn-primary"},e.Name))})),x.default.createElement(M2e,{color:"secondary",onClick:D,outline:!0,className:"me-1"},i("Close")))))))};const Xnt=e.createContext(null);var Qnt=Object.freeze({__proto__:null,LexicalComposerContext:Xnt,createLexicalComposerContext:function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},useLexicalComposerContext:function(){const t=e.useContext(Xnt);if(null==t)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return t}}),Jnt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const ert=e.createContext(null);var trt=Object.freeze({__proto__:null,LexicalComposerContext:ert,createLexicalComposerContext:function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},useLexicalComposerContext:function(){const t=e.useContext(ert);return null==t&&Jnt(8),t}});const nrt="development"===process.env.NODE_ENV?Qnt:trt,rrt=nrt.LexicalComposerContext,ort=nrt.createLexicalComposerContext,art=nrt.useLexicalComposerContext;function irt(e){return{type:e}}const lrt=irt("SELECTION_CHANGE_COMMAND"),srt=irt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),crt=irt("CLICK_COMMAND"),urt=irt("DELETE_CHARACTER_COMMAND"),drt=irt("INSERT_LINE_BREAK_COMMAND"),hrt=irt("INSERT_PARAGRAPH_COMMAND"),prt=irt("CONTROLLED_TEXT_INSERTION_COMMAND"),frt=irt("PASTE_COMMAND"),mrt=irt("REMOVE_TEXT_COMMAND"),vrt=irt("DELETE_WORD_COMMAND"),grt=irt("DELETE_LINE_COMMAND"),brt=irt("FORMAT_TEXT_COMMAND"),yrt=irt("UNDO_COMMAND"),wrt=irt("REDO_COMMAND"),xrt=irt("KEYDOWN_COMMAND"),Ert=irt("KEY_ARROW_RIGHT_COMMAND"),krt=irt("MOVE_TO_END"),Srt=irt("KEY_ARROW_LEFT_COMMAND"),Crt=irt("MOVE_TO_START"),Mrt=irt("KEY_ARROW_UP_COMMAND"),_rt=irt("KEY_ARROW_DOWN_COMMAND"),Nrt=irt("KEY_ENTER_COMMAND"),Art=irt("KEY_SPACE_COMMAND"),Ort=irt("KEY_BACKSPACE_COMMAND"),Irt=irt("KEY_ESCAPE_COMMAND"),Drt=irt("KEY_DELETE_COMMAND"),Prt=irt("KEY_TAB_COMMAND"),Trt=irt("INSERT_TAB_COMMAND"),Hrt=irt("INDENT_CONTENT_COMMAND"),Lrt=irt("OUTDENT_CONTENT_COMMAND"),zrt=irt("DROP_COMMAND"),Rrt=irt("FORMAT_ELEMENT_COMMAND"),Brt=irt("DRAGSTART_COMMAND"),$rt=irt("DRAGOVER_COMMAND"),Zrt=irt("DRAGEND_COMMAND"),Vrt=irt("COPY_COMMAND"),jrt=irt("CUT_COMMAND"),Wrt=irt("SELECT_ALL_COMMAND"),Frt=irt("CLEAR_EDITOR_COMMAND"),qrt=irt("CLEAR_HISTORY_COMMAND"),Yrt=irt("CAN_REDO_COMMAND"),Urt=irt("CAN_UNDO_COMMAND"),Krt=irt("FOCUS_COMMAND"),Grt=irt("BLUR_COMMAND"),Xrt=irt("KEY_MODIFIER_COMMAND"),Qrt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jrt=Qrt&&"documentMode"in document?document.documentMode:null,eot=Qrt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),tot=Qrt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),not=!(!Qrt||!("InputEvent"in window)||Jrt)&&"getTargetRanges"in new window.InputEvent("input"),rot=Qrt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),oot=Qrt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,aot=Qrt&&/Android/.test(navigator.userAgent),iot=Qrt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lot=Qrt&&aot&&iot,sot=Qrt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!iot,cot=0,uot=1,dot=2,hot=1,pot=2,fot=3,mot=4,vot=5,got=6,bot=rot||oot||sot?" ":"​",yot="\n\n",wot=tot?" ":bot,xot="֑-߿יִ-﷽ﹰ-ﻼ",Eot="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",kot=new RegExp("^[^"+Eot+"]*["+xot+"]"),Sot=new RegExp("^[^"+xot+"]*["+Eot+"]"),Cot={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Mot={directionless:1,unmergeable:2},_ot={center:2,end:6,justify:4,left:1,right:3,start:5},Not={[pot]:"center",[got]:"end",[mot]:"justify",[hot]:"left",[fot]:"right",[vot]:"start"},Aot={normal:0,segmented:2,token:1},Oot={[cot]:"normal",[dot]:"segmented",[uot]:"token"};function Iot(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let Dot=!1,Pot=0;function Tot(e){Pot=e.timeStamp}function Hot(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Lot(e,t,n){const r=Yat(n._window);let o=null,a=null;null!==r&&r.anchorNode===e&&(o=r.anchorOffset,a=r.focusOffset);const i=e.nodeValue;null!==i&&xat(t,i,o,a,!1)}function zot(e,t,n){if(Plt(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return 3===t.nodeType&&n.isAttached()}function Rot(e,t,n){Dot=!0;const r=performance.now()-Pot>100;try{xst(e,(()=>{const o=qlt()||function(e){return e.getEditorState().read((()=>{const e=qlt();return null!==e?e.clone():null}))}(e),a=new Map,i=e.getRootElement(),l=e._editorState,s=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=sat(p,l);if(!(null===f&&p!==i||kst(f)))if("characterData"===h)r&&klt(f)&&zot(o,p,f)&&Lot(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],o=lat(r),a=r.parentNode;if(null!=a&&r!==s&&null===o&&("BR"!==r.nodeName||!Hot(r,a,e))){if(tot){const e=r.innerText||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let o=0;o<r;o++){const r=n[o];("BR"===r.nodeName&&Hot(r,p,e)||s===r)&&(p.appendChild(r),t++)}r!==t&&(p===i&&(f=hat(l)),a.set(p,f))}}}if(a.size>0)for(const[t,n]of a)if(Cst(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n<r.length;n++){const a=r[n],i=e.getElementByKey(a);null!==i&&(null==o?(t.appendChild(i),o=i):o!==i&&t.replaceChild(i,o),o=o.nextSibling)}}else klt(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,o=n.target;for(let t=0;t<r.length;t++){const n=r[t],a=n.parentNode;null==a||"BR"!==n.nodeName||Hot(n,o,e)||a.removeChild(n)}}n.takeRecords()}null!==o&&(c&&(o.dirty=!0,pat(o)),tot&&Pat(e)&&o.insertRawText(u))}))}finally{Dot=!1}}function Bot(e){const t=e._observer;null!==t&&Rot(e,t.takeRecords(),t)}function $ot(e){!function(e){0===Pot&&Bat(e).addEventListener("textInput",Tot,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Rot(e,t,n)}))}function Zot(e,t){const n=e.__mode,r=e.__format,o=e.__style,a=t.__mode,i=t.__format,l=t.__style;return!(null!==n&&n!==a||null!==r&&r!==i||null!==o&&o!==l)}function Vot(e,t){const n=e.mergeWithSibling(t),r=ust()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function jot(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&klt(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Zot(t,r)){r=Vot(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&klt(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Zot(r,n)){r=Vot(r,n);break}break}n.remove()}}else r.remove()}function Wot(e){return Fot(e.anchor),Fot(e.focus),e}function Fot(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),klt(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Cst(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let qot=1;const Yot="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Uot(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return kst(sat(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function Kot(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Uot(t)&&Got(t)===e}catch(e){return!1}}function Got(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=zat(t)}return null}function Xot(e){return e.isToken()||e.isSegmented()}function Qot(e){return 3===e.nodeType}function Jot(e){let t=e;for(;null!=t;){if(Qot(t))return t;t=t.firstChild}return null}function eat(e,t,n){const r=Cot[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Cot.superscript:"superscript"===t&&(o&=~Cot.subscript),o}function tat(e,t){if(null!=t)return void(e.__key=t);lst(),sst();const n=ust(),r=cst(),o=""+qot++;r._nodeMap.set(o,e),Cst(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}function nat(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),a=e.getNextSibling();if(null===o)if(null!==a){const e=a.getWritable();r.__first=a.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==a){const t=a.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===a)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=a.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function rat(e){sst();const t=e.getLatest(),n=t.__parent,r=cst(),o=ust(),a=r._nodeMap,i=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,a,i);const l=t.__key;o._dirtyType=1,Cst(e)?i.set(l,!0):o._dirtyLeaves.add(l)}function oat(e){lst();const t=ust(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=iat(n);null!==e&&e.getWritable()}if(null!==e){const t=iat(e);null!==t&&t.getWritable()}}}function aat(){return ist()?null:ust()._compositionKey}function iat(e,t){const n=(t||cst())._nodeMap.get(e);return void 0===n?null:n}function lat(e,t){const n=e[`__lexicalKey_${ust()._key}`];return void 0!==n?iat(n,t):null}function sat(e,t){let n=e;for(;null!=n;){const e=lat(n,t);if(null!==e)return e;n=zat(n)}return null}function cat(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function uat(e){return e.read((()=>dat().getTextContent()))}function dat(){return hat(cst())}function hat(e){return e._nodeMap.get("root")}function pat(e){lst();const t=cst();if(null!==e){if(Object.isFrozen(e))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");e.dirty=!0,e.setCachedNodes(null)}t._selection=e}function fat(e){const t=ust(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=zat(n)}return null}(e,t);return null===n?e===t.getRootElement()?iat("root"):null:iat(n)}function mat(e,t){return t?e.getTextContentSize():0}function vat(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function gat(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function bat(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function yat(e){return 3===e.nodeType?e.nodeValue:null}function wat(e,t,n){const r=Yat(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:a,focusOffset:i}=r;if(null!==o){let t=yat(o);const r=sat(o);if(null!==t&&klt(r)){if(t===bot&&n){const e=n.length;t=n,a=e,i=e}null!==t&&xat(r,t,a,i,e)}}}function xat(e,t,n,r,o){let a=e;if(a.isAttached()&&(o||!a.isDirty())){const i=a.isComposing();let l=t;(i||o)&&t[t.length-1]===bot&&(l=t.slice(0,-1));const s=a.getTextContent();if(o||l!==s){if(""===l){if(oat(null),rot||oot||sot)a.remove();else{const e=ust();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}const t=a.getParent(),o=Ylt(),s=a.getTextContentSize(),c=aat(),u=a.getKey();if(a.isToken()||null!==c&&u===c&&!i||Plt(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!a.canInsertTextBefore()&&!i||o.focus.key===e.__key&&o.focus.offset===s&&!a.canInsertTextAfter()&&!i))return void a.markDirty();const d=qlt();if(!Plt(d)||null===n||null===r)return void a.setTextContent(l);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){const e=Elt(a.getTextContent());a.replace(e),a=e}a.setTextContent(l)}}}function Eat(e){return"ArrowLeft"===e}function kat(e){return"ArrowRight"===e}function Sat(e,t){return eot?e:t}function Cat(e){return"Enter"===e}function Mat(e){return"Backspace"===e}function _at(e){return"Delete"===e}function Nat(e,t,n){return"KeyA"===e&&Sat(t,n)}function Aat(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=Iot(o);return n[t]=e,e}return o}function Oat(e,t,n,r,o){if(0===n.size)return;const a=r.__type,i=r.__key,l=t.get(a);if(void 0===l)throw Error(`Type ${a} not in registeredNodes`);const s=l.klass;let c=e.get(s);void 0===c&&(c=new Map,e.set(s,c));const u=c.get(i),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(i,d?"updated":o)}function Iat(e,t,n){const r=e.getParent();let o=n,a=e;return null!==r&&(t&&0===n?(o=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(o=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?o-1:o)}function Dat(e,t){const n=e.offset;if("element"===e.type)return Iat(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Iat(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Pat(e){const t=Bat(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Tat(e,t,n){return bst(e,t,n)}function Hat(e){return!Nst(e)&&!e.isLastChild()&&!e.isInline()}function Lat(e,t){const n=e._keyToDOMMap.get(t);if(void 0===n)throw Error(`Reconciliation: could not find DOM element for node key ${t}`);return n}function zat(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Rat(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Bat(e){const t=e._window;if(null===t)throw Error("window object not found");return t}function $at(e){let t=e.getParentOrThrow();for(;null!==t;){if(Zat(t))return t;t=t.getParentOrThrow()}return t}function Zat(e){return Nst(e)||Cst(e)&&e.isShadowRoot()}function Vat(e){const t=e.constructor.clone(e);return tat(t,null),t}function jat(e){const t=ust(),n=e.constructor.getType(),r=t._nodes.get(n);if(void 0===r)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const o=r.replace;if(null!==o){const t=o(e);if(!(t instanceof e.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return t}return e}function Wat(e,t){if(Nst(e.getParent())&&!Cst(t)&&!kst(t))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Fat(e){return(kst(e)||Cst(e)&&!e.canBeEmpty())&&!e.isInline()}function qat(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Yat(e){return Qrt?(e||window).getSelection():null}function Uat(e){return 1===e.nodeType}function Kat(e){const t=new RegExp(/^(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|#text)$/,"i");return null!==e.nodeName.match(t)}function Gat(e){if(Nst(e)||kst(e)&&!e.isInline())return!0;if(!Cst(e)||Zat(e))return!1;const t=e.getFirstChild(),n=null===t||alt(t)||klt(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Xat(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function Qat(e,t,n,r,o,a){let i=e.getFirstChild();for(;null!==i;){const e=i.__key;i.__parent===t&&(Cst(i)&&Qat(i,e,n,r,o,a),n.has(e)||a.delete(e),o.push(e)),i=i.getNextSibling()}}let Jat,eit,tit,nit,rit,oit,ait,iit,lit,sit,cit="",uit="",dit=null,hit="",pit=!1,fit=!1,mit=null;function vit(e,t){const n=ait.get(e);if(null!==t){const n=Iit(e);n.parentNode===t&&t.removeChild(n)}if(iit.has(e)||eit._keyToDOMMap.delete(e),Cst(n)){const e=_it(n,ait);git(e,0,e.length-1,null)}void 0!==n&&Oat(sit,tit,nit,n,"destroyed")}function git(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&vit(t,r)}}function bit(e,t){e.setProperty("text-align",t)}const yit="40px";function wit(e,t){const n=Jat.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||yit;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function xit(e,t){const n=e.style;0===t?bit(n,""):1===t?bit(n,"left"):2===t?bit(n,"center"):3===t?bit(n,"right"):4===t?bit(n,"justify"):5===t?bit(n,"start"):6===t&&bit(n,"end")}function Eit(e,t,n){const r=iit.get(e);if(void 0===r)throw Error("createNode: node does not exist in nodeMap");const o=r.createDOM(Jat,eit);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,eit),klt(r)?o.setAttribute("data-lexical-text","true"):kst(r)&&o.setAttribute("data-lexical-decorator","true"),Cst(r)){const e=r.__indent,t=r.__size;if(0!==e&&wit(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=uit;uit="",kit(e,n,0,t,r,null),Mit(n,r),uit=o}(_it(r,iit),e,r,o)}const n=r.__format;0!==n&&xit(o,n),r.isInline()||Cit(null,r,o),Hat(r)&&(cit+=yot,hit+=yot)}else{const t=r.getTextContent();if(kst(r)){const t=r.decorate(eit,Jat);null!==t&&Ait(e,t),o.contentEditable="false"}else klt(r)&&(r.isDirectionless()||(uit+=t));cit+=t,hit+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return Object.freeze(r),Oat(sit,tit,nit,r,"created"),o}function kit(e,t,n,r,o,a){const i=cit;cit="";let l=n;for(;l<=r;++l){Eit(e[l],o,a);const t=iit.get(e[l]);null!==t&&null===dit&&klt(t)&&(dit=t.getFormat())}Hat(t)&&(cit+=yot),o.__lexicalTextContent=cit,cit=i+cit}function Sit(e,t){const n=t.get(e);return alt(n)||kst(n)&&n.isInline()}function Cit(e,t,n){const r=null!==e&&(0===e.__size||Sit(e.__last,ait)),o=0===t.__size||Sit(t.__last,iit);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Mit(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==uit||r!==mit){const n=""===uit,a=n?mit:(o=uit,kot.test(o)?"rtl":Sot.test(o)?"ltr":null);if(a!==r){const o=t.classList,i=Jat.theme;let l=null!==r?i[r]:void 0,s=null!==a?i[a]:void 0;if(void 0!==l){if("string"==typeof l){const e=Iot(l);l=i[r]=e}o.remove(...l)}if(null===a||n&&"ltr"===a)t.removeAttribute("dir");else{if(void 0!==s){if("string"==typeof s){const e=Iot(s);s=i[a]=e}void 0!==s&&o.add(...s)}t.dir=a}fit||(e.getWritable().__dir=a)}mit=a,t.__lexicalDirTextContent=uit,t.__lexicalDir=a}var o}function _it(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);if(void 0===e)throw Error("createChildrenArray: node does not exist in nodeMap");n.push(r),r=e.__next}return n}function Nit(e,t){const n=ait.get(e);let r=iit.get(e);if(void 0===n||void 0===r)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const o=pit||oit.has(e)||rit.has(e),a=Lat(eit,e);if(n===r&&!o){if(Cst(n)){const e=a.__lexicalTextContent;void 0!==e&&(cit+=e,hit+=e);const t=a.__lexicalDirTextContent;void 0!==t&&(uit+=t)}else{const e=n.getTextContent();klt(n)&&!n.isDirectionless()&&(uit+=e),hit+=e,cit+=e}return a}if(n!==r&&o&&Oat(sit,tit,nit,r,"updated"),r.updateDOM(n,a,Jat)){const n=Eit(e,null,null);if(null===t)throw Error("reconcileNode: parentDOM is null");return t.replaceChild(n,a),vit(e,null),n}if(Cst(n)&&Cst(r)){const e=r.__indent;e!==n.__indent&&wit(a,e);const t=r.__format;t!==n.__format&&xit(a,t),o&&(function(e,t,n){const r=uit;var o;uit="",dit=null,function(e,t,n){const r=cit,o=e.__size,a=t.__size;if(cit="",1===o&&1===a){const r=e.__first,o=t.__first;if(r===o)Nit(r,n);else{const e=Iit(r),t=Eit(o,null,null);n.replaceChild(t,e),vit(r,null)}const a=iit.get(o);null===dit&&klt(a)&&(dit=a.getFormat())}else{const r=_it(e,ait),i=_it(t,iit);if(0===o)0!==a&&kit(i,t,0,a-1,n,null);else if(0===a){if(0!==o){const e=null==n.__lexicalLineBreak;git(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,a){const i=r-1,l=o-1;let s,c,u=a.firstChild,d=0,h=0;for(;d<=i&&h<=l;){const e=t[d],r=n[h];if(e===r)u=Oit(Nit(r,a)),d++,h++;else{void 0===s&&(s=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),i=s.has(r);if(o)if(i){const e=Lat(eit,r);e===u?u=Oit(Nit(r,a)):(null!=u?a.insertBefore(e,u):a.appendChild(e),Nit(r,a)),d++,h++}else Eit(r,a,u),h++;else u=Oit(Iit(e)),vit(e,a),d++}const o=iit.get(r);null!==o&&null===dit&&klt(o)&&(dit=o.getFormat())}const p=d>i,f=h>l;if(p&&!f){const t=n[l+1];kit(n,e,h,l,a,void 0===t?null:eit.getElementByKey(t))}else f&&!p&&git(t,d,i,a)}(t,r,i,o,a,n)}Hat(t)&&(cit+=yot),n.__lexicalTextContent=cit,cit=r+cit}(e,t,n),Mit(t,n),Lst(o=t)&&null!=dit&&dit!==o.__textFormat&&o.setTextFormat(dit),uit=r,dit=null}(n,r,a),Nst(r)||r.isInline()||Cit(n,r,a)),Hat(r)&&(cit+=yot,hit+=yot)}else{const t=r.getTextContent();if(kst(r)){const t=r.decorate(eit,Jat);null!==t&&Ait(e,t)}else klt(r)&&!r.isDirectionless()&&(uit+=t);cit+=t,hit+=t}if(!fit&&Nst(r)&&r.__cachedText!==hit){const e=r.getWritable();e.__cachedText=hit,r=e}return Object.freeze(r),a}function Ait(e,t){let n=eit._pendingDecorators;const r=eit._decorators;if(null===n){if(r[e]===t)return;n=cat(eit)}n[e]=t}function Oit(e){let t=e.nextSibling;return null!==t&&t===eit._blockCursorElement&&(t=t.nextSibling),t}function Iit(e){const t=lit.get(e);if(void 0===t)throw Error(`Reconciliation: could not find DOM element for node key ${e}`);return t}const Dit=Object.freeze({}),Pit=[["keydown",function(e,t){if(Tit=e.timeStamp,Hit=e.code,t.isComposing())return;const{code:n,shiftKey:r,ctrlKey:o,metaKey:a,altKey:i}=e;Tat(t,xrt,e)||(!function(e,t,n,r){return kat(e)&&!t&&!r&&!n}(n,o,i,a)?!function(e,t,n,r,o){return kat(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?!function(e,t,n,r){return Eat(e)&&!t&&!r&&!n}(n,o,i,a)?!function(e,t,n,r,o){return Eat(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?!function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,a)?!function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,a)?!function(e,t){return Cat(e)&&t}(n,r)?!function(e){return"Space"===e}(n)?!function(e,t){return eot&&t&&"KeyO"===e}(n,o)?!function(e,t){return Cat(e)&&!t}(n,r)?!function(e,t,n,r){return eot?!t&&!n&&(Mat(e)||"KeyH"===e&&r):!(r||t||n)&&Mat(e)}(n,i,a,o)?!function(e){return"Escape"===e}(n)?!function(e,t,n,r,o){return eot?!(n||r||o)&&(_at(e)||"KeyD"===e&&t):!(t||r||o)&&_at(e)}(n,o,r,i,a)?!function(e,t,n){return Mat(e)&&(eot?t:n)}(n,i,o)?!function(e,t,n){return _at(e)&&(eot?t:n)}(n,i,o)?!function(e,t){return eot&&t&&Mat(e)}(n,a)?!function(e,t){return eot&&t&&_at(e)}(n,a)?!function(e,t,n,r){return"KeyB"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"KeyU"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"KeyI"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,i,o,a)?!function(e,t,n,r){return"KeyZ"===e&&!t&&Sat(n,r)}(n,r,a,o)?!function(e,t,n,r){return eot?"KeyZ"===e&&n&&t:"KeyY"===e&&r||"KeyZ"===e&&r&&t}(n,r,a,o)?Hlt(t._editorState._selection)?function(e,t,n,r){return!t&&"KeyC"===e&&(eot?n:r)}(n,r,a,o)?(e.preventDefault(),Tat(t,Vrt,e)):function(e,t,n,r){return!t&&"KeyX"===e&&(eot?n:r)}(n,r,a,o)?(e.preventDefault(),Tat(t,jrt,e)):Nat(n,a,o)&&(e.preventDefault(),Tat(t,Wrt,e)):!tot&&Nat(n,a,o)&&(e.preventDefault(),Tat(t,Wrt,e)):(e.preventDefault(),Tat(t,wrt,void 0)):(e.preventDefault(),Tat(t,yrt,void 0)):Tat(t,Prt,e):(e.preventDefault(),Tat(t,brt,"italic")):(e.preventDefault(),Tat(t,brt,"underline")):(e.preventDefault(),Tat(t,brt,"bold")):(e.preventDefault(),Tat(t,grt,!1)):(e.preventDefault(),Tat(t,grt,!0)):(e.preventDefault(),Tat(t,vrt,!1)):(e.preventDefault(),Tat(t,vrt,!0)):_at(n)?Tat(t,Drt,e):(e.preventDefault(),Tat(t,urt,!1)):Tat(t,Irt,e):Mat(n)?Tat(t,Ort,e):(e.preventDefault(),Tat(t,urt,!0)):(Zit=!1,Tat(t,Nrt,e)):(e.preventDefault(),Zit=!0,Tat(t,drt,!0)):Tat(t,Art,e):(Zit=!0,Tat(t,Nrt,e)):Tat(t,_rt,e):Tat(t,Mrt,e):Tat(t,Crt,e):Tat(t,Srt,e):Tat(t,krt,e):Tat(t,Ert,e),function(e,t,n,r){return e||t||n||r}(o,r,i,a)&&Tat(t,Xrt,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&xst(t,(()=>{(function(e){return kst(sat(e))})(n)||($it=!0)}))}],["compositionstart",function(e,t){xst(t,(()=>{const n=qlt();if(Plt(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();oat(r.key),(e.timeStamp<Tit+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||klt(o)&&o.getStyle()!==n.style)&&Tat(t,prt,wot)}}))}],["compositionend",function(e,t){tot?Vit=!0:xst(t,(()=>{Uit(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),xst(t,(()=>{const n=qlt(),r=e.data,o=Yit(e);if(null!=r&&Plt(n)&&Wit(n,o,r,e.timeStamp,!1)){Vit&&(Uit(t,r),Vit=!1);const o=n.anchor.getNode(),a=Yat(t._window);if(null===a)return;const i=n.isBackward(),l=i?n.anchor.offset:n.focus.offset,s=i?n.focus.offset:n.anchor.offset;not&&!n.isCollapsed()&&klt(o)&&null!==a.anchorNode&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+s)===yat(a.anchorNode)||Tat(t,prt,r);const c=r.length;tot&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),rot||oot||sot||!t.isComposing()||(Tit=0,oat(null))}else wat(!1,t,null!==r?r:void 0),Vit&&(Uit(t,r||void 0),Vit=!1);lst(),Bot(ust())})),zit=null}],["click",function(e,t){xst(t,(()=>{const n=qlt(),r=Yat(t._window),o=Ylt();if(r)if(Plt(n)){const t=n.anchor,a=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Nst(a)&&1===dat().getChildrenSize()&&a.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||a!==n.focus.getNode()&&(Cst(a)?a.select(0):a.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const a=n.nodeType;1!==a&&3!==a||pat(Flt(o,r,t,e))}}Tat(t,crt,e)}))}],["cut",Dit],["copy",Dit],["dragstart",Dit],["dragover",Dit],["dragend",Dit],["paste",Dit],["focus",Dit],["blur",Dit],["drop",Dit]];not&&Pit.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Yit(e);"deleteCompositionText"===n||tot&&Pat(t)||"insertCompositionText"!==n&&xst(t,(()=>{const o=qlt();if("deleteContentBackward"===n){if(null===o){const e=Ylt();if(!Plt(e))return;pat(e.clone())}if(Plt(o)){const n=o.anchor.key===o.focus.key;if(a=e.timeStamp,"Delete"===Hit&&a<Tit+30&&t.isComposing()&&n){if(oat(null),Tit=0,setTimeout((()=>{xst(t,(()=>{oat(null)}))}),30),Plt(o)){const e=o.anchor.getNode();if(e.markDirty(),o.format=e.getFormat(),!klt(e))throw Error("Anchor node must be a TextNode");o.style=e.getStyle()}}else{oat(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),a=0===o.anchor.offset&&o.focus.offset===r.length;lot&&n&&!a||Tat(t,urt,!0)}return}}var a;if(!Plt(o))return;const i=e.data;null!==zit&&wat(!1,t,zit),o.dirty&&null===zit||!o.isCollapsed()||Nst(o.anchor.getNode())||null===r||o.applyDOMRange(r),zit=null;const l=o.anchor,s=o.focus,c=l.getNode(),u=s.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Tat(t,prt,e);break;case"insertFromComposition":oat(null),Tat(t,prt,e);break;case"insertLineBreak":oat(null),Tat(t,drt,!1);break;case"insertParagraph":oat(null),Zit&&!oot?(Zit=!1,Tat(t,drt,!1)):Tat(t,hrt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Tat(t,frt,e);break;case"deleteByComposition":(function(e,t){return e!==t||Cst(e)||Cst(t)||!e.isToken()||!t.isToken()})(c,u)&&Tat(t,mrt,e);break;case"deleteByDrag":case"deleteByCut":Tat(t,mrt,e);break;case"deleteContent":Tat(t,urt,!1);break;case"deleteWordBackward":Tat(t,vrt,!0);break;case"deleteWordForward":Tat(t,vrt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Tat(t,grt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Tat(t,grt,!1);break;case"formatStrikeThrough":Tat(t,brt,"strikethrough");break;case"formatBold":Tat(t,brt,"bold");break;case"formatItalic":Tat(t,brt,"italic");break;case"formatUnderline":Tat(t,brt,"underline");break;case"historyUndo":Tat(t,yrt,void 0);break;case"historyRedo":Tat(t,wrt,void 0)}else{if("\n"===i)e.preventDefault(),Tat(t,drt,!1);else if(i===yot)e.preventDefault(),Tat(t,hrt,void 0);else if(null==i&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=i&&Wit(o,r,i,e.timeStamp,!0)?(e.preventDefault(),Tat(t,prt,i)):zit=i;Lit=e.timeStamp}}))}(e,t)]);let Tit=0,Hit=null,Lit=0,zit=null;const Rit=new WeakMap;let Bit=!1,$it=!1,Zit=!1,Vit=!1,jit=[0,"",0,"root",0];function Wit(e,t,n,r,o){const a=e.anchor,i=e.focus,l=a.getNode(),s=ust(),c=Yat(s._window),u=null!==c?c.anchorNode:null,d=a.key,h=s.getElementByKey(d),p=n.length;return d!==i.key||!klt(l)||(!o&&(!not||Lit<r+50)||l.isDirty()&&p<2||vat(n))&&a.offset!==i.offset&&!l.isComposing()||Xot(l)||l.isDirty()&&p>1||(o||!not)&&null!==h&&!l.isComposing()&&u!==Jot(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||l.getFormat()!==e.format||l.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(klt(t)||Cst(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,l)}function Fit(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function qit(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:a,focusOffset:i}=e;Bit&&(Bit=!1,Fit(r,o)&&Fit(a,i))||xst(t,(()=>{if(!n)return void pat(null);if(!Kot(t,r,a))return;const l=qlt();if(Plt(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const o=Bat(t).event,a=o?o.timeStamp:performance.now(),[i,s,c,u,d]=jit,h=dat(),p=!1===t.isComposing()&&""===h.getTextContent();if(a<d+200&&n.offset===c&&n.key===u)l.format=i,l.style=s;else if("text"===n.type){if(!klt(r))throw Error("Point.getNode() must return TextNode when type is text");l.format=r.getFormat(),l.style=r.getStyle()}else if("element"===n.type&&!p){const e=n.getNode();e instanceof Pst&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),a=r.length,s=l.isBackward(),c=s?i:o,u=s?o:i,d=s?t:e,h=s?e:t;let p=255,f=!1;for(let e=0;e<a;e++){const t=r[e],n=t.getTextContentSize();if(klt(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===a-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}Tat(t,lrt,void 0)}))}function Yit(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function Uit(e,t){const n=e._compositionKey;if(oat(null),null!==n&&null!=t){if(""===t){const t=iat(n),r=Jot(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&klt(t)&&xat(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=qlt();if(Plt(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void Tat(e,Nrt,null)}}}wat(!0,e,t)}function Kit(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const Git=new Map;function Xit(e){const t=e.target,n=Yat(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=Got(n.anchorNode);if(null===r)return;$it&&($it=!1,xst(r,(()=>{const t=Ylt(),o=n.anchorNode;if(null===o)return;const a=o.nodeType;1!==a&&3!==a||pat(Flt(t,n,r,e))})));const o=gat(r),a=o[o.length-1],i=a._key,l=Git.get(i),s=l||a;s!==r&&qit(n,s,!1),qit(n,r,!0),r!==a?Git.set(i,r):l&&Git.delete(i)}function Qit(e){e._lexicalHandled=!0}function Jit(e){return!0===e._lexicalHandled}function elt(e,t,n){lst();const r=e.__key,o=e.getParent();if(null===o)return;const a=function(e){const t=qlt();if(!Plt(t)||!Cst(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),a=r.getNode();return Rat(o,e)&&n.set(e.__key,0,"element"),Rat(a,e)&&r.set(e.__key,0,"element"),t}(e);let i=!1;if(Plt(a)&&t){const t=a.anchor,n=a.focus;t.key===r&&(Glt(t,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0),n.key===r&&(Glt(n,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else Hlt(a)&&t&&e.isSelected()&&e.selectPrevious();if(Plt(a)&&t&&!i){const t=e.getIndexWithinParent();nat(e),Ult(a,o,t,-1)}else nat(e);n||Zat(o)||o.canBeEmpty()||!o.isEmpty()||elt(o,t),t&&Nst(o)&&o.isEmpty()&&o.selectEnd()}class tlt{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(e){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,tat(this,e),"root"!==this.__type&&(lst(),function(e,t){const n=ust()._nodes.get(e);if(void 0===n)throw Error(`Create node: Attempted to create node ${t.name} that was not configured to be used on the editor.`);const r=n.klass;if(r!==t)throw Error(`Create node: Type ${e} in node ${t.name} does not match registered node ${r.name} with the same type`)}(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=iat(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||qlt();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(klt(this)||!Plt(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:iat(e)}getParentOrThrow(){const e=this.getParent();if(null===e)throw Error(`Expected node ${this.__key} to have a parent.`);return e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Zat(t)){if(!Cst(e))throw Error("Children of root nodes must be elements");return e}e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();if(null===e)throw Error(`Expected node ${this.__key} to have a top parent element.`);return e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:iat(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:iat(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Cst(this)&&t.unshift(this),Cst(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const a=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(a.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,o=this;for(;;){const e=o.getParentOrThrow();if(e===t){n=o.getIndexWithinParent();break}o=e}for(o=e;;){const e=o.getParentOrThrow();if(e===t){r=o.getIndexWithinParent();break}o=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let o=this;for(;null!==o;){const a=o.__key;if(r.has(a)||(r.add(a),n.push(o)),o===e)break;const i=Cst(o)?t?o.getFirstChild():o.getLastChild():null;if(null!==i){o=i;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(null!==l){o=l;continue}const s=o.getParentOrThrow();if(r.has(s.__key)||n.push(s),s===e)break;let c=null,u=s;do{if(null===u)throw Error("getNodesBetween: ancestor is null");if(c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);o=c}return t||n.reverse(),n}isDirty(){const e=ust()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=iat(this.__key);if(null===e)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return e}getWritable(){lst();const e=cst(),t=ust(),n=e._nodeMap,r=this.__key,o=this.getLatest(),a=o.__parent,i=t._cloneNotNeeded,l=qlt();if(null!==l&&l.setCachedNodes(null),i.has(r))return rat(o),o;const s=o.constructor.clone(o);return s.__parent=a,s.__next=o.__next,s.__prev=o.__prev,Cst(o)&&Cst(s)?(Lst(o)&&Lst(s)&&(s.__textFormat=o.__textFormat),s.__first=o.__first,s.__last=o.__last,s.__size=o.__size,s.__indent=o.__indent,s.__format=o.__format,s.__dir=o.__dir):klt(o)&&klt(s)&&(s.__format=o.__format,s.__style=o.__style,s.__mode=o.__mode,s.__detail=o.__detail),i.add(r),s.__key=r,rat(s),n.set(r,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){throw Error("createDOM: base method not extended")}updateDOM(e,t,n){throw Error("updateDOM: base method not extended")}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(e){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(e){elt(this,!0,e)}replace(e,t){lst();let n=qlt();null!==n&&(n=n.clone()),Wat(this,e);const r=this.getLatest(),o=this.__key,a=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),s=l.__size;nat(i);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(elt(r,!1,!0),null===c?l.__first=a:c.getWritable().__next=a,i.__prev=d,null===u?l.__last=a:u.getWritable().__prev=a,i.__next=h,i.__parent=p,l.__size=s,t){if(!Cst(this)||!Cst(i))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach((e=>{i.append(e)}))}if(Plt(n)){pat(n);const e=n.anchor,t=n.focus;e.key===o&&Olt(e,i),t.key===o&&Olt(t,i)}return aat()===o&&oat(a),i}insertAfter(e,t=!0){lst(),Wat(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),a=qlt();let i=!1,l=!1;if(null!==o){const t=e.getIndexWithinParent();if(nat(r),Plt(a)){const e=o.__key,n=a.anchor,r=a.focus;i="element"===n.type&&n.key===e&&n.offset===t+1,l="element"===r.type&&r.key===e&&r.offset===t+1}}const s=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===s?c.__last=u:s.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Plt(a)){const e=this.getIndexWithinParent();Ult(a,c,e+1);const t=c.__key;i&&a.anchor.set(t,e+2,"element"),l&&a.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){lst(),Wat(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;nat(r);const a=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),l=n.__prev,s=this.getIndexWithinParent();null===a?i.__first=o:a.getWritable().__next=o,i.__size++,n.__prev=o,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const c=qlt();return t&&Plt(c)&&Ult(c,this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return Hst()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){lst();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Cst(n))return n.select();if(!klt(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){lst();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Cst(n))return n.select(0,0);if(!klt(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class nlt extends tlt{static getType(){return"linebreak"}static clone(e){return new nlt(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&ilt(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&ilt(n))return!0}}return!1}(e)?null:{conversion:rlt,priority:0}}}static importJSON(e){return olt()}exportJSON(){return{type:"linebreak",version:1}}}function rlt(e){return{node:olt()}}function olt(){return jat(new nlt)}function alt(e){return e instanceof nlt}function ilt(e){return 3===e.nodeType&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function llt(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function slt(e,t){return 1&t?"strong":2&t?"em":"span"}function clt(e,t,n,r,o){const a=r.classList;let i=Aat(o,"base");void 0!==i&&a.add(...i),i=Aat(o,"underlineStrikethrough");let l=!1;const s=8&t&&4&t;void 0!==i&&(8&n&&4&n?(l=!0,s||a.add(...i)):s&&a.remove(...i));for(const e in Cot){const r=Cot[e];if(i=Aat(o,e),void 0!==i)if(n&r){if(l&&("underline"===e||"strikethrough"===e)){t&r&&a.remove(...i);continue}t&r&&(!s||"underline"!==e)&&"strikethrough"!==e||a.add(...i)}else t&r&&a.remove(...i)}}function ult(e,t,n){const r=t.firstChild,o=n.isComposing(),a=e+(o?bot:"");if(null==r)t.textContent=a;else{const e=r.nodeValue;if(e!==a)if(o||tot){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,a=0;for(;o<n&&o<r&&e[o]===t[o];)o++;for(;a+o<n&&a+o<r&&e[n-a-1]===t[r-a-1];)a++;return[o,n-o-a,t.slice(o,r-a)]}(e,a);0!==n&&r.deleteData(t,n),r.insertData(t,o)}else r.nodeValue=a}}function dlt(e,t,n,r,o,a){ult(o,e,t);const i=a.theme.text;void 0!==i&&clt(0,0,r,e,i)}function hlt(e,t){const n=document.createElement(t);return n.appendChild(e),n}class plt extends tlt{static getType(){return"text"}static clone(e){return new plt(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Oot[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===aat()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Cot[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return eat(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=llt(0,n),o=slt(0,n),a=null===r?o:r,i=document.createElement(a);let l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(o),i.appendChild(l)),dlt(l,this,0,n,this.__text,e);const s=this.__style;return""!==s&&(i.style.cssText=s),i}updateDOM(e,t,n){const r=this.__text,o=e.__format,a=this.__format,i=llt(0,o),l=llt(0,a),s=slt(0,o),c=slt(0,a);if((null===i?s:i)!==(null===l?c:l))return!0;if(i===l&&s!==c){const e=t.firstChild;if(null==e)throw Error("updateDOM: prevInnerDOM is null or undefined");const o=document.createElement(c);return dlt(o,this,0,a,r,n),t.replaceChild(o,e),!1}let u=t;if(null!==l&&null!==i&&(u=t.firstChild,null==u))throw Error("updateDOM: innerDOM is null or undefined");ult(r,u,this);const d=n.theme.text;void 0!==d&&o!==a&&clt(0,o,a,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:blt,priority:0}),b:()=>({conversion:mlt,priority:0}),code:()=>({conversion:xlt,priority:0}),em:()=>({conversion:xlt,priority:0}),i:()=>({conversion:xlt,priority:0}),s:()=>({conversion:xlt,priority:0}),span:()=>({conversion:flt,priority:0}),strong:()=>({conversion:xlt,priority:0}),sub:()=>({conversion:xlt,priority:0}),sup:()=>({conversion:xlt,priority:0}),u:()=>({conversion:xlt,priority:0})}}static importJSON(e){const t=Elt(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);if(null===t||!Uat(t))throw Error("Expected TextNode createDOM to always return a HTMLElement");return t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=hlt(t,"b")),this.hasFormat("italic")&&(t=hlt(t,"i")),this.hasFormat("strikethrough")&&(t=hlt(t,"s")),this.hasFormat("underline")&&(t=hlt(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Cot[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Mot[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=eat(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Aot[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){lst();let n=e,r=t;const o=qlt(),a=this.getTextContent(),i=this.__key;if("string"==typeof a){const e=a.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Plt(o))return jlt(i,n,i,r,"text","text");{const e=aat();e!==o.anchor.key&&e!==o.focus.key||oat(i),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),a=o.__text,i=n.length;let l=e;l<0&&(l=i+l,l<0&&(l=0));const s=qlt();if(r&&Plt(s)){const t=e+i;s.setTextNodeRange(o,t,o,t)}const c=a.slice(0,l)+n+a.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){lst();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=aat(),a=new Set(e),i=[],l=n.length;let s="";for(let e=0;e<l;e++)""!==s&&a.has(e)&&(i.push(s),s=""),s+=n[e];""!==s&&i.push(s);const c=i.length;if(0===c)return[];if(i[0]===n)return[t];const u=i[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),m=t.__detail;let v=!1;t.isSegmented()?(h=Elt(u),h.__format=p,h.__style=f,h.__detail=m,v=!0):(h=t.getWritable(),h.__text=u);const g=qlt(),b=[h];let y=u.length;for(let e=1;e<c;e++){const t=i[e],n=t.length,a=Elt(t).getWritable();a.__format=p,a.__style=f,a.__detail=m;const l=a.__key,s=y+n;if(Plt(g)){const e=g.anchor,t=g.focus;e.key===r&&"text"===e.type&&e.offset>y&&e.offset<=s&&(e.key=l,e.offset-=y,g.dirty=!0),t.key===r&&"text"===t.type&&t.offset>y&&t.offset<=s&&(t.key=l,t.offset-=y,g.dirty=!0)}o===r&&oat(l),y=s,b.push(a)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&rat(t),null!==n&&rat(n)}(this);const w=d.getWritable(),x=this.getIndexWithinParent();return v?(w.splice(x,0,b),this.remove()):w.splice(x,1,b),Plt(g)&&Ult(g,d,x,c-1),b}mergeWithSibling(e){const t=e===this.getPreviousSibling();if(!t&&e!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const n=this.__key,r=e.__key,o=this.__text,a=o.length;aat()===r&&oat(n);const i=qlt();if(Plt(i)){const o=i.anchor,l=i.focus;null!==o&&o.key===r&&(Xlt(o,t,n,e,a),i.dirty=!0),null!==l&&l.key===r&&(Xlt(l,t,n,e,a),i.dirty=!0)}const l=e.__text,s=t?l+o:o+l;this.setTextContent(s);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function flt(e){const t=e.style,n=t.fontWeight,r=t.textDecoration.split(" "),o="700"===n||"bold"===n,a=r.includes("line-through"),i="italic"===t.fontStyle,l=r.includes("underline"),s=t.verticalAlign;return{forChild:e=>klt(e)?(o&&e.toggleFormat("bold"),a&&e.toggleFormat("strikethrough"),i&&e.toggleFormat("italic"),l&&e.toggleFormat("underline"),"sub"===s&&e.toggleFormat("subscript"),"super"===s&&e.toggleFormat("superscript"),e):e,node:null}}function mlt(e){const t="normal"===e.style.fontWeight;return{forChild:e=>(klt(e)&&!t&&e.toggleFormat("bold"),e),node:null}}const vlt=new WeakMap;function glt(e){return"PRE"===e.nodeName||1===e.nodeType&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function blt(e){const t=e;if(null===e.parentElement)throw Error("Expected parentElement of Text not to be null");let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=vlt.get(n))&&!glt(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e<r.length;e++)vlt.set(r[e],o);return o}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(olt()):"\t"===r?t.push(Clt()):""!==r&&t.push(Elt(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=ylt(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=ylt(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Elt(n)}}function ylt(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,1===n.nodeType){const e=n.style.display;if(""===e&&!Kat(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(3===n.nodeType)return n;if("BR"===n.nodeName)return null}}const wlt={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function xlt(e){const t=wlt[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(klt(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function Elt(e=""){return jat(new plt(e))}function klt(e){return e instanceof plt}class Slt extends plt{static getType(){return"tab"}static clone(e){const t=new Slt(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Clt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){throw Error("TabNode does not support setTextContent")}setDetail(e){throw Error("TabNode does not support setDetail")}setMode(e){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Clt(){return jat(new Slt)}function Mlt(e){return e instanceof Slt}class _lt{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Cst(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Cst(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?r<o:t.isBefore(n)}getNode(){const e=iat(this.key);if(null===e)throw Error("Point.getNode: node not found");return e}set(e,t,n){const r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,ist()||(aat()===o&&oat(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Nlt(e,t,n){return new _lt(e,t,n)}function Alt(e,t){let n=t.__key,r=e.offset,o="element";if(klt(t)){o="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Cst(t)){const e=t.getNextSibling();if(klt(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Olt(e,t){if(Cst(t)){const n=t.getLastDescendant();Cst(n)||klt(n)?Alt(e,n):Alt(e,t)}else Alt(e,t)}function Ilt(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Dlt{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Hlt(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Dlt(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(klt(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=iat(e);null!==t&&n.push(t)}return ist()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Plt(e){return e instanceof Tlt}class Tlt{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Plt(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),o=r?t:n,a=r?n:t;let i=o.getNode(),l=a.getNode();const s=o.offset,c=a.offset;if(Cst(i)){const e=i.getDescendantByIndex(s);i=null!=e?e:i}if(Cst(l)){let e=l.getDescendantByIndex(c);null!==e&&e!==i&&l.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),l=null!=e?e:l}let u;return u=i.is(l)?Cst(i)&&i.getChildrenSize()>0?[]:[i]:i.getNodesBetween(l),ist()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Ilt(this.anchor,e.__key,t,"text"),Ilt(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,a=r.isBefore(o),[i,l]=zlt(this);let s="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Cst(d)&&!d.isInline())c||(s+="\n"),c=!d.isEmpty();else if(c=!1,klt(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=i<l?e.slice(i,l):e.slice(l,i)):e=a?e.slice(i):e.slice(l):d===n&&(e=a?e.slice(0,l):e.slice(0,i)),s+=e}else!kst(d)&&!alt(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){const t=ust(),n=t.getEditorState()._selection,r=Vlt(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[o,a]=r;Ilt(this.anchor,o.key,o.offset,o.type),Ilt(this.focus,a.key,a.offset,a.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Tlt(Nlt(e.key,e.offset,e.type),Nlt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=eat(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Cot[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(olt()):"\t"===r?n.push(Clt()):n.push(Elt(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,o=this.style;let a=t,i=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,i=t),"element"===a.type&&function(e,t,n,r){const o=e.getNode(),a=o.getChildAtIndex(e.offset),i=Elt(),l=Nst(o)?Hst().append(i):i;i.setFormat(n),i.setStyle(r),null===a?o.append(l):a.insertBefore(l),e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}(a,i,r,o);const l=a.offset;let s=i.offset;const c=this.getNodes(),u=c.length;let d=c[0];if(!klt(d))throw Error("insertText: first node is not a text node");const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===i.type&&(s=h,i.set(a.key,s,"text")),this.isCollapsed()&&l===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(klt(t)&&t.canInsertTextBefore()&&!Xot(t)||(t=Elt(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===l&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(klt(t)&&!Xot(t)||(t=Elt(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const e=Elt(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Cst(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Zlt(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Elt(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(l!==s||t===r&&n===o){if(Mlt(d)){const t=Elt(e);return t.setFormat(r),t.setStyle(o),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Elt(e);if(t.setFormat(r),t.setStyle(o),t.select(),0===l)d.insertBefore(t,!1);else{const[e]=d.splitText(l);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(o)}const a=s-l;d=d.spliceText(l,a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Cst(d)?d:d.getParentOrThrow();let r=Cst(f)?f:f.getParentOrThrow(),o=f;if(!n.is(r)&&r.isInline())do{o=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===i.type&&(0!==s||""===f.getTextContent())||"element"===i.type&&f.getIndexWithinParent()<s)if(klt(f)&&!f.isToken()&&s!==f.getTextContentSize()){if(f.isSegmented()){const e=Elt(f.getTextContent());f.replace(e),f=e}Nst(i.getNode())||"text"!==i.type||(f=f.spliceText(0,s,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const a=r.getChildren(),p=new Set(c),m=n.is(r),v=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=a.length-1;e>=0;e--){const t=a[e];if(t.is(d)||Cst(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(o)?m||v.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(l===h)d.select();else{const t=Elt(e);t.select(),d.replace(t)}else d=d.spliceText(l,h-l,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void oat(null);const t=this.getNodes(),n=[];for(const e of t)klt(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void oat(null);const o=this.anchor,a=this.focus,i=this.isBackward(),l=i?a:o,s=i?o:a;let c=0,u=n[0],d="element"===l.type?0:l.offset;if("text"===l.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const m="text"===s.type?s.offset:f.getTextContentSize();if(u.is(f)){if(d===m)return;if(0===d&&m===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,m),t=0===d?e[0]:e[1];t.setFormat(h),"text"===l.type&&l.set(t.__key,0,"text"),"text"===s.type&&s.set(t.__key,m-d,"text")}return void(this.format=h)}0!==d&&([,u]=u.splitText(d),d=0),u.setFormat(h);const v=f.getFormatFlags(e,h);m>0&&(m!==f.getTextContentSize()&&([f]=f.splitText(m)),f.setFormat(v));for(let t=c+1;t<p;t++){const r=n[t];if(!r.isToken()){const t=r.getFormatFlags(e,v);r.setFormat(t)}}"text"===l.type&&l.set(u.__key,d,"text"),"text"===s.type&&s.set(f.__key,m,"text"),this.format=h|v}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=qlt();if(!Plt(t))throw Error("Expected RangeSelection after insertParagraph");return t.insertNodes(e)}const t=Xat((this.isBackward()?this.focus:this.anchor).getNode(),Gat),n=e[e.length-1];if("__language"in t&&Cst(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=Qlt(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Cst(e)||kst(e))&&!e.isInline()))){if(!Cst(t))throw Error("Expected 'firstBlock' to be an ElementNode");const r=Qlt(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Hst();let n=null;for(let r=0;r<e.length;r++){const o=e[r],a=alt(o);if(a||kst(o)&&o.isInline()||Cst(o)&&o.isInline()||klt(o)||o.isParentRequired()){if(null===n&&(n=o.createParentElementNode(),t.append(n),a))continue;null!==n&&n.append(o)}else t.append(o),n=null}return t}(e),o=r.getLastDescendant(),a=r.getChildren(),i=e=>"__value"in e&&"__checked"in e,l=Cst(t)&&t.isEmpty()?null:this.insertParagraph(),s=a[a.length-1];let c=a[0];if((e=>Cst(e)&&Gat(e)&&!e.isEmpty()&&Cst(t)&&(!t.isEmpty()||i(t)))(c)){if(!Cst(t))throw Error("Expected 'firstBlock' to be an ElementNode");t.append(...c.getChildren()),c=a[1]}c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;){if(!r.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");r=r.getNextSibling(),o.push(r)}let a=e;for(const e of o)a=a.insertAfter(e)}(t,c);const u=Xat(o,Gat);l&&Cst(u)&&(i(l)||Gat(s))&&(u.append(...l.getChildren()),l.remove()),Cst(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=Cst(t)?t.getLastChild():null;alt(d)&&u!==t&&d.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Hst();return dat().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Qlt(this),t=Xat(this.anchor.getNode(),Gat);if(!Cst(t))throw Error("Expected ancestor to be an ElementNode");const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=olt();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let a=e[0],i=e[n];const[l,s]=zlt(this);if(0===t)return[];if(1===t){if(klt(a)&&!this.isCollapsed()){const e=l>s?s:l,t=l>s?l:s,n=a.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[a]}const c=r.isBefore(o);if(klt(a)){const t=c?l:s;t===a.getTextContentSize()?e.shift():0!==t&&([,a]=a.splitText(t),e[0]=a)}if(klt(i)){const t=i.getTextContent().length,r=c?s:l;0===r?e.pop():r!==t&&([i]=i.splitText(r),e[n]=i)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,a="move"===e,i=Dat(r,t);if(kst(i)&&!i.isIsolated()){if(a&&i.isKeyboardSelectable()){const e=Wlt();return e.add(i.__key),void pat(e)}const e=t?i.getPreviousSibling():i.getNextSibling();if(klt(e)){const n=e.__key,i=t?e.getTextContent().length:0;return r.set(n,i,"text"),void(a&&o.set(n,i,"text"))}{const n=i.getParentOrThrow();let l,s;return Cst(e)?(s=e.__key,l=t?e.getChildrenSize():0):(l=i.getIndexWithinParent(),s=n.__key,t||l++),r.set(s,l,"element"),void(a&&o.set(s,l,"element"))}}const l=ust(),s=Yat(l._window);if(!s)return;const c=l._blockCursorElement,u=l._rootElement;if(null===u||null===c||!Cst(i)||i.isInline()||i.canBeEmpty()||qat(c,l,u),function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),r=Nst(n)?n:$at(n);if(this.applyDOMRange(e),this.dirty=!0,!a){const n=this.getNodes(),o=[];let a=!1;for(let e=0;e<n.length;e++){const t=n[e];Rat(t,r)?o.push(t):a=!0}if(a&&o.length>0)if(t){const e=o[0];Cst(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Cst(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,a=n.type;Ilt(n,t.key,t.offset,t.type),Ilt(t,r,o,a),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Cst(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Cst(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Dat(r,e);if(kst(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Cst(n)&&0===n.getChildrenSize()){n.remove();const e=Wlt();e.add(o.__key),pat(e)}else o.remove(),ust().dispatchCommand(lrt,void 0);return}if(!e&&Cst(o)&&Cst(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,a=o.getTextContentSize();if(o.is(n)||e&&t!==a||!e&&0!==t)return void Rlt(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,a=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==a)return void Rlt(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,a=r.offset,i=e<a,l=i?e:a,s=i?a:e,c=s-1;l!==c&&(vat(o.getTextContent().slice(l,s))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Nst(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Hlt(e){return e instanceof Dlt}function Llt(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zlt(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Llt(n),Llt(r)]}function Rlt(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),a=o.length;let i=0,l=0;for(let e=0;e<a;e++){const r=e===a-1;if(l=i,i+=o[e].length,t&&i===n||i>n||r){o.splice(e,1),r&&(l=void 0);break}}const s=o.join("").trim();""===s?r.remove():(r.setTextContent(s),r.select(l,l))}function Blt(e,t,n,r){let o,a=t;if(1===e.nodeType){let i=!1;const l=e.childNodes,s=l.length,c=r._blockCursorElement;a===s&&(i=!0,a=s-1);let u=l[a],d=!1;if(u===c)u=l[a+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&a--}if(o=fat(u),klt(o))a=mat(o,i);else{let r=fat(e);if(null===r)return null;if(Cst(r)){a=Math.min(r.getChildrenSize(),a);let e=r.getChildAtIndex(a);if(Cst(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=i?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Cst(e)?e:e.getParentOrThrow()),a=0}klt(e)?(o=e,r=null,a=mat(e,i)):e!==r&&i&&!d&&a++}else{const n=r.getIndexWithinParent();a=0===t&&kst(r)&&fat(e)===r?n:n+1,r=r.getParentOrThrow()}if(Cst(r))return Nlt(r.__key,a,"element")}}else o=fat(e);return klt(o)?Nlt(o.__key,a,"text"):null}function $lt(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),a=o.getParent();if(t){if((n||!t)&&null===r&&Cst(a)&&a.isInline()){const t=a.getPreviousSibling();klt(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Cst(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):klt(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),a=o.getParent();if(t&&Cst(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Cst(a)&&a.isInline()&&!a.canInsertTextAfter()){const t=a.getNextSibling();klt(t)&&(e.key=t.__key,e.offset=0)}}}function Zlt(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);$lt(e,r,o),$lt(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const a=ust();if(a.isComposing()&&a._compositionKey!==e.key&&Plt(n)){const r=n.anchor,o=n.focus;Ilt(e,r.key,r.offset,r.type),Ilt(t,o.key,o.offset,o.type)}}}function Vlt(e,t,n,r,o,a){if(null===e||null===n||!Kot(o,e,n))return null;const i=Blt(e,t,Plt(a)?a.anchor:null,o);if(null===i)return null;const l=Blt(n,r,Plt(a)?a.focus:null,o);if(null===l)return null;if("element"===i.type&&"element"===l.type){const t=fat(e),r=fat(n);if(kst(t)&&kst(r))return null}return Zlt(i,l,a),[i,l]}function jlt(e,t,n,r,o,a){const i=cst(),l=new Tlt(Nlt(e,t,o),Nlt(n,r,a),0,"");return l.dirty=!0,i._selection=l,l}function Wlt(){return new Dlt(new Set)}function Flt(e,t,n,r){const o=n._window;if(null===o)return null;const a=r||o.event,i=a?a.type:void 0,l="selectionchange"===i,s=!Dot&&(l||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&a&&3===a.detail||"drop"===i||void 0===i);let c,u,d,h;if(Plt(e)&&!s)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,l&&Plt(e)&&!Kot(n,c,u))return e.clone();const p=Vlt(c,d,u,h,n,e);if(null===p)return null;const[f,m]=p;return new Tlt(f,m,Plt(e)?e.format:0,Plt(e)?e.style:"")}function qlt(){return cst()._selection}function Ylt(){return ust()._editorState._selection}function Ult(e,t,n,r=1){const o=e.anchor,a=e.focus,i=o.getNode(),l=a.getNode();if(!t.is(i)&&!t.is(l))return;const s=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);o.set(s,n,"element"),a.set(s,n,"element"),Klt(e)}}else{const i=e.isBackward(),l=i?a:o,c=l.getNode(),u=i?o:a,d=u.getNode();if(t.is(c)){const e=l.offset;(n<=e&&r>0||n<e&&r<0)&&l.set(s,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(s,Math.max(0,e+r),"element")}}Klt(e)}function Klt(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,a=t.getNode(),i=r.getNode();if(e.isCollapsed()){if(!Cst(a))return;const e=a.getChildrenSize(),o=n>=e,i=o?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(klt(i)){let e=0;o&&(e=i.getTextContentSize()),t.set(i.__key,e,"text"),r.set(i.__key,e,"text")}}else{if(Cst(a)){const e=a.getChildrenSize(),r=n>=e,o=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(klt(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Cst(i)){const e=i.getChildrenSize(),t=o>=e,n=t?i.getChildAtIndex(e-1):i.getChildAtIndex(o);if(klt(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Glt(e,t,n,r,o){let a=null,i=0,l=null;null!==r?(a=r.__key,klt(r)?(i=r.getTextContentSize(),l="text"):Cst(r)&&(i=r.getChildrenSize(),l="element")):null!==o&&(a=o.__key,klt(o)?l="text":Cst(o)&&(l="element")),null!==a&&null!==l?e.set(a,i,l):(i=t.getIndexWithinParent(),-1===i&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function Xlt(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function Qlt(e){let t=e;e.isCollapsed()||t.removeText();const n=qlt();if(Plt(n)&&(t=n),!Plt(t))throw Error("Unexpected dirty selection to be null");const r=t.anchor;let o=r.getNode(),a=r.offset;for(;!Gat(o);)[o,a]=Jlt(o,a);return a}function Jlt(e,t){const n=e.getParent();if(!n){const e=Hst();return dat().append(e),e.select(),[dat(),0]}if(klt(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Cst(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Tlt(Nlt(e.__key,t,"element"),Nlt(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let est=null,tst=null,nst=!1,rst=!1,ost=0;const ast={characterData:!0,childList:!0,subtree:!0};function ist(){return nst||null!==est&&est._readOnly}function lst(){if(nst)throw Error("Cannot use method in read-only mode.")}function sst(){if(ost>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function cst(){if(null===est)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return est}function ust(){if(null===tst)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return tst}function dst(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);if(void 0===n)throw Error(`registeredNode: Type ${t} not found`);return n}(e,r);let a=n.get(r);void 0===a&&(a=Array.from(o.transforms),n.set(r,a));const i=a.length;for(let e=0;e<i&&(a[e](t),t.isAttached());e++);}function hst(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function pst(e,t){const n=e.type,r=t.get(n);if(void 0===r)throw Error(`parseEditorState: type "${n}" + not found`);const o=r.klass;if(e.type!==o.getType())throw Error(`LexicalNode: Node ${o.name} does not implement .importJSON().`);const a=o.importJSON(e),i=e.children;if(Cst(a)&&Array.isArray(i))for(let e=0;e<i.length;e++){const n=pst(i[e],t);a.append(n)}return a}function fst(e,t){const n=est,r=nst,o=tst;est=e,nst=!0,tst=null;try{return t()}finally{est=n,nst=r,tst=o}}function mst(e){const t=e._nodeMap;t.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function vst(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const a=e._editorState,i=a._selection,l=n._selection,s=0!==e._dirtyType,c=est,u=nst,d=tst,h=e._updating,p=e._observer;let f=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==p){tst=e,est=n,nst=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;p.disconnect(),f=function(e,t,n,r,o,a){cit="",hit="",uit="",pit=2===r,mit=null,eit=n,Jat=n._config,tit=n._nodes,nit=eit._listeners.mutation,rit=o,oit=a,ait=e._nodeMap,iit=t._nodeMap,fit=t._readOnly,lit=new Map(n._keyToDOMMap);const i=new Map;return sit=i,Nit("root",null),eit=void 0,tit=void 0,rit=void 0,oit=void 0,ait=void 0,iit=void 0,Jat=void 0,lit=void 0,sit=void 0,i}(a,n,e,t,r,o)}catch(t){if(t instanceof Error&&e._onError(t),rst)throw t;return zst(e,null,r,n),$ot(e),e._dirtyType=2,rst=!0,vst(e,a),void(rst=!1)}finally{p.observe(r,ast),e._updating=h,est=c,nst=u,tst=d}}n._readOnly||(n._readOnly=!0,mst(n),Plt(l)&&(Object.freeze(l.anchor),Object.freeze(l.focus)),Object.freeze(l));const m=e._dirtyLeaves,v=e._dirtyElements,g=e._normalizedNodes,b=e._updateTags,y=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const o=t._nodeMap;let a;for(a in r)o.has(a)||(r===n&&(r=cat(e)),delete r[a])}(e,n);const w=o?null:Yat(e._window);if(e._editable&&null!==w&&(s||null===l||l.dirty)){tst=e,est=n;try{if(null!==p&&p.disconnect(),s||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&qat(t,e,r),function(e,t,n,r,o,a){const i=r.anchorNode,l=r.focusNode,s=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(o.has("collaboration")&&u!==a||null!==u&&Uot(u))return;if(!Plt(t))return void(null!==e&&Kot(n,i,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,p=d.key,f=h.key,m=Lat(n,p),v=Lat(n,f),g=d.offset,b=h.offset,y=t.format,w=t.style,x=t.isCollapsed();let E=m,k=v,S=!1;if("text"===d.type){E=Jot(m);const e=d.getNode();S=e.getFormat()!==y||e.getStyle()!==w}else Plt(e)&&"text"===e.anchor.type&&(S=!0);if("text"===h.type&&(k=Jot(v)),null!==E&&null!==k&&(x&&(null===e||S||Plt(e)&&(e.format!==y||e.style!==w))&&function(e,t,n,r,o){jit=[e,t,n,r,o]}(y,w,g,p,performance.now()),s!==g||c!==b||i!==E||l!==k||"Range"===r.type&&x||(null!==u&&a.contains(u)||a.focus({preventScroll:!0}),"element"===d.type))){try{r.setBaseAndExtent(E,g,k,b)}catch(e){console.warn(e)}if(!o.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==a&&a===document.activeElement){const e=t instanceof Tlt&&"element"===t.anchor.type?E.childNodes[g]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:a,bottom:i}=t,l=0,s=0,c=n;for(;null!==c;){const t=c===r.body;if(t)l=0,s=Bat(e).innerHeight;else{const e=c.getBoundingClientRect();l=e.top,s=e.bottom}let n=0;if(a<l?n=-(l-a):i>s&&(n=i-s),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;a-=t,i-=t}if(t)break;c=zat(c)}}(n,t,a)}}Bit=!0}}(i,l,e,w,b,r)}(function(e,t,n){let r=e._blockCursorElement;if(Plt(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,a=o.getNode(),i=o.offset;let l=!1,s=null;if(i===a.getChildrenSize())Fat(a.getChildAtIndex(i-1))&&(l=!0);else{const t=a.getChildAtIndex(i);if(Fat(t)){const n=t.getPreviousSibling();(null===n||Fat(n))&&(l=!0,s=e.getElementByKey(t.__key))}}if(l){const n=e.getElementByKey(a.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Iot(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===s?n.appendChild(r):n.insertBefore(r,s))}}null!==r&&qat(r,e,t)})(e,r,l),null!==p&&p.observe(r,ast)}finally{tst=d,est=c}}null!==f&&function(e,t,n,r,o){const a=Array.from(e._listeners.mutation),i=a.length;for(let e=0;e<i;e++){const[i,l]=a[e],s=t.get(l);void 0!==s&&i(s,{dirtyLeaves:r,prevEditorState:o,updateTags:n})}}(e,f,b,m,a),Plt(l)||null===l||null!==i&&i.is(l)||e.dispatchCommand(lrt,void 0);const x=e._pendingDecorators;null!==x&&(e._decorators=x,e._pendingDecorators=null,gst("decorator",e,!0,x)),function(e,t,n){const r=uat(t),o=uat(n);r!==o&&gst("textcontent",e,!0,o)}(e,t||a,n),gst("update",e,!0,{dirtyElements:v,dirtyLeaves:m,editorState:n,normalizedNodes:g,prevEditorState:t||a,tags:b}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;wst(e,t,r)}}}(e)}function gst(e,t,n,...r){const o=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function bst(e,t,n){if(!1===e._updating||tst!==e){let r=!1;return e.update((()=>{r=bst(e,t,n)})),r}const r=gat(e);for(let o=4;o>=0;o--)for(let a=0;a<r.length;a++){const i=r[a]._commands.get(t);if(void 0!==i){const t=i[o];if(void 0!==t){const r=Array.from(t),o=r.length;for(let t=0;t<o;t++)if(!0===r[t](n,e))return!0}}}return!1}function yst(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,o]=t;let a,i;void 0!==o&&(a=o.onUpdate,i=o.tag,o.skipTransforms&&(r=!0),a&&e._deferred.push(a),i&&e._updateTags.add(i)),n()}}return r}function wst(e,t,n){const r=e._updateTags;let o,a,i=!1,l=!1;void 0!==n&&(o=n.onUpdate,a=n.tag,null!=a&&r.add(a),i=n.skipTransforms||!1,l=n.discrete||!1),o&&e._deferred.push(o);const s=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new Ist(new Map((c||s)._nodeMap)),u=!0),c._flushSync=l;const d=est,h=nst,p=tst,f=e._updating;est=c,nst=!1,e._updating=!0,tst=e;try{u&&(e._headless?null!==s._selection&&(c._selection=s._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=Yat(e._window);return Plt(t)||null==t?Flt(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),i=yst(e,i),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Plt(r)){const e=r.anchor,t=r.focus;let o;if("text"===e.type&&(o=e.getNode(),o.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();o!==e&&e.selectionTransform(n,r)}}}(c,e),0!==e._dirtyType&&(i?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);klt(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&jot(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,o=e._nodeMap,a=aat(),i=new Map;let l=n,s=l.size,c=r,u=c.size;for(;s>0||u>0;){if(s>0){t._dirtyLeaves=new Set;for(const e of l){const r=o.get(e);klt(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&jot(r),void 0!==r&&hst(r,a)&&dst(t,r,i),n.add(e)}if(l=t._dirtyLeaves,s=l.size,s>0){ost++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],l=e[1];if("root"!==n&&!l)continue;const s=o.get(n);void 0!==s&&hst(s,a)&&dst(t,s,i),r.set(n,l)}l=t._dirtyLeaves,s=l.size,c=t._dirtyElements,u=c.size,ost++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),yst(e),function(e,t,n,r){const o=e._nodeMap,a=t._nodeMap,i=[];for(const[e]of r){const t=a.get(e);void 0!==t&&(t.isAttached()||(Cst(t)&&Qat(t,e,o,a,i,r),o.has(e)||r.delete(e),i.push(e)))}for(const e of i)a.delete(e);for(const e of n){const t=a.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Plt(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;if(void 0===e.get(t)||void 0===e.get(n))throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Hlt(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void vst(e)}finally{est=d,nst=h,tst=p,e._updating=f,ost=0}const m=0!==e._dirtyType||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,vst(e)):u&&Yot((()=>{vst(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function xst(e,t,n){e._updating?e._updates.push([t,n]):wst(e,t,n)}class Est extends tlt{constructor(e){super(e)}decorate(e,t){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function kst(e){return e instanceof Est}class Sst extends tlt{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Not[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=ust()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(klt(t)&&e.push(t),Cst(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Cst(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Cst(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Cst(e)&&e.getLastDescendant()||e||null}const r=t[e];return Cst(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:iat(e)}getFirstChildOrThrow(){const e=this.getFirstChild();if(null===e)throw Error(`Expected node ${this.__key} to have a first child.`);return e}getLastChild(){const e=this.getLatest().__last;return null===e?null:iat(e)}getLastChildOrThrow(){const e=this.getLastChild();if(null===e)throw Error(`Expected node ${this.__key} to have a last child.`);return e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContent(),Cst(o)&&r!==n-1&&!o.isInline()&&(e+=yot)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContentSize(),Cst(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=_ot[e];return!!(this.getFormat()&t)}return!1}select(e,t){lst();const n=qlt();let r=e,o=t;const a=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(klt(e)||Cst(e))return e.select(0,0)}else if(!(void 0!==e&&e!==a||void 0!==t&&t!==a)){const e=this.getLastChild();if(klt(e)||Cst(e))return e.select()}void 0===r&&(r=a),void 0===o&&(o=a);const i=this.__key;return Plt(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):jlt(i,r,i,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?_ot[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),a=this.getWritable(),i=a.__key,l=[],s=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){if(null===e)throw Error("splice: sibling not found");const t=e.getNextSibling(),n=e.__key;nat(e.getWritable()),s.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===i&&d--,nat(r);const o=t.__key;if(null===h)a.__first=o,r.__prev=null;else{const e=h.getWritable();e.__next=o,r.__prev=e.__key}if(t.__key===i)throw Error("append: attempting to append self");r.__parent=i,l.push(o),h=t}if(e+t===o)null!==h&&(h.getWritable().__next=null,a.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(a.__size=d,s.length){const e=qlt();if(Plt(e)){const t=new Set(s),n=new Set(l),{anchor:r,focus:o}=e;Mst(r,t,n)&&Glt(r,r.getNode(),this,u,c),Mst(o,t,n)&&Glt(o,o.getNode(),this,u,c),0!==d||this.canBeEmpty()||Zat(this)||this.remove()}}return a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Cst(e){return e instanceof Sst}function Mst(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class _st extends Sst{static getType(){return"root"}static clone(){return new _st}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const e=this.__cachedText;return!ist()&&0!==ust()._dirtyType||null===e?super.getTextContent():e}remove(){throw Error("remove: cannot be called on root nodes")}replace(e){throw Error("replace: cannot be called on root nodes")}insertBefore(e){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(e){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(!Cst(n)&&!kst(n))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...e)}static importJSON(e){const t=dat();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Nst(e){return e instanceof _st}function Ast(){return new Ist(new Map([["root",new _st]]))}function Ost(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(Cst(e)){const r=t.children;if(!Array.isArray(r))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`);const o=e.getChildren();for(let e=0;e<o.length;e++){const t=Ost(o[e]);r.push(t)}}return t}class Ist{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return fst(this,e)}clone(e){const t=new Ist(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return fst(this,(()=>({root:Ost(dat())})))}}class Dst extends Sst{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Pst extends Sst{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Cot[e];return!!(this.getTextFormat()&t)}static clone(e){return new Pst(e.__key)}createDOM(e){const t=document.createElement("p"),n=Aat(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Tst,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Uat(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Hst();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Hst();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||klt(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Tst(e){const t=Hst();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Hst(){return jat(new Pst)}function Lst(e){return e instanceof Pst}function zst(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Ast(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const a=e._observer;null!==a&&(a.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Rst{constructor(e,t,n,r,o,a,i){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=bat(),this._onError=o,this._htmlConversions=a,this._editable=i,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){if(void 0===n)throw Error('Listener for type "command" requires a "priority".');const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);if(void 0===o)throw Error(`registerCommand: Command ${String(e)} not found in command map`);const a=o[n];return a.add(t),()=>{a.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){if(void 0===this._nodes.get(e.getType()))throw Error(`Node ${e.name} has not been registered. Ensure node has been passed to createEditor.`);const n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);if(void 0===r)throw Error(`Node ${e.name} has not been registered. Ensure node has been passed to createEditor.`);return r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var a;return a=e.getType(),xst(this,(()=>{const e=cst();if(e.isEmpty())return;if("root"===a)return void dat().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Tat(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Aat(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,zst(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Rit.get(t);if(void 0===n)throw Error("Root element not registered");const r=n-1;if(!(r>=0))throw Error("Root element count less than 0");Rit.set(t,r),0===r&&t.removeEventListener("selectionchange",Xit);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=gat(e),n=t[t.length-1]._key;Git.get(n)===e&&Git.delete(n)}else Git.delete(e._key)}(o),e.__lexicalEditor=null);const a=Kit(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,$ot(this),this._updateTags.add("history-merge"),vst(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=Rit.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Xit),Rit.set(n,(r||0)+1),e.__lexicalEditor=t;const o=Kit(e);for(let n=0;n<Pit.length;n++){const[r,a]=Pit[n],i="function"==typeof a?e=>{Jit(e)||(Qit(e),(t.isEditable()||"click"===r)&&a(e,t))}:e=>{if(!Jit(e)&&(Qit(e),t.isEditable()))switch(r){case"cut":return Tat(t,jrt,e);case"copy":return Tat(t,Vrt,e);case"paste":return Tat(t,frt,e);case"dragstart":return Tat(t,Brt,e);case"dragover":return Tat(t,$rt,e);case"dragend":return Tat(t,Zrt,e);case"focus":return Tat(t,Krt,e);case"blur":return Tat(t,Grt,e);case"drop":return Tat(t,zrt,e)}};e.addEventListener(r,i),o.push((()=>{e.removeEventListener(r,i)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;gst("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){if(e.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");Bot(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),vst(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),vst(this)}parseEditorState(e,t){return function(e,t,n){const r=Ast(),o=est,a=nst,i=tst,l=t._dirtyElements,s=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,est=r,nst=!1,tst=t;try{const o=t._nodes;pst(e.root,o),n&&n(),r._readOnly=!0,mst(r)}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=l,t._dirtyLeaves=s,t._cloneNotNeeded=c,t._dirtyType=u,est=o,nst=a,tst=i}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){xst(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),xst(this,(()=>{const e=qlt(),n=dat();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Yat(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,gst("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}var Bst=Object.freeze({__proto__:null,$addUpdateTag:function(e){lst(),ust()._updateTags.add(e)},$applyNodeReplacement:jat,$copyNode:Vat,$createLineBreakNode:olt,$createNodeSelection:Wlt,$createParagraphNode:Hst,$createPoint:Nlt,$createRangeSelection:function(){const e=Nlt("root",0,"element"),t=Nlt("root",0,"element");return new Tlt(e,t,0,"")},$createRangeSelectionFromDom:function(e,t){return Flt(null,e,t,null)},$createTabNode:Clt,$createTextNode:Elt,$getAdjacentNode:Dat,$getCharacterOffsets:zlt,$getEditor:function(){return ust()},$getNearestNodeFromDOMNode:sat,$getNearestRootOrShadowRoot:$at,$getNodeByKey:iat,$getPreviousSelection:Ylt,$getRoot:dat,$getSelection:qlt,$getTextContent:function(){const e=qlt();return null===e?"":e.getTextContent()},$hasAncestor:Rat,$hasUpdateTag:function(e){return ust()._updateTags.has(e)},$insertNodes:function(e){let t=qlt()||Ylt();null===t&&(t=dat().selectEnd()),t.insertNodes(e)},$isBlockElementNode:function(e){return Cst(e)&&!e.isInline()},$isDecoratorNode:kst,$isElementNode:Cst,$isInlineElementOrDecoratorNode:function(e){return Cst(e)&&e.isInline()||kst(e)&&e.isInline()},$isLeafNode:function(e){return klt(e)||alt(e)||kst(e)},$isLineBreakNode:alt,$isNodeSelection:Hlt,$isParagraphNode:Lst,$isRangeSelection:Plt,$isRootNode:Nst,$isRootOrShadowRoot:Zat,$isTabNode:Mlt,$isTextNode:klt,$nodesOfType:function(e){const t=cst(),n=t._readOnly,r=e.getType(),o=t._nodeMap,a=[];for(const[,t]of o)t instanceof e&&t.__type===r&&(n||t.isAttached())&&a.push(t);return a},$normalizeSelection__EXPERIMENTAL:Wot,$parseSerializedNode:function(e){return pst(e,ust()._nodes)},$selectAll:function(){const e=dat();pat(Wot(e.select(0,e.getChildrenSize())))},$setCompositionKey:oat,$setSelection:pat,$splitNode:function(e,t){let n=e.getChildAtIndex(t);if(null==n&&(n=e),Zat(e))throw Error("Can not call $splitNode() on root element");const r=e=>{const t=e.getParentOrThrow(),o=Zat(t),a=e!==n||o?Vat(e):e;if(o){if(!Cst(e)||!Cst(a))throw Error("Children of a root must be ElementNode");return e.insertAfter(a),[e,a,a]}{const[n,o,i]=r(t),l=e.getNextSiblings();return i.append(a,...l),[n,o,a]}},[o,a]=r(n);return[o,a]},ArtificialNode__DO_NOT_USE:Dst,BLUR_COMMAND:Grt,CAN_REDO_COMMAND:Yrt,CAN_UNDO_COMMAND:Urt,CLEAR_EDITOR_COMMAND:Frt,CLEAR_HISTORY_COMMAND:qrt,CLICK_COMMAND:crt,COMMAND_PRIORITY_CRITICAL:4,COMMAND_PRIORITY_EDITOR:0,COMMAND_PRIORITY_HIGH:3,COMMAND_PRIORITY_LOW:1,COMMAND_PRIORITY_NORMAL:2,CONTROLLED_TEXT_INSERTION_COMMAND:prt,COPY_COMMAND:Vrt,CUT_COMMAND:jrt,DELETE_CHARACTER_COMMAND:urt,DELETE_LINE_COMMAND:grt,DELETE_WORD_COMMAND:vrt,DRAGEND_COMMAND:Zrt,DRAGOVER_COMMAND:$rt,DRAGSTART_COMMAND:Brt,DROP_COMMAND:zrt,DecoratorNode:Est,ElementNode:Sst,FOCUS_COMMAND:Krt,FORMAT_ELEMENT_COMMAND:Rrt,FORMAT_TEXT_COMMAND:brt,INDENT_CONTENT_COMMAND:Hrt,INSERT_LINE_BREAK_COMMAND:drt,INSERT_PARAGRAPH_COMMAND:hrt,INSERT_TAB_COMMAND:Trt,KEY_ARROW_DOWN_COMMAND:_rt,KEY_ARROW_LEFT_COMMAND:Srt,KEY_ARROW_RIGHT_COMMAND:Ert,KEY_ARROW_UP_COMMAND:Mrt,KEY_BACKSPACE_COMMAND:Ort,KEY_DELETE_COMMAND:Drt,KEY_DOWN_COMMAND:xrt,KEY_ENTER_COMMAND:Nrt,KEY_ESCAPE_COMMAND:Irt,KEY_MODIFIER_COMMAND:Xrt,KEY_SPACE_COMMAND:Art,KEY_TAB_COMMAND:Prt,LineBreakNode:nlt,MOVE_TO_END:krt,MOVE_TO_START:Crt,OUTDENT_CONTENT_COMMAND:Lrt,PASTE_COMMAND:frt,ParagraphNode:Pst,REDO_COMMAND:wrt,REMOVE_TEXT_COMMAND:mrt,RootNode:_st,SELECTION_CHANGE_COMMAND:lrt,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:srt,SELECT_ALL_COMMAND:Wrt,TabNode:Slt,TextNode:plt,UNDO_COMMAND:yrt,createCommand:irt,createEditor:function(e){const t=e||{},n=tst,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,a=t.disableEvents||!1,i=Ast(),l=t.namespace||(null!==o?o._config.namespace:bat()),s=t.editorState,c=[_st,plt,nlt,Slt,Pst,Dst,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}{const e=t.name;if("RootNode"!==e){const n=t.prototype;["getType","clone"].forEach((n=>{t.hasOwnProperty(n)||console.warn(`${e} must implement static "${n}" method`)})),!t.hasOwnProperty("importDOM")&&t.hasOwnProperty("exportDOM")&&console.warn(`${e} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),n instanceof Est&&(n.hasOwnProperty("decorate")||console.warn(`${n.constructor.name} must implement "decorate" method`)),t.hasOwnProperty("importJSON")||console.warn(`${e} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),n.hasOwnProperty("exportJSON")||console.warn(`${e} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const o=t.getType(),a=t.transform(),i=new Set;null!==a&&i.add(a),p.set(o,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:i})}}const f=new Rst(i,o,p,{disableEvents:a,namespace:l,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,o=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(p,d?d.import:void 0),h);return void 0!==s&&(f._pendingEditorState=s,f._dirtyType=2),f},getNearestEditorFromDOMNode:Got,isBlockDomNode:function(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)},isCurrentlyReadOnlyMode:ist,isHTMLAnchorElement:function(e){return Uat(e)&&"A"===e.tagName},isHTMLElement:Uat,isInlineDomNode:Kat,isSelectionCapturedInDecoratorInput:Uot,isSelectionWithinEditor:Kot});const $st={},Zst={},Vst={},jst={},Wst={},Fst={},qst={},Yst={},Ust={},Kst={},Gst={},Xst={},Qst={},Jst={},ect={},tct={},nct={},rct={},oct={},act={},ict={},lct={},sct={},cct={},uct={},dct={},hct={},pct={},fct={},mct={},vct={},gct={},bct={},yct={},wct={},xct={};var Ect=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const kct="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Sct=kct&&"documentMode"in document?document.documentMode:null,Cct=kct&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Mct=kct&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_ct=!(!kct||!("InputEvent"in window)||Sct)&&"getTargetRanges"in new window.InputEvent("input"),Nct=kct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Act=kct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Oct=kct&&/Android/.test(navigator.userAgent),Ict=kct&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dct=kct&&Oct&&Ict,Pct=kct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ict,Tct=0,Hct=1,Lct=2,zct=1,Rct=2,Bct=3,$ct=4,Zct=5,Vct=6,jct=Nct||Act||Pct?" ":"​",Wct="\n\n",Fct=Mct?" ":jct,qct="֑-߿יִ-﷽ﹰ-ﻼ",Yct="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Uct=new RegExp("^[^"+Yct+"]*["+qct+"]"),Kct=new RegExp("^[^"+qct+"]*["+Yct+"]"),Gct={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Xct={directionless:1,unmergeable:2},Qct={center:2,end:6,justify:4,left:1,right:3,start:5},Jct={[Rct]:"center",[Vct]:"end",[$ct]:"justify",[zct]:"left",[Bct]:"right",[Zct]:"start"},eut={normal:0,segmented:2,token:1},tut={[Tct]:"normal",[Lct]:"segmented",[Hct]:"token"};function nut(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let rut=!1,out=0;function aut(e){out=e.timeStamp}function iut(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function lut(e,t,n){const r=bdt(n._window);let o=null,a=null;null!==r&&r.anchorNode===e&&(o=r.anchorOffset,a=r.focusOffset);const i=e.nodeValue;null!==i&&qut(t,i,o,a,!1)}function sut(e,t,n){if(opt(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return 3===t.nodeType&&n.isAttached()}function cut(e,t,n){rut=!0;const r=performance.now()-out>100;try{Fpt(e,(()=>{const o=gpt()||function(e){return e.getEditorState().read((()=>{const e=gpt();return null!==e?e.clone():null}))}(e),a=new Map,i=e.getRootElement(),l=e._editorState,s=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=Put(p,l);if(!(null===f&&p!==i||Ypt(f)))if("characterData"===h)r&&Uht(f)&&sut(o,p,f)&&lut(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],o=Dut(r),a=r.parentNode;if(null!=a&&r!==s&&null===o&&("BR"!==r.nodeName||!iut(r,a,e))){if(Mct){const e=r.innerText||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let o=0;o<r;o++){const r=n[o];("BR"===r.nodeName&&iut(r,p,e)||s===r)&&(p.appendChild(r),t++)}r!==t&&(p===i&&(f=zut(l)),a.set(p,f))}}}if(a.size>0)for(const[t,n]of a)if(Kpt(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n<r.length;n++){const a=r[n],i=e.getElementByKey(a);null!==i&&(null==o?(t.appendChild(i),o=i):o!==i&&t.replaceChild(i,o),o=o.nextSibling)}}else Uht(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,o=n.target;for(let t=0;t<r.length;t++){const n=r[t],a=n.parentNode;null==a||"BR"!==n.nodeName||iut(n,o,e)||a.removeChild(n)}}n.takeRecords()}null!==o&&(c&&(o.dirty=!0,Rut(o)),Mct&&odt(e)&&o.insertRawText(u))}))}finally{rut=!1}}function uut(e){const t=e._observer;null!==t&&cut(e,t.takeRecords(),t)}function dut(e){!function(e){0===out&&udt(e).addEventListener("textInput",aut,!0)}(e),e._observer=new MutationObserver(((t,n)=>{cut(e,t,n)}))}function hut(e,t){const n=e.__mode,r=e.__format,o=e.__style,a=t.__mode,i=t.__format,l=t.__style;return!(null!==n&&n!==a||null!==r&&r!==i||null!==o&&o!==l)}function put(e,t){const n=e.mergeWithSibling(t),r=Hpt()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function fut(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Uht(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(hut(t,r)){r=put(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Uht(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(hut(r,n)){r=put(r,n);break}break}n.remove()}}else r.remove()}function mut(e){return vut(e.anchor),vut(e.focus),e}function vut(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Uht(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Kpt(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let gut=1;const but="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function yut(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Ypt(Put(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function wut(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!yut(t)&&xut(t)===e}catch(e){return!1}}function xut(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=sdt(t)}return null}function Eut(e){return e.isToken()||e.isSegmented()}function kut(e){return 3===e.nodeType}function Sut(e){let t=e;for(;null!=t;){if(kut(t))return t;t=t.firstChild}return null}function Cut(e,t,n){const r=Gct[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Gct.superscript:"superscript"===t&&(o&=~Gct.subscript),o}function Mut(e,t){if(null!=t)return void(e.__key=t);Dpt(),Ppt();const n=Hpt(),r=Tpt(),o=""+gut++;r._nodeMap.set(o,e),Kpt(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}function _ut(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),a=e.getNextSibling();if(null===o)if(null!==a){const e=a.getWritable();r.__first=a.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==a){const t=a.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===a)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=a.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function Nut(e){Ppt();const t=e.getLatest(),n=t.__parent,r=Tpt(),o=Hpt(),a=r._nodeMap,i=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,a,i);const l=t.__key;o._dirtyType=1,Kpt(e)?i.set(l,!0):o._dirtyLeaves.add(l)}function Aut(e){Dpt();const t=Hpt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Iut(n);null!==e&&e.getWritable()}if(null!==e){const t=Iut(e);null!==t&&t.getWritable()}}}function Out(){return Ipt()?null:Hpt()._compositionKey}function Iut(e,t){const n=(t||Tpt())._nodeMap.get(e);return void 0===n?null:n}function Dut(e,t){const n=e[`__lexicalKey_${Hpt()._key}`];return void 0!==n?Iut(n,t):null}function Put(e,t){let n=e;for(;null!=n;){const e=Dut(n,t);if(null!==e)return e;n=sdt(n)}return null}function Tut(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Hut(e){return e.read((()=>Lut().getTextContent()))}function Lut(){return zut(Tpt())}function zut(e){return e._nodeMap.get("root")}function Rut(e){Dpt();const t=Tpt();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function But(e){const t=Hpt(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=sdt(n)}return null}(e,t);return null===n?e===t.getRootElement()?Iut("root"):null:Iut(n)}function $ut(e,t){return t?e.getTextContentSize():0}function Zut(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Vut(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function jut(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Wut(e){return 3===e.nodeType?e.nodeValue:null}function Fut(e,t,n){const r=bdt(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:a,focusOffset:i}=r;if(null!==o){let t=Wut(o);const r=Put(o);if(null!==t&&Uht(r)){if(t===jct&&n){const e=n.length;t=n,a=e,i=e}null!==t&&qut(r,t,a,i,e)}}}function qut(e,t,n,r,o){let a=e;if(a.isAttached()&&(o||!a.isDirty())){const i=a.isComposing();let l=t;(i||o)&&t[t.length-1]===jct&&(l=t.slice(0,-1));const s=a.getTextContent();if(o||l!==s){if(""===l){if(Aut(null),Nct||Act||Pct)a.remove();else{const e=Hpt();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}const t=a.getParent(),o=bpt(),s=a.getTextContentSize(),c=Out(),u=a.getKey();if(a.isToken()||null!==c&&u===c&&!i||opt(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!a.canInsertTextBefore()&&!i||o.focus.key===e.__key&&o.focus.offset===s&&!a.canInsertTextAfter()&&!i))return void a.markDirty();const d=gpt();if(!opt(d)||null===n||null===r)return void a.setTextContent(l);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){const e=Yht(a.getTextContent());a.replace(e),a=e}a.setTextContent(l)}}}function Yut(e){return"ArrowLeft"===e}function Uut(e){return"ArrowRight"===e}function Kut(e,t){return Cct?e:t}function Gut(e){return"Enter"===e}function Xut(e){return"Backspace"===e}function Qut(e){return"Delete"===e}function Jut(e,t,n){return"KeyA"===e&&Kut(t,n)}function edt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=nut(o);return n[t]=e,e}return o}function tdt(e,t,n,r,o){if(0===n.size)return;const a=r.__type,i=r.__key,l=t.get(a);void 0===l&&Ect(33,a);const s=l.klass;let c=e.get(s);void 0===c&&(c=new Map,e.set(s,c));const u=c.get(i),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(i,d?"updated":o)}function ndt(e,t,n){const r=e.getParent();let o=n,a=e;return null!==r&&(t&&0===n?(o=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(o=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?o-1:o)}function rdt(e,t){const n=e.offset;if("element"===e.type)return ndt(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?ndt(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function odt(e){const t=udt(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function adt(e,t,n){return Vpt(e,t,n)}function idt(e){return!Qpt(e)&&!e.isLastChild()&&!e.isInline()}function ldt(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Ect(75,t),n}function sdt(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function cdt(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function udt(e){const t=e._window;return null===t&&Ect(78),t}function ddt(e){let t=e.getParentOrThrow();for(;null!==t;){if(hdt(t))return t;t=t.getParentOrThrow()}return t}function hdt(e){return Qpt(e)||Kpt(e)&&e.isShadowRoot()}function pdt(e){const t=e.constructor.clone(e);return Mut(t,null),t}function fdt(e){const t=Hpt(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Ect(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Ect(98),t}return e}function mdt(e,t){!Qpt(e.getParent())||Kpt(t)||Ypt(t)||Ect(99)}function vdt(e){return(Ypt(e)||Kpt(e)&&!e.canBeEmpty())&&!e.isInline()}function gdt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function bdt(e){return kct?(e||window).getSelection():null}function ydt(e){return 1===e.nodeType}function wdt(e){const t=new RegExp(/^(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|#text)$/,"i");return null!==e.nodeName.match(t)}function xdt(e){if(Qpt(e)||Ypt(e)&&!e.isInline())return!0;if(!Kpt(e)||hdt(e))return!1;const t=e.getFirstChild(),n=null===t||Oht(t)||Uht(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Edt(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function kdt(e,t,n,r,o,a){let i=e.getFirstChild();for(;null!==i;){const e=i.__key;i.__parent===t&&(Kpt(i)&&kdt(i,e,n,r,o,a),n.has(e)||a.delete(e),o.push(e)),i=i.getNextSibling()}}let Sdt,Cdt,Mdt,_dt,Ndt,Adt,Odt,Idt,Ddt,Pdt,Tdt="",Hdt="",Ldt=null,zdt="",Rdt=!1,Bdt=!1,$dt=null;function Zdt(e,t){const n=Odt.get(e);if(null!==t){const n=nht(e);n.parentNode===t&&t.removeChild(n)}if(Idt.has(e)||Cdt._keyToDOMMap.delete(e),Kpt(n)){const e=Qdt(n,Odt);Vdt(e,0,e.length-1,null)}void 0!==n&&tdt(Pdt,Mdt,_dt,n,"destroyed")}function Vdt(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&Zdt(t,r)}}function jdt(e,t){e.setProperty("text-align",t)}const Wdt="40px";function Fdt(e,t){const n=Sdt.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Wdt;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function qdt(e,t){const n=e.style;0===t?jdt(n,""):1===t?jdt(n,"left"):2===t?jdt(n,"center"):3===t?jdt(n,"right"):4===t?jdt(n,"justify"):5===t?jdt(n,"start"):6===t&&jdt(n,"end")}function Ydt(e,t,n){const r=Idt.get(e);void 0===r&&Ect(60);const o=r.createDOM(Sdt,Cdt);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,Cdt),Uht(r)?o.setAttribute("data-lexical-text","true"):Ypt(r)&&o.setAttribute("data-lexical-decorator","true"),Kpt(r)){const e=r.__indent,t=r.__size;if(0!==e&&Fdt(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=Hdt;Hdt="",Udt(e,n,0,t,r,null),Xdt(n,r),Hdt=o}(Qdt(r,Idt),e,r,o)}const n=r.__format;0!==n&&qdt(o,n),r.isInline()||Gdt(null,r,o),idt(r)&&(Tdt+=Wct,zdt+=Wct)}else{const t=r.getTextContent();if(Ypt(r)){const t=r.decorate(Cdt,Sdt);null!==t&&eht(e,t),o.contentEditable="false"}else Uht(r)&&(r.isDirectionless()||(Hdt+=t));Tdt+=t,zdt+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return tdt(Pdt,Mdt,_dt,r,"created"),o}function Udt(e,t,n,r,o,a){const i=Tdt;Tdt="";let l=n;for(;l<=r;++l){Ydt(e[l],o,a);const t=Idt.get(e[l]);null!==t&&null===Ldt&&Uht(t)&&(Ldt=t.getFormat())}idt(t)&&(Tdt+=Wct),o.__lexicalTextContent=Tdt,Tdt=i+Tdt}function Kdt(e,t){const n=t.get(e);return Oht(n)||Ypt(n)&&n.isInline()}function Gdt(e,t,n){const r=null!==e&&(0===e.__size||Kdt(e.__last,Odt)),o=0===t.__size||Kdt(t.__last,Idt);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Xdt(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==Hdt||r!==$dt){const n=""===Hdt,a=n?$dt:(o=Hdt,Uct.test(o)?"rtl":Kct.test(o)?"ltr":null);if(a!==r){const o=t.classList,i=Sdt.theme;let l=null!==r?i[r]:void 0,s=null!==a?i[a]:void 0;if(void 0!==l){if("string"==typeof l){const e=nut(l);l=i[r]=e}o.remove(...l)}if(null===a||n&&"ltr"===a)t.removeAttribute("dir");else{if(void 0!==s){if("string"==typeof s){const e=nut(s);s=i[a]=e}void 0!==s&&o.add(...s)}t.dir=a}Bdt||(e.getWritable().__dir=a)}$dt=a,t.__lexicalDirTextContent=Hdt,t.__lexicalDir=a}var o}function Qdt(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Ect(101),n.push(r),r=e.__next}return n}function Jdt(e,t){const n=Odt.get(e);let r=Idt.get(e);void 0!==n&&void 0!==r||Ect(61);const o=Rdt||Adt.has(e)||Ndt.has(e),a=ldt(Cdt,e);if(n===r&&!o){if(Kpt(n)){const e=a.__lexicalTextContent;void 0!==e&&(Tdt+=e,zdt+=e);const t=a.__lexicalDirTextContent;void 0!==t&&(Hdt+=t)}else{const e=n.getTextContent();Uht(n)&&!n.isDirectionless()&&(Hdt+=e),zdt+=e,Tdt+=e}return a}if(n!==r&&o&&tdt(Pdt,Mdt,_dt,r,"updated"),r.updateDOM(n,a,Sdt)){const n=Ydt(e,null,null);return null===t&&Ect(62),t.replaceChild(n,a),Zdt(e,null),n}if(Kpt(n)&&Kpt(r)){const e=r.__indent;e!==n.__indent&&Fdt(a,e);const t=r.__format;t!==n.__format&&qdt(a,t),o&&(function(e,t,n){const r=Hdt;var o;Hdt="",Ldt=null,function(e,t,n){const r=Tdt,o=e.__size,a=t.__size;if(Tdt="",1===o&&1===a){const r=e.__first,o=t.__first;if(r===o)Jdt(r,n);else{const e=nht(r),t=Ydt(o,null,null);n.replaceChild(t,e),Zdt(r,null)}const a=Idt.get(o);null===Ldt&&Uht(a)&&(Ldt=a.getFormat())}else{const r=Qdt(e,Odt),i=Qdt(t,Idt);if(0===o)0!==a&&Udt(i,t,0,a-1,n,null);else if(0===a){if(0!==o){const e=null==n.__lexicalLineBreak;Vdt(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,a){const i=r-1,l=o-1;let s,c,u=a.firstChild,d=0,h=0;for(;d<=i&&h<=l;){const e=t[d],r=n[h];if(e===r)u=tht(Jdt(r,a)),d++,h++;else{void 0===s&&(s=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),i=s.has(r);if(o)if(i){const e=ldt(Cdt,r);e===u?u=tht(Jdt(r,a)):(null!=u?a.insertBefore(e,u):a.appendChild(e),Jdt(r,a)),d++,h++}else Ydt(r,a,u),h++;else u=tht(nht(e)),Zdt(e,a),d++}const o=Idt.get(r);null!==o&&null===Ldt&&Uht(o)&&(Ldt=o.getFormat())}const p=d>i,f=h>l;if(p&&!f){const t=n[l+1];Udt(n,e,h,l,a,void 0===t?null:Cdt.getElementByKey(t))}else f&&!p&&Vdt(t,d,i,a)}(t,r,i,o,a,n)}idt(t)&&(Tdt+=Wct),n.__lexicalTextContent=Tdt,Tdt=r+Tdt}(e,t,n),Xdt(t,n),ift(o=t)&&null!=Ldt&&Ldt!==o.__textFormat&&o.setTextFormat(Ldt),Hdt=r,Ldt=null}(n,r,a),Qpt(r)||r.isInline()||Gdt(n,r,a)),idt(r)&&(Tdt+=Wct,zdt+=Wct)}else{const t=r.getTextContent();if(Ypt(r)){const t=r.decorate(Cdt,Sdt);null!==t&&eht(e,t)}else Uht(r)&&!r.isDirectionless()&&(Hdt+=t);Tdt+=t,zdt+=t}if(!Bdt&&Qpt(r)&&r.__cachedText!==zdt){const e=r.getWritable();e.__cachedText=zdt,r=e}return a}function eht(e,t){let n=Cdt._pendingDecorators;const r=Cdt._decorators;if(null===n){if(r[e]===t)return;n=Tut(Cdt)}n[e]=t}function tht(e){let t=e.nextSibling;return null!==t&&t===Cdt._blockCursorElement&&(t=t.nextSibling),t}function nht(e){const t=Ddt.get(e);return void 0===t&&Ect(75,e),t}const rht=Object.freeze({}),oht=[["keydown",function(e,t){if(aht=e.timeStamp,iht=e.code,t.isComposing())return;const{code:n,shiftKey:r,ctrlKey:o,metaKey:a,altKey:i}=e;adt(t,Jst,e)||(function(e,t,n,r){return Uut(e)&&!t&&!r&&!n}(n,o,i,a)?adt(t,ect,e):function(e,t,n,r,o){return Uut(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?adt(t,tct,e):function(e,t,n,r){return Yut(e)&&!t&&!r&&!n}(n,o,i,a)?adt(t,nct,e):function(e,t,n,r,o){return Yut(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?adt(t,rct,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,a)?adt(t,oct,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,a)?adt(t,act,e):function(e,t){return Gut(e)&&t}(n,r)?(hht=!0,adt(t,ict,e)):function(e){return"Space"===e}(n)?adt(t,lct,e):function(e,t){return Cct&&t&&"KeyO"===e}(n,o)?(e.preventDefault(),hht=!0,adt(t,jst,!0)):function(e,t){return Gut(e)&&!t}(n,r)?(hht=!1,adt(t,ict,e)):function(e,t,n,r){return Cct?!t&&!n&&(Xut(e)||"KeyH"===e&&r):!(r||t||n)&&Xut(e)}(n,i,a,o)?Xut(n)?adt(t,sct,e):(e.preventDefault(),adt(t,Vst,!0)):function(e){return"Escape"===e}(n)?adt(t,cct,e):function(e,t,n,r,o){return Cct?!(n||r||o)&&(Qut(e)||"KeyD"===e&&t):!(t||r||o)&&Qut(e)}(n,o,r,i,a)?Qut(n)?adt(t,uct,e):(e.preventDefault(),adt(t,Vst,!1)):function(e,t,n){return Xut(e)&&(Cct?t:n)}(n,i,o)?(e.preventDefault(),adt(t,Ust,!0)):function(e,t,n){return Qut(e)&&(Cct?t:n)}(n,i,o)?(e.preventDefault(),adt(t,Ust,!1)):function(e,t){return Cct&&t&&Xut(e)}(n,a)?(e.preventDefault(),adt(t,Kst,!0)):function(e,t){return Cct&&t&&Qut(e)}(n,a)?(e.preventDefault(),adt(t,Kst,!1)):function(e,t,n,r){return"KeyB"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"bold")):function(e,t,n,r){return"KeyU"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"underline")):function(e,t,n,r){return"KeyI"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,i,o,a)?adt(t,dct,e):function(e,t,n,r){return"KeyZ"===e&&!t&&Kut(n,r)}(n,r,a,o)?(e.preventDefault(),adt(t,Xst,void 0)):function(e,t,n,r){return Cct?"KeyZ"===e&&n&&t:"KeyY"===e&&r||"KeyZ"===e&&r&&t}(n,r,a,o)?(e.preventDefault(),adt(t,Qst,void 0)):ipt(t._editorState._selection)?function(e,t,n,r){return!t&&"KeyC"===e&&(Cct?n:r)}(n,r,a,o)?(e.preventDefault(),adt(t,vct,e)):function(e,t,n,r){return!t&&"KeyX"===e&&(Cct?n:r)}(n,r,a,o)?(e.preventDefault(),adt(t,gct,e)):Jut(n,a,o)&&(e.preventDefault(),adt(t,bct,e)):!Mct&&Jut(n,a,o)&&(e.preventDefault(),adt(t,bct,e)),function(e,t,n,r){return e||t||n||r}(o,r,i,a)&&adt(t,xct,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Fpt(t,(()=>{Ypt(Put(n))||(dht=!0)}))}],["compositionstart",function(e,t){Fpt(t,(()=>{const n=gpt();if(opt(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Aut(r.key),(e.timeStamp<aht+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||Uht(o)&&o.getStyle()!==n.style)&&adt(t,Fst,Fct)}}))}],["compositionend",function(e,t){Mct?pht=!0:Fpt(t,(()=>{yht(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Fpt(t,(()=>{const n=gpt(),r=e.data,o=bht(e);if(null!=r&&opt(n)&&mht(n,o,r,e.timeStamp,!1)){pht&&(yht(t,r),pht=!1);const o=n.anchor.getNode(),a=bdt(t._window);if(null===a)return;const i=n.isBackward(),l=i?n.anchor.offset:n.focus.offset,s=i?n.focus.offset:n.anchor.offset;_ct&&!n.isCollapsed()&&Uht(o)&&null!==a.anchorNode&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+s)===Wut(a.anchorNode)||adt(t,Fst,r);const c=r.length;Mct&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Nct||Act||Pct||!t.isComposing()||(aht=0,Aut(null))}else Fut(!1,t,null!==r?r:void 0),pht&&(yht(t,r||void 0),pht=!1);Dpt(),uut(Hpt())})),sht=null}],["click",function(e,t){Fpt(t,(()=>{const n=gpt(),r=bdt(t._window),o=bpt();if(r)if(opt(n)){const t=n.anchor,a=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Qpt(a)&&1===Lut().getChildrenSize()&&a.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||a!==n.focus.getNode()&&(Kpt(a)?a.select(0):a.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const a=n.nodeType;1!==a&&3!==a||Rut(vpt(o,r,t,e))}}adt(t,Zst,e)}))}],["cut",rht],["copy",rht],["dragstart",rht],["dragover",rht],["dragend",rht],["paste",rht],["focus",rht],["blur",rht],["drop",rht]];_ct&&oht.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=bht(e);"deleteCompositionText"===n||Mct&&odt(t)||"insertCompositionText"!==n&&Fpt(t,(()=>{const o=gpt();if("deleteContentBackward"===n){if(null===o){const e=bpt();if(!opt(e))return;Rut(e.clone())}if(opt(o)){const n=o.anchor.key===o.focus.key;if(a=e.timeStamp,"Delete"===iht&&a<aht+30&&t.isComposing()&&n){if(Aut(null),aht=0,setTimeout((()=>{Fpt(t,(()=>{Aut(null)}))}),30),opt(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Uht(e)||Ect(142),o.style=e.getStyle()}}else{Aut(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),a=0===o.anchor.offset&&o.focus.offset===r.length;Dct&&n&&!a||adt(t,Vst,!0)}return}}var a;if(!opt(o))return;const i=e.data;null!==sht&&Fut(!1,t,sht),o.dirty&&null===sht||!o.isCollapsed()||Qpt(o.anchor.getNode())||null===r||o.applyDOMRange(r),sht=null;const l=o.anchor,s=o.focus,c=l.getNode(),u=s.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":adt(t,Fst,e);break;case"insertFromComposition":Aut(null),adt(t,Fst,e);break;case"insertLineBreak":Aut(null),adt(t,jst,!1);break;case"insertParagraph":Aut(null),hht&&!Act?(hht=!1,adt(t,jst,!1)):adt(t,Wst,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":adt(t,qst,e);break;case"deleteByComposition":(function(e,t){return e!==t||Kpt(e)||Kpt(t)||!e.isToken()||!t.isToken()})(c,u)&&adt(t,Yst,e);break;case"deleteByDrag":case"deleteByCut":adt(t,Yst,e);break;case"deleteContent":adt(t,Vst,!1);break;case"deleteWordBackward":adt(t,Ust,!0);break;case"deleteWordForward":adt(t,Ust,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":adt(t,Kst,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":adt(t,Kst,!1);break;case"formatStrikeThrough":adt(t,Gst,"strikethrough");break;case"formatBold":adt(t,Gst,"bold");break;case"formatItalic":adt(t,Gst,"italic");break;case"formatUnderline":adt(t,Gst,"underline");break;case"historyUndo":adt(t,Xst,void 0);break;case"historyRedo":adt(t,Qst,void 0)}else{if("\n"===i)e.preventDefault(),adt(t,jst,!1);else if(i===Wct)e.preventDefault(),adt(t,Wst,void 0);else if(null==i&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=i&&mht(o,r,i,e.timeStamp,!0)?(e.preventDefault(),adt(t,Fst,i)):sht=i;lht=e.timeStamp}}))}(e,t)]);let aht=0,iht=null,lht=0,sht=null;const cht=new WeakMap;let uht=!1,dht=!1,hht=!1,pht=!1,fht=[0,"",0,"root",0];function mht(e,t,n,r,o){const a=e.anchor,i=e.focus,l=a.getNode(),s=Hpt(),c=bdt(s._window),u=null!==c?c.anchorNode:null,d=a.key,h=s.getElementByKey(d),p=n.length;return d!==i.key||!Uht(l)||(!o&&(!_ct||lht<r+50)||l.isDirty()&&p<2||Zut(n))&&a.offset!==i.offset&&!l.isComposing()||Eut(l)||l.isDirty()&&p>1||(o||!_ct)&&null!==h&&!l.isComposing()&&u!==Sut(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||l.getFormat()!==e.format||l.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Uht(t)||Kpt(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,l)}function vht(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function ght(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:a,focusOffset:i}=e;uht&&(uht=!1,vht(r,o)&&vht(a,i))||Fpt(t,(()=>{if(!n)return void Rut(null);if(!wut(t,r,a))return;const l=gpt();if(opt(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const o=udt(t).event,a=o?o.timeStamp:performance.now(),[i,s,c,u,d]=fht,h=Lut(),p=!1===t.isComposing()&&""===h.getTextContent();if(a<d+200&&n.offset===c&&n.key===u)l.format=i,l.style=s;else if("text"===n.type)Uht(r)||Ect(141),l.format=r.getFormat(),l.style=r.getStyle();else if("element"===n.type&&!p){const e=n.getNode();e instanceof rft&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),a=r.length,s=l.isBackward(),c=s?i:o,u=s?o:i,d=s?t:e,h=s?e:t;let p=255,f=!1;for(let e=0;e<a;e++){const t=r[e],n=t.getTextContentSize();if(Uht(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===a-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}adt(t,$st,void 0)}))}function bht(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function yht(e,t){const n=e._compositionKey;if(Aut(null),null!==n&&null!=t){if(""===t){const t=Iut(n),r=Sut(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Uht(t)&&qut(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=gpt();if(opt(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void adt(e,ict,null)}}}Fut(!0,e,t)}function wht(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const xht=new Map;function Eht(e){const t=e.target,n=bdt(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=xut(n.anchorNode);if(null===r)return;dht&&(dht=!1,Fpt(r,(()=>{const t=bpt(),o=n.anchorNode;if(null===o)return;const a=o.nodeType;1!==a&&3!==a||Rut(vpt(t,n,r,e))})));const o=Vut(r),a=o[o.length-1],i=a._key,l=xht.get(i),s=l||a;s!==r&&ght(n,s,!1),ght(n,r,!0),r!==a?xht.set(i,r):l&&xht.delete(i)}function kht(e){e._lexicalHandled=!0}function Sht(e){return!0===e._lexicalHandled}function Cht(e,t,n){Dpt();const r=e.__key,o=e.getParent();if(null===o)return;const a=function(e){const t=gpt();if(!opt(t)||!Kpt(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),a=r.getNode();return cdt(o,e)&&n.set(e.__key,0,"element"),cdt(a,e)&&r.set(e.__key,0,"element"),t}(e);let i=!1;if(opt(a)&&t){const t=a.anchor,n=a.focus;t.key===r&&(xpt(t,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0),n.key===r&&(xpt(n,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else ipt(a)&&t&&e.isSelected()&&e.selectPrevious();if(opt(a)&&t&&!i){const t=e.getIndexWithinParent();_ut(e),ypt(a,o,t,-1)}else _ut(e);n||hdt(o)||o.canBeEmpty()||!o.isEmpty()||Cht(o,t),t&&Qpt(o)&&o.isEmpty()&&o.selectEnd()}class Mht{static getType(){Ect(64,this.name)}static clone(e){Ect(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Mut(this,e)}getType(){return this.__type}isInline(){Ect(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Iut(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||gpt();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(Uht(this)||!opt(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Iut(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Ect(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(hdt(t))return Kpt(e)||Ect(138),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Ect(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Iut(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Iut(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Kpt(this)&&t.unshift(this),Kpt(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const a=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(a.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,o=this;for(;;){const e=o.getParentOrThrow();if(e===t){n=o.getIndexWithinParent();break}o=e}for(o=e;;){const e=o.getParentOrThrow();if(e===t){r=o.getIndexWithinParent();break}o=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let o=this;for(;null!==o;){const a=o.__key;if(r.has(a)||(r.add(a),n.push(o)),o===e)break;const i=Kpt(o)?t?o.getFirstChild():o.getLastChild():null;if(null!==i){o=i;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(null!==l){o=l;continue}const s=o.getParentOrThrow();if(r.has(s.__key)||n.push(s),s===e)break;let c=null,u=s;do{if(null===u&&Ect(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);o=c}return t||n.reverse(),n}isDirty(){const e=Hpt()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=Iut(this.__key);return null===e&&Ect(113),e}getWritable(){Dpt();const e=Tpt(),t=Hpt(),n=e._nodeMap,r=this.__key,o=this.getLatest(),a=o.__parent,i=t._cloneNotNeeded,l=gpt();if(null!==l&&l.setCachedNodes(null),i.has(r))return Nut(o),o;const s=o.constructor.clone(o);return s.__parent=a,s.__next=o.__next,s.__prev=o.__prev,Kpt(o)&&Kpt(s)?(ift(o)&&ift(s)&&(s.__textFormat=o.__textFormat),s.__first=o.__first,s.__last=o.__last,s.__size=o.__size,s.__indent=o.__indent,s.__format=o.__format,s.__dir=o.__dir):Uht(o)&&Uht(s)&&(s.__format=o.__format,s.__style=o.__style,s.__mode=o.__mode,s.__detail=o.__detail),i.add(r),s.__key=r,Nut(s),n.set(r,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Ect(70)}updateDOM(e,t,n){Ect(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){Ect(72)}static importJSON(e){Ect(18,this.name)}static transform(){return null}remove(e){Cht(this,!0,e)}replace(e,t){Dpt();let n=gpt();null!==n&&(n=n.clone()),mdt(this,e);const r=this.getLatest(),o=this.__key,a=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),s=l.__size;_ut(i);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(Cht(r,!1,!0),null===c?l.__first=a:c.getWritable().__next=a,i.__prev=d,null===u?l.__last=a:u.getWritable().__prev=a,i.__next=h,i.__parent=p,l.__size=s,t&&(Kpt(this)&&Kpt(i)||Ect(139),this.getChildren().forEach((e=>{i.append(e)}))),opt(n)){Rut(n);const e=n.anchor,t=n.focus;e.key===o&&tpt(e,i),t.key===o&&tpt(t,i)}return Out()===o&&Aut(a),i}insertAfter(e,t=!0){Dpt(),mdt(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),a=gpt();let i=!1,l=!1;if(null!==o){const t=e.getIndexWithinParent();if(_ut(r),opt(a)){const e=o.__key,n=a.anchor,r=a.focus;i="element"===n.type&&n.key===e&&n.offset===t+1,l="element"===r.type&&r.key===e&&r.offset===t+1}}const s=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===s?c.__last=u:s.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&opt(a)){const e=this.getIndexWithinParent();ypt(a,c,e+1);const t=c.__key;i&&a.anchor.set(t,e+2,"element"),l&&a.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){Dpt(),mdt(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;_ut(r);const a=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),l=n.__prev,s=this.getIndexWithinParent();null===a?i.__first=o:a.getWritable().__next=o,i.__size++,n.__prev=o,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const c=gpt();return t&&opt(c)&&ypt(c,this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return aft()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Dpt();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Kpt(n))return n.select();if(!Uht(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Dpt();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Kpt(n))return n.select(0,0);if(!Uht(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class _ht extends Mht{static getType(){return"linebreak"}static clone(e){return new _ht(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&Iht(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Iht(n))return!0}}return!1}(e)?null:{conversion:Nht,priority:0}}}static importJSON(e){return Aht()}exportJSON(){return{type:"linebreak",version:1}}}function Nht(e){return{node:Aht()}}function Aht(){return fdt(new _ht)}function Oht(e){return e instanceof _ht}function Iht(e){return 3===e.nodeType&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Dht(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Pht(e,t){return 1&t?"strong":2&t?"em":"span"}function Tht(e,t,n,r,o){const a=r.classList;let i=edt(o,"base");void 0!==i&&a.add(...i),i=edt(o,"underlineStrikethrough");let l=!1;const s=8&t&&4&t;void 0!==i&&(8&n&&4&n?(l=!0,s||a.add(...i)):s&&a.remove(...i));for(const e in Gct){const r=Gct[e];if(i=edt(o,e),void 0!==i)if(n&r){if(l&&("underline"===e||"strikethrough"===e)){t&r&&a.remove(...i);continue}t&r&&(!s||"underline"!==e)&&"strikethrough"!==e||a.add(...i)}else t&r&&a.remove(...i)}}function Hht(e,t,n){const r=t.firstChild,o=n.isComposing(),a=e+(o?jct:"");if(null==r)t.textContent=a;else{const e=r.nodeValue;if(e!==a)if(o||Mct){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,a=0;for(;o<n&&o<r&&e[o]===t[o];)o++;for(;a+o<n&&a+o<r&&e[n-a-1]===t[r-a-1];)a++;return[o,n-o-a,t.slice(o,r-a)]}(e,a);0!==n&&r.deleteData(t,n),r.insertData(t,o)}else r.nodeValue=a}}function Lht(e,t,n,r,o,a){Hht(o,e,t);const i=a.theme.text;void 0!==i&&Tht(0,0,r,e,i)}function zht(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Rht extends Mht{static getType(){return"text"}static clone(e){return new Rht(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return tut[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Out()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Gct[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Cut(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=Dht(0,n),o=Pht(0,n),a=null===r?o:r,i=document.createElement(a);let l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(o),i.appendChild(l)),Lht(l,this,0,n,this.__text,e);const s=this.__style;return""!==s&&(i.style.cssText=s),i}updateDOM(e,t,n){const r=this.__text,o=e.__format,a=this.__format,i=Dht(0,o),l=Dht(0,a),s=Pht(0,o),c=Pht(0,a);if((null===i?s:i)!==(null===l?c:l))return!0;if(i===l&&s!==c){const e=t.firstChild;null==e&&Ect(48);const o=document.createElement(c);return Lht(o,this,0,a,r,n),t.replaceChild(o,e),!1}let u=t;null!==l&&null!==i&&(u=t.firstChild,null==u&&Ect(49)),Hht(r,u,this);const d=n.theme.text;void 0!==d&&o!==a&&Tht(0,o,a,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:jht,priority:0}),b:()=>({conversion:$ht,priority:0}),code:()=>({conversion:qht,priority:0}),em:()=>({conversion:qht,priority:0}),i:()=>({conversion:qht,priority:0}),s:()=>({conversion:qht,priority:0}),span:()=>({conversion:Bht,priority:0}),strong:()=>({conversion:qht,priority:0}),sub:()=>({conversion:qht,priority:0}),sup:()=>({conversion:qht,priority:0}),u:()=>({conversion:qht,priority:0})}}static importJSON(e){const t=Yht(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&ydt(t)||Ect(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=zht(t,"b")),this.hasFormat("italic")&&(t=zht(t,"i")),this.hasFormat("strikethrough")&&(t=zht(t,"s")),this.hasFormat("underline")&&(t=zht(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Gct[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Xct[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Cut(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=eut[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Dpt();let n=e,r=t;const o=gpt(),a=this.getTextContent(),i=this.__key;if("string"==typeof a){const e=a.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!opt(o))return fpt(i,n,i,r,"text","text");{const e=Out();e!==o.anchor.key&&e!==o.focus.key||Aut(i),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),a=o.__text,i=n.length;let l=e;l<0&&(l=i+l,l<0&&(l=0));const s=gpt();if(r&&opt(s)){const t=e+i;s.setTextNodeRange(o,t,o,t)}const c=a.slice(0,l)+n+a.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Dpt();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=Out(),a=new Set(e),i=[],l=n.length;let s="";for(let e=0;e<l;e++)""!==s&&a.has(e)&&(i.push(s),s=""),s+=n[e];""!==s&&i.push(s);const c=i.length;if(0===c)return[];if(i[0]===n)return[t];const u=i[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),m=t.__detail;let v=!1;t.isSegmented()?(h=Yht(u),h.__format=p,h.__style=f,h.__detail=m,v=!0):(h=t.getWritable(),h.__text=u);const g=gpt(),b=[h];let y=u.length;for(let e=1;e<c;e++){const t=i[e],n=t.length,a=Yht(t).getWritable();a.__format=p,a.__style=f,a.__detail=m;const l=a.__key,s=y+n;if(opt(g)){const e=g.anchor,t=g.focus;e.key===r&&"text"===e.type&&e.offset>y&&e.offset<=s&&(e.key=l,e.offset-=y,g.dirty=!0),t.key===r&&"text"===t.type&&t.offset>y&&t.offset<=s&&(t.key=l,t.offset-=y,g.dirty=!0)}o===r&&Aut(l),y=s,b.push(a)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Nut(t),null!==n&&Nut(n)}(this);const w=d.getWritable(),x=this.getIndexWithinParent();return v?(w.splice(x,0,b),this.remove()):w.splice(x,1,b),opt(g)&&ypt(g,d,x,c-1),b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Ect(50);const n=this.__key,r=e.__key,o=this.__text,a=o.length;Out()===r&&Aut(n);const i=gpt();if(opt(i)){const o=i.anchor,l=i.focus;null!==o&&o.key===r&&(Ept(o,t,n,e,a),i.dirty=!0),null!==l&&l.key===r&&(Ept(l,t,n,e,a),i.dirty=!0)}const l=e.__text,s=t?l+o:o+l;this.setTextContent(s);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function Bht(e){const t=e.style,n=t.fontWeight,r=t.textDecoration.split(" "),o="700"===n||"bold"===n,a=r.includes("line-through"),i="italic"===t.fontStyle,l=r.includes("underline"),s=t.verticalAlign;return{forChild:e=>Uht(e)?(o&&e.toggleFormat("bold"),a&&e.toggleFormat("strikethrough"),i&&e.toggleFormat("italic"),l&&e.toggleFormat("underline"),"sub"===s&&e.toggleFormat("subscript"),"super"===s&&e.toggleFormat("superscript"),e):e,node:null}}function $ht(e){const t="normal"===e.style.fontWeight;return{forChild:e=>(Uht(e)&&!t&&e.toggleFormat("bold"),e),node:null}}const Zht=new WeakMap;function Vht(e){return"PRE"===e.nodeName||1===e.nodeType&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function jht(e){const t=e;null===e.parentElement&&Ect(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Zht.get(n))&&!Vht(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e<r.length;e++)Zht.set(r[e],o);return o}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(Aht()):"\t"===r?t.push(Ght()):""!==r&&t.push(Yht(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=Wht(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Wht(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Yht(n)}}function Wht(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,1===n.nodeType){const e=n.style.display;if(""===e&&!wdt(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(3===n.nodeType)return n;if("BR"===n.nodeName)return null}}const Fht={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qht(e){const t=Fht[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(Uht(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function Yht(e=""){return fdt(new Rht(e))}function Uht(e){return e instanceof Rht}class Kht extends Rht{static getType(){return"tab"}static clone(e){const t=new Kht(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Ght();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Ect(126)}setDetail(e){Ect(127)}setMode(e){Ect(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ght(){return fdt(new Kht)}function Xht(e){return e instanceof Kht}class Qht{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Kpt(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Kpt(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?r<o:t.isBefore(n)}getNode(){const e=Iut(this.key);return null===e&&Ect(20),e}set(e,t,n){const r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,Ipt()||(Out()===o&&Aut(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Jht(e,t,n){return new Qht(e,t,n)}function ept(e,t){let n=t.__key,r=e.offset,o="element";if(Uht(t)){o="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Kpt(t)){const e=t.getNextSibling();if(Uht(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function tpt(e,t){if(Kpt(t)){const n=t.getLastDescendant();Kpt(n)||Uht(n)?ept(e,n):ept(e,t)}else ept(e,t)}function npt(e,t,n,r){e.key=t,e.offset=n,e.type=r}class rpt{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ipt(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new rpt(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Uht(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=Iut(e);null!==t&&n.push(t)}return Ipt()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function opt(e){return e instanceof apt}class apt{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!opt(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),o=r?t:n,a=r?n:t;let i=o.getNode(),l=a.getNode();const s=o.offset,c=a.offset;if(Kpt(i)){const e=i.getDescendantByIndex(s);i=null!=e?e:i}if(Kpt(l)){let e=l.getDescendantByIndex(c);null!==e&&e!==i&&l.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),l=null!=e?e:l}let u;return u=i.is(l)?Kpt(i)&&i.getChildrenSize()>0?[]:[i]:i.getNodesBetween(l),Ipt()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){npt(this.anchor,e.__key,t,"text"),npt(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,a=r.isBefore(o),[i,l]=spt(this);let s="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Kpt(d)&&!d.isInline())c||(s+="\n"),c=!d.isEmpty();else if(c=!1,Uht(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=i<l?e.slice(i,l):e.slice(l,i)):e=a?e.slice(i):e.slice(l):d===n&&(e=a?e.slice(0,l):e.slice(0,i)),s+=e}else!Ypt(d)&&!Oht(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){const t=Hpt(),n=t.getEditorState()._selection,r=ppt(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[o,a]=r;npt(this.anchor,o.key,o.offset,o.type),npt(this.focus,a.key,a.offset,a.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new apt(Jht(e.key,e.offset,e.type),Jht(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Cut(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Gct[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(Aht()):"\t"===r?n.push(Ght()):n.push(Yht(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,o=this.style;let a=t,i=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,i=t),"element"===a.type&&function(e,t,n,r){const o=e.getNode(),a=o.getChildAtIndex(e.offset),i=Yht(),l=Qpt(o)?aft().append(i):i;i.setFormat(n),i.setStyle(r),null===a?o.append(l):a.insertBefore(l),e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}(a,i,r,o);const l=a.offset;let s=i.offset;const c=this.getNodes(),u=c.length;let d=c[0];Uht(d)||Ect(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===i.type&&(s=h,i.set(a.key,s,"text")),this.isCollapsed()&&l===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Uht(t)&&t.canInsertTextBefore()&&!Eut(t)||(t=Yht(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===l&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Uht(t)&&!Eut(t)||(t=Yht(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const e=Yht(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Kpt(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),hpt(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Yht(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(l!==s||t===r&&n===o){if(Xht(d)){const t=Yht(e);return t.setFormat(r),t.setStyle(o),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Yht(e);if(t.setFormat(r),t.setStyle(o),t.select(),0===l)d.insertBefore(t,!1);else{const[e]=d.splitText(l);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(o)}const a=s-l;d=d.spliceText(l,a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Kpt(d)?d:d.getParentOrThrow();let r=Kpt(f)?f:f.getParentOrThrow(),o=f;if(!n.is(r)&&r.isInline())do{o=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===i.type&&(0!==s||""===f.getTextContent())||"element"===i.type&&f.getIndexWithinParent()<s)if(Uht(f)&&!f.isToken()&&s!==f.getTextContentSize()){if(f.isSegmented()){const e=Yht(f.getTextContent());f.replace(e),f=e}Qpt(i.getNode())||"text"!==i.type||(f=f.spliceText(0,s,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const a=r.getChildren(),p=new Set(c),m=n.is(r),v=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=a.length-1;e>=0;e--){const t=a[e];if(t.is(d)||Kpt(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(o)?m||v.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(l===h)d.select();else{const t=Yht(e);t.select(),d.replace(t)}else d=d.spliceText(l,h-l,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void Aut(null);const t=this.getNodes(),n=[];for(const e of t)Uht(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void Aut(null);const o=this.anchor,a=this.focus,i=this.isBackward(),l=i?a:o,s=i?o:a;let c=0,u=n[0],d="element"===l.type?0:l.offset;if("text"===l.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const m="text"===s.type?s.offset:f.getTextContentSize();if(u.is(f)){if(d===m)return;if(0===d&&m===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,m),t=0===d?e[0]:e[1];t.setFormat(h),"text"===l.type&&l.set(t.__key,0,"text"),"text"===s.type&&s.set(t.__key,m-d,"text")}return void(this.format=h)}0!==d&&([,u]=u.splitText(d),d=0),u.setFormat(h);const v=f.getFormatFlags(e,h);m>0&&(m!==f.getTextContentSize()&&([f]=f.splitText(m)),f.setFormat(v));for(let t=c+1;t<p;t++){const r=n[t];if(!r.isToken()){const t=r.getFormatFlags(e,v);r.setFormat(t)}}"text"===l.type&&l.set(u.__key,d,"text"),"text"===s.type&&s.set(f.__key,m,"text"),this.format=h|v}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=gpt();return opt(t)||Ect(134),t.insertNodes(e)}const t=Edt((this.isBackward()?this.focus:this.anchor).getNode(),xdt),n=e[e.length-1];if("__language"in t&&Kpt(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=kpt(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Kpt(e)||Ypt(e))&&!e.isInline()))){Kpt(t)||Ect(135);const r=kpt(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=aft();let n=null;for(let r=0;r<e.length;r++){const o=e[r],a=Oht(o);if(a||Ypt(o)&&o.isInline()||Kpt(o)&&o.isInline()||Uht(o)||o.isParentRequired()){if(null===n&&(n=o.createParentElementNode(),t.append(n),a))continue;null!==n&&n.append(o)}else t.append(o),n=null}return t}(e),o=r.getLastDescendant(),a=r.getChildren(),i=e=>"__value"in e&&"__checked"in e,l=Kpt(t)&&t.isEmpty()?null:this.insertParagraph(),s=a[a.length-1];let c=a[0];var u;Kpt(u=c)&&xdt(u)&&!u.isEmpty()&&Kpt(t)&&(!t.isEmpty()||i(t))&&(Kpt(t)||Ect(135),t.append(...c.getChildren()),c=a[1]),c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;)r.getNextSibling()||Ect(140),r=r.getNextSibling(),o.push(r);let a=e;for(const e of o)a=a.insertAfter(e)}(t,c);const d=Edt(o,xdt);l&&Kpt(d)&&(i(l)||xdt(s))&&(d.append(...l.getChildren()),l.remove()),Kpt(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const h=Kpt(t)?t.getLastChild():null;Oht(h)&&d!==t&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=aft();return Lut().splice(this.anchor.offset,0,[e]),e.select(),e}const e=kpt(this),t=Edt(this.anchor.getNode(),xdt);Kpt(t)||Ect(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=Aht();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let a=e[0],i=e[n];const[l,s]=spt(this);if(0===t)return[];if(1===t){if(Uht(a)&&!this.isCollapsed()){const e=l>s?s:l,t=l>s?l:s,n=a.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[a]}const c=r.isBefore(o);if(Uht(a)){const t=c?l:s;t===a.getTextContentSize()?e.shift():0!==t&&([,a]=a.splitText(t),e[0]=a)}if(Uht(i)){const t=i.getTextContent().length,r=c?s:l;0===r?e.pop():r!==t&&([i]=i.splitText(r),e[n]=i)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,a="move"===e,i=rdt(r,t);if(Ypt(i)&&!i.isIsolated()){if(a&&i.isKeyboardSelectable()){const e=mpt();return e.add(i.__key),void Rut(e)}const e=t?i.getPreviousSibling():i.getNextSibling();if(Uht(e)){const n=e.__key,i=t?e.getTextContent().length:0;return r.set(n,i,"text"),void(a&&o.set(n,i,"text"))}{const n=i.getParentOrThrow();let l,s;return Kpt(e)?(s=e.__key,l=t?e.getChildrenSize():0):(l=i.getIndexWithinParent(),s=n.__key,t||l++),r.set(s,l,"element"),void(a&&o.set(s,l,"element"))}}const l=Hpt(),s=bdt(l._window);if(!s)return;const c=l._blockCursorElement,u=l._rootElement;if(null===u||null===c||!Kpt(i)||i.isInline()||i.canBeEmpty()||gdt(c,l,u),function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),r=Qpt(n)?n:ddt(n);if(this.applyDOMRange(e),this.dirty=!0,!a){const n=this.getNodes(),o=[];let a=!1;for(let e=0;e<n.length;e++){const t=n[e];cdt(t,r)?o.push(t):a=!0}if(a&&o.length>0)if(t){const e=o[0];Kpt(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Kpt(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,a=n.type;npt(n,t.key,t.offset,t.type),npt(t,r,o,a),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Kpt(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Kpt(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=rdt(r,e);if(Ypt(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Kpt(n)&&0===n.getChildrenSize()){n.remove();const e=mpt();e.add(o.__key),Rut(e)}else o.remove(),Hpt().dispatchCommand($st,void 0);return}if(!e&&Kpt(o)&&Kpt(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,a=o.getTextContentSize();if(o.is(n)||e&&t!==a||!e&&0!==t)return void cpt(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,a=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==a)return void cpt(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,a=r.offset,i=e<a,l=i?e:a,s=i?a:e,c=s-1;l!==c&&(Zut(o.getTextContent().slice(l,s))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Qpt(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ipt(e){return e instanceof rpt}function lpt(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function spt(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[lpt(n),lpt(r)]}function cpt(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),a=o.length;let i=0,l=0;for(let e=0;e<a;e++){const r=e===a-1;if(l=i,i+=o[e].length,t&&i===n||i>n||r){o.splice(e,1),r&&(l=void 0);break}}const s=o.join("").trim();""===s?r.remove():(r.setTextContent(s),r.select(l,l))}function upt(e,t,n,r){let o,a=t;if(1===e.nodeType){let i=!1;const l=e.childNodes,s=l.length,c=r._blockCursorElement;a===s&&(i=!0,a=s-1);let u=l[a],d=!1;if(u===c)u=l[a+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&a--}if(o=But(u),Uht(o))a=$ut(o,i);else{let r=But(e);if(null===r)return null;if(Kpt(r)){a=Math.min(r.getChildrenSize(),a);let e=r.getChildAtIndex(a);if(Kpt(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=i?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Kpt(e)?e:e.getParentOrThrow()),a=0}Uht(e)?(o=e,r=null,a=$ut(e,i)):e!==r&&i&&!d&&a++}else{const n=r.getIndexWithinParent();a=0===t&&Ypt(r)&&But(e)===r?n:n+1,r=r.getParentOrThrow()}if(Kpt(r))return Jht(r.__key,a,"element")}}else o=But(e);return Uht(o)?Jht(o.__key,a,"text"):null}function dpt(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),a=o.getParent();if(t){if((n||!t)&&null===r&&Kpt(a)&&a.isInline()){const t=a.getPreviousSibling();Uht(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Kpt(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Uht(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),a=o.getParent();if(t&&Kpt(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Kpt(a)&&a.isInline()&&!a.canInsertTextAfter()){const t=a.getNextSibling();Uht(t)&&(e.key=t.__key,e.offset=0)}}}function hpt(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);dpt(e,r,o),dpt(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const a=Hpt();if(a.isComposing()&&a._compositionKey!==e.key&&opt(n)){const r=n.anchor,o=n.focus;npt(e,r.key,r.offset,r.type),npt(t,o.key,o.offset,o.type)}}}function ppt(e,t,n,r,o,a){if(null===e||null===n||!wut(o,e,n))return null;const i=upt(e,t,opt(a)?a.anchor:null,o);if(null===i)return null;const l=upt(n,r,opt(a)?a.focus:null,o);if(null===l)return null;if("element"===i.type&&"element"===l.type){const t=But(e),r=But(n);if(Ypt(t)&&Ypt(r))return null}return hpt(i,l,a),[i,l]}function fpt(e,t,n,r,o,a){const i=Tpt(),l=new apt(Jht(e,t,o),Jht(n,r,a),0,"");return l.dirty=!0,i._selection=l,l}function mpt(){return new rpt(new Set)}function vpt(e,t,n,r){const o=n._window;if(null===o)return null;const a=r||o.event,i=a?a.type:void 0,l="selectionchange"===i,s=!rut&&(l||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&a&&3===a.detail||"drop"===i||void 0===i);let c,u,d,h;if(opt(e)&&!s)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,l&&opt(e)&&!wut(n,c,u))return e.clone();const p=ppt(c,d,u,h,n,e);if(null===p)return null;const[f,m]=p;return new apt(f,m,opt(e)?e.format:0,opt(e)?e.style:"")}function gpt(){return Tpt()._selection}function bpt(){return Hpt()._editorState._selection}function ypt(e,t,n,r=1){const o=e.anchor,a=e.focus,i=o.getNode(),l=a.getNode();if(!t.is(i)&&!t.is(l))return;const s=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);o.set(s,n,"element"),a.set(s,n,"element"),wpt(e)}}else{const i=e.isBackward(),l=i?a:o,c=l.getNode(),u=i?o:a,d=u.getNode();if(t.is(c)){const e=l.offset;(n<=e&&r>0||n<e&&r<0)&&l.set(s,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(s,Math.max(0,e+r),"element")}}wpt(e)}function wpt(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,a=t.getNode(),i=r.getNode();if(e.isCollapsed()){if(!Kpt(a))return;const e=a.getChildrenSize(),o=n>=e,i=o?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(Uht(i)){let e=0;o&&(e=i.getTextContentSize()),t.set(i.__key,e,"text"),r.set(i.__key,e,"text")}}else{if(Kpt(a)){const e=a.getChildrenSize(),r=n>=e,o=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(Uht(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Kpt(i)){const e=i.getChildrenSize(),t=o>=e,n=t?i.getChildAtIndex(e-1):i.getChildAtIndex(o);if(Uht(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function xpt(e,t,n,r,o){let a=null,i=0,l=null;null!==r?(a=r.__key,Uht(r)?(i=r.getTextContentSize(),l="text"):Kpt(r)&&(i=r.getChildrenSize(),l="element")):null!==o&&(a=o.__key,Uht(o)?l="text":Kpt(o)&&(l="element")),null!==a&&null!==l?e.set(a,i,l):(i=t.getIndexWithinParent(),-1===i&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function Ept(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function kpt(e){let t=e;e.isCollapsed()||t.removeText();const n=gpt();opt(n)&&(t=n),opt(t)||Ect(161);const r=t.anchor;let o=r.getNode(),a=r.offset;for(;!xdt(o);)[o,a]=Spt(o,a);return a}function Spt(e,t){const n=e.getParent();if(!n){const e=aft();return Lut().append(e),e.select(),[Lut(),0]}if(Uht(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Kpt(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new apt(Jht(e.__key,t,"element"),Jht(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Cpt=null,Mpt=null,_pt=!1,Npt=!1,Apt=0;const Opt={characterData:!0,childList:!0,subtree:!0};function Ipt(){return _pt||null!==Cpt&&Cpt._readOnly}function Dpt(){_pt&&Ect(13)}function Ppt(){Apt>99&&Ect(14)}function Tpt(){return null===Cpt&&Ect(15),Cpt}function Hpt(){return null===Mpt&&Ect(16),Mpt}function Lpt(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Ect(30,t),n}(e,r);let a=n.get(r);void 0===a&&(a=Array.from(o.transforms),n.set(r,a));const i=a.length;for(let e=0;e<i&&(a[e](t),t.isAttached());e++);}function zpt(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Rpt(e,t){const n=e.type,r=t.get(n);void 0===r&&Ect(17,n);const o=r.klass;e.type!==o.getType()&&Ect(18,o.name);const a=o.importJSON(e),i=e.children;if(Kpt(a)&&Array.isArray(i))for(let e=0;e<i.length;e++){const n=Rpt(i[e],t);a.append(n)}return a}function Bpt(e,t){const n=Cpt,r=_pt,o=Mpt;Cpt=e,_pt=!0,Mpt=null;try{return t()}finally{Cpt=n,_pt=r,Mpt=o}}function $pt(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const a=e._editorState,i=a._selection,l=n._selection,s=0!==e._dirtyType,c=Cpt,u=_pt,d=Mpt,h=e._updating,p=e._observer;let f=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==p){Mpt=e,Cpt=n,_pt=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;p.disconnect(),f=function(e,t,n,r,o,a){Tdt="",zdt="",Hdt="",Rdt=2===r,$dt=null,Cdt=n,Sdt=n._config,Mdt=n._nodes,_dt=Cdt._listeners.mutation,Ndt=o,Adt=a,Odt=e._nodeMap,Idt=t._nodeMap,Bdt=t._readOnly,Ddt=new Map(n._keyToDOMMap);const i=new Map;return Pdt=i,Jdt("root",null),Cdt=void 0,Mdt=void 0,Ndt=void 0,Adt=void 0,Odt=void 0,Idt=void 0,Sdt=void 0,Ddt=void 0,Pdt=void 0,i}(a,n,e,t,r,o)}catch(t){if(t instanceof Error&&e._onError(t),Npt)throw t;return lft(e,null,r,n),dut(e),e._dirtyType=2,Npt=!0,$pt(e,a),void(Npt=!1)}finally{p.observe(r,Opt),e._updating=h,Cpt=c,_pt=u,Mpt=d}}n._readOnly||(n._readOnly=!0);const m=e._dirtyLeaves,v=e._dirtyElements,g=e._normalizedNodes,b=e._updateTags,y=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const o=t._nodeMap;let a;for(a in r)o.has(a)||(r===n&&(r=Tut(e)),delete r[a])}(e,n);const w=o?null:bdt(e._window);if(e._editable&&null!==w&&(s||null===l||l.dirty)){Mpt=e,Cpt=n;try{if(null!==p&&p.disconnect(),s||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&gdt(t,e,r),function(e,t,n,r,o,a){const i=r.anchorNode,l=r.focusNode,s=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(o.has("collaboration")&&u!==a||null!==u&&yut(u))return;if(!opt(t))return void(null!==e&&wut(n,i,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,p=d.key,f=h.key,m=ldt(n,p),v=ldt(n,f),g=d.offset,b=h.offset,y=t.format,w=t.style,x=t.isCollapsed();let E=m,k=v,S=!1;if("text"===d.type){E=Sut(m);const e=d.getNode();S=e.getFormat()!==y||e.getStyle()!==w}else opt(e)&&"text"===e.anchor.type&&(S=!0);var C,M,_,N,A;if("text"===h.type&&(k=Sut(v)),null!==E&&null!==k&&(x&&(null===e||S||opt(e)&&(e.format!==y||e.style!==w))&&(C=y,M=w,_=g,N=p,A=performance.now(),fht=[C,M,_,N,A]),s!==g||c!==b||i!==E||l!==k||"Range"===r.type&&x||(null!==u&&a.contains(u)||a.focus({preventScroll:!0}),"element"===d.type))){try{r.setBaseAndExtent(E,g,k,b)}catch(e){}if(!o.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==a&&a===document.activeElement){const e=t instanceof apt&&"element"===t.anchor.type?E.childNodes[g]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:a,bottom:i}=t,l=0,s=0,c=n;for(;null!==c;){const t=c===r.body;if(t)l=0,s=udt(e).innerHeight;else{const e=c.getBoundingClientRect();l=e.top,s=e.bottom}let n=0;if(a<l?n=-(l-a):i>s&&(n=i-s),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;a-=t,i-=t}if(t)break;c=sdt(c)}}(n,t,a)}}uht=!0}}(i,l,e,w,b,r)}(function(e,t,n){let r=e._blockCursorElement;if(opt(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,a=o.getNode(),i=o.offset;let l=!1,s=null;if(i===a.getChildrenSize())vdt(a.getChildAtIndex(i-1))&&(l=!0);else{const t=a.getChildAtIndex(i);if(vdt(t)){const n=t.getPreviousSibling();(null===n||vdt(n))&&(l=!0,s=e.getElementByKey(t.__key))}}if(l){const n=e.getElementByKey(a.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=nut(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===s?n.appendChild(r):n.insertBefore(r,s))}}null!==r&&gdt(r,e,t)})(e,r,l),null!==p&&p.observe(r,Opt)}finally{Mpt=d,Cpt=c}}null!==f&&function(e,t,n,r,o){const a=Array.from(e._listeners.mutation),i=a.length;for(let e=0;e<i;e++){const[i,l]=a[e],s=t.get(l);void 0!==s&&i(s,{dirtyLeaves:r,prevEditorState:o,updateTags:n})}}(e,f,b,m,a),opt(l)||null===l||null!==i&&i.is(l)||e.dispatchCommand($st,void 0);const x=e._pendingDecorators;null!==x&&(e._decorators=x,e._pendingDecorators=null,Zpt("decorator",e,!0,x)),function(e,t,n){const r=Hut(t),o=Hut(n);r!==o&&Zpt("textcontent",e,!0,o)}(e,t||a,n),Zpt("update",e,!0,{dirtyElements:v,dirtyLeaves:m,editorState:n,normalizedNodes:g,prevEditorState:t||a,tags:b}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;Wpt(e,t,r)}}}(e)}function Zpt(e,t,n,...r){const o=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function Vpt(e,t,n){if(!1===e._updating||Mpt!==e){let r=!1;return e.update((()=>{r=Vpt(e,t,n)})),r}const r=Vut(e);for(let o=4;o>=0;o--)for(let a=0;a<r.length;a++){const i=r[a]._commands.get(t);if(void 0!==i){const t=i[o];if(void 0!==t){const r=Array.from(t),o=r.length;for(let t=0;t<o;t++)if(!0===r[t](n,e))return!0}}}return!1}function jpt(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,o]=t;let a,i;void 0!==o&&(a=o.onUpdate,i=o.tag,o.skipTransforms&&(r=!0),a&&e._deferred.push(a),i&&e._updateTags.add(i)),n()}}return r}function Wpt(e,t,n){const r=e._updateTags;let o,a,i=!1,l=!1;void 0!==n&&(o=n.onUpdate,a=n.tag,null!=a&&r.add(a),i=n.skipTransforms||!1,l=n.discrete||!1),o&&e._deferred.push(o);const s=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new tft(new Map((c||s)._nodeMap)),u=!0),c._flushSync=l;const d=Cpt,h=_pt,p=Mpt,f=e._updating;Cpt=c,_pt=!1,e._updating=!0,Mpt=e;try{u&&(e._headless?null!==s._selection&&(c._selection=s._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=bdt(e._window);return opt(t)||null==t?vpt(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),i=jpt(e,i),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(opt(r)){const e=r.anchor,t=r.focus;let o;if("text"===e.type&&(o=e.getNode(),o.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();o!==e&&e.selectionTransform(n,r)}}}(c,e),0!==e._dirtyType&&(i?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Uht(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&fut(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,o=e._nodeMap,a=Out(),i=new Map;let l=n,s=l.size,c=r,u=c.size;for(;s>0||u>0;){if(s>0){t._dirtyLeaves=new Set;for(const e of l){const r=o.get(e);Uht(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&fut(r),void 0!==r&&zpt(r,a)&&Lpt(t,r,i),n.add(e)}if(l=t._dirtyLeaves,s=l.size,s>0){Apt++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],l=e[1];if("root"!==n&&!l)continue;const s=o.get(n);void 0!==s&&zpt(s,a)&&Lpt(t,s,i),r.set(n,l)}l=t._dirtyLeaves,s=l.size,c=t._dirtyElements,u=c.size,Apt++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),jpt(e),function(e,t,n,r){const o=e._nodeMap,a=t._nodeMap,i=[];for(const[e]of r){const t=a.get(e);void 0!==t&&(t.isAttached()||(Kpt(t)&&kdt(t,e,o,a,i,r),o.has(e)||r.delete(e),i.push(e)))}for(const e of i)a.delete(e);for(const e of n){const t=a.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(opt(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Ect(19)}else ipt(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void $pt(e)}finally{Cpt=d,_pt=h,Mpt=p,e._updating=f,Apt=0}const m=0!==e._dirtyType||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,$pt(e)):u&&but((()=>{$pt(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Fpt(e,t,n){e._updating?e._updates.push([t,n]):Wpt(e,t,n)}class qpt extends Mht{constructor(e){super(e)}decorate(e,t){Ect(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ypt(e){return e instanceof qpt}class Upt extends Mht{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Jct[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Hpt()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Uht(t)&&e.push(t),Kpt(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Kpt(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Kpt(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Kpt(e)&&e.getLastDescendant()||e||null}const r=t[e];return Kpt(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Iut(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Ect(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Iut(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Ect(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContent(),Kpt(o)&&r!==n-1&&!o.isInline()&&(e+=Wct)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContentSize(),Kpt(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=Qct[e];return!!(this.getFormat()&t)}return!1}select(e,t){Dpt();const n=gpt();let r=e,o=t;const a=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Uht(e)||Kpt(e))return e.select(0,0)}else if(!(void 0!==e&&e!==a||void 0!==t&&t!==a)){const e=this.getLastChild();if(Uht(e)||Kpt(e))return e.select()}void 0===r&&(r=a),void 0===o&&(o=a);const i=this.__key;return opt(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):fpt(i,r,i,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Qct[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),a=this.getWritable(),i=a.__key,l=[],s=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&Ect(100);const t=e.getNextSibling(),n=e.__key;_ut(e.getWritable()),s.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===i&&d--,_ut(r);const o=t.__key;if(null===h)a.__first=o,r.__prev=null;else{const e=h.getWritable();e.__next=o,r.__prev=e.__key}t.__key===i&&Ect(76),r.__parent=i,l.push(o),h=t}if(e+t===o)null!==h&&(h.getWritable().__next=null,a.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(a.__size=d,s.length){const e=gpt();if(opt(e)){const t=new Set(s),n=new Set(l),{anchor:r,focus:o}=e;Gpt(r,t,n)&&xpt(r,r.getNode(),this,u,c),Gpt(o,t,n)&&xpt(o,o.getNode(),this,u,c),0!==d||this.canBeEmpty()||hdt(this)||this.remove()}}return a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Kpt(e){return e instanceof Upt}function Gpt(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class Xpt extends Upt{static getType(){return"root"}static clone(){return new Xpt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Ect(51)}getTextContent(){const e=this.__cachedText;return!Ipt()&&0!==Hpt()._dirtyType||null===e?super.getTextContent():e}remove(){Ect(52)}replace(e){Ect(53)}insertBefore(e){Ect(54)}insertAfter(e){Ect(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];Kpt(n)||Ypt(n)||Ect(56)}return super.append(...e)}static importJSON(e){const t=Lut();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Qpt(e){return e instanceof Xpt}function Jpt(){return new tft(new Map([["root",new Xpt]]))}function eft(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Ect(130,n.name),Kpt(e)){const r=t.children;Array.isArray(r)||Ect(59,n.name);const o=e.getChildren();for(let e=0;e<o.length;e++){const t=eft(o[e]);r.push(t)}}return t}class tft{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return Bpt(this,e)}clone(e){const t=new tft(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Bpt(this,(()=>({root:eft(Lut())})))}}class nft extends Upt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rft extends Upt{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Gct[e];return!!(this.getTextFormat()&t)}static clone(e){return new rft(e.__key)}createDOM(e){const t=document.createElement("p"),n=edt(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:oft,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&ydt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=aft();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=aft();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Uht(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function oft(e){const t=aft();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function aft(){return fdt(new rft)}function ift(e){return e instanceof rft}function lft(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Jpt(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const a=e._observer;null!==a&&(a.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class sft{constructor(e,t,n,r,o,a,i){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=jut(),this._onError=o,this._htmlConversions=a,this._editable=i,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Ect(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Ect(36,String(e));const a=o[n];return a.add(t),()=>{a.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){void 0===this._nodes.get(e.getType())&&Ect(37,e.name);const n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);return void 0===r&&Ect(37,e.name),r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var a;return a=e.getType(),Fpt(this,(()=>{const e=Tpt();if(e.isEmpty())return;if("root"===a)return void Lut().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return adt(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=edt(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,lft(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=cht.get(t);void 0===n&&Ect(162);const r=n-1;r>=0||Ect(164),cht.set(t,r),0===r&&t.removeEventListener("selectionchange",Eht);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=Vut(e),n=t[t.length-1]._key;xht.get(n)===e&&xht.delete(n)}else xht.delete(e._key)}(o),e.__lexicalEditor=null);const a=wht(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,dut(this),this._updateTags.add("history-merge"),$pt(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=cht.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Eht),cht.set(n,(r||0)+1),e.__lexicalEditor=t;const o=wht(e);for(let n=0;n<oht.length;n++){const[r,a]=oht[n],i="function"==typeof a?e=>{Sht(e)||(kht(e),(t.isEditable()||"click"===r)&&a(e,t))}:e=>{if(!Sht(e)&&(kht(e),t.isEditable()))switch(r){case"cut":return adt(t,gct,e);case"copy":return adt(t,vct,e);case"paste":return adt(t,qst,e);case"dragstart":return adt(t,pct,e);case"dragover":return adt(t,fct,e);case"dragend":return adt(t,mct,e);case"focus":return adt(t,yct,e);case"blur":return adt(t,wct,e);case"drop":return adt(t,hct,e)}};e.addEventListener(r,i),o.push((()=>{e.removeEventListener(r,i)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Zpt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Ect(38),uut(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),$pt(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),$pt(this)}parseEditorState(e,t){return function(e,t,n){const r=Jpt(),o=Cpt,a=_pt,i=Mpt,l=t._dirtyElements,s=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Cpt=r,_pt=!1,Mpt=t;try{const o=t._nodes;Rpt(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=l,t._dirtyLeaves=s,t._cloneNotNeeded=c,t._dirtyType=u,Cpt=o,_pt=a,Mpt=i}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){Fpt(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Fpt(this,(()=>{const e=gpt(),n=Lut();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=bdt(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Zpt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}var cft=Object.freeze({__proto__:null,$addUpdateTag:function(e){Dpt(),Hpt()._updateTags.add(e)},$applyNodeReplacement:fdt,$copyNode:pdt,$createLineBreakNode:Aht,$createNodeSelection:mpt,$createParagraphNode:aft,$createPoint:Jht,$createRangeSelection:function(){const e=Jht("root",0,"element"),t=Jht("root",0,"element");return new apt(e,t,0,"")},$createRangeSelectionFromDom:function(e,t){return vpt(null,e,t,null)},$createTabNode:Ght,$createTextNode:Yht,$getAdjacentNode:rdt,$getCharacterOffsets:spt,$getEditor:function(){return Hpt()},$getNearestNodeFromDOMNode:Put,$getNearestRootOrShadowRoot:ddt,$getNodeByKey:Iut,$getPreviousSelection:bpt,$getRoot:Lut,$getSelection:gpt,$getTextContent:function(){const e=gpt();return null===e?"":e.getTextContent()},$hasAncestor:cdt,$hasUpdateTag:function(e){return Hpt()._updateTags.has(e)},$insertNodes:function(e){let t=gpt()||bpt();null===t&&(t=Lut().selectEnd()),t.insertNodes(e)},$isBlockElementNode:function(e){return Kpt(e)&&!e.isInline()},$isDecoratorNode:Ypt,$isElementNode:Kpt,$isInlineElementOrDecoratorNode:function(e){return Kpt(e)&&e.isInline()||Ypt(e)&&e.isInline()},$isLeafNode:function(e){return Uht(e)||Oht(e)||Ypt(e)},$isLineBreakNode:Oht,$isNodeSelection:ipt,$isParagraphNode:ift,$isRangeSelection:opt,$isRootNode:Qpt,$isRootOrShadowRoot:hdt,$isTabNode:Xht,$isTextNode:Uht,$nodesOfType:function(e){const t=Tpt(),n=t._readOnly,r=e.getType(),o=t._nodeMap,a=[];for(const[,t]of o)t instanceof e&&t.__type===r&&(n||t.isAttached())&&a.push(t);return a},$normalizeSelection__EXPERIMENTAL:mut,$parseSerializedNode:function(e){return Rpt(e,Hpt()._nodes)},$selectAll:function(){const e=Lut();Rut(mut(e.select(0,e.getChildrenSize())))},$setCompositionKey:Aut,$setSelection:Rut,$splitNode:function(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),hdt(e)&&Ect(102);const r=e=>{const t=e.getParentOrThrow(),o=hdt(t),a=e!==n||o?pdt(e):e;if(o)return Kpt(e)&&Kpt(a)||Ect(133),e.insertAfter(a),[e,a,a];{const[n,o,i]=r(t),l=e.getNextSiblings();return i.append(a,...l),[n,o,a]}},[o,a]=r(n);return[o,a]},ArtificialNode__DO_NOT_USE:nft,BLUR_COMMAND:wct,CAN_REDO_COMMAND:{},CAN_UNDO_COMMAND:{},CLEAR_EDITOR_COMMAND:{},CLEAR_HISTORY_COMMAND:{},CLICK_COMMAND:Zst,COMMAND_PRIORITY_CRITICAL:4,COMMAND_PRIORITY_EDITOR:0,COMMAND_PRIORITY_HIGH:3,COMMAND_PRIORITY_LOW:1,COMMAND_PRIORITY_NORMAL:2,CONTROLLED_TEXT_INSERTION_COMMAND:Fst,COPY_COMMAND:vct,CUT_COMMAND:gct,DELETE_CHARACTER_COMMAND:Vst,DELETE_LINE_COMMAND:Kst,DELETE_WORD_COMMAND:Ust,DRAGEND_COMMAND:mct,DRAGOVER_COMMAND:fct,DRAGSTART_COMMAND:pct,DROP_COMMAND:hct,DecoratorNode:qpt,ElementNode:Upt,FOCUS_COMMAND:yct,FORMAT_ELEMENT_COMMAND:{},FORMAT_TEXT_COMMAND:Gst,INDENT_CONTENT_COMMAND:{},INSERT_LINE_BREAK_COMMAND:jst,INSERT_PARAGRAPH_COMMAND:Wst,INSERT_TAB_COMMAND:{},KEY_ARROW_DOWN_COMMAND:act,KEY_ARROW_LEFT_COMMAND:nct,KEY_ARROW_RIGHT_COMMAND:ect,KEY_ARROW_UP_COMMAND:oct,KEY_BACKSPACE_COMMAND:sct,KEY_DELETE_COMMAND:uct,KEY_DOWN_COMMAND:Jst,KEY_ENTER_COMMAND:ict,KEY_ESCAPE_COMMAND:cct,KEY_MODIFIER_COMMAND:xct,KEY_SPACE_COMMAND:lct,KEY_TAB_COMMAND:dct,LineBreakNode:_ht,MOVE_TO_END:tct,MOVE_TO_START:rct,OUTDENT_CONTENT_COMMAND:{},PASTE_COMMAND:qst,ParagraphNode:rft,REDO_COMMAND:Qst,REMOVE_TEXT_COMMAND:Yst,RootNode:Xpt,SELECTION_CHANGE_COMMAND:$st,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:{},SELECT_ALL_COMMAND:bct,TabNode:Kht,TextNode:Rht,UNDO_COMMAND:Xst,createCommand:function(e){return{}},createEditor:function(e){const t=e||{},n=Mpt,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,a=t.disableEvents||!1,i=Jpt(),l=t.namespace||(null!==o?o._config.namespace:jut()),s=t.editorState,c=[Xpt,Rht,_ht,Kht,rft,nft,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}const o=t.getType(),a=t.transform(),i=new Set;null!==a&&i.add(a),p.set(o,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:i})}}const f=new sft(i,o,p,{disableEvents:a,namespace:l,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,o=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(p,d?d.import:void 0),h);return void 0!==s&&(f._pendingEditorState=s,f._dirtyType=2),f},getNearestEditorFromDOMNode:xut,isBlockDomNode:function(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)},isCurrentlyReadOnlyMode:Ipt,isHTMLAnchorElement:function(e){return ydt(e)&&"A"===e.tagName},isHTMLElement:ydt,isInlineDomNode:wdt,isSelectionCapturedInDecoratorInput:yut,isSelectionWithinEditor:wut});const uft="development"===process.env.NODE_ENV?Bst:cft;uft.$addUpdateTag;const dft=uft.$applyNodeReplacement;uft.$copyNode;const hft=uft.$createLineBreakNode,pft=uft.$createNodeSelection,fft=uft.$createParagraphNode;uft.$createPoint;const mft=uft.$createRangeSelection;uft.$createRangeSelectionFromDom;const vft=uft.$createTabNode,gft=uft.$createTextNode,bft=uft.$getAdjacentNode,yft=uft.$getCharacterOffsets;uft.$getEditor;const wft=uft.$getNearestNodeFromDOMNode;uft.$getNearestRootOrShadowRoot;const xft=uft.$getNodeByKey,Eft=uft.$getPreviousSelection,kft=uft.$getRoot,Sft=uft.$getSelection;uft.$getTextContent;const Cft=uft.$hasAncestor;uft.$hasUpdateTag;const Mft=uft.$insertNodes,_ft=uft.$isBlockElementNode,Nft=uft.$isDecoratorNode,Aft=uft.$isElementNode;uft.$isInlineElementOrDecoratorNode;const Oft=uft.$isLeafNode,Ift=uft.$isLineBreakNode,Dft=uft.$isNodeSelection,Pft=uft.$isParagraphNode,Tft=uft.$isRangeSelection,Hft=uft.$isRootNode,Lft=uft.$isRootOrShadowRoot;uft.$isTabNode;const zft=uft.$isTextNode;uft.$nodesOfType;const Rft=uft.$normalizeSelection__EXPERIMENTAL,Bft=uft.$parseSerializedNode,$ft=uft.$selectAll;uft.$setCompositionKey;const Zft=uft.$setSelection,Vft=uft.$splitNode,jft=uft.ArtificialNode__DO_NOT_USE,Wft=uft.BLUR_COMMAND,Fft=uft.CAN_REDO_COMMAND,qft=uft.CAN_UNDO_COMMAND,Yft=uft.CLEAR_EDITOR_COMMAND,Uft=uft.CLEAR_HISTORY_COMMAND,Kft=uft.CLICK_COMMAND,Gft=uft.COMMAND_PRIORITY_CRITICAL,Xft=uft.COMMAND_PRIORITY_EDITOR;uft.COMMAND_PRIORITY_HIGH;const Qft=uft.COMMAND_PRIORITY_LOW,Jft=uft.COMMAND_PRIORITY_NORMAL,emt=uft.CONTROLLED_TEXT_INSERTION_COMMAND,tmt=uft.COPY_COMMAND,nmt=uft.CUT_COMMAND,rmt=uft.DELETE_CHARACTER_COMMAND,omt=uft.DELETE_LINE_COMMAND,amt=uft.DELETE_WORD_COMMAND;uft.DRAGEND_COMMAND;const imt=uft.DRAGOVER_COMMAND,lmt=uft.DRAGSTART_COMMAND,smt=uft.DROP_COMMAND,cmt=uft.DecoratorNode,umt=uft.ElementNode,dmt=uft.FOCUS_COMMAND,hmt=uft.FORMAT_ELEMENT_COMMAND,pmt=uft.FORMAT_TEXT_COMMAND,fmt=uft.INDENT_CONTENT_COMMAND,mmt=uft.INSERT_LINE_BREAK_COMMAND,vmt=uft.INSERT_PARAGRAPH_COMMAND,gmt=uft.INSERT_TAB_COMMAND,bmt=uft.KEY_ARROW_DOWN_COMMAND,ymt=uft.KEY_ARROW_LEFT_COMMAND,wmt=uft.KEY_ARROW_RIGHT_COMMAND,xmt=uft.KEY_ARROW_UP_COMMAND,Emt=uft.KEY_BACKSPACE_COMMAND,kmt=uft.KEY_DELETE_COMMAND,Smt=uft.KEY_DOWN_COMMAND,Cmt=uft.KEY_ENTER_COMMAND,Mmt=uft.KEY_ESCAPE_COMMAND;uft.KEY_MODIFIER_COMMAND,uft.KEY_SPACE_COMMAND;const _mt=uft.KEY_TAB_COMMAND;uft.LineBreakNode,uft.MOVE_TO_END,uft.MOVE_TO_START;const Nmt=uft.OUTDENT_CONTENT_COMMAND,Amt=uft.PASTE_COMMAND;uft.ParagraphNode;const Omt=uft.REDO_COMMAND,Imt=uft.REMOVE_TEXT_COMMAND;uft.RootNode;const Dmt=uft.SELECTION_CHANGE_COMMAND,Pmt=uft.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Tmt=uft.SELECT_ALL_COMMAND;uft.TabNode;const Hmt=uft.TextNode,Lmt=uft.UNDO_COMMAND,zmt=uft.createCommand,Rmt=uft.createEditor;uft.getNearestEditorFromDOMNode;const Bmt=uft.isBlockDomNode;uft.isCurrentlyReadOnlyMode;const $mt=uft.isHTMLAnchorElement,Zmt=uft.isHTMLElement,Vmt=uft.isInlineDomNode,jmt=uft.isSelectionCapturedInDecoratorInput,Wmt=uft.isSelectionWithinEditor,Fmt=new Map;function qmt(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function Ymt(e){const t=e.parentNode;if(null==t)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function Umt(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Kmt(e){let t=Fmt.get(e);return void 0===t&&(t=Umt(e),Fmt.set(e,t)),Object.freeze(t),t}function Gmt(e,t,n){let r=t.getNode(),o=n;if(Aft(r)){const e=r.getDescendantByIndex(t.offset);null!==e&&(r=e)}for(;o>0&&null!==r;){if(Aft(r)){const e=r.getLastDescendant();null!==e&&(r=e)}let n=r.getPreviousSibling(),a=0;if(null===n){let e=r.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){n=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,n=t)}let i=r.getTextContent();""===i&&Aft(r)&&!r.isInline()&&(i="\n\n");const l=i.length;if(!zft(r)||o>=l){const e=r.getParent();r.remove(),null==e||0!==e.getChildrenSize()||Hft(e)||e.remove(),o-=l+a,r=n}else{const n=r.getKey(),a=e.getEditorState().read((()=>{const e=xft(n);return zft(e)&&e.isSimpleText()?e.getTextContent():null})),s=l-o,c=i.slice(0,s);if(null!==a&&a!==i){const e=Eft();let t=r;if(r.isSimpleText())r.setTextContent(a);else{const e=gft(a);r.replace(e),t=e}if(Tft(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(r.isSimpleText()){const e=t.key===n;let a=t.offset;a<o&&(a=l);const i=e?a-o:0,c=e?a:s;if(e&&0===i){const[e]=r.splitText(i,c);e.remove()}else{const[,e]=r.splitText(i,c);e.remove()}}else{const e=gft(c);r.replace(e)}o=0}}}function Xmt(e,t){const n=Kmt("getStyle"in e?e.getStyle():e.style),r=Object.entries(t).reduce(((e,[t,r])=>(r instanceof Function?e[t]=r(n[t]):null===r?delete e[t]:e[t]=r,e)),{...n}||{}),o=function(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}(r);e.setStyle(o),Fmt.set(o,r)}function Qmt(e){return e.getNode().isAttached()}function Jmt(e){let t=e;for(;null!==t&&!Lft(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function evt(e,t,n,r,o=null){if(0===t.length)return;const a=t[0],i=new Map,l=[];let s=Aft(a)?a:a.getParentOrThrow();s.isInline()&&(s=s.getParentOrThrow());let c=!1;for(;null!==s;){const e=s.getPreviousSibling();if(null!==e){s=e,c=!0;break}if(s=s.getParentOrThrow(),Lft(s))break}const u=new Set;for(let e=0;e<n;e++){const n=t[e];Aft(n)&&0===n.getChildrenSize()&&u.add(n.getKey())}const d=new Set;for(let e=0;e<n;e++){const n=t[e];let o=n.getParent();if(null!==o&&o.isInline()&&(o=o.getParent()),null!==o&&Oft(n)&&!d.has(n.getKey())){const e=o.getKey();if(void 0===i.get(e)){const t=r();t.setFormat(o.getFormatType()),t.setIndent(o.getIndent()),l.push(t),i.set(e,t),o.getChildren().forEach((e=>{t.append(e),d.add(e.getKey()),Aft(e)&&e.getChildrenKeys().forEach((e=>d.add(e)))})),Jmt(o)}}else if(u.has(n.getKey())){if(!Aft(n))throw Error("Expected node in emptyElements to be an ElementNode");const e=r();e.setFormat(n.getFormatType()),e.setIndent(n.getIndent()),l.push(e),n.remove(!0)}}if(null!==o)for(let e=0;e<l.length;e++){const t=l[e];o.append(t)}let h=null;if(Lft(s))if(c)if(null!==o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t)}else{const e=s.getFirstChild();if(Aft(e)&&(s=e),null===e)if(o)s.append(o);else for(let e=0;e<l.length;e++){const t=l[e];s.append(t),h=t}else if(null!==o)e.insertBefore(o);else for(let t=0;t<l.length;t++){const n=l[t];e.insertBefore(n),h=n}}else if(o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t),h=t}const p=Eft();Tft(p)&&Qmt(p.anchor)&&Qmt(p.focus)?Zft(p.clone()):null!==h?h.selectEnd():e.dirty=!0}function tvt(e,t,n,r){e.modify(t?"extend":"move",n,r)}function nvt(e){const t=e.anchor.getNode();return"rtl"===(Hft(t)?t:t.getParentOrThrow()).getDirection()}function rvt(e,t,n){const r=Kmt(e.getStyle());return null!==r&&r[t]||n}function ovt(e){if(Nft(e))return!1;if(!Aft(e)||Lft(e))return!1;const t=e.getFirstChild(),n=null===t||Ift(t)||zft(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}const avt=Gmt;var ivt=Object.freeze({__proto__:null,$addNodeStyle:function(e){const t=e.getStyle(),n=Umt(t);Fmt.set(t,n)},$cloneWithProperties:function(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Aft(e)&&Aft(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):zft(e)&&zft(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):Pft(e)&&Pft(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r},$getSelectionStyleValueForProperty:function(e,t,n=""){let r=null;const o=e.getNodes(),a=e.anchor,i=e.focus,l=e.isBackward(),s=l?i.offset:a.offset,c=l?i.getNode():a.getNode();if(Tft(e)&&e.isCollapsed()&&""!==e.style){const n=Kmt(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e<o.length;e++){const a=o[e];if((0===e||0!==s||!a.is(c))&&zft(a)){const e=rvt(a,t,n);if(null===r)r=e;else if(r!==e){r="";break}}}return null===r?n:r},$isAtNodeEnd:function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();if(!Aft(t))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return e.offset===t.getChildrenSize()},$isParentElementRTL:nvt,$moveCaretSelection:tvt,$moveCharacter:function(e,t,n){const r=nvt(e);tvt(e,t,n?!r:r,"character")},$patchStyleText:function(e,t){const n=e.getNodes(),r=n.length,o=e.getStartEndPoints();if(null===o)return;const[a,i]=o,l=r-1;let s=n[0],c=n[l];if(e.isCollapsed()&&Tft(e))return void Xmt(e,t);const u=s.getTextContent().length,d=i.offset;let h=a.offset;const p=a.isBefore(i);let f=p?h:d,m=p?d:h;const v=p?a.type:i.type,g=p?i.type:a.type,b=p?i.key:a.key;if(zft(s)&&f===u){const e=s.getNextSibling();zft(e)&&(h=0,f=0,s=e)}if(1===n.length){if(zft(s)&&s.canHaveFormat()){if(f="element"===v?0:h>d?d:h,m="element"===g?u:h>d?h:d,f===m)return;if(0===f&&m===u)Xmt(s,t),s.select(f,m);else{const e=s.splitText(f,m),n=0===f?e[0]:e[1];Xmt(n,t),n.select(0,m-f)}}}else{if(zft(s)&&f<s.getTextContentSize()&&s.canHaveFormat()&&(0!==f&&(s=s.splitText(f)[1],f=0,a.set(s.getKey(),f,"text")),Xmt(s,t)),zft(c)&&c.canHaveFormat()){const e=c.getTextContent().length;c.__key!==b&&0!==m&&(m=e),m!==e&&([c]=c.splitText(m)),0===m&&"element"!==g||Xmt(c,t)}for(let e=1;e<l;e++){const r=n[e],o=r.getKey();zft(r)&&r.canHaveFormat()&&o!==s.getKey()&&o!==c.getKey()&&!r.isToken()&&Xmt(r,t)}}},$selectAll:function(e){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),a=r.getLastDescendant(),i="element",l="element",s=0;zft(o)?i="text":Aft(o)||null===o||(o=o.getParentOrThrow()),zft(a)?(l="text",s=a.getTextContentSize()):Aft(a)||null===a||(a=a.getParentOrThrow()),o&&a&&(t.set(o.getKey(),0,i),n.set(a.getKey(),s,l))},$setBlocksType:function(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=kft(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const o=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),ovt);a&&-1===o.indexOf(a)&&o.push(a);for(let e=0;e<o.length;e++){const n=o[e];if(!ovt(n))continue;if(!Aft(n))throw Error("Expected block node to be an ElementNode");const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}},$shouldOverrideDefaultCharacterSelection:function(e,t){const n=bft(e.focus,t);return Nft(n)&&!n.isIsolated()||Aft(n)&&!n.isInline()&&!n.canBeEmpty()},$sliceSelectedTextNodeContent:function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,a=e.isBackward(),i=r.getNode(),l=o.getNode(),s=t.is(i),c=t.is(l);if(s||c){const[n,r]=yft(e),o=i.is(l),s=t.is(a?l:i),c=t.is(a?i:l);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):s?(d=a?r:n,u=void 0):c&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u),t}}return t},$trimTextContentFromAnchor:Gmt,$wrapNodes:function(e,t,n=null){const r=e.getStartEndPoints(),o=r?r[0]:null,a=e.getNodes(),i=a.length;if(null!==o&&(0===i||1===i&&"element"===o.type&&0===o.getNode().getChildrenSize())){const e="text"===o.type?o.getNode().getParentOrThrow():o.getNode(),r=e.getChildren();let a=t();return a.setFormat(e.getFormatType()),a.setIndent(e.getIndent()),r.forEach((e=>a.append(e))),n&&(a=n.append(a)),void e.replace(a)}let l=null,s=[];for(let r=0;r<i;r++){const o=a[r];Lft(o)?(evt(e,s,s.length,t,n),s=[],l=o):null===l||null!==l&&Cft(o,l)?s.push(o):(evt(e,s,s.length,t,n),s=[o])}evt(e,s,s.length,t,n)},createDOMRange:function(e,t,n,r,o){const a=t.getKey(),i=r.getKey(),l=document.createRange();let s=e.getElementByKey(a),c=e.getElementByKey(i),u=n,d=o;if(zft(t)&&(s=qmt(s)),zft(r)&&(c=qmt(c)),void 0===t||void 0===r||null===s||null===c)return null;"BR"===s.nodeName&&([s,u]=Ymt(s)),"BR"===c.nodeName&&([c,d]=Ymt(c));const h=s.firstChild;s===c&&null!=h&&"BR"===h.nodeName&&0===u&&0===d&&(d=1);try{l.setStart(s,u),l.setEnd(c,d)}catch(e){return null}return!l.collapsed||u===d&&a===i||(l.setStart(c,d),l.setEnd(s,u)),l},createRectsFromDOMRange:function(e,t){const n=e.getRootElement();if(null===n)return[];const r=n.getBoundingClientRect(),o=getComputedStyle(n),a=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(t.getClientRects());let l,s=i.length;i.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<s;e++){const t=i[e],n=l&&l.top<=t.top&&l.top+l.height>t.top&&l.left+l.width>t.left,o=t.width+a===r.width;n||o?(i.splice(e--,1),s--):l=t}return i},getStyleObjectFromCSS:Kmt,trimTextContentFromAnchor:avt}),lvt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const svt=new Map;function cvt(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function uvt(e){const t=e.parentNode;if(null==t)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function dvt(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function hvt(e){let t=svt.get(e);return void 0===t&&(t=dvt(e),svt.set(e,t)),t}function pvt(e,t,n){let r=t.getNode(),o=n;if(Aft(r)){const e=r.getDescendantByIndex(t.offset);null!==e&&(r=e)}for(;o>0&&null!==r;){if(Aft(r)){const e=r.getLastDescendant();null!==e&&(r=e)}let n=r.getPreviousSibling(),a=0;if(null===n){let e=r.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){n=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,n=t)}let i=r.getTextContent();""===i&&Aft(r)&&!r.isInline()&&(i="\n\n");const l=i.length;if(!zft(r)||o>=l){const e=r.getParent();r.remove(),null==e||0!==e.getChildrenSize()||Hft(e)||e.remove(),o-=l+a,r=n}else{const n=r.getKey(),a=e.getEditorState().read((()=>{const e=xft(n);return zft(e)&&e.isSimpleText()?e.getTextContent():null})),s=l-o,c=i.slice(0,s);if(null!==a&&a!==i){const e=Eft();let t=r;if(r.isSimpleText())r.setTextContent(a);else{const e=gft(a);r.replace(e),t=e}if(Tft(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(r.isSimpleText()){const e=t.key===n;let a=t.offset;a<o&&(a=l);const i=e?a-o:0,c=e?a:s;if(e&&0===i){const[e]=r.splitText(i,c);e.remove()}else{const[,e]=r.splitText(i,c);e.remove()}}else{const e=gft(c);r.replace(e)}o=0}}}function fvt(e,t){const n=hvt("getStyle"in e?e.getStyle():e.style),r=Object.entries(t).reduce(((e,[t,r])=>(r instanceof Function?e[t]=r(n[t]):null===r?delete e[t]:e[t]=r,e)),{...n}||{}),o=function(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}(r);e.setStyle(o),svt.set(o,r)}function mvt(e){return e.getNode().isAttached()}function vvt(e){let t=e;for(;null!==t&&!Lft(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function gvt(e,t,n,r,o=null){if(0===t.length)return;const a=t[0],i=new Map,l=[];let s=Aft(a)?a:a.getParentOrThrow();s.isInline()&&(s=s.getParentOrThrow());let c=!1;for(;null!==s;){const e=s.getPreviousSibling();if(null!==e){s=e,c=!0;break}if(s=s.getParentOrThrow(),Lft(s))break}const u=new Set;for(let e=0;e<n;e++){const n=t[e];Aft(n)&&0===n.getChildrenSize()&&u.add(n.getKey())}const d=new Set;for(let e=0;e<n;e++){const n=t[e];let o=n.getParent();if(null!==o&&o.isInline()&&(o=o.getParent()),null!==o&&Oft(n)&&!d.has(n.getKey())){const e=o.getKey();if(void 0===i.get(e)){const t=r();t.setFormat(o.getFormatType()),t.setIndent(o.getIndent()),l.push(t),i.set(e,t),o.getChildren().forEach((e=>{t.append(e),d.add(e.getKey()),Aft(e)&&e.getChildrenKeys().forEach((e=>d.add(e)))})),vvt(o)}}else if(u.has(n.getKey())){Aft(n)||lvt(179);const e=r();e.setFormat(n.getFormatType()),e.setIndent(n.getIndent()),l.push(e),n.remove(!0)}}if(null!==o)for(let e=0;e<l.length;e++){const t=l[e];o.append(t)}let h=null;if(Lft(s))if(c)if(null!==o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t)}else{const e=s.getFirstChild();if(Aft(e)&&(s=e),null===e)if(o)s.append(o);else for(let e=0;e<l.length;e++){const t=l[e];s.append(t),h=t}else if(null!==o)e.insertBefore(o);else for(let t=0;t<l.length;t++){const n=l[t];e.insertBefore(n),h=n}}else if(o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t),h=t}const p=Eft();Tft(p)&&mvt(p.anchor)&&mvt(p.focus)?Zft(p.clone()):null!==h?h.selectEnd():e.dirty=!0}function bvt(e,t,n,r){e.modify(t?"extend":"move",n,r)}function yvt(e){const t=e.anchor.getNode();return"rtl"===(Hft(t)?t:t.getParentOrThrow()).getDirection()}function wvt(e,t,n){const r=hvt(e.getStyle());return null!==r&&r[t]||n}function xvt(e){if(Nft(e))return!1;if(!Aft(e)||Lft(e))return!1;const t=e.getFirstChild(),n=null===t||Ift(t)||zft(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}const Evt=pvt;var kvt=Object.freeze({__proto__:null,$addNodeStyle:function(e){const t=e.getStyle(),n=dvt(t);svt.set(t,n)},$cloneWithProperties:function(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Aft(e)&&Aft(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):zft(e)&&zft(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):Pft(e)&&Pft(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r},$getSelectionStyleValueForProperty:function(e,t,n=""){let r=null;const o=e.getNodes(),a=e.anchor,i=e.focus,l=e.isBackward(),s=l?i.offset:a.offset,c=l?i.getNode():a.getNode();if(Tft(e)&&e.isCollapsed()&&""!==e.style){const n=hvt(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e<o.length;e++){const a=o[e];if((0===e||0!==s||!a.is(c))&&zft(a)){const e=wvt(a,t,n);if(null===r)r=e;else if(r!==e){r="";break}}}return null===r?n:r},$isAtNodeEnd:function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return Aft(t)||lvt(177),e.offset===t.getChildrenSize()},$isParentElementRTL:yvt,$moveCaretSelection:bvt,$moveCharacter:function(e,t,n){const r=yvt(e);bvt(e,t,n?!r:r,"character")},$patchStyleText:function(e,t){const n=e.getNodes(),r=n.length,o=e.getStartEndPoints();if(null===o)return;const[a,i]=o,l=r-1;let s=n[0],c=n[l];if(e.isCollapsed()&&Tft(e))return void fvt(e,t);const u=s.getTextContent().length,d=i.offset;let h=a.offset;const p=a.isBefore(i);let f=p?h:d,m=p?d:h;const v=p?a.type:i.type,g=p?i.type:a.type,b=p?i.key:a.key;if(zft(s)&&f===u){const e=s.getNextSibling();zft(e)&&(h=0,f=0,s=e)}if(1===n.length){if(zft(s)&&s.canHaveFormat()){if(f="element"===v?0:h>d?d:h,m="element"===g?u:h>d?h:d,f===m)return;if(0===f&&m===u)fvt(s,t),s.select(f,m);else{const e=s.splitText(f,m),n=0===f?e[0]:e[1];fvt(n,t),n.select(0,m-f)}}}else{if(zft(s)&&f<s.getTextContentSize()&&s.canHaveFormat()&&(0!==f&&(s=s.splitText(f)[1],f=0,a.set(s.getKey(),f,"text")),fvt(s,t)),zft(c)&&c.canHaveFormat()){const e=c.getTextContent().length;c.__key!==b&&0!==m&&(m=e),m!==e&&([c]=c.splitText(m)),0===m&&"element"!==g||fvt(c,t)}for(let e=1;e<l;e++){const r=n[e],o=r.getKey();zft(r)&&r.canHaveFormat()&&o!==s.getKey()&&o!==c.getKey()&&!r.isToken()&&fvt(r,t)}}},$selectAll:function(e){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),a=r.getLastDescendant(),i="element",l="element",s=0;zft(o)?i="text":Aft(o)||null===o||(o=o.getParentOrThrow()),zft(a)?(l="text",s=a.getTextContentSize()):Aft(a)||null===a||(a=a.getParentOrThrow()),o&&a&&(t.set(o.getKey(),0,i),n.set(a.getKey(),s,l))},$setBlocksType:function(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=kft(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const o=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),xvt);a&&-1===o.indexOf(a)&&o.push(a);for(let e=0;e<o.length;e++){const n=o[e];if(!xvt(n))continue;Aft(n)||lvt(178);const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}},$shouldOverrideDefaultCharacterSelection:function(e,t){const n=bft(e.focus,t);return Nft(n)&&!n.isIsolated()||Aft(n)&&!n.isInline()&&!n.canBeEmpty()},$sliceSelectedTextNodeContent:function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,a=e.isBackward(),i=r.getNode(),l=o.getNode(),s=t.is(i),c=t.is(l);if(s||c){const[n,r]=yft(e),o=i.is(l),s=t.is(a?l:i),c=t.is(a?i:l);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):s?(d=a?r:n,u=void 0):c&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u),t}}return t},$trimTextContentFromAnchor:pvt,$wrapNodes:function(e,t,n=null){const r=e.getStartEndPoints(),o=r?r[0]:null,a=e.getNodes(),i=a.length;if(null!==o&&(0===i||1===i&&"element"===o.type&&0===o.getNode().getChildrenSize())){const e="text"===o.type?o.getNode().getParentOrThrow():o.getNode(),r=e.getChildren();let a=t();return a.setFormat(e.getFormatType()),a.setIndent(e.getIndent()),r.forEach((e=>a.append(e))),n&&(a=n.append(a)),void e.replace(a)}let l=null,s=[];for(let r=0;r<i;r++){const o=a[r];Lft(o)?(gvt(e,s,s.length,t,n),s=[],l=o):null===l||null!==l&&Cft(o,l)?s.push(o):(gvt(e,s,s.length,t,n),s=[o])}gvt(e,s,s.length,t,n)},createDOMRange:function(e,t,n,r,o){const a=t.getKey(),i=r.getKey(),l=document.createRange();let s=e.getElementByKey(a),c=e.getElementByKey(i),u=n,d=o;if(zft(t)&&(s=cvt(s)),zft(r)&&(c=cvt(c)),void 0===t||void 0===r||null===s||null===c)return null;"BR"===s.nodeName&&([s,u]=uvt(s)),"BR"===c.nodeName&&([c,d]=uvt(c));const h=s.firstChild;s===c&&null!=h&&"BR"===h.nodeName&&0===u&&0===d&&(d=1);try{l.setStart(s,u),l.setEnd(c,d)}catch(e){return null}return!l.collapsed||u===d&&a===i||(l.setStart(c,d),l.setEnd(s,u)),l},createRectsFromDOMRange:function(e,t){const n=e.getRootElement();if(null===n)return[];const r=n.getBoundingClientRect(),o=getComputedStyle(n),a=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(t.getClientRects());let l,s=i.length;i.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<s;e++){const t=i[e],n=l&&l.top<=t.top&&l.top+l.height>t.top&&l.left+l.width>t.left,o=t.width+a===r.width;n||o?(i.splice(e--,1),s--):l=t}return i},getStyleObjectFromCSS:hvt,trimTextContentFromAnchor:Evt});const Svt="development"===process.env.NODE_ENV?ivt:kvt,Cvt=Svt.$addNodeStyle,Mvt=Svt.$cloneWithProperties;Svt.$getSelectionStyleValueForProperty,Svt.$isAtNodeEnd,Svt.$isParentElementRTL,Svt.$moveCaretSelection;const _vt=Svt.$moveCharacter;Svt.$patchStyleText,Svt.$selectAll,Svt.$setBlocksType;const Nvt=Svt.$shouldOverrideDefaultCharacterSelection,Avt=Svt.$sliceSelectedTextNodeContent;Svt.$trimTextContentFromAnchor,Svt.$wrapNodes,Svt.createDOMRange;const Ovt=Svt.createRectsFromDOMRange;Svt.getStyleObjectFromCSS,Svt.trimTextContentFromAnchor;const Ivt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dvt=Ivt&&"documentMode"in document?document.documentMode:null,Pvt=Ivt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Tvt=Ivt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Hvt=!(!Ivt||!("InputEvent"in window)||Dvt)&&"getTargetRanges"in new window.InputEvent("input"),Lvt=Ivt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zvt=Ivt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Rvt=Ivt&&/Android/.test(navigator.userAgent),Bvt=Ivt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),$vt=Ivt&&Rvt&&Bvt,Zvt=Ivt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Bvt;function Vvt(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function jvt(...e){return()=>{e.forEach((e=>e()))}}function Wvt(e){return`${e}px`}const Fvt={attributes:!0,characterData:!0,childList:!0,subtree:!0};function qvt(e,t,n){let r=null,o=null,a=null,i=[];const l=document.createElement("div");function s(){if(null===r)throw Error("Unexpected null rootDOMNode");if(null===o)throw Error("Unexpected null parentDOMNode");const{left:a,top:s}=r.getBoundingClientRect(),c=o,u=Ovt(e,t);l.isConnected||c.append(l);let d=!1;for(let e=0;e<u.length;e++){const t=u[e],n=i[e]||document.createElement("div"),r=n.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const o=Wvt(t.left-a);r.left!==o&&(r.left=o,d=!0);const c=Wvt(t.top-s);r.top!==c&&(n.style.top=c,d=!0);const h=Wvt(t.width);r.width!==h&&(n.style.width=h,d=!0);const p=Wvt(t.height);r.height!==p&&(n.style.height=p,d=!0),n.parentNode!==l&&(l.append(n),d=!0),i[e]=n}for(;i.length>u.length;)i.pop();d&&n(i)}function c(){o=null,r=null,null!==a&&a.disconnect(),a=null,l.remove();for(const e of i)e.remove();i=[]}const u=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),r=n,o=i,a=new MutationObserver((n=>{const a=e.getRootElement(),i=a&&a.parentElement;if(a!==r||i!==o)return t();for(const e of n)if(!l.contains(e.target))return s()})),a.observe(i,Fvt),s()}));return()=>{u(),c()}}const Yvt=Hvt,Uvt=Ivt,Kvt=Rvt,Gvt=$vt,Xvt=Pvt,Qvt=Zvt,Jvt=Bvt,egt=Tvt,tgt=zvt,ngt=Lvt;function rgt(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}const ogt=(e,t)=>{let n=e;for(;n!==kft()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};var agt=Object.freeze({__proto__:null,$dfs:function(e,t){const n=[],r=(e||kft()).getLatest(),o=t||Aft(r)&&r.getLastDescendant()||r;let a=r,i=function(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}(a);for(;null!==a&&!a.is(o);)if(n.push({depth:i,node:a}),Aft(a)&&a.getChildrenSize()>0)a=a.getFirstChild(),i++;else{let e=null;for(;null===e&&null!==a;)e=a.getNextSibling(),null===e?(a=a.getParent(),i--):a=e}return null!==a&&a.is(o)&&n.push({depth:i,node:a}),n},$filter:function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=t(e[r]);null!==o&&n.push(o)}return n},$findMatchingParent:ogt,$getNearestBlockElementAncestorOrThrow:function(e){const t=ogt(e,(e=>Aft(e)&&!e.isInline()));if(!Aft(t))throw Error(`Expected node ${e.__key} to have closest block element node.`);return t},$getNearestNodeOfType:function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null},$getNextRightPreorderNode:function(e){let t=e;if(Aft(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t},$insertFirst:function(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)},$insertNodeToNearestRoot:function(e){const t=Sft()||Eft();if(Tft(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if(Lft(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;zft(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,a]=Vft(t,n);a.insertBefore(e),a.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else kft().append(e);const n=fft();e.insertAfter(n),n.select()}return e.getLatest()},$restoreEditorState:function(e,t){const n=new Map,r=e._pendingEditorState;for(const[e,r]of t._nodeMap){const t=Mvt(r);if(zft(t)){if(!zft(r))throw Error("Expected node be a TextNode");t.__text=r.__text}n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2;const o=t._selection;Zft(null===o?null:o.clone())},$wrapNodeInElement:function(e,t){const n=t();return e.replace(n),n.append(e),n},CAN_USE_BEFORE_INPUT:Yvt,CAN_USE_DOM:Uvt,IS_ANDROID:Kvt,IS_ANDROID_CHROME:Gvt,IS_APPLE:Xvt,IS_APPLE_WEBKIT:Qvt,IS_CHROME:Jvt,IS_FIREFOX:egt,IS_IOS:tgt,IS_SAFARI:ngt,addClassNamesToElement:function(e,...t){const n=Vvt(...t);n.length>0&&e.classList.add(...n)},calculateZoomLevel:function(e){if(egt)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t},isMimeType:rgt,markSelection:function(e,t){let n=null,r=null,o=null,a=null,i=()=>{};function l(l){l.read((()=>{const l=Sft();if(!Tft(l))return n=null,r=null,o=null,a=null,i(),void(i=()=>{});const{anchor:s,focus:c}=l,u=s.getNode(),d=u.getKey(),h=s.offset,p=c.getNode(),f=p.getKey(),m=c.offset,v=e.getElementByKey(d),g=e.getElementByKey(f),b=null===n||null===v||h!==r||d!==n.getKey()||u!==n&&(!(n instanceof Hmt)||u.updateDOM(n,v,e._config)),y=null===o||null===g||m!==a||f!==o.getKey()||p!==o&&(!(o instanceof Hmt)||p.updateDOM(o,g,e._config));if(b||y){const n=e.getElementByKey(s.getNode().getKey()),r=e.getElementByKey(c.getNode().getKey());if(null!==n&&null!==r&&"SPAN"===n.tagName&&"SPAN"===r.tagName){const o=document.createRange();let a,l,u,d;c.isBefore(s)?(a=r,l=c.offset,u=n,d=s.offset):(a=n,l=s.offset,u=r,d=c.offset);const h=a.firstChild;if(null===h)throw Error("Expected text node to be first child of span");const p=u.firstChild;if(null===p)throw Error("Expected text node to be first child of span");o.setStart(h,l),o.setEnd(p,d),i(),i=qvt(e,o,(e=>{for(const t of e){const e=t.style;"Highlight"!==e.background&&(e.background="Highlight"),"HighlightText"!==e.color&&(e.color="HighlightText"),"-1"!==e.zIndex&&(e.zIndex="-1"),"none"!==e.pointerEvents&&(e.pointerEvents="none"),e.marginTop!==Wvt(-1.5)&&(e.marginTop=Wvt(-1.5)),e.paddingTop!==Wvt(4)&&(e.paddingTop=Wvt(4)),e.paddingBottom!==Wvt(0)&&(e.paddingBottom=Wvt(0))}void 0!==t&&t(e)}))}}n=u,r=h,o=p,a=m}))}return l(e.getEditorState()),jvt(e.registerUpdateListener((({editorState:e})=>l(e))),i,(()=>{i()}))},mediaFileReader:function(e,t){const n=e[Symbol.iterator]();return new Promise(((e,r)=>{const o=[],a=()=>{const{done:i,value:l}=n.next();if(i)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:l,result:e}),a()})),rgt(l,t)?s.readAsDataURL(l):a()};a()}))},mergeRegister:jvt,objectKlassEquals:function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},positionNodeOnRange:qvt,registerNestedElementResolver:function(e,t,n,r){const o=e=>e instanceof t;return e.registerNodeTransform(t,(e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(o(n))return null}let n=e,r=e;for(;null!==n;)if(r=n,n=n.getParent(),o(n))return{child:r,parent:n};return null})(e);if(null!==t){const{child:o,parent:a}=t;if(o.is(e)){r(a,e);const t=o.getNextSiblings(),i=t.length;if(a.insertAfter(o),0!==i){const e=n(a);o.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}a.canBeEmpty()||0!==a.getChildrenSize()||a.remove()}}}))},removeClassNamesFromElement:function(e,...t){const n=Vvt(...t);n.length>0&&e.classList.remove(...n)},$splitNode:Vft,isBlockDomNode:Bmt,isHTMLAnchorElement:$mt,isHTMLElement:Zmt,isInlineDomNode:Vmt}),igt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const lgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,sgt=lgt&&"documentMode"in document?document.documentMode:null,cgt=lgt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ugt=lgt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),dgt=!(!lgt||!("InputEvent"in window)||sgt)&&"getTargetRanges"in new window.InputEvent("input"),hgt=lgt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pgt=lgt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fgt=lgt&&/Android/.test(navigator.userAgent),mgt=lgt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vgt=lgt&&fgt&&mgt,ggt=lgt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mgt;function bgt(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function ygt(...e){return()=>{e.forEach((e=>e()))}}function wgt(e){return`${e}px`}const xgt={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Egt(e,t,n){let r=null,o=null,a=null,i=[];const l=document.createElement("div");function s(){null===r&&igt(182),null===o&&igt(183);const{left:a,top:s}=r.getBoundingClientRect(),c=o,u=Ovt(e,t);l.isConnected||c.append(l);let d=!1;for(let e=0;e<u.length;e++){const t=u[e],n=i[e]||document.createElement("div"),r=n.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const o=wgt(t.left-a);r.left!==o&&(r.left=o,d=!0);const c=wgt(t.top-s);r.top!==c&&(n.style.top=c,d=!0);const h=wgt(t.width);r.width!==h&&(n.style.width=h,d=!0);const p=wgt(t.height);r.height!==p&&(n.style.height=p,d=!0),n.parentNode!==l&&(l.append(n),d=!0),i[e]=n}for(;i.length>u.length;)i.pop();d&&n(i)}function c(){o=null,r=null,null!==a&&a.disconnect(),a=null,l.remove();for(const e of i)e.remove();i=[]}const u=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),r=n,o=i,a=new MutationObserver((n=>{const a=e.getRootElement(),i=a&&a.parentElement;if(a!==r||i!==o)return t();for(const e of n)if(!l.contains(e.target))return s()})),a.observe(i,xgt),s()}));return()=>{u(),c()}}const kgt=dgt,Sgt=lgt,Cgt=fgt,Mgt=vgt,_gt=cgt,Ngt=ggt,Agt=mgt,Ogt=ugt,Igt=pgt,Dgt=hgt;function Pgt(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}const Tgt=(e,t)=>{let n=e;for(;n!==kft()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};var Hgt=Object.freeze({__proto__:null,$dfs:function(e,t){const n=[],r=(e||kft()).getLatest(),o=t||Aft(r)&&r.getLastDescendant()||r;let a=r,i=function(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}(a);for(;null!==a&&!a.is(o);)if(n.push({depth:i,node:a}),Aft(a)&&a.getChildrenSize()>0)a=a.getFirstChild(),i++;else{let e=null;for(;null===e&&null!==a;)e=a.getNextSibling(),null===e?(a=a.getParent(),i--):a=e}return null!==a&&a.is(o)&&n.push({depth:i,node:a}),n},$filter:function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=t(e[r]);null!==o&&n.push(o)}return n},$findMatchingParent:Tgt,$getNearestBlockElementAncestorOrThrow:function(e){const t=Tgt(e,(e=>Aft(e)&&!e.isInline()));return Aft(t)||igt(4,e.__key),t},$getNearestNodeOfType:function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null},$getNextRightPreorderNode:function(e){let t=e;if(Aft(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t},$insertFirst:function(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)},$insertNodeToNearestRoot:function(e){const t=Sft()||Eft();if(Tft(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if(Lft(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;zft(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,a]=Vft(t,n);a.insertBefore(e),a.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else kft().append(e);const n=fft();e.insertAfter(n),n.select()}return e.getLatest()},$restoreEditorState:function(e,t){const n=new Map,r=e._pendingEditorState;for(const[e,r]of t._nodeMap){const t=Mvt(r);zft(t)&&(zft(r)||igt(180),t.__text=r.__text),n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2;const o=t._selection;Zft(null===o?null:o.clone())},$wrapNodeInElement:function(e,t){const n=t();return e.replace(n),n.append(e),n},CAN_USE_BEFORE_INPUT:kgt,CAN_USE_DOM:Sgt,IS_ANDROID:Cgt,IS_ANDROID_CHROME:Mgt,IS_APPLE:_gt,IS_APPLE_WEBKIT:Ngt,IS_CHROME:Agt,IS_FIREFOX:Ogt,IS_IOS:Igt,IS_SAFARI:Dgt,addClassNamesToElement:function(e,...t){const n=bgt(...t);n.length>0&&e.classList.add(...n)},calculateZoomLevel:function(e){if(Ogt)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t},isMimeType:Pgt,markSelection:function(e,t){let n=null,r=null,o=null,a=null,i=()=>{};function l(l){l.read((()=>{const l=Sft();if(!Tft(l))return n=null,r=null,o=null,a=null,i(),void(i=()=>{});const{anchor:s,focus:c}=l,u=s.getNode(),d=u.getKey(),h=s.offset,p=c.getNode(),f=p.getKey(),m=c.offset,v=e.getElementByKey(d),g=e.getElementByKey(f),b=null===n||null===v||h!==r||d!==n.getKey()||u!==n&&(!(n instanceof Hmt)||u.updateDOM(n,v,e._config)),y=null===o||null===g||m!==a||f!==o.getKey()||p!==o&&(!(o instanceof Hmt)||p.updateDOM(o,g,e._config));if(b||y){const n=e.getElementByKey(s.getNode().getKey()),r=e.getElementByKey(c.getNode().getKey());if(null!==n&&null!==r&&"SPAN"===n.tagName&&"SPAN"===r.tagName){const o=document.createRange();let a,l,u,d;c.isBefore(s)?(a=r,l=c.offset,u=n,d=s.offset):(a=n,l=s.offset,u=r,d=c.offset);const h=a.firstChild;null===h&&igt(181);const p=u.firstChild;null===p&&igt(181),o.setStart(h,l),o.setEnd(p,d),i(),i=Egt(e,o,(e=>{for(const t of e){const e=t.style;"Highlight"!==e.background&&(e.background="Highlight"),"HighlightText"!==e.color&&(e.color="HighlightText"),"-1"!==e.zIndex&&(e.zIndex="-1"),"none"!==e.pointerEvents&&(e.pointerEvents="none"),e.marginTop!==wgt(-1.5)&&(e.marginTop=wgt(-1.5)),e.paddingTop!==wgt(4)&&(e.paddingTop=wgt(4)),e.paddingBottom!==wgt(0)&&(e.paddingBottom=wgt(0))}void 0!==t&&t(e)}))}}n=u,r=h,o=p,a=m}))}return l(e.getEditorState()),ygt(e.registerUpdateListener((({editorState:e})=>l(e))),i,(()=>{i()}))},mediaFileReader:function(e,t){const n=e[Symbol.iterator]();return new Promise(((e,r)=>{const o=[],a=()=>{const{done:i,value:l}=n.next();if(i)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:l,result:e}),a()})),Pgt(l,t)?s.readAsDataURL(l):a()};a()}))},mergeRegister:ygt,objectKlassEquals:function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},positionNodeOnRange:Egt,registerNestedElementResolver:function(e,t,n,r){const o=e=>e instanceof t;return e.registerNodeTransform(t,(e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(o(n))return null}let n=e,r=e;for(;null!==n;)if(r=n,n=n.getParent(),o(n))return{child:r,parent:n};return null})(e);if(null!==t){const{child:o,parent:a}=t;if(o.is(e)){r(a,e);const t=o.getNextSiblings(),i=t.length;if(a.insertAfter(o),0!==i){const e=n(a);o.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}a.canBeEmpty()||0!==a.getChildrenSize()||a.remove()}}}))},removeClassNamesFromElement:function(e,...t){const n=bgt(...t);n.length>0&&e.classList.remove(...n)},$splitNode:Vft,isBlockDomNode:Bmt,isHTMLAnchorElement:$mt,isHTMLElement:Zmt,isInlineDomNode:Vmt});const Lgt="development"===process.env.NODE_ENV?agt:Hgt;Lgt.$dfs,Lgt.$filter;const zgt=Lgt.$findMatchingParent,Rgt=Lgt.$getNearestBlockElementAncestorOrThrow;Lgt.$getNearestNodeOfType,Lgt.$getNextRightPreorderNode,Lgt.$insertFirst,Lgt.$insertNodeToNearestRoot,Lgt.$restoreEditorState,Lgt.$splitNode,Lgt.$wrapNodeInElement,Lgt.CAN_USE_BEFORE_INPUT,Lgt.CAN_USE_DOM,Lgt.IS_ANDROID,Lgt.IS_ANDROID_CHROME,Lgt.IS_APPLE,Lgt.IS_APPLE_WEBKIT,Lgt.IS_CHROME,Lgt.IS_FIREFOX,Lgt.IS_IOS,Lgt.IS_SAFARI;const Bgt=Lgt.addClassNamesToElement;Lgt.calculateZoomLevel;const $gt=Lgt.isBlockDomNode;Lgt.isHTMLAnchorElement;const Zgt=Lgt.isHTMLElement;Lgt.isInlineDomNode,Lgt.isMimeType,Lgt.markSelection,Lgt.mediaFileReader;const Vgt=Lgt.mergeRegister,jgt=Lgt.objectKlassEquals;Lgt.positionNodeOnRange,Lgt.registerNestedElementResolver,Lgt.removeClassNamesFromElement;const Wgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,Fgt=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function qgt(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function Ygt(t,n,r,o){const[a]=art();e.useEffect((()=>{if(null!=n&&null!=t){const e=a.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let i=!1,l=qgt(n,t);const s=function(){i||(window.requestAnimationFrame((function(){r(),i=!1})),i=!0);const e=qgt(n,t);e!==l&&(l=e,null!=o&&o(e))},c=new ResizeObserver(r);return window.addEventListener("resize",r),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",r),document.removeEventListener("scroll",s,!0)}}}),[n,a,o,r,t])}const Ugt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function Kgt({close:t,editor:n,anchorElementRef:r,resolution:o,options:a,menuRenderFn:i,onSelectOption:l,shouldSplitNodeWithQuery:s=!1,commandPriority:c=Qft}){const[u,d]=e.useState(null),h=o.match&&o.match.matchingString;e.useEffect((()=>{d(0)}),[h]);const p=e.useCallback((e=>{n.update((()=>{const n=null!=o.match&&s?function(e){const t=Sft();if(!Tft(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,a=r.getTextContent().slice(0,o),i=e.replaceableString.length,l=function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(a,e.matchingString,i),s=o-l;if(s<0)return null;let c;return 0===s?[c]=r.splitText(o):[,c]=r.splitText(s,o),c}(o.match):null;l(e,n,t,o.match?o.match.matchingString:"")}))}),[n,s,o.match,l,t]),f=e.useCallback((e=>{const t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[n]);return e.useEffect((()=>()=>{const e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[n]),Wgt((()=>{null===a?d(null):null===u&&f(0)}),[a,u,f]),e.useEffect((()=>Vgt(n.registerCommand(Ugt,(({option:e})=>!(!e.ref||null==e.ref.current||(Fgt(e.ref.current),0))),c))),[n,f,c]),e.useEffect((()=>Vgt(n.registerCommand(bmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=u!==a.length-1?u+1:0;f(e);const r=a[e];null!=r.ref&&r.ref.current&&n.dispatchCommand(Ugt,{index:e,option:r}),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(xmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=0!==u?u-1:a.length-1;f(e);const n=a[e];null!=n.ref&&n.ref.current&&Fgt(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(Mmt,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),c),n.registerCommand(_mt,(e=>{const t=e;return null!==a&&null!==u&&null!=a[u]&&(t.preventDefault(),t.stopImmediatePropagation(),p(a[u]),!0)}),c),n.registerCommand(Cmt,(e=>null!==a&&null!==u&&null!=a[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),p(a[u]),!0)),c))),[p,t,n,a,u,f,c]),i(r,e.useMemo((()=>({options:a,selectOptionAndCleanUp:p,selectedIndex:u,setHighlightedIndex:d})),[p,u,a]),o.match?o.match.matchingString:"")}const Ggt="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",Xgt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");var Qgt=Object.freeze({__proto__:null,LexicalTypeaheadMenuPlugin:function({options:t,onQueryChange:n,onSelectOption:r,onOpen:o,onClose:a,menuRenderFn:i,triggerFn:l,anchorClassName:s,commandPriority:c=Qft,parent:u}){const[d]=art(),[h,p]=e.useState(null),f=function(t,n,r,o=document.body){const[a]=art(),i=e.useRef(document.createElement("div")),l=e.useCallback((()=>{i.current.style.top=i.current.style.bottom;const e=a.getRootElement(),n=i.current,l=n.firstChild;if(null!==e&&null!==t){const{left:a,top:s,width:c,height:u}=t.getRect(),d=i.current.offsetHeight;if(n.style.top=`${s+window.pageYOffset+d+3}px`,n.style.left=`${a+window.pageXOffset}px`,n.style.height=`${u}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),r=t.height,o=t.width,i=e.getBoundingClientRect();a+o>i.right&&(n.style.left=`${i.right-o+window.pageXOffset}px`),(s+r>window.innerHeight||s+r>i.bottom)&&s-i.top>r+u&&(n.style.top=s-r+window.pageYOffset-u+"px")}n.isConnected||(null!=r&&(n.className=r),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",o.append(n)),i.current=n,e.setAttribute("aria-controls","typeahead-menu")}}),[a,t,r,o]);e.useEffect((()=>{const e=a.getRootElement();if(null!==t)return l(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=i.current;null!==t&&t.isConnected&&t.remove()}}),[a,l,t]);const s=e.useCallback((e=>{null!==t&&(e||n(null))}),[t,n]);return Ygt(t,i.current,l,s),i}(h,p,s,u),m=e.useCallback((()=>{p(null),null!=a&&null!==h&&a()}),[a,h]),v=e.useCallback((e=>{p(e),null!=o&&null===h&&o(e)}),[o,h]);return e.useEffect((()=>{const e=d.registerUpdateListener((()=>{d.getEditorState().read((()=>{const e=d._window||window,t=e.document.createRange(),r=Sft(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Sft();Tft(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(d);if(!Tft(r)||!r.isCollapsed()||null===o||null===t)return void m();const a=l(o,d);if(n(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Sft();if(Tft(e)){const t=e.anchor.getNode().getPreviousSibling();return zft(t)&&t.isTextEntity()}return!1}))}(d,a.leadOffset)){const n=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,a=e,i=r.anchorOffset;if(null==o||null==i)return!1;try{t.setStart(o,a),t.setEnd(o,i)}catch(e){return!1}return!0}(a.leadOffset,t,e);if(null!==n)return i=()=>v({getRect:()=>t.getBoundingClientRect(),match:a}),void(E.startTransition?E.startTransition(i):i())}var i;m()}))}));return()=>{e()}}),[d,l,n,h,m,v]),null===h||null===d?null:E.createElement(Kgt,{close:m,resolution:h,editor:d,anchorElementRef:f,options:t,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:r,commandPriority:c})},MenuOption:class{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}},PUNCTUATION:Ggt,SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND:Xgt,getScrollParent:function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body},useBasicTypeaheadTriggerMatch:function(t,{minLength:n=1,maxLength:r=75}){return e.useCallback((e=>{const o=new RegExp("(^|\\s|\\()(["+t+"]((?:[^"+t+Ggt+"\\s]){0,"+r+"}))$").exec(e);if(null!==o){const e=o[1],t=o[3];if(t.length>=n)return{leadOffset:o.index+e.length,matchingString:t,replaceableString:o[2]}}return null}),[r,n,t])},useDynamicPositioning:Ygt});const Jgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,ebt=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function tbt(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function nbt(t,n,r,o){const[a]=art();e.useEffect((()=>{if(null!=n&&null!=t){const e=a.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let i=!1,l=tbt(n,t);const s=function(){i||(window.requestAnimationFrame((function(){r(),i=!1})),i=!0);const e=tbt(n,t);e!==l&&(l=e,null!=o&&o(e))},c=new ResizeObserver(r);return window.addEventListener("resize",r),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",r),document.removeEventListener("scroll",s,!0)}}}),[n,a,o,r,t])}const rbt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function obt({close:t,editor:n,anchorElementRef:r,resolution:o,options:a,menuRenderFn:i,onSelectOption:l,shouldSplitNodeWithQuery:s=!1,commandPriority:c=Qft}){const[u,d]=e.useState(null),h=o.match&&o.match.matchingString;e.useEffect((()=>{d(0)}),[h]);const p=e.useCallback((e=>{n.update((()=>{const n=null!=o.match&&s?function(e){const t=Sft();if(!Tft(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,a=r.getTextContent().slice(0,o),i=e.replaceableString.length,l=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(a,e.matchingString,i);if(l<0)return null;let s;return 0===l?[s]=r.splitText(o):[,s]=r.splitText(l,o),s}(o.match):null;l(e,n,t,o.match?o.match.matchingString:"")}))}),[n,s,o.match,l,t]),f=e.useCallback((e=>{const t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[n]);return e.useEffect((()=>()=>{const e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[n]),Jgt((()=>{null===a?d(null):null===u&&f(0)}),[a,u,f]),e.useEffect((()=>Vgt(n.registerCommand(rbt,(({option:e})=>!(!e.ref||null==e.ref.current||(ebt(e.ref.current),0))),c))),[n,f,c]),e.useEffect((()=>Vgt(n.registerCommand(bmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=u!==a.length-1?u+1:0;f(e);const r=a[e];null!=r.ref&&r.ref.current&&n.dispatchCommand(rbt,{index:e,option:r}),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(xmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=0!==u?u-1:a.length-1;f(e);const n=a[e];null!=n.ref&&n.ref.current&&ebt(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(Mmt,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),c),n.registerCommand(_mt,(e=>{const t=e;return null!==a&&null!==u&&null!=a[u]&&(t.preventDefault(),t.stopImmediatePropagation(),p(a[u]),!0)}),c),n.registerCommand(Cmt,(e=>null!==a&&null!==u&&null!=a[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),p(a[u]),!0)),c))),[p,t,n,a,u,f,c]),i(r,e.useMemo((()=>({options:a,selectOptionAndCleanUp:p,selectedIndex:u,setHighlightedIndex:d})),[p,u,a]),o.match?o.match.matchingString:"")}const abt="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",ibt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");var lbt=Object.freeze({__proto__:null,LexicalTypeaheadMenuPlugin:function({options:t,onQueryChange:n,onSelectOption:r,onOpen:o,onClose:a,menuRenderFn:i,triggerFn:l,anchorClassName:s,commandPriority:c=Qft,parent:u}){const[d]=art(),[h,p]=e.useState(null),f=function(t,n,r,o=document.body){const[a]=art(),i=e.useRef(document.createElement("div")),l=e.useCallback((()=>{i.current.style.top=i.current.style.bottom;const e=a.getRootElement(),n=i.current,l=n.firstChild;if(null!==e&&null!==t){const{left:a,top:s,width:c,height:u}=t.getRect(),d=i.current.offsetHeight;if(n.style.top=`${s+window.pageYOffset+d+3}px`,n.style.left=`${a+window.pageXOffset}px`,n.style.height=`${u}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),r=t.height,o=t.width,i=e.getBoundingClientRect();a+o>i.right&&(n.style.left=`${i.right-o+window.pageXOffset}px`),(s+r>window.innerHeight||s+r>i.bottom)&&s-i.top>r+u&&(n.style.top=s-r+window.pageYOffset-u+"px")}n.isConnected||(null!=r&&(n.className=r),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",o.append(n)),i.current=n,e.setAttribute("aria-controls","typeahead-menu")}}),[a,t,r,o]);e.useEffect((()=>{const e=a.getRootElement();if(null!==t)return l(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=i.current;null!==t&&t.isConnected&&t.remove()}}),[a,l,t]);const s=e.useCallback((e=>{null!==t&&(e||n(null))}),[t,n]);return nbt(t,i.current,l,s),i}(h,p,s,u),m=e.useCallback((()=>{p(null),null!=a&&null!==h&&a()}),[a,h]),v=e.useCallback((e=>{p(e),null!=o&&null===h&&o(e)}),[o,h]);return e.useEffect((()=>{const e=d.registerUpdateListener((()=>{d.getEditorState().read((()=>{const e=d._window||window,t=e.document.createRange(),r=Sft(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Sft();Tft(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(d);if(!Tft(r)||!r.isCollapsed()||null===o||null===t)return void m();const a=l(o,d);if(n(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Sft();if(Tft(e)){const t=e.anchor.getNode().getPreviousSibling();return zft(t)&&t.isTextEntity()}return!1}))}(d,a.leadOffset)){const n=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,a=e,i=r.anchorOffset;if(null==o||null==i)return!1;try{t.setStart(o,a),t.setEnd(o,i)}catch(e){return!1}return!0}(a.leadOffset,t,e);if(null!==n)return i=()=>v({getRect:()=>t.getBoundingClientRect(),match:a}),void(E.startTransition?E.startTransition(i):i())}var i;m()}))}));return()=>{e()}}),[d,l,n,h,m,v]),null===h||null===d?null:E.createElement(obt,{close:m,resolution:h,editor:d,anchorElementRef:f,options:t,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:r,commandPriority:c})},MenuOption:class{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}},PUNCTUATION:abt,SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND:ibt,getScrollParent:function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body},useBasicTypeaheadTriggerMatch:function(t,{minLength:n=1,maxLength:r=75}){return e.useCallback((e=>{const o=new RegExp("(^|\\s|\\()(["+t+"]((?:[^"+t+abt+"\\s]){0,"+r+"}))$").exec(e);if(null!==o){const e=o[1],t=o[3];if(t.length>=n)return{leadOffset:o.index+e.length,matchingString:t,replaceableString:o[2]}}return null}),[r,n,t])},useDynamicPositioning:nbt});const sbt="development"===process.env.NODE_ENV?Qgt:lbt,cbt=sbt.LexicalTypeaheadMenuPlugin,ubt=sbt.MenuOption;sbt.PUNCTUATION,sbt.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,sbt.getScrollParent;const dbt=sbt.useBasicTypeaheadTriggerMatch;sbt.useDynamicPositioning;var hbt=function(e){function t(t,n){var r=e.call(this,"​",n)||this;return r.__textContent=t,r}return m0e(t,e),t.getType=function(){return"zeroWidth"},t.clone=function(e){return new t(e.__textContent,e.__key)},t.importJSON=function(e){return function(e){void 0===e&&(e="");var t=new hbt(e);return t.setMode("segmented"),dft(t)}()},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{text:"",type:"zeroWidth"})},t.prototype.updateDOM=function(){return!1},t.importDOM=function(){return null},t.prototype.exportDOM=function(e){return{element:null}},t.prototype.isTextEntity=function(){return!0},t.prototype.getTextContent=function(){return this.__textContent},t}(Hmt);function pbt(e){return e instanceof hbt}var fbt="\\.,\\*\\?\\$\\|#{}\\(\\)\\^\\[\\]\\\\/!%'\"~=<>_:;",mbt=function(e){return"(?:".concat(e.join("|"),")")},vbt=function(e,t){var n=0===e.length?"":"(?!".concat(e.join("|"),")");return"".concat(n,"[^\\s").concat(t,"]")};function gbt(e,t,n){return new RegExp(vbt(t,n)).test(e)}function bbt(e){for(var t=e.getNextSibling();null!==t&&pbt(t);)t=t.getNextSibling();return t}function ybt(e){for(var t=e.getPreviousSibling();null!==t&&pbt(t);)t=t.getPreviousSibling();return t}var wbt=function(){function e(e,t,n){this.value=e,this.displayValue=t,this.data=n,this.key=n?JSON.stringify(v0e(v0e({},n),{value:e})):e,this.displayValue=null!=t?t:e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}return e.prototype.setRefElement=function(e){this.ref={current:e}},e}(),xbt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ebt=xbt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;function kbt(e,t){return e.getEditorState().read((()=>{const e=xft(t);return null!==e&&e.isSelected()}))}xbt&&window.matchMedia("(pointer: coarse)").matches;var Sbt=Object.freeze({__proto__:null,useLexicalNodeSelection:function(t){const[n]=art(),[r,o]=e.useState((()=>kbt(n,t)));return e.useEffect((()=>{let e=!0;const r=n.registerUpdateListener((()=>{e&&o(kbt(n,t))}));return()=>{e=!1,r()}}),[n,t]),[r,e.useCallback((e=>{n.update((()=>{let n=Sft();Dft(n)||(n=pft(),Zft(n)),Dft(n)&&(e?n.add(t):n.delete(t))}))}),[n,t]),e.useCallback((()=>{n.update((()=>{const e=Sft();Dft(e)&&e.clear()}))}),[n])]}});function Cbt(e,t){return e.getEditorState().read((()=>{const e=xft(t);return null!==e&&e.isSelected()}))}var Mbt=Object.freeze({__proto__:null,useLexicalNodeSelection:function(t){const[n]=art(),[r,o]=e.useState((()=>Cbt(n,t)));return e.useEffect((()=>{let e=!0;const r=n.registerUpdateListener((()=>{e&&o(Cbt(n,t))}));return()=>{e=!1,r()}}),[n,t]),[r,e.useCallback((e=>{n.update((()=>{let n=Sft();Dft(n)||(n=pft(),Zft(n)),Dft(n)&&(e?n.add(t):n.delete(t))}))}),[n,t]),e.useCallback((()=>{n.update((()=>{const e=Sft();Dft(e)&&e.clear()}))}),[n])]}});const _bt=("development"===process.env.NODE_ENV?Sbt:Mbt).useLexicalNodeSelection;var Nbt=xbt?e.useLayoutEffect:e.useEffect;function Abt(t){var n=t.value,r=t.trigger,o=t.data,a=t.className,i=t.classNameFocused,l=t.classNames,s=t.nodeKey,c=t.component,u=art()[0],d=function(){var t=art()[0],n=e.useState((function(){return!!xbt&&t.getRootElement()===document.activeElement})),r=n[0],o=n[1];return Nbt((function(){return Vgt(t.registerCommand(dmt,(function(){return o(!0),!1}),Jft),t.registerCommand(Wft,(function(){return o(!1),!1}),Jft))}),[t]),r}(),h=_bt(s),p=h[0],f=h[1],m=h[2],v=e.useRef(null),g=r+n,b=e.useMemo((function(){if(a){var e=[a];return p&&d&&i&&e.push(i),e.join(" ").trim()||void 0}return""}),[p,a,i,d]),y=e.useCallback((function(e){if(p&&Dft(Sft())){e.preventDefault();var t=xft(s);Tbt(t)&&t.remove()}return!1}),[p,s]),w=e.useCallback((function(e){var t=xft(s);if(!t||!t.isSelected())return!1;var n=!1,r=ybt(t);return Aft(r)&&(r.selectEnd(),n=!0),zft(r)&&(r.select(),n=!0),Nft(r)&&(r.selectNext(),n=!0),null===r&&(t.selectPrevious(),n=!0),n&&e.preventDefault(),n}),[s]),E=e.useCallback((function(e){var t=xft(s);if(!t||!t.isSelected())return!1;var n=!1,r=bbt(t);return Aft(r)&&(r.selectStart(),n=!0),zft(r)&&(r.select(0,0),n=!0),Nft(r)&&(r.selectPrevious(),n=!0),null===r&&(t.selectNext(),n=!0),n&&e.preventDefault(),n}),[s]),k=e.useCallback((function(e){var t;return!(e.target!==v.current&&!(null===(t=v.current)||void 0===t?void 0:t.contains(e.target))||(e.shiftKey||m(),f(!0),0))}),[m,f]),S=e.useCallback((function(){var e=xft(s);if(!e||!e.isSelected())return!1;var t=Sft();return!!Dft(t)&&(Zft(null),!1)}),[s]),C=e.useCallback((function(){return!(!Ebt||!p||(f(!1),0))}),[p,f]);return e.useEffect((function(){var e=Vgt(u.registerCommand(Kft,k,Qft),u.registerCommand(kmt,y,Qft),u.registerCommand(Emt,y,Qft),u.registerCommand(ymt,w,Qft),u.registerCommand(wmt,E,Qft),u.registerCommand(Wft,S,Qft),u.registerCommand(Dmt,C,Qft));return function(){e()}}),[u,w,E,k,y,S,C]),c?x.default.createElement(c,{ref:v,trigger:r,value:n,data:o,className:b,"data-beautiful-mention":g},g):l?x.default.createElement("span",{ref:v,className:p&&l.containerFocused?l.containerFocused:l.container,"data-beautiful-mention":g},x.default.createElement("span",{className:l.trigger},r),x.default.createElement("span",{className:l.value},n)):x.default.createElement("span",{ref:v,className:b,"data-beautiful-mention":g},g)}function Obt(e){var t=e.getAttribute("data-lexical-beautiful-mention-trigger"),n=e.getAttribute("data-lexical-beautiful-mention-value"),r=void 0,o=e.getAttribute("data-lexical-beautiful-mention-data");if(o)try{r=JSON.parse(o)}catch(e){console.warn("Failed to parse data attribute of beautiful mention node",e)}return null!==t&&null!==n?{node:Pbt(t,n,r)}:null}var Ibt,Dbt=function(e){function t(t,n,r,o){var a=e.call(this,o)||this;return a.__trigger=t,a.__value=n,a.__data=r,a}return m0e(t,e),t.getType=function(){return"beautifulMention"},t.clone=function(e){return new t(e.__trigger,e.__value,e.__data,e.__key)},t.prototype.createDOM=function(){return document.createElement("span")},t.prototype.updateDOM=function(){return!1},t.prototype.exportDOM=function(){var e=document.createElement("span");return e.setAttribute("data-lexical-beautiful-mention","true"),e.setAttribute("data-lexical-beautiful-mention-trigger",this.__trigger),e.setAttribute("data-lexical-beautiful-mention-value",this.__value),this.__data&&e.setAttribute("data-lexical-beautiful-mention-data",JSON.stringify(this.__data)),e.textContent=this.getTextContent(),{element:e}},t.importDOM=function(){return{span:function(e){return e.hasAttribute("data-lexical-beautiful-mention")?{conversion:Obt,priority:1}:null}}},t.importJSON=function(e){return Pbt(e.trigger,e.value,e.data)},t.prototype.exportJSON=function(){var e=this.__data;return v0e(v0e({trigger:this.__trigger,value:this.__value},e?{data:e}:{}),{type:"beautifulMention",version:1})},t.prototype.getTextContent=function(){var e=this.getLatest();return e.__trigger+e.__value},t.prototype.getTrigger=function(){return this.getLatest().__trigger},t.prototype.getValue=function(){return this.getLatest().__value},t.prototype.setValue=function(e){this.getWritable().__value=e},t.prototype.getData=function(){return this.getLatest().__data},t.prototype.setData=function(e){this.getWritable().__data=e},t.prototype.component=function(){return null},t.prototype.decorate=function(e,t){var n=this.getCssClassesFromTheme(t),r=n.className,o=n.classNameFocused,a=n.classNames;return x.default.createElement(Abt,{nodeKey:this.getKey(),trigger:this.getTrigger(),value:this.getValue(),data:this.getData(),className:r,classNameFocused:o,classNames:a,component:this.component()})},t.prototype.getCssClassesFromTheme=function(e){var t=this,n=e.theme.beautifulMentions||{},r=Object.entries(n).find((function(e){var n=e[0];return new RegExp(n).test(t.__trigger)})),o=r&&r[0],a=r&&r[1],i="string"==typeof a?a:void 0;return{className:i,classNameFocused:i&&"string"==typeof n["".concat(o,"Focused")]?n["".concat(o,"Focused")]:void 0,classNames:r&&"string"!=typeof a?a:void 0}},t}(cmt);function Pbt(e,t,n){var r=new Dbt(e,t,n);return dft(r)}function Tbt(e){return e instanceof Dbt}function Hbt(e){var t=e.textContent;return null!==t?{node:zbt(t)}:null}zmt("INSERT_MENTION_COMMAND"),zmt("REMOVE_MENTIONS_COMMAND"),zmt("RENAME_MENTIONS_COMMAND"),zmt("OPEN_MENTION_MENU_COMMAND"),function(e){m0e((function(t,n,r,o){void 0===o&&(o={});var a=e.call(this,n,r,o)||this;return a.itemType=t,a.comboboxItem={itemType:t,value:n,displayValue:r,data:o},a.menuOption=new wbt(n,r,o),a}),e)}(wbt),function(e){m0e((function(t,n,r,o){var a=e.call(this,n,r,o)||this;return a.trigger=t,a.menuItem={trigger:t,value:n,displayValue:r,data:o},a}),e)}(wbt);var Lbt=function(e){function t(t,n,r){var o=e.call(this,null!=n?n:t,r)||this;return o.__mention=t,o}return m0e(t,e),t.getType=function(){return"mention"},t.clone=function(e){return new t(e.__mention,e.__text,e.__key)},t.importJSON=function(e){var t=zbt(e.mentionName);return t.setTextContent(e.text),t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{mentionName:this.__mention,type:"mention",version:1})},t.prototype.createDOM=function(t){var n=e.prototype.createDOM.call(this,t);return n.style.cssText="color: #0068ff; font-weight: 500",n.className="mention",n},t.prototype.exportDOM=function(){var e=document.createElement("span");return e.setAttribute("data-lexical-mention","true"),e.textContent=this.__text,{element:e}},t.importDOM=function(){return{span:function(e){return e.hasAttribute("data-lexical-mention")?{conversion:Hbt,priority:1}:null}}},t.prototype.isTextEntity=function(){return!0},t.prototype.canInsertTextBefore=function(){return!1},t.prototype.canInsertTextAfter=function(){return!1},t}(Hmt);function zbt(e){var t=new Lbt(e);return t.setMode("segmented").toggleDirectionless(),dft(t)}function Rbt(e){var t="";if(Aft(e))for(var n=0,r=e.getChildren();n<r.length;n++)t+=Rbt(r[n]);else Tbt(e)?t+="[".concat(e.getTextContent(),"]"):pbt(e)||(t+=e.getTextContent());return t}var Bbt=function(t){var n=t.onClick,r=t.children,o=art()[0],a=e.useCallback((function(){o.update((function(){var e=kft(),t=Rbt(e);n(t),e.clear()}))}),[o,n]);return x.default.createElement(M2e,{className:"send",outline:!0,style:{background:"none",border:0},onClick:function(){return a()}},r)},$bt=new Map,Zbt=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name=t,r.picture=n,r}return m0e(t,e),t}(ubt);function Vbt(e){var t=e.index,n=e.isSelected,r=e.onClick,o=e.onMouseEnter,a=e.option,i="item";return n&&(i+=" selected"),E.createElement("li",{key:a.key,tabIndex:-1,className:i,ref:a.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-".concat(t),onMouseEnter:o,onClick:r},a.picture,E.createElement("span",{className:"text"},a.name))}var jbt=function(t){var n=art()[0],r=t.items,o=t.targetContainer,a=fbt,i=!0,l=e.useState(null),s=l[0],c=l[1],u=function(t,n){var r=e.useState([]),o=r[0],a=r[1],i=function(e,t){setTimeout((function(){var r=n.filter((function(t){return t.name.toLowerCase().includes(e.toLowerCase())}));t(r)}),500)};return e.useEffect((function(){var e=$bt.get(t);null!==t?null!==e&&(void 0===e?($bt.set(t,null),i(t,(function(e){$bt.set(t,e),a(e)}))):a(e)):a([])}),[t]),o}(s,r),d=["@"],h=e.useMemo((function(){return u.map((function(e){return new Zbt(e.name,E.createElement("i",{className:"icon user"}))}))}),[u]),p=e.useCallback((function(e,t,r){n.update((function(){var n=zbt("@".concat(e.name));t&&t.replace(n),n.select(),r()}))}),[n]),f=e.useCallback((function(e){var t=function(e,t){var n=Sft();if(n&&Tft(n)){var r=n.anchor,o=n.focus,a=n.getNodes();if(r.key===o.key&&r.offset===o.offset&&0!==a.length){var i=a[0],l=pbt(i)?i.getPreviousSibling():i;if(l){var s=zft(l)&&l.isSimpleText(),c="text"===r.type?r.offset:0,u=function(e){return pbt(e)?"":e.getTextContent()}(l),d=0===c,h=u.length===c,p=u.charAt(c-1),f=u.charAt(c),m=gbt(p,e,t),v=gbt(f,e,t),g=/\s/.test(p),b=/\s/.test(f),y={node:l,offset:c,isTextNode:s,textContent:u,selection:n,prevNode:ybt(l),nextNode:bbt(l),cursorAtStartOfNode:d,cursorAtEndOfNode:h,wordCharBeforeCursor:m,wordCharAfterCursor:v,spaceBeforeCursor:g,spaceAfterCursor:b};return v0e(v0e({},y),s?{isTextNode:!0,node:l}:{isTextNode:!1,node:l})}}}}(d,a);if((null==t?void 0:t.isTextNode)&&t.wordCharAfterCursor)return null;var n=function(e,t,n,r,o){var a=function(e,t,n,r){return new RegExp("".concat((t?"(^|\\s|".concat(t,")("):"(^|\\s)(")+mbt(e),"((?:").concat(vbt(e,n)).concat(r?function(e){return"(?:\\.[ |$]|\\s|"+"[".concat(e,"]|")+")"}(n):"","){0,").concat(75,"})")+")$")}(t,n,r,o).exec(e);if(null!==a){var i=a[1],l=a[2],s=a[3];if(l.length>=1)return{leadOffset:a.index+i.length,matchingString:s,replaceableString:l}}return null}(e,d,"\\(",a,i);return n&&n.replaceableString?n:null}),["\\(",i,a,d]);return E.createElement(cbt,{anchorClassName:"mentions-class",onQueryChange:c,onSelectOption:p,triggerFn:f,options:h,menuRenderFn:function(e,t){var n=t.selectedIndex,r=t.selectOptionAndCleanUp,a=t.setHighlightedIndex;return e.current&&u.length?k.default.createPortal(E.createElement("div",{className:"typeahead-popover mentions-menu "},E.createElement("ul",null,h.map((function(e,t){return E.createElement(Vbt,{index:t,isSelected:n===t,onClick:function(){a(t),r(e)},onMouseEnter:function(){a(t)},key:e.key,option:e})})))),o.current):null}})},Wbt=function(t){var n=t.ignoreHistoryMergeTagChange,r=void 0===n||n,o=t.ignoreSelectionChange,a=void 0!==o&&o,i=t.onKeyDown,l=t.onEnter,s=art()[0];return e.useLayoutEffect((function(){var e=s.registerCommand(Smt,(function(e){return function(e){if(i){var t=Rbt(n=kft());i(e,t,s)}var n;!e.shiftKey&&"Enter"===e.code&&l&&(t=Rbt(n=kft()),l(t,s),n.clear())}(e),!1}),1);return function(){e()}}),[s,r,a,l,i]),null},Fbt=Object.freeze({__proto__:null,AutoFocusPlugin:function({defaultSelection:t}){const[n]=art();return e.useEffect((()=>{n.focus((()=>{const e=document.activeElement,t=n.getRootElement();null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,n]),null}}),qbt=Object.freeze({__proto__:null,AutoFocusPlugin:function({defaultSelection:t}){const[n]=art();return e.useEffect((()=>{n.focus((()=>{const e=document.activeElement,t=n.getRootElement();null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,n]),null}});const Ybt=("development"===process.env.NODE_ENV?Fbt:qbt).AutoFocusPlugin;var Ubt=function(e){function t(t,n,r){var o=e.call(this,n,r)||this;return o.__className=t,o}return m0e(t,e),t.getType=function(){return"emoji"},t.clone=function(e){return new t(e.__className,e.__text,e.__key)},t.prototype.createDOM=function(t){var n=document.createElement("span"),r=e.prototype.createDOM.call(this,t);return n.className=this.__className,r.className="emoji-inner",n.appendChild(r),n},t.prototype.updateDOM=function(t,n,r){var o=n.firstChild;return null===o||(e.prototype.updateDOM.call(this,t,o,r),!1)},t.importJSON=function(e){var t=Kbt(e.className,e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{className:this.getClassName(),type:"emoji"})},t.prototype.getClassName=function(){return this.getLatest().__className},t}(Hmt);function Kbt(e,t){var n=new Ubt(e,t).setMode("token");return dft(n)}var Gbt=new Map([[":)",["emoji happysmile","🙂"]],[":D",["emoji veryhappysmile","😀"]],[":(",["emoji unhappysmile","🙁"]],["<3",["emoji heart","❤"]]]);function Xbt(e){for(var t=e.getTextContent(),n=0;n<t.length;n++){var r=Gbt.get(t[n])||Gbt.get(t.slice(n,n+2));if(void 0!==r){var o=r[0],a=r[1],i=void 0;i=0===n?e.splitText(n+2)[0]:e.splitText(n,n+2)[1];var l=Kbt(o,a);return i.replace(l),l}}return null}function Qbt(e){for(var t=e;null!==t;){if(!t.isSimpleText())return;t=Xbt(t)}}function Jbt(){return function(t){e.useEffect((function(){if(!t.hasNodes([Ubt]))throw new Error("EmojisPlugin: EmojiNode not registered on editor");return t.registerNodeTransform(Hmt,Qbt)}),[t])}(art()[0]),null}var eyt=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.title=t,o.emoji=n,o.keywords=r.keywords||[],o}return m0e(t,e),t}(ubt);function tyt(e){var t=e.index,n=e.isSelected,r=e.onClick,o=e.onMouseEnter,a=e.option,i="item";return n&&(i+=" selected"),E.createElement("li",{key:a.key,tabIndex:-1,className:i,ref:a.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-".concat(t),onMouseEnter:o,onClick:r},E.createElement("span",{className:"text"},a.emoji," ",a.title))}function nyt(){var t=art()[0],n=e.useState(null),r=n[0],o=n[1],a=e.useState([])[0],i=e.useMemo((function(){return null!==a?a.map((function(e){var t=e.emoji,n=e.aliases,r=e.tags;return new eyt(n[0],t,{keywords:w0e(w0e([],n,!0),r,!0)})})):[]}),[a]),l=dbt(":",{minLength:0}),s=e.useMemo((function(){return i.filter((function(e){return null!==r?!(!new RegExp(r,"gi").exec(e.title)&&null===e.keywords)&&e.keywords.some((function(e){return new RegExp(r,"gi").exec(e)})):i})).slice(0,10)}),[i,r]),c=e.useCallback((function(e,n,r){t.update((function(){var t=Sft();Tft(t)&&null!==e&&(n&&n.remove(),t.insertNodes([gft(e.emoji)]),r())}))}),[t]);return E.createElement(cbt,{onQueryChange:o,onSelectOption:c,triggerFn:l,options:s,menuRenderFn:function(e,t){var n=t.selectedIndex,r=t.selectOptionAndCleanUp,o=t.setHighlightedIndex;return null===e.current||0===s.length?null:e.current&&s.length?S.createPortal(E.createElement("div",{className:"typeahead-popover emoji-menu"},E.createElement("ul",null,s.map((function(e,t){return E.createElement(tyt,{key:e.key,index:t,isSelected:n===t,onClick:function(){o(t),r(e)},onMouseEnter:function(){o(t)},option:e})})))),e.current):null}})}const ryt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var oyt=Object.freeze({__proto__:null,OnChangePlugin:function({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=art();return ryt((()=>{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:a,dirtyLeaves:i,prevEditorState:l,tags:s})=>{t&&0===a.size&&0===i.size||e&&s.has("history-merge")||l.isEmpty()||n(o,r,s)}))}),[r,e,t,n]),null}});const ayt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var iyt=Object.freeze({__proto__:null,OnChangePlugin:function({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=art();return ayt((()=>{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:a,dirtyLeaves:i,prevEditorState:l,tags:s})=>{t&&0===a.size&&0===i.size||e&&s.has("history-merge")||l.isEmpty()||n(o,r,s)}))}),[r,e,t,n]),null}});const lyt=("development"===process.env.NODE_ENV?oyt:iyt).OnChangePlugin,syt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function cyt(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}var uyt=Object.freeze({__proto__:null,default:function(){return function(t){const[n]=art(),r=e.useMemo((()=>t(n)),[n,t]),o=e.useRef(r.initialValueFn()),[a,i]=e.useState(o.current);return syt((()=>{const{initialValueFn:e,subscribe:t}=r,n=e();return o.current!==n&&(o.current=n,i(n)),t((e=>{o.current=e,i(e)}))}),[r,t]),a}(cyt)}});const dyt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function hyt(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}var pyt=Object.freeze({__proto__:null,default:function(){return function(t){const[n]=art(),r=e.useMemo((()=>t(n)),[n,t]),o=e.useRef(r.initialValueFn()),[a,i]=e.useState(o.current);return dyt((()=>{const{initialValueFn:e,subscribe:t}=r,n=e();return o.current!==n&&(o.current=n,i(n)),t((e=>{o.current=e,i(e)}))}),[r,t]),a}(hyt)}}),fyt=("development"===process.env.NODE_ENV?uyt:pyt).default;function myt(){return kft().getTextContent()}function vyt(e,t=!0){if(e)return!1;let n=myt();return t&&(n=n.trim()),""===n}function gyt(e){if(!vyt(e,!1))return!1;const t=kft().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(Nft(n))return!1;if(Aft(n)){if(!Pft(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!zft(n))return!1}}}return!0}var byt=Object.freeze({__proto__:null,$canShowPlaceholder:gyt,$canShowPlaceholderCurry:function(e){return()=>gyt(e)},$findTextIntersectionFromCharacters:function(e,t){let n=e.getFirstChild(),r=0;e:for(;null!==n;){if(Aft(n)){const e=n.getFirstChild();if(null!==e){n=e;continue}}else if(zft(n)){const e=n.getTextContentSize();if(r+e>t)return{node:n,offset:t-r};r+=e}const e=n.getNextSibling();if(null!==e){n=e;continue}let o=n.getParent();for(;null!==o;){const e=o.getNextSibling();if(null!==e){n=e;continue e}o=o.getParent()}break}return null},$isRootTextContentEmpty:vyt,$isRootTextContentEmptyCurry:function(e,t){return()=>vyt(e,t)},$rootTextContent:myt,registerLexicalTextEntity:function(e,t,n,r){const o=e=>e instanceof n,a=e=>{const t=gft(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)},i=e.registerNodeTransform(Hmt,(e=>{if(!e.isSimpleText())return;let n,i=e.getPreviousSibling(),l=e.getTextContent(),s=e;if(zft(i)){const n=i.getTextContent(),r=t(n+l);if(o(i)){if(null===r||0!==(e=>e.getLatest().__mode)(i))return void a(i);{const t=r.end-n.length;if(t>0){const r=n+l.slice(0,t);if(i.select(),i.setTextContent(r),t===l.length)e.remove();else{const n=l.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=t(l);let e,u=null===n?"":l.slice(n.end);if(l=u,""===u){const e=s.getNextSibling();if(zft(e)){u=s.getTextContent()+e.getTextContent();const n=t(u);if(null===n)return void(o(e)?a(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&zft(i)&&i.isTextEntity()){c+=n.end;continue}if(0===n.start?[e,s]=s.splitText(n.end):[,e,s]=s.splitText(n.start+c,n.end+c),void 0===e)throw Error("nodeToReplace should not be undefined. You may want to check splitOffsets passed to the splitText.");const d=r(e);if(d.setFormat(e.getFormat()),e.replace(d),null==s)return;c=0,i=d}})),l=e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void a(e);if(n.length>r.end)return void e.splitText(r.end);const i=e.getPreviousSibling();zft(i)&&i.isTextEntity()&&(a(i),a(e));const l=e.getNextSibling();zft(l)&&l.isTextEntity()&&(a(l),o(e)&&a(e))}));return[i,l]}});function yyt(){return kft().getTextContent()}function wyt(e,t=!0){if(e)return!1;let n=yyt();return t&&(n=n.trim()),""===n}function xyt(e){if(!wyt(e,!1))return!1;const t=kft().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(Nft(n))return!1;if(Aft(n)){if(!Pft(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!zft(n))return!1}}}return!0}var Eyt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})),kyt=Object.freeze({__proto__:null,$canShowPlaceholder:xyt,$canShowPlaceholderCurry:function(e){return()=>xyt(e)},$findTextIntersectionFromCharacters:function(e,t){let n=e.getFirstChild(),r=0;e:for(;null!==n;){if(Aft(n)){const e=n.getFirstChild();if(null!==e){n=e;continue}}else if(zft(n)){const e=n.getTextContentSize();if(r+e>t)return{node:n,offset:t-r};r+=e}const e=n.getNextSibling();if(null!==e){n=e;continue}let o=n.getParent();for(;null!==o;){const e=o.getNextSibling();if(null!==e){n=e;continue e}o=o.getParent()}break}return null},$isRootTextContentEmpty:wyt,$isRootTextContentEmptyCurry:function(e,t){return()=>wyt(e,t)},$rootTextContent:yyt,registerLexicalTextEntity:function(e,t,n,r){const o=e=>e instanceof n,a=e=>{const t=gft(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)};return[e.registerNodeTransform(Hmt,(e=>{if(!e.isSimpleText())return;let n,i=e.getPreviousSibling(),l=e.getTextContent(),s=e;if(zft(i)){const n=i.getTextContent(),r=t(n+l);if(o(i)){if(null===r||0!==(e=>e.getLatest().__mode)(i))return void a(i);{const t=r.end-n.length;if(t>0){const r=n+l.slice(0,t);if(i.select(),i.setTextContent(r),t===l.length)e.remove();else{const n=l.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=t(l);let e,u=null===n?"":l.slice(n.end);if(l=u,""===u){const e=s.getNextSibling();if(zft(e)){u=s.getTextContent()+e.getTextContent();const n=t(u);if(null===n)return void(o(e)?a(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&zft(i)&&i.isTextEntity()){c+=n.end;continue}0===n.start?[e,s]=s.splitText(n.end):[,e,s]=s.splitText(n.start+c,n.end+c),void 0===e&&Eyt(165,"nodeToReplace");const d=r(e);if(d.setFormat(e.getFormat()),e.replace(d),null==s)return;c=0,i=d}})),e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void a(e);if(n.length>r.end)return void e.splitText(r.end);const i=e.getPreviousSibling();zft(i)&&i.isTextEntity()&&(a(i),a(e));const l=e.getNextSibling();zft(l)&&l.isTextEntity()&&(a(l),o(e)&&a(e))}))]}});const Syt="development"===process.env.NODE_ENV?byt:kyt;Syt.$canShowPlaceholder;const Cyt=Syt.$canShowPlaceholderCurry;Syt.$findTextIntersectionFromCharacters,Syt.$isRootTextContentEmpty,Syt.$isRootTextContentEmptyCurry,Syt.$rootTextContent,Syt.registerLexicalTextEntity;var Myt=Object.freeze({__proto__:null,registerDragonSupport:function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,a,i,l,s]=t;e.update((()=>{const e=Sft();if(Tft(e)){const t=e.anchor;let s=t.getNode(),c=0,u=0;if(zft(s)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(s,c,s,u)),c===u&&""===a||(e.insertRawText(a),s=t.getNode()),zft(s)){c=i,u=i+l;const t=s.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(s,c,s,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}}),_yt=Object.freeze({__proto__:null,registerDragonSupport:function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,a,i,l,s]=t;e.update((()=>{const e=Sft();if(Tft(e)){const t=e.anchor;let s=t.getNode(),c=0,u=0;if(zft(s)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(s,c,s,u)),c===u&&""===a||(e.insertRawText(a),s=t.getNode()),zft(s)){c=i,u=i+l;const t=s.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(s,c,s,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}});const Nyt=("development"===process.env.NODE_ENV?Myt:_yt).registerDragonSupport;function Ayt(e,t,n,r=null){let o=null===r||t.isSelected(r);const a=Aft(t)&&t.excludeFromCopy("html");let i=t;if(null!==r){let e=Mvt(t);e=zft(e)&&null!==r?Avt(r,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=e._nodes.get(i.getType());let c;c=s&&void 0!==s.exportDOM?s.exportDOM(e,i):i.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<l.length;n++){const a=l[n],i=Ayt(e,a,h,r);!o&&Aft(t)&&i&&t.extractWithChild(a,r,"html")&&(o=!0)}if(o&&!a){if(Zgt(u)&&u.append(h),n.append(u),d){const e=d.call(i,u);e&&u.replaceWith(e)}}else n.append(h);return o}const Oyt=new Set(["STYLE","SCRIPT"]);function Iyt(e,t,n,r,o=new Map,a){let i=[];if(Oyt.has(e.nodeName))return i;let l=null;const s=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=s?s(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(l=Array.isArray(t)?t[t.length-1]:t,null!==l){for(const[,e]of o)if(l=e(l,a),!l)break;l&&i.push(...Array.isArray(t)?t:[l])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==l||!Lft(l))&&(null!=l&&_ft(l)||r);for(let e=0;e<d.length;e++)h.push(...Iyt(d[e],t,n,p,new Map(o),l));return null!=u&&(h=u(h)),$gt(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let a=[];for(let e=0;e<t.length;e++){const i=t[e];if(_ft(i))i.setFormat(r),o.push(i);else if(a.push(i),e===t.length-1||e<t.length-1&&_ft(t[e+1])){const e=n();e.setFormat(r),e.append(...a),o.push(e),a=[]}}return o}(e,h,p?()=>{const e=new jft;return n.push(e),e}:fft)),null==l?i=i.concat(h):Aft(l)&&l.append(...h),i}var Dyt=Object.freeze({__proto__:null,$generateHtmlFromNodes:function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=kft().getChildren();for(let o=0;o<r.length;o++)Ayt(e,r[o],n,t);return n.innerHTML},$generateNodesFromDOM:function(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const a=n[t];if(!Oyt.has(a.nodeName)){const t=Iyt(a,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof jft&&t.insertAfter(hft());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}});function Pyt(e,t,n,r=null){let o=null===r||t.isSelected(r);const a=Aft(t)&&t.excludeFromCopy("html");let i=t;if(null!==r){let e=Mvt(t);e=zft(e)&&null!==r?Avt(r,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=e._nodes.get(i.getType());let c;c=s&&void 0!==s.exportDOM?s.exportDOM(e,i):i.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<l.length;n++){const a=l[n],i=Pyt(e,a,h,r);!o&&Aft(t)&&i&&t.extractWithChild(a,r,"html")&&(o=!0)}if(o&&!a){if(Zgt(u)&&u.append(h),n.append(u),d){const e=d.call(i,u);e&&u.replaceWith(e)}}else n.append(h);return o}const Tyt=new Set(["STYLE","SCRIPT"]);function Hyt(e,t,n,r,o=new Map,a){let i=[];if(Tyt.has(e.nodeName))return i;let l=null;const s=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=s?s(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(l=Array.isArray(t)?t[t.length-1]:t,null!==l){for(const[,e]of o)if(l=e(l,a),!l)break;l&&i.push(...Array.isArray(t)?t:[l])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==l||!Lft(l))&&(null!=l&&_ft(l)||r);for(let e=0;e<d.length;e++)h.push(...Hyt(d[e],t,n,p,new Map(o),l));return null!=u&&(h=u(h)),$gt(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let a=[];for(let e=0;e<t.length;e++){const i=t[e];if(_ft(i))i.setFormat(r),o.push(i);else if(a.push(i),e===t.length-1||e<t.length-1&&_ft(t[e+1])){const e=n();e.setFormat(r),e.append(...a),o.push(e),a=[]}}return o}(e,h,p?()=>{const e=new jft;return n.push(e),e}:fft)),null==l?i=i.concat(h):Aft(l)&&l.append(...h),i}var Lyt=Object.freeze({__proto__:null,$generateHtmlFromNodes:function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=kft().getChildren();for(let o=0;o<r.length;o++)Pyt(e,r[o],n,t);return n.innerHTML},$generateNodesFromDOM:function(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const a=n[t];if(!Tyt.has(a.nodeName)){const t=Hyt(a,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof jft&&t.insertAfter(hft());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}});const zyt="development"===process.env.NODE_ENV?Dyt:Lyt,Ryt=zyt.$generateHtmlFromNodes,Byt=zyt.$generateNodesFromDOM,$yt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Zyt=e=>$yt?(e||window).getSelection():null;function Vyt(e){const t=Sft();if(null==t)throw Error("Expected valid LexicalSelection");return Tft(t)&&t.isCollapsed()||0===t.getNodes().length?"":Ryt(e,t)}function jyt(e){const t=Sft();if(null==t)throw Error("Expected valid LexicalSelection");return Tft(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(qyt(e,t))}function Wyt(e,t,n){e.dispatchCommand(Pmt,{nodes:t,selection:n})||n.insertNodes(t)}function Fyt(e,t,n,r=[]){let o=null===t||n.isSelected(t);const a=Aft(n)&&n.excludeFromCopy("html");let i=n;if(null!==t){let e=Mvt(n);e=zft(e)&&null!==t?Avt(t,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not implement .exportJSON().`);if(Aft(e)){const e=t.children;if(!Array.isArray(e))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`)}return t}(i);if(zft(i)){const e=i.__text;e.length>0?s.text=e:o=!1}for(let r=0;r<l.length;r++){const a=l[r],i=Fyt(e,t,a,s.children);!o&&Aft(n)&&i&&n.extractWithChild(a,t,"clone")&&(o=!0)}if(o&&!a)r.push(s);else if(Array.isArray(s.children))for(let e=0;e<s.children.length;e++){const t=s.children[e];r.push(t)}return o}function qyt(e,t){const n=[],r=kft().getChildren();for(let o=0;o<r.length;o++)Fyt(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function Yyt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Bft(r);zft(o)&&Cvt(o),t.push(o)}return t}let Uyt=null;function Kyt(e,t){const n=Zyt(e._window);if(!n)return!1;const r=n.anchorNode,o=n.focusNode;if(null!==r&&null!==o&&!Wmt(e,r,o))return!1;t.preventDefault();const a=t.clipboardData,i=Sft();if(null===a||null===i)return!1;const l=Vyt(e),s=jyt(e);let c="";return null!==i&&(c=i.getTextContent()),null!==l&&a.setData("text/html",l),null!==s&&a.setData("application/x-lexical-editor",s),a.setData("text/plain",c),!0}var Gyt=Object.freeze({__proto__:null,$generateJSONFromSelectedNodes:qyt,$generateNodesFromSerializedNodes:Yyt,$getHtmlContent:Vyt,$getLexicalContent:jyt,$insertDataTransferForPlainText:function(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)},$insertDataTransferForRichText:function(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Wyt(n,Yyt(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return Wyt(n,Byt(n,e),t)}catch(e){}const a=e.getData("text/plain")||e.getData("text/uri-list");if(null!=a)if(Tft(t)){const e=a.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=Sft();if(Tft(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([vft()]):n.insertText(r)}}}else t.insertRawText(a)},$insertGeneratedNodes:Wyt,copyToClipboard:async function(e,t){if(null!==Uyt)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(Kyt(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,o=Zyt(e._window);if(null===n||null===o)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const i=new Range;return i.setStart(a,0),i.setEnd(a,1),o.removeAllRanges(),o.addRange(i),new Promise(((t,n)=>{const o=e.registerCommand(tmt,(n=>(jgt(n,ClipboardEvent)&&(o(),null!==Uyt&&(window.clearTimeout(Uyt),Uyt=null),t(Kyt(e,n))),!0)),Gft);Uyt=window.setTimeout((()=>{o(),Uyt=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}}),Xyt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const Qyt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jyt=e=>Qyt?(e||window).getSelection():null;function ewt(e){const t=Sft();return null==t&&Xyt(166),Tft(t)&&t.isCollapsed()||0===t.getNodes().length?"":Ryt(e,t)}function twt(e){const t=Sft();return null==t&&Xyt(166),Tft(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(owt(e,t))}function nwt(e,t,n){e.dispatchCommand(Pmt,{nodes:t,selection:n})||n.insertNodes(t)}function rwt(e,t,n,r=[]){let o=null===t||n.isSelected(t);const a=Aft(n)&&n.excludeFromCopy("html");let i=n;if(null!==t){let e=Mvt(n);e=zft(e)&&null!==t?Avt(t,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Xyt(58,n.name),Aft(e)){const e=t.children;Array.isArray(e)||Xyt(59,n.name)}return t}(i);if(zft(i)){const e=i.__text;e.length>0?s.text=e:o=!1}for(let r=0;r<l.length;r++){const a=l[r],i=rwt(e,t,a,s.children);!o&&Aft(n)&&i&&n.extractWithChild(a,t,"clone")&&(o=!0)}if(o&&!a)r.push(s);else if(Array.isArray(s.children))for(let e=0;e<s.children.length;e++){const t=s.children[e];r.push(t)}return o}function owt(e,t){const n=[],r=kft().getChildren();for(let o=0;o<r.length;o++)rwt(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function awt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Bft(r);zft(o)&&Cvt(o),t.push(o)}return t}let iwt=null;function lwt(e,t){const n=Jyt(e._window);if(!n)return!1;const r=n.anchorNode,o=n.focusNode;if(null!==r&&null!==o&&!Wmt(e,r,o))return!1;t.preventDefault();const a=t.clipboardData,i=Sft();if(null===a||null===i)return!1;const l=ewt(e),s=twt(e);let c="";return null!==i&&(c=i.getTextContent()),null!==l&&a.setData("text/html",l),null!==s&&a.setData("application/x-lexical-editor",s),a.setData("text/plain",c),!0}var swt=Object.freeze({__proto__:null,$generateJSONFromSelectedNodes:owt,$generateNodesFromSerializedNodes:awt,$getHtmlContent:ewt,$getLexicalContent:twt,$insertDataTransferForPlainText:function(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)},$insertDataTransferForRichText:function(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return nwt(n,awt(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return nwt(n,Byt(n,e),t)}catch(e){}const a=e.getData("text/plain")||e.getData("text/uri-list");if(null!=a)if(Tft(t)){const e=a.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=Sft();if(Tft(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([vft()]):n.insertText(r)}}}else t.insertRawText(a)},$insertGeneratedNodes:nwt,copyToClipboard:async function(e,t){if(null!==iwt)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(lwt(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,o=Jyt(e._window);if(null===n||null===o)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const i=new Range;return i.setStart(a,0),i.setEnd(a,1),o.removeAllRanges(),o.addRange(i),new Promise(((t,n)=>{const o=e.registerCommand(tmt,(n=>(jgt(n,ClipboardEvent)&&(o(),null!==iwt&&(window.clearTimeout(iwt),iwt=null),t(lwt(e,n))),!0)),Gft);iwt=window.setTimeout((()=>{o(),iwt=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}});const cwt="development"===process.env.NODE_ENV?Gyt:swt;cwt.$generateJSONFromSelectedNodes,cwt.$generateNodesFromSerializedNodes,cwt.$getHtmlContent,cwt.$getLexicalContent,cwt.$insertDataTransferForPlainText;const uwt=cwt.$insertDataTransferForRichText;cwt.$insertGeneratedNodes;const dwt=cwt.copyToClipboard;function hwt(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const pwt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fwt=pwt&&"documentMode"in document?document.documentMode:null,mwt=!(!pwt||!("InputEvent"in window)||fwt)&&"getTargetRanges"in new window.InputEvent("input"),vwt=pwt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gwt=pwt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,bwt=pwt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ywt=pwt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!bwt,wwt=zmt("DRAG_DROP_PASTE_FILE");class xwt extends umt{static getType(){return"quote"}static clone(e){return new xwt(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return Bgt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Mwt,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Ewt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=fft(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=fft();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function Ewt(){return dft(new xwt)}class kwt extends umt{static getType(){return"heading"}static clone(e){return new kwt(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];Bgt(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:Cwt,priority:0}),h2:e=>({conversion:Cwt,priority:0}),h3:e=>({conversion:Cwt,priority:0}),h4:e=>({conversion:Cwt,priority:0}),h5:e=>({conversion:Cwt,priority:0}),h6:e=>({conversion:Cwt,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Swt(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Swt(e)?{conversion:e=>({node:_wt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=_wt(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?_wt(this.getTag()):fft(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=fft();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?fft():_wt(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function Swt(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Cwt(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=_wt(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function Mwt(e){const t=Ewt();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function _wt(e){return dft(new kwt(e))}function Nwt(e){let t=null;if(jgt(e,DragEvent)?t=e.dataTransfer:jgt(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Awt(e){const t=Sft();if(!Tft(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],a=o.getKey();if(n.has(a))continue;const i=zgt(o,(e=>Aft(e)&&!e.isInline()));if(null===i)continue;const l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function Owt(e){const t=wft(e);return Nft(t)}var Iwt=Object.freeze({__proto__:null,$createHeadingNode:_wt,$createQuoteNode:Ewt,$isHeadingNode:function(e){return e instanceof kwt},$isQuoteNode:function(e){return e instanceof xwt},DRAG_DROP_PASTE:wwt,HeadingNode:kwt,QuoteNode:xwt,eventFiles:Nwt,registerRichText:function(e){const t=Vgt(e.registerCommand(Kft,(e=>{const t=Sft();return!!Dft(t)&&(t.clear(),!0)}),0),e.registerCommand(rmt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteCharacter(e),!0)}),Xft),e.registerCommand(amt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteWord(e),!0)}),Xft),e.registerCommand(omt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteLine(e),!0)}),Xft),e.registerCommand(emt,(t=>{const n=Sft();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)uwt(r,n,e);else if(Tft(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),Xft),e.registerCommand(Imt,(()=>{const e=Sft();return!!Tft(e)&&(e.removeText(),!0)}),Xft),e.registerCommand(pmt,(e=>{const t=Sft();return!!Tft(t)&&(t.formatText(e),!0)}),Xft),e.registerCommand(hmt,(e=>{const t=Sft();if(!Tft(t)&&!Dft(t))return!1;const n=t.getNodes();for(const t of n){const n=zgt(t,(e=>Aft(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),Xft),e.registerCommand(mmt,(e=>{const t=Sft();return!!Tft(t)&&(t.insertLineBreak(e),!0)}),Xft),e.registerCommand(vmt,(()=>{const e=Sft();return!!Tft(e)&&(e.insertParagraph(),!0)}),Xft),e.registerCommand(gmt,(()=>(Mft([vft()]),!0)),Xft),e.registerCommand(fmt,(()=>Awt((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Xft),e.registerCommand(Nmt,(()=>Awt((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),Xft),e.registerCommand(xmt,(e=>{const t=Sft();if(Dft(t)&&!Owt(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(Tft(t)){const n=bft(t.focus,!0);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(bmt,(e=>{const t=Sft();if(Dft(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(Tft(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===kft().getChildrenSize()}(t))return e.preventDefault(),!0;const n=bft(t.focus,!1);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(ymt,(e=>{const t=Sft();if(Dft(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!Tft(t))return!1;if(Nvt(t,!0)){const n=e.shiftKey;return e.preventDefault(),_vt(t,n,!0),!0}return!1}),Xft),e.registerCommand(wmt,(e=>{const t=Sft();if(Dft(t)&&!Owt(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!Tft(t))return!1;const n=e.shiftKey;return!!Nvt(t,!1)&&(e.preventDefault(),_vt(t,n,!1),!0)}),Xft),e.registerCommand(Emt,(t=>{if(Owt(t.target))return!1;const n=Sft();if(!Tft(n))return!1;t.preventDefault();const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!Hft(o)&&Rgt(o).getIndent()>0?e.dispatchCommand(Nmt,void 0):e.dispatchCommand(rmt,!0)}),Xft),e.registerCommand(kmt,(t=>{if(Owt(t.target))return!1;const n=Sft();return!!Tft(n)&&(t.preventDefault(),e.dispatchCommand(rmt,!1))}),Xft),e.registerCommand(Cmt,(t=>{const n=Sft();if(!Tft(n))return!1;if(null!==t){if((gwt||vwt||ywt)&&mwt)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mmt,!1)}return e.dispatchCommand(vmt,void 0)}),Xft),e.registerCommand(Mmt,(()=>{const t=Sft();return!!Tft(t)&&(e.blur(),!0)}),Xft),e.registerCommand(smt,(t=>{const[,n]=Nwt(t);if(n.length>0){const r=hwt(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,a=wft(o);if(null!==a){const e=mft();if(zft(a))e.anchor.set(a.getKey(),t,"text"),e.focus.set(a.getKey(),t,"text");else{const t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Rft(e);Zft(n)}e.dispatchCommand(wwt,n)}return t.preventDefault(),!0}const r=Sft();return!!Tft(r)}),Xft),e.registerCommand(lmt,(e=>{const[t]=Nwt(e),n=Sft();return!(t&&!Tft(n))}),Xft),e.registerCommand(imt,(e=>{const[t]=Nwt(e),n=Sft();if(t&&!Tft(n))return!1;const r=hwt(e.clientX,e.clientY);if(null!==r){const t=wft(r.node);Nft(t)&&e.preventDefault()}return!0}),Xft),e.registerCommand(Tmt,(()=>($ft(),!0)),Xft),e.registerCommand(tmt,(t=>(dwt(e,jgt(t,ClipboardEvent)?t:null),!0)),Xft),e.registerCommand(nmt,(t=>(async function(e,t){await dwt(t,jgt(e,ClipboardEvent)?e:null),t.update((()=>{const e=Sft();Tft(e)?e.removeText():Dft(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Xft),e.registerCommand(Amt,(t=>{const[,n,r]=Nwt(t);return n.length>0&&!r?(e.dispatchCommand(wwt,n),!0):!jmt(t.target)&&(null!==Sft()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=Sft(),r=jgt(e,InputEvent)||jgt(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&uwt(r,n,t)}),{tag:"paste"})}(t,e),!0))}),Xft));return t}});function Dwt(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const Pwt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Twt=Pwt&&"documentMode"in document?document.documentMode:null,Hwt=!(!Pwt||!("InputEvent"in window)||Twt)&&"getTargetRanges"in new window.InputEvent("input"),Lwt=Pwt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zwt=Pwt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Rwt=Pwt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Bwt=Pwt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Rwt,$wt=zmt("DRAG_DROP_PASTE_FILE");class Zwt extends umt{static getType(){return"quote"}static clone(e){return new Zwt(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return Bgt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:qwt,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Vwt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=fft(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=fft();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function Vwt(){return dft(new Zwt)}class jwt extends umt{static getType(){return"heading"}static clone(e){return new jwt(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];Bgt(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:Fwt,priority:0}),h2:e=>({conversion:Fwt,priority:0}),h3:e=>({conversion:Fwt,priority:0}),h4:e=>({conversion:Fwt,priority:0}),h5:e=>({conversion:Fwt,priority:0}),h6:e=>({conversion:Fwt,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Wwt(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Wwt(e)?{conversion:e=>({node:Ywt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Ywt(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?Ywt(this.getTag()):fft(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=fft();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?fft():Ywt(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function Wwt(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Fwt(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=Ywt(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function qwt(e){const t=Vwt();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function Ywt(e){return dft(new jwt(e))}function Uwt(e){let t=null;if(jgt(e,DragEvent)?t=e.dataTransfer:jgt(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Kwt(e){const t=Sft();if(!Tft(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],a=o.getKey();if(n.has(a))continue;const i=zgt(o,(e=>Aft(e)&&!e.isInline()));if(null===i)continue;const l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function Gwt(e){const t=wft(e);return Nft(t)}var Xwt=Object.freeze({__proto__:null,$createHeadingNode:Ywt,$createQuoteNode:Vwt,$isHeadingNode:function(e){return e instanceof jwt},$isQuoteNode:function(e){return e instanceof Zwt},DRAG_DROP_PASTE:$wt,HeadingNode:jwt,QuoteNode:Zwt,eventFiles:Uwt,registerRichText:function(e){return Vgt(e.registerCommand(Kft,(e=>{const t=Sft();return!!Dft(t)&&(t.clear(),!0)}),0),e.registerCommand(rmt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteCharacter(e),!0)}),Xft),e.registerCommand(amt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteWord(e),!0)}),Xft),e.registerCommand(omt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteLine(e),!0)}),Xft),e.registerCommand(emt,(t=>{const n=Sft();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)uwt(r,n,e);else if(Tft(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),Xft),e.registerCommand(Imt,(()=>{const e=Sft();return!!Tft(e)&&(e.removeText(),!0)}),Xft),e.registerCommand(pmt,(e=>{const t=Sft();return!!Tft(t)&&(t.formatText(e),!0)}),Xft),e.registerCommand(hmt,(e=>{const t=Sft();if(!Tft(t)&&!Dft(t))return!1;const n=t.getNodes();for(const t of n){const n=zgt(t,(e=>Aft(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),Xft),e.registerCommand(mmt,(e=>{const t=Sft();return!!Tft(t)&&(t.insertLineBreak(e),!0)}),Xft),e.registerCommand(vmt,(()=>{const e=Sft();return!!Tft(e)&&(e.insertParagraph(),!0)}),Xft),e.registerCommand(gmt,(()=>(Mft([vft()]),!0)),Xft),e.registerCommand(fmt,(()=>Kwt((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Xft),e.registerCommand(Nmt,(()=>Kwt((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),Xft),e.registerCommand(xmt,(e=>{const t=Sft();if(Dft(t)&&!Gwt(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(Tft(t)){const n=bft(t.focus,!0);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(bmt,(e=>{const t=Sft();if(Dft(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(Tft(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===kft().getChildrenSize()}(t))return e.preventDefault(),!0;const n=bft(t.focus,!1);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(ymt,(e=>{const t=Sft();if(Dft(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!Tft(t))return!1;if(Nvt(t,!0)){const n=e.shiftKey;return e.preventDefault(),_vt(t,n,!0),!0}return!1}),Xft),e.registerCommand(wmt,(e=>{const t=Sft();if(Dft(t)&&!Gwt(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!Tft(t))return!1;const n=e.shiftKey;return!!Nvt(t,!1)&&(e.preventDefault(),_vt(t,n,!1),!0)}),Xft),e.registerCommand(Emt,(t=>{if(Gwt(t.target))return!1;const n=Sft();if(!Tft(n))return!1;t.preventDefault();const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!Hft(o)&&Rgt(o).getIndent()>0?e.dispatchCommand(Nmt,void 0):e.dispatchCommand(rmt,!0)}),Xft),e.registerCommand(kmt,(t=>{if(Gwt(t.target))return!1;const n=Sft();return!!Tft(n)&&(t.preventDefault(),e.dispatchCommand(rmt,!1))}),Xft),e.registerCommand(Cmt,(t=>{const n=Sft();if(!Tft(n))return!1;if(null!==t){if((zwt||Lwt||Bwt)&&Hwt)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mmt,!1)}return e.dispatchCommand(vmt,void 0)}),Xft),e.registerCommand(Mmt,(()=>{const t=Sft();return!!Tft(t)&&(e.blur(),!0)}),Xft),e.registerCommand(smt,(t=>{const[,n]=Uwt(t);if(n.length>0){const r=Dwt(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,a=wft(o);if(null!==a){const e=mft();if(zft(a))e.anchor.set(a.getKey(),t,"text"),e.focus.set(a.getKey(),t,"text");else{const t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Rft(e);Zft(n)}e.dispatchCommand($wt,n)}return t.preventDefault(),!0}const r=Sft();return!!Tft(r)}),Xft),e.registerCommand(lmt,(e=>{const[t]=Uwt(e),n=Sft();return!(t&&!Tft(n))}),Xft),e.registerCommand(imt,(e=>{const[t]=Uwt(e),n=Sft();if(t&&!Tft(n))return!1;const r=Dwt(e.clientX,e.clientY);if(null!==r){const t=wft(r.node);Nft(t)&&e.preventDefault()}return!0}),Xft),e.registerCommand(Tmt,(()=>($ft(),!0)),Xft),e.registerCommand(tmt,(t=>(dwt(e,jgt(t,ClipboardEvent)?t:null),!0)),Xft),e.registerCommand(nmt,(t=>(async function(e,t){await dwt(t,jgt(e,ClipboardEvent)?e:null),t.update((()=>{const e=Sft();Tft(e)?e.removeText():Dft(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Xft),e.registerCommand(Amt,(t=>{const[,n,r]=Uwt(t);return n.length>0&&!r?(e.dispatchCommand($wt,n),!0):!jmt(t.target)&&null!==Sft()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=Sft(),r=jgt(e,InputEvent)||jgt(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&uwt(r,n,t)}),{tag:"paste"})}(t,e),!0)}),Xft))}});const Qwt="development"===process.env.NODE_ENV?Iwt:Xwt;Qwt.$createHeadingNode,Qwt.$createQuoteNode,Qwt.$isHeadingNode,Qwt.$isQuoteNode,Qwt.DRAG_DROP_PASTE,Qwt.HeadingNode,Qwt.QuoteNode,Qwt.eventFiles;const Jwt=Qwt.registerRichText,ext="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function txt(e){return e.getEditorState().read(Cyt(e.isComposing()))}function nxt({content:t}){const[n]=art(),r=function(t){const[n,r]=e.useState((()=>txt(t)));return ext((()=>{function e(){const e=txt(t);r(e)}return e(),Vgt(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),n}(n),o=fyt();return r?"function"==typeof t?t(o):t:null}var rxt=Object.freeze({__proto__:null,RichTextPlugin:function({contentEditable:n,placeholder:r,ErrorBoundary:o}){const[a]=art(),i=function(n,r){const[o,a]=e.useState((()=>n.getDecorators()));return ext((()=>n.registerDecoratorListener((e=>{t.flushSync((()=>{a(e)}))}))),[n]),e.useEffect((()=>{a(n.getDecorators())}),[n]),e.useMemo((()=>{const a=[],i=Object.keys(o);for(let l=0;l<i.length;l++){const s=i[l],c=E.createElement(r,{onError:e=>n._onError(e)},E.createElement(e.Suspense,{fallback:null},o[s])),u=n.getElementByKey(s);null!==u&&a.push(t.createPortal(c,u,s))}return a}),[r,o,n])}(a,o);return function(e){ext((()=>Vgt(Jwt(e),Nyt(e))),[e])}(a),E.createElement(E.Fragment,null,n,E.createElement(nxt,{content:r}),i)}});const oxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function axt(e){return e.getEditorState().read(Cyt(e.isComposing()))}function ixt({content:t}){const[n]=art(),r=function(t){const[n,r]=e.useState((()=>axt(t)));return oxt((()=>{function e(){const e=axt(t);r(e)}return e(),Vgt(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),n}(n),o=fyt();return r?"function"==typeof t?t(o):t:null}var lxt=Object.freeze({__proto__:null,RichTextPlugin:function({contentEditable:n,placeholder:r,ErrorBoundary:o}){const[a]=art(),i=function(n,r){const[o,a]=e.useState((()=>n.getDecorators()));return oxt((()=>n.registerDecoratorListener((e=>{t.flushSync((()=>{a(e)}))}))),[n]),e.useEffect((()=>{a(n.getDecorators())}),[n]),e.useMemo((()=>{const a=[],i=Object.keys(o);for(let l=0;l<i.length;l++){const s=i[l],c=E.createElement(r,{onError:e=>n._onError(e)},E.createElement(e.Suspense,{fallback:null},o[s])),u=n.getElementByKey(s);null!==u&&a.push(t.createPortal(c,u,s))}return a}),[r,o,n])}(a,o);return function(e){oxt((()=>Vgt(Jwt(e),Nyt(e))),[e])}(a),E.createElement(E.Fragment,null,n,E.createElement(ixt,{content:r}),i)}});const sxt=("development"===process.env.NODE_ENV?rxt:lxt).RichTextPlugin;function cxt(e,t){return cxt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cxt(e,t)}var uxt={error:null},dxt=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=uxt,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,cxt(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(uxt)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,o=this.state.error,a=this.props.resetKeys;null!==o&&null!==t.error&&function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),e.length!==t.length||e.some((function(e,n){return!Object.is(e,t[n])}))}(e.resetKeys,a)&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(a);if(r)return E.createElement(r,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(E.Component),hxt=Object.freeze({__proto__:null,default:function({children:e,onError:t}){return E.createElement(dxt,{fallback:E.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},e)}});function pxt(e,t){return pxt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pxt(e,t)}var fxt={error:null},mxt=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=fxt,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,pxt(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(fxt)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,o,a,i=this.state.error,l=this.props.resetKeys;null!==i&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(a=l)&&(a=[]),o.length!==a.length||o.some((function(e,t){return!Object.is(e,a[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,l),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(a);if(r)return E.createElement(r,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(E.Component),vxt=Object.freeze({__proto__:null,default:function({children:e,onError:t}){return E.createElement(mxt,{fallback:E.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},e)}}),gxt=("development"===process.env.NODE_ENV?hxt:vxt).default;function bxt(){return bxt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bxt.apply(this,arguments)}const yxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var wxt=Object.freeze({__proto__:null,ContentEditable:function({ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:a,ariaLabel:i,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:h,id:p,role:f="textbox",spellCheck:m=!0,style:v,tabIndex:g,"data-testid":b,...y}){const[w]=art(),[x,k]=e.useState(!1),S=e.useCallback((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&w.setRootElement(e)}),[w]);return yxt((()=>(k(w.isEditable()),w.registerEditableListener((e=>{k(e)})))),[w]),E.createElement("div",bxt({},y,{"aria-activedescendant":x?t:void 0,"aria-autocomplete":x?n:"none","aria-controls":x?r:void 0,"aria-describedby":o,"aria-expanded":x&&"combobox"===f?!!a:void 0,"aria-label":i,"aria-labelledby":l,"aria-multiline":s,"aria-owns":x?c:void 0,"aria-readonly":!x||void 0,"aria-required":u,autoCapitalize:d,className:h,contentEditable:x,"data-testid":b,id:p,ref:S,role:f,spellCheck:m,style:v,tabIndex:g}))}});function xxt(){return xxt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xxt.apply(this,arguments)}const Ext="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var kxt=Object.freeze({__proto__:null,ContentEditable:function({ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:a,ariaLabel:i,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:h,id:p,role:f="textbox",spellCheck:m=!0,style:v,tabIndex:g,"data-testid":b,...y}){const[w]=art(),[x,k]=e.useState(!1),S=e.useCallback((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&w.setRootElement(e)}),[w]);return Ext((()=>(k(w.isEditable()),w.registerEditableListener((e=>{k(e)})))),[w]),E.createElement("div",xxt({},y,{"aria-activedescendant":x?t:void 0,"aria-autocomplete":x?n:"none","aria-controls":x?r:void 0,"aria-describedby":o,"aria-expanded":x&&"combobox"===f?!!a:void 0,"aria-label":i,"aria-labelledby":l,"aria-multiline":s,"aria-owns":x?c:void 0,"aria-readonly":!x||void 0,"aria-required":u,autoCapitalize:d,className:h,contentEditable:x,"data-testid":b,id:p,ref:S,role:f,spellCheck:m,style:v,tabIndex:g}))}});const Sxt=("development"===process.env.NODE_ENV?wxt:kxt).ContentEditable;var Cxt,Mxt=new URL("./assets/file-icons/icon-photo.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,_xt=new URL("./assets/file-icons/icon-word.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Nxt=new URL("./assets/file-icons/icon-excel.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Axt=new URL("./assets/file-icons/icon-powerpoint.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Oxt=new URL("./assets/file-icons/icon-music.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Ixt=new URL("./assets/file-icons/icon-video.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Dxt=new URL("./assets/file-icons/icon-pdf.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Pxt=function(e){var t,n=e.fileType,r=e.width,o=e.height;switch(n){case".jpg":case".jpeg":case".png":t=Mxt;break;case".mp3":case".wma":case".wma9":case".wav":case".flac":case".aac":case".aac+":case".ogg":case".aiff":case".lossless":case".amr":case".ac3":t=Oxt;break;case".avi":case".mp4":case".mkv":case".wmv":case".vob":case".flv":case".webm":case".3gp":case".mpeg":t=Ixt;break;case".pdf":t=Dxt;break;case".ppt":t=Axt;break;case".xlsx":t=Nxt;break;case".doc":case".docx":t=_xt;break;default:t=""}return x.default.createElement("img",v0e({},e,{src:t,style:v0e({width:r||24,height:o||"auto"},e.style)}))},Txt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Hxt=G8e.div(Cxt||(Cxt=x0e(["\n font-size: 13px;\n &.comment {\n display: flex;\n width: 100%;\n align-items: flex-start;\n margin-bottom: 15px;\n position: relative; /* Add for child positioning */\n }\n\n .comment-avatar {\n /* width: 40px;\n height: 40px; */\n border-radius: 50%;\n margin-right: 10px;\n }\n\n .comment-body {\n //background-color: #f0f2f5;\n //padding: 10px 15px;\n //border-radius: 10px;\n //max-width: 600px;\n flex: 1;\n }\n \n .comment-content {\n background-color: #f0f2f5;\n padding: 10px 15px;\n border-radius: 10px;\n }\n\n .comment-header {\n font-size: 13px;\n display: flex;\n align-items: center;\n //margin-bottom: 5px;\n }\n\n .comment-username {\n font-weight: bold;\n color: #050505;\n margin-right: 10px;\n }\n\n .comment-timestamp {\n font-size: 12px;\n color: #65676b;\n }\n\n .comment-text {\n margin: 0;\n color: #050505;\n line-height: 1.5;\n }\n\n .replies {\n margin-top: 10px;\n //margin-left: 50px;\n position: relative;\n padding-left: 10px;\n \n }\n\n .replies::before {\n //content: '';\n //position: absolute;\n //top: calc(-50% + 40px - 20px);\n //left: calc(-15px - 10px - 20px); \n //width: 2px;\n //height: 100%;\n //background-color: #d1d1d1;\n }\n \n .replies .comment {\n margin-bottom: 10px;\n position: relative;\n }\n \n .replies .comment::before {\n //content: '';\n //position: absolute;\n //top: 15px;\n //left: -55px;\n //width: 30px;\n //height: 2px;\n //background-color: #d1d1d1;\n }\n\n .reply-toggle {\n background: none;\n border: none;\n color: #65676b;\n cursor: pointer;\n font-size: 13px;\n padding: 0;\n margin-top: 5px;\n }\n\n .reply-toggle:hover {\n text-decoration: underline;\n }\n .comment-toolbar {\n display: flex;\n align-items: end;\n gap: 1rem\n }\n\n .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n }\n\n .comment-link {\n margin: 0;\n color: #1b74e4;\n line-height: 1.5;\n text-decoration: underline;\n word-break: break-all;\n }\n .comment-link:hover {\n color: #135ab2;\n }\n"],["\n font-size: 13px;\n &.comment {\n display: flex;\n width: 100%;\n align-items: flex-start;\n margin-bottom: 15px;\n position: relative; /* Add for child positioning */\n }\n\n .comment-avatar {\n /* width: 40px;\n height: 40px; */\n border-radius: 50%;\n margin-right: 10px;\n }\n\n .comment-body {\n //background-color: #f0f2f5;\n //padding: 10px 15px;\n //border-radius: 10px;\n //max-width: 600px;\n flex: 1;\n }\n \n .comment-content {\n background-color: #f0f2f5;\n padding: 10px 15px;\n border-radius: 10px;\n }\n\n .comment-header {\n font-size: 13px;\n display: flex;\n align-items: center;\n //margin-bottom: 5px;\n }\n\n .comment-username {\n font-weight: bold;\n color: #050505;\n margin-right: 10px;\n }\n\n .comment-timestamp {\n font-size: 12px;\n color: #65676b;\n }\n\n .comment-text {\n margin: 0;\n color: #050505;\n line-height: 1.5;\n }\n\n .replies {\n margin-top: 10px;\n //margin-left: 50px;\n position: relative;\n padding-left: 10px;\n \n }\n\n .replies::before {\n //content: '';\n //position: absolute;\n //top: calc(-50% + 40px - 20px);\n //left: calc(-15px - 10px - 20px); \n //width: 2px;\n //height: 100%;\n //background-color: #d1d1d1;\n }\n \n .replies .comment {\n margin-bottom: 10px;\n position: relative;\n }\n \n .replies .comment::before {\n //content: '';\n //position: absolute;\n //top: 15px;\n //left: -55px;\n //width: 30px;\n //height: 2px;\n //background-color: #d1d1d1;\n }\n\n .reply-toggle {\n background: none;\n border: none;\n color: #65676b;\n cursor: pointer;\n font-size: 13px;\n padding: 0;\n margin-top: 5px;\n }\n\n .reply-toggle:hover {\n text-decoration: underline;\n }\n .comment-toolbar {\n display: flex;\n align-items: end;\n gap: 1rem\n }\n\n .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n }\n\n .comment-link {\n margin: 0;\n color: #1b74e4;\n line-height: 1.5;\n text-decoration: underline;\n word-break: break-all;\n }\n .comment-link:hover {\n color: #135ab2;\n }\n"]))),Lxt=function(t){var n=t.t,r=t.commentData,o=t.setReplyComment,a=t.handlePreviewImage,i=t.CDN_URL_VIEW,l=art()[0],s=[".png",".jpg",".jpeg",".gif",".bmp",".webp"],c=e.useState(!0),u=c[0],d=c[1],h=r.photo,p=r.createdByName,f=r.action,m=r.comment,v=r.createdDate,g=r.files,b=r.children,y=void 0===b?[]:b,w=(new Date).getDate(),E=v?new Date(v).getDate():null,k=E&&w-E==0?"".concat(jnt(v).format("HH:mm")," Hôm nay"):E&&w-E==1?"".concat(jnt(v).format("HH:mm")," Hôm qua"):v?Wnt(v):"",S=function(e){try{return new URL(e),!0}catch(e){return!1}}(m),C=S&&!m.startsWith("http")?"https://".concat(m):m;return x.default.createElement(Hxt,{className:"comment"},x.default.createElement("img",{src:h&&""!==h?h.startsWith("http")?h:"".concat(i,"/").concat(h):Txt,width:40,height:40,alt:"".concat(p,"'s avatar"),className:"comment-avatar"}),x.default.createElement("div",{className:"comment-body"},x.default.createElement("div",{className:"comment-content"},x.default.createElement("div",{className:"comment-header"},x.default.createElement("span",{className:"comment-username"},p),x.default.createElement("span",{className:"comment-text"},f)),S?x.default.createElement("a",{href:C,className:"comment-link",target:"_blank",rel:"noopener noreferrer",title:m},m):x.default.createElement("p",{className:"comment-text"},m),(null==g?void 0:g.length)>0&&x.default.createElement("div",{className:"d-flex "},null==g?void 0:g.map((function(t,n){return x.default.createElement(e.Fragment,{key:n},s.includes(t.type)?x.default.createElement("div",{className:"image-container"},x.default.createElement("img",{style:{maxWidth:"100%",maxHeight:360,cursor:"pointer"},src:"".concat(i,"/").concat(t.path),onClick:a,alt:""})):x.default.createElement(x.default.Fragment,null,x.default.createElement("a",{href:"".concat(i,"/").concat(t.path),key:n,className:"d-flex align-items-center p-1",style:{textDecoration:"none",color:"inherit"}},x.default.createElement("div",{className:"me-1"},x.default.createElement(Pxt,{fileType:null==t?void 0:t.type,width:35})),x.default.createElement("div",{className:"d-flex flex-column justify-content-center"},x.default.createElement("p",{className:"file-name-chat m-0"},t.name),x.default.createElement("p",{className:" m-0"},function(e,t){if(void 0===t&&(t=2),!+e.size)return"0 Bytes";var n=t<0?0:t,r=Math.floor(Math.log(e.size)/Math.log(1024));return"".concat(parseFloat((e.size/Math.pow(1024,r)).toFixed(n))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r])}({size:t.size}))))))}))," ")),x.default.createElement("div",{className:"comment-toolbar"},x.default.createElement("div",null,x.default.createElement("span",{className:"comment-timestamp"},k)),x.default.createElement("button",{className:"reply-toggle",onClick:function(){l.focus(),o(r)}},n("Reply")),y.length>0&&x.default.createElement("button",{className:"reply-toggle",onClick:function(){return d(!u)}},u?n("Hide"):"".concat(n("SeeReplies")," (").concat(y.length,")"))),u&&y.length>0&&x.default.createElement("div",{className:"replies"},y.map((function(e,t){return x.default.createElement(Lxt,{key:t,t:n,commentData:e,handlePreviewImage:a,setReplyComment:o,CDN_URL_VIEW:i})})))))};const zxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Rxt=zxt?e.useLayoutEffect:e.useEffect,Bxt={tag:"history-merge"};var $xt=Object.freeze({__proto__:null,LexicalComposer:function({initialConfig:t,children:n}){const r=e.useMemo((()=>{const{theme:e,namespace:n,editor__DEPRECATED:r,nodes:o,onError:a,editorState:i,html:l}=t,s=ort(null,e);let c=r||null;if(null===c){const r=Rmt({editable:t.editable,html:l,namespace:n,nodes:o,onError:e=>a(e,r),theme:e});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=kft();if(t.isEmpty()){const n=fft();t.append(n);const r=zxt?document.activeElement:null;(null!==Sft()||null!==r&&r===e.getRootElement())&&n.select()}}),Bxt);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Bxt);break}case"object":e.setEditorState(t,Bxt);break;case"function":e.update((()=>{kft().isEmpty()&&t(e)}),Bxt)}}(r,i),c=r}return[c,s]}),[]);return Rxt((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),E.createElement(rrt.Provider,{value:r},n)}});const Zxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Vxt=Zxt?e.useLayoutEffect:e.useEffect,jxt={tag:"history-merge"};var Wxt=Object.freeze({__proto__:null,LexicalComposer:function({initialConfig:t,children:n}){const r=e.useMemo((()=>{const{theme:e,namespace:n,editor__DEPRECATED:r,nodes:o,onError:a,editorState:i,html:l}=t,s=ort(null,e);let c=r||null;if(null===c){const r=Rmt({editable:t.editable,html:l,namespace:n,nodes:o,onError:e=>a(e,r),theme:e});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=kft();if(t.isEmpty()){const n=fft();t.append(n);const r=Zxt?document.activeElement:null;(null!==Sft()||null!==r&&r===e.getRootElement())&&n.select()}}),jxt);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,jxt);break}case"object":e.setEditorState(t,jxt);break;case"function":e.update((()=>{kft().isEmpty()&&t(e)}),jxt)}}(r,i),c=r}return[c,s]}),[]);return Vxt((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),E.createElement(rrt.Provider,{value:r},n)}});const Fxt=("development"===process.env.NODE_ENV?$xt:Wxt).LexicalComposer;var qxt="px-1 mx-2/3 mx-px align-baseline inline-block rounded break-words cursor-pointer leading-5",Yxt="ring-2 ring-offset-1",Uxt={ltr:"text-left",rtl:"text-right",beautifulMentions:{"@":"".concat(qxt," dark:bg-green-500 bg-green-600 text-accent"),"@Focused":"".concat(Yxt," dark:ring-green-500 ring-green-600 ring-offset-background"),"#":"".concat(qxt," dark:bg-blue-400 bg-blue-600 text-accent"),"#Focused":"".concat(Yxt," dark:ring-blue-400 ring-blue-600 ring-offset-background"),"due:":"".concat(qxt," dark:bg-yellow-400 bg-yellow-600 text-accent"),"due:Focused":"".concat(Yxt," dark:ring-yellow-400 ring-yellow-600 ring-offset-background"),"rec:":{trigger:"text-blue-500",value:"text-orange-500",container:"mx-[2px] px-[4px] rounded border border-muted cursor-pointer",containerFocused:"mx-[2px] px-[4px] rounded border border-muted cursor-pointer"},"\\w+:":"".concat(qxt," dark:bg-gray-400 bg-gray-500 text-accent"),"\\w+:Focused":"".concat(Yxt," dark:ring-gray-400 ring-gray-500 ring-offset-background")}},Kxt=e.forwardRef((function(t,n){var r=t.value,o=g0e(t,["value"]);return x.default.createElement(e.Fragment,null,x.default.createElement("span",v0e({},o,{ref:n}),r))}));function Gxt(e,t,n){return function(){var r=kft();if(null===r.getFirstChild()){var o=fft();o.append.apply(o,function(e,t,n,r){void 0===r&&(r=fbt);for(var o=function(e,t,n){var r=function(e,t,n){var r,o=new RegExp("(?<=\\s|^|\\()".concat(mbt(t),"((?:").concat(vbt(t,n),"){1,").concat(75,"})"),"g"),a=[];for(o.lastIndex=0;null!==(r=o.exec(e));)a.push({value:r[0],index:r.index});return a}(e,t,n),o=[],a=0;if(r.forEach((function(n){var r=n.value,i=n.index;if(i>a){var l=e.substring(a,i);o.push({type:"text",value:l})}var s=t.find((function(e){return new RegExp(e).test(r)})),c=s&&r.match(new RegExp(s));if(!c)throw new Error("No trigger found for mention");var u=c[0];o.push({type:"mention",value:r.substring(u.length),trigger:u}),a=i+r.length})),a<e.length){var i=e.substring(a);o.push({type:"text",value:i})}return o}(e,t,r),a=[],i=function(e){var t=n.find((function(t){return t.name===e.value}));"text"===e.type?a.push(gft(e.value)):t?a.push(zbt("@".concat(e.value))):a.push(gft("@".concat(e.value)))},l=0,s=o;l<s.length;l++)i(s[l]);return a}(e,t,n)),r.append(o)}}}Kxt.displayName="CustomMentionComponent";Ibt=Ibt||function(e){return function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return m0e(n,t),n.getType=function(){return"custom-beautifulMention"},n.clone=function(e){return new n(e.__trigger,e.__value,e.__data,e.__key)},n.importJSON=function(e){return new n(e.trigger,e.value,e.data)},n.prototype.exportJSON=function(){var e=this.__data;return v0e(v0e({trigger:this.__trigger,value:this.__value},e?{data:e}:{}),{type:"custom-beautifulMention",version:1})},n.prototype.component=function(){return e},n.prototype.decorate=function(e,n){return t.prototype.decorate.call(this,e,n)},n}(Dbt)}(Kxt);function Xxt(e,t){let n=Date.now(),r=0;return(o,a,i,l,s,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const a=t._selection,i=e._selection;if(o)return 1;if(!(Tft(a)&&Tft(i)&&i.isCollapsed()&&a.isCollapsed()))return 0;const l=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Hft(n)||o.push(n)}return o}(t,n,r);if(0===l.length)return 0;if(l.length>1){const n=t._nodeMap,r=n.get(a.anchor.key),o=n.get(i.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&zft(r)&&1===r.__text.length&&1===a.anchor.offset?2:0}const s=l[0],c=e._nodeMap.get(s.__key);if(!zft(c)||!zft(s)||c.__mode!==s.__mode)return 0;const u=c.__text,d=s.__text;if(u===d)return 0;const h=a.anchor,p=i.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,v=d.length-u.length;return 1===v&&m===f-1?2:-1===v&&m===f+1?3:-1===v&&m===f?4:0}(o,a,l,s,e.isComposing()),h=(()=>{const h=null===i||i.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=a._selection;return l.size>0||s.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===l.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),a=t._selection,i=n._selection;let l=!1;return Tft(a)&&Tft(i)&&(l="element"===a.anchor.type&&"element"===a.focus.type&&"text"===i.anchor.type&&"text"===i.focus.type),!(l||!zft(r)||!zft(o))&&r.__type===o.__type&&r.__text===o.__text&&r.__mode===o.__mode&&r.__detail===o.__detail&&r.__style===o.__style&&r.__format===o.__format&&r.__parent===o.__parent}(Array.from(l)[0],o,a)?0:1:null!==f?0:2})();return n=u,r=d,h}}function Qxt(e){e.undoStack=[],e.redoStack=[],e.current=null}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chat-app-window .user-chats {\n background-color: #f2f0f7;\n padding: 0;\n position: relative;\n}\n.chat-app-window .user-chats > div:first-child {\n overflow: auto !important;\n margin-bottom: 0 !important;\n}\n.chat-app-window .user-chats .avatar img {\n border: 2px solid #fff;\n}\n.chat-app-window .active-chat {\n height: inherit;\n display: flex;\n flex-direction: column;\n}\n.chat-app-window .active-chat .chat-header {\n display: flex;\n justify-content: space-between;\n height: 65px;\n background-color: #fff;\n padding: 0 1rem;\n border-bottom: 1px solid #ebe9f1;\n}\n.chat-app-window .chats .chat-avatar {\n float: right;\n}\n.chat-app-window .chats .chat {\n margin: 0 17px;\n}\n.chat-app-window .chats .chat-body {\n display: block;\n margin: 10px 0 0 0;\n overflow: hidden;\n}\n.chat-app-window .chats .chat-body .chat-content {\n float: right;\n margin: 0 0 10px 0;\n clear: both;\n min-height: 40px;\n color: #22292f;\n background-color: #FFFFFF;\n border-radius: 0.357rem;\n box-shadow: 0 4px 8px 0 rgba(34, 41, 47, 0.12);\n max-width: 75%;\n}\n.chat-app-window .chats .chat-body .chat-content.chat-content-file {\n padding: 0;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message {\n user-select: text;\n white-space: pre-wrap;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message-text {\n font-size: 1.075rem;\n margin-bottom: 0.5rem;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message-text .mention {\n color: #0068ff;\n font-weight: 500;\n}\n.chat-app-window .chats .chat-body .chat-content p {\n margin: 0;\n}\n.chat-app-window .chats .chat-body .chat-message-item .message-action {\n visibility: hidden;\n opacity: 0;\n}\n.chat-app-window .chats .chat-body .chat-message-item:hover .message-action {\n opacity: 1;\n visibility: visible;\n}\n.chat-app-window .chat-input-container {\n background-color: #FFFFFF;\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: flex-end;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n}\n.chat-app-window .chat-input-container .editor-container {\n max-height: 150px;\n overflow: auto;\n flex-grow: 1;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar {\n width: 6px;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar-track {\n background: none;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 10px;\n}\n.chat-app-window .chat-input-container .editor-container .editor-input {\n padding: 10px 12px;\n}\n.chat-app-window .chat-input-container .editor-container .editor-input p {\n margin: 0;\n}\n.chat-app-window .chat-input-container .send {\n background: none;\n border: 0 !important;\n}\n.chat-app-window .chat-app-form {\n min-height: 65px;\n padding: 0 1rem;\n background-color: #fff;\n display: flex;\n align-items: center;\n}\n.chat-app-window .chat-app-form.chat-toolbar {\n min-height: 40px;\n border-bottom: 1px solid #ebe9f1;\n border-top: 1px solid #ebe9f1;\n position: relative;\n}\n.chat-app-window .chat-app-reply {\n width: 100%;\n padding: 14px;\n height: 0;\n display: none;\n}\n.chat-app-window .chat-app-reply.show {\n display: block;\n height: auto;\n transition: all 1s ease-in-out;\n}\n.chat-app-window .chat-app-reply .reply-container {\n display: flex;\n padding: 10px;\n background-color: #eaedf0;\n border-radius: 6px;\n position: relative;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-quote {\n border-left: 2px solid #007bb6;\n margin-right: 5px;\n height: 42px;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-image {\n margin-right: 4px;\n width: 42px;\n height: 42px;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-clear-btn {\n position: absolute;\n right: 3px;\n top: 3px;\n background: #3b4253;\n border-radius: 50%;\n cursor: pointer;\n padding: 2px;\n}\n.chat-app-window .chat-app-reply .reply-container p {\n margin-bottom: 0;\n}\n.chat-app-window .chat-app-preview {\n padding-left: 1rem;\n max-height: 170px;\n overflow-y: auto;\n background-color: #fff;\n height: 0;\n display: none;\n}\n.chat-app-window .chat-app-preview.show {\n display: block;\n height: auto;\n transition: all 2ms ease-in-out;\n}\n.chat-app-window .chat-app-preview .preview-image-container {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n padding: 10px;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview {\n position: relative;\n border-radius: 5px;\n overflow: hidden;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview .image-preview-clear-btn {\n position: absolute;\n right: 3px;\n top: 3px;\n background: #3b4253;\n border-radius: 50%;\n cursor: pointer;\n padding: 2px;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview .img {\n width: 100px;\n height: 100px;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n border: 1px solid #ebe9f1;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar {\n width: 6px;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar-track {\n background: none;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 10px;\n}\n\n.chat-app-window .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n}\n\n.chat-widget .card-header {\n padding-top: 0.8rem;\n padding-bottom: 0.8rem;\n}\n.chat-widget .chat-app-window .user-chats {\n background-color: #f8f8f8;\n height: 390px;\n}\n.chat-widget .chat-app-window .user-chats div:first-child {\n overflow: auto !important;\n}\n.chat-widget .chat-app-window .chat-app-form {\n border-top: 0;\n border-bottom-left-radius: 0.357rem;\n border-bottom-right-radius: 0.357rem;\n height: 56px;\n}\n.chat-widget .chat-app-window .chat-app-form .input-group-text,\n.chat-widget .chat-app-window .chat-app-form .message {\n border: 0;\n border-left: 0;\n padding-left: 0;\n}\n.chat-widget .chat-app-window .chat-app-form .input-group:not(.bootstrap-touchspin):focus-within {\n box-shadow: none;\n}\n\n.input-group-merge.form-send-message:focus-within {\n box-shadow: none;\n}\n.input-group-merge.form-send-message .message-container {\n padding: 0;\n position: relative;\n flex: 1 1 auto;\n}\n.input-group-merge.form-send-message .message-container .editing {\n height: 100%;\n line-height: 1.5;\n flex: 1 1 auto;\n border: none;\n border-radius: 0;\n padding: 4px 10px;\n user-select: text;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.input-group-merge.form-send-message .message-container .editing:focus {\n outline: none;\n}\n.input-group-merge.form-send-message .message-container .editing .tags {\n color: #0068ff;\n}\n.input-group-merge.form-send-message .message-container .editing.empty:before {\n content: attr(placeholder);\n cursor: text;\n background: none;\n color: #b9b9c3;\n display: block;\n position: absolute;\n padding-top: 2px;\n left: 16px;\n right: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n pointer-events: none;\n}\n.input-group-merge.form-send-message .message-container .editing .editing-message {\n margin: 0;\n user-select: text;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.input-group-merge.form-send-message .message-container .editing-placeholder {\n position: absolute;\n left: 11px;\n top: 6px;\n}\n\n.input-container {\n position: relative;\n}\n.input-container .menu-suggestion {\n border-radius: 6px;\n display: none;\n position: absolute;\n inset: auto auto 0px 0px;\n transform: translate(20px, -50px);\n box-shadow: 0 5px 25px rgba(34, 41, 47, 0.1);\n width: 300px;\n max-height: 600px;\n background-color: #FFFFFF;\n}\n.input-container .menu-suggestion.show {\n display: block;\n}\n.input-container .menu-suggestion .suggest-item {\n cursor: pointer;\n padding: 0.5rem 1rem;\n}\n.input-container .menu-suggestion .suggest-item:hover {\n background-color: #f8f8f8;\n}\n.input-container .menu-suggestion .menu-suggestion-item {\n cursor: pointer;\n padding: 0.5rem 1rem;\n}\n.input-container .menu-suggestion .menu-suggestion-item:hover {\n background-color: #f8f8f8;\n}\n\n.test-editor {\n box-sizing: border-box;\n /*border: 1px solid #ddd;*/\n cursor: text;\n /*padding: 16px;*/\n /*border-radius: 2px;*/\n /*margin-bottom: 2em;*/\n /*box-shadow: inset 0px 1px 8px -3px #ABABAB;*/\n /*background: #fefefe;*/\n max-height: 100px;\n overflow-y: scroll;\n}\n.test-editor::-webkit-scrollbar {\n width: 6px;\n}\n.test-editor::-webkit-scrollbar-track {\n background: none;\n}\n.test-editor::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 5px;\n}\n\n.test-editor :global(.public-DraftEditor-content) {\n min-height: 20px;\n}\n\n.attachment-icon .chat-btn {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 30px;\n height: 30px;\n padding: 0;\n background: none;\n background-color: #FFFFFF !important;\n border: none;\n border-radius: 50%;\n z-index: 999999;\n}\n\n.attachment-icon-emoji > div > button {\n border: 0;\n margin: 0;\n font-size: 23px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 30px;\n height: 30px;\n padding: 0;\n background: none;\n background-color: #FFFFFF !important;\n border: none;\n border-radius: 50%;\n}\n.attachment-icon-emoji button {\n font-size: 18px;\n}\n\n.ass {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n min-height: 18px;\n}");var Jxt=Object.freeze({__proto__:null,createEmptyHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},registerHistory:function(e,t,n){const r=Xxt(e,n);return Vgt(e.registerCommand(Lmt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,a=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Fft,!0)),0===r.length&&e.dispatchCommand(qft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Omt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(qft,!0));const a=n.pop();0===n.length&&e.dispatchCommand(Fft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Yft,(()=>(Qxt(t),!1)),Xft),e.registerCommand(Uft,(()=>(Qxt(t),e.dispatchCommand(Fft,!1),e.dispatchCommand(qft,!1),!0)),Xft),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:a,dirtyElements:i,tags:l})=>{const s=t.current,c=t.redoStack,u=t.undoStack,d=null===s?null:s.editorState;if(null!==s&&n===d)return;const h=r(o,n,s,a,i,l);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Fft,!1)),null!==s&&(u.push({...s}),e.dispatchCommand(qft,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}});function eEt(e,t){let n=Date.now(),r=0;return(o,a,i,l,s,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const a=t._selection,i=e._selection;if(o)return 1;if(!(Tft(a)&&Tft(i)&&i.isCollapsed()&&a.isCollapsed()))return 0;const l=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Hft(n)||o.push(n)}return o}(t,n,r);if(0===l.length)return 0;if(l.length>1){const n=t._nodeMap,r=n.get(a.anchor.key),o=n.get(i.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&zft(r)&&1===r.__text.length&&1===a.anchor.offset?2:0}const s=l[0],c=e._nodeMap.get(s.__key);if(!zft(c)||!zft(s)||c.__mode!==s.__mode)return 0;const u=c.__text,d=s.__text;if(u===d)return 0;const h=a.anchor,p=i.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,v=d.length-u.length;return 1===v&&m===f-1?2:-1===v&&m===f+1?3:-1===v&&m===f?4:0}(o,a,l,s,e.isComposing()),h=(()=>{const h=null===i||i.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=a._selection;return l.size>0||s.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===l.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),a=t._selection,i=n._selection;let l=!1;return Tft(a)&&Tft(i)&&(l="element"===a.anchor.type&&"element"===a.focus.type&&"text"===i.anchor.type&&"text"===i.focus.type),!(l||!zft(r)||!zft(o))&&r.__type===o.__type&&r.__text===o.__text&&r.__mode===o.__mode&&r.__detail===o.__detail&&r.__style===o.__style&&r.__format===o.__format&&r.__parent===o.__parent}(Array.from(l)[0],o,a)?0:1:null!==f?0:2})();return n=u,r=d,h}}function tEt(e){e.undoStack=[],e.redoStack=[],e.current=null}var nEt=Object.freeze({__proto__:null,createEmptyHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},registerHistory:function(e,t,n){const r=eEt(e,n),o=Vgt(e.registerCommand(Lmt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,a=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Fft,!0)),0===r.length&&e.dispatchCommand(qft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Omt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(qft,!0));const a=n.pop();0===n.length&&e.dispatchCommand(Fft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Yft,(()=>(tEt(t),!1)),Xft),e.registerCommand(Uft,(()=>(tEt(t),e.dispatchCommand(Fft,!1),e.dispatchCommand(qft,!1),!0)),Xft),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:a,dirtyElements:i,tags:l})=>{const s=t.current,c=t.redoStack,u=t.undoStack,d=null===s?null:s.editorState;if(null!==s&&n===d)return;const h=r(o,n,s,a,i,l);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Fft,!1)),null!==s&&(u.push({...s}),e.dispatchCommand(qft,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return o}});const rEt="development"===process.env.NODE_ENV?Jxt:nEt,oEt=rEt.createEmptyHistoryState,aEt=rEt.registerHistory;var iEt=Object.freeze({__proto__:null,HistoryPlugin:function({externalHistoryState:t}){const[n]=art();return function(t,n,r=1e3){const o=e.useMemo((()=>n||oEt()),[n]);e.useEffect((()=>aEt(t,o,r)),[r,t,o])}(n,t),null},createEmptyHistoryState:oEt}),lEt=Object.freeze({__proto__:null,HistoryPlugin:function({externalHistoryState:t}){const[n]=art();return function(t,n,r=1e3){const o=e.useMemo((()=>n||oEt()),[n]);e.useEffect((()=>aEt(t,o,r)),[r,t,o])}(n,t),null},createEmptyHistoryState:oEt});const sEt="development"===process.env.NODE_ENV?iEt:lEt,cEt=sEt.HistoryPlugin;sEt.createEmptyHistoryState;var uEt,dEt,hEt,pEt,fEt,mEt,vEt,gEt,bEt,yEt=function(t){var n=t.open,r=t.children,o=t.toggleSidebar,a=t.width,i=t.keyboard,l=t.hiddenBackground,s=t.hiddenFullScreenButton,c=e.useState(!1),u=c[0],d=c[1],h=e.useState(n),p=h[0],f=h[1];e.useEffect((function(){n?f(n):setTimeout((function(){f(n)}),50)}),[n]);var m=function(){f(!1),setTimeout((function(){o()}),400)};return x.default.createElement("div",{tabIndex:0,className:w1e({"d-none":!n}),onKeyDown:function(e){!i&&"Escape"===e.code&&p&&(m(),e.stopPropagation(),e.preventDefault())}},x.default.createElement("div",{className:w1e("offcanvas-backdrop fade",{"d-none":!p||l,show:p}),style:{zIndex:1056},onClick:m}),x.default.createElement("div",{className:w1e("customizer d-none d-md-block ","customizer-".concat(null!=a?a:600),{open:p,fullscreen:u}),style:{zIndex:1057}},x.default.createElement("div",{style:{position:"fixed",top:"50%",transform:"translate(-50%, -50%)",background:"#FFF",filter:"drop-shadow(0.9px 0.9px 1.5px)",height:50,display:"flex",alignItems:"center",borderRadius:"0px 5px 5px 0px",cursor:"pointer",zIndex:9,marginLeft:7},className:w1e({"d-none":s}),onClick:function(){d(!u)}},x.default.createElement(Dnt,{className:"".concat(u?"d-none":""),fontSize:16}),x.default.createElement(Pnt,{className:"".concat(u?"":"d-none"),fontSize:15})),r))},wEt=G8e.div(uEt||(uEt=x0e(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #000;\n overflow: hidden;\n"],["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #000;\n overflow: hidden;\n"]))),xEt=G8e.img(dEt||(dEt=x0e(["\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n transform: translate(","px, ","px)\n scale(",");\n transition: transform "," ease-out;\n user-select: none;\n cursor: ",";\n &:hover {\n opacity: 0.95;\n }\n"],["\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n transform: translate(","px, ","px)\n scale(",");\n transition: transform "," ease-out;\n user-select: none;\n cursor: ",";\n &:hover {\n opacity: 0.95;\n }\n"])),(function(e){return e.translateX}),(function(e){return e.translateY}),(function(e){return e.scale}),(function(e){return e.isDragging?"0s":"0.3s"}),(function(e){return e.isDragging?"grabbing":"grab"})),EEt=G8e(w5e)(hEt||(hEt=x0e(["\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 10px 20px;\n z-index: 1060;\n"],["\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 10px 20px;\n z-index: 1060;\n"]))),kEt=G8e.div(pEt||(pEt=x0e(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-size: 16px;\n"],["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-size: 16px;\n"]))),SEt=G8e.button(fEt||(fEt=x0e(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background: rgba(0, 0, 0, 0.5);\n border: none;\n color: #fff;\n padding: 15px;\n border-radius: 50%;\n cursor: pointer;\n z-index: 1060;\n &:hover {\n background: rgba(0, 0, 0, 0.8);\n }\n"],["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background: rgba(0, 0, 0, 0.5);\n border: none;\n color: #fff;\n padding: 15px;\n border-radius: 50%;\n cursor: pointer;\n z-index: 1060;\n &:hover {\n background: rgba(0, 0, 0, 0.8);\n }\n"]))),CEt=G8e(SEt)(mEt||(mEt=x0e(["\n left: 20px;\n"],["\n left: 20px;\n"]))),MEt=G8e(SEt)(vEt||(vEt=x0e(["\n right: 20px;\n"],["\n right: 20px;\n"]))),_Et=G8e.div(gEt||(gEt=x0e(["\n display: flex;\n overflow-x: auto;\n padding: 10px;\n background: rgba(0, 0, 0, 0.7);\n justify-content: center;\n &::-webkit-scrollbar {\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 4px;\n }\n"],["\n display: flex;\n overflow-x: auto;\n padding: 10px;\n background: rgba(0, 0, 0, 0.7);\n justify-content: center;\n &::-webkit-scrollbar {\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 4px;\n }\n"]))),NEt=G8e.img(bEt||(bEt=x0e(["\n width: 60px;\n height: 60px;\n object-fit: cover;\n margin: 0 5px;\n cursor: pointer;\n border: ",";\n border-radius: 4px;\n opacity: ",";\n &:hover {\n opacity: 1;\n }\n"],["\n width: 60px;\n height: 60px;\n object-fit: cover;\n margin: 0 5px;\n cursor: pointer;\n border: ",";\n border-radius: 4px;\n opacity: ",";\n &:hover {\n opacity: 1;\n }\n"])),(function(e){return e.active?"2px solid #fff":"1px solid #555"}),(function(e){return e.active?1:.7})),AEt=function(t){var n,r,o,a,i=t.openModal,l=t.handleModal,s=t.images,c=t.CDN_URL_VIEW,u=t.initialIndex,d=void 0===u?0:u,h=e.useState(d),p=h[0],f=h[1],m=e.useState(1),v=m[0],g=m[1],b=e.useState({x:0,y:0}),y=b[0],w=b[1],E=e.useState(!1),k=E[0],S=E[1],C=e.useState({x:0,y:0}),M=C[0],_=C[1],N=e.useState(null),A=N[0],O=N[1],I=e.useState(!0),D=I[0],P=I[1],T=e.useState(null),H=T[0],L=T[1],z=e.useRef(new Map),R=e.useRef(null);e.useEffect((function(){i&&(g(1),w({x:0,y:0}),S(!1),O(null),P(!0),z.current.clear(),f(d))}),[i,d]),e.useEffect((function(){g(1),w({x:0,y:0}),S(!1),O(null),P(!0)}),[p]),e.useEffect((function(){[s[(p+1)%s.length],s[(p-1+s.length)%s.length]].filter(Boolean).forEach((function(e){var t,n;(new Image).src="".concat(c,"/").concat(null!==(n=null!==(t=null==e?void 0:e.urlExternal)&&void 0!==t?t:null==e?void 0:e.path)&&void 0!==n?n:"")}))}),[p,s]),e.useEffect((function(){var e=function(e){"ArrowLeft"===e.key&&B(),"ArrowRight"===e.key&&$(),"Escape"===e.key&&l()};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[p]);var B=function(){f((function(e){return 0===e?s.length-1:e-1}))},$=function(){f((function(e){return e===s.length-1?0:e+1}))},Z=s[p],V=(new Date).getDate(),j=(null==Z?void 0:Z.createdDate)?new Date(null==Z?void 0:Z.createdDate).getDate():null,W=j&&V-j==0?"".concat(jnt(null==Z?void 0:Z.createdDate).format("HH:mm")," Hôm nay"):j&&V-j==1?"".concat(jnt(null==Z?void 0:Z.createdDate).format("HH:mm")," Hôm qua"):(null==Z?void 0:Z.createdDate)?Wnt(null==Z?void 0:Z.createdDate):"";return x.default.createElement(h5e,{zIndex:1058,isOpen:i,toggle:l,className:"modal-dialog-centered modal-fullscreen"},x.default.createElement("div",{className:"modal-header d-flex align-items-center justify-content-between mb-0"},x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("h5",{className:"modal-title"},x.default.createElement(Hnt,{fontSize:17,className:"me-1"}),"Xem ảnh (",p+1,"/",s.length,")")),x.default.createElement($nt,{className:"fw-normal mt-25 cursor-pointer",fontSize:24,onClick:l})),x.default.createElement(v5e,{style:{padding:0}},x.default.createElement(wEt,{onWheel:function(e){e.preventDefault();var t=e.deltaY>0?-.1:.1;g((function(e){return Math.min(Math.max(e+t,.5),3)}))}},D&&x.default.createElement(kEt,null,"Đang tải..."),x.default.createElement(xEt,{ref:R,src:"".concat(c,"/").concat(null!==(r=null!==(n=null==Z?void 0:Z.urlExternal)&&void 0!==n?n:null==Z?void 0:Z.path)&&void 0!==r?r:""),scale:v,translateX:y.x,translateY:y.y,isDragging:k,onPointerDown:function(e){if(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),z.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),L(e.clientX),1===z.current.size)S(!0),_({x:e.clientX-y.x,y:e.clientY-y.y});else if(2===z.current.size){S(!1);var t=Array.from(z.current.values()),n=Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y);O(n),_({x:n,y:v})}},onPointerMove:function(e){if(e.preventDefault(),z.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),k&&1===z.current.size){var t=e.clientX-M.x,n=e.clientY-M.y;w({x:Math.max(Math.min(t,500),-500),y:Math.max(Math.min(n,500),-500)})}else if(2===z.current.size&&null!==A){var r=Array.from(z.current.values()),o=Math.hypot(r[0].x-r[1].x,r[0].y-r[1].y),a=M.y*o/M.x;g(Math.min(Math.max(a,.5),3))}},onPointerUp:function(e){if(e.preventDefault(),e.currentTarget.releasePointerCapture(e.pointerId),z.current.delete(e.pointerId),null!==H&&0===z.current.size){var t=e.clientX-H;t>100?B():t<-100&&$()}if(0===z.current.size)S(!1),w({x:0,y:0}),O(null),L(null);else if(1===z.current.size){S(!0);var n=Array.from(z.current.values())[0];_({x:n.x-y.x,y:n.y-y.y})}},onPointerCancel:function(e){e.preventDefault(),e.currentTarget.releasePointerCapture(e.pointerId),z.current.delete(e.pointerId),S(!1),w({x:0,y:0}),O(null),L(null)},onDoubleClick:function(){g(1===v?2:1),w({x:0,y:0})},onLoad:function(){return P(!1)},onError:function(){return P(!1)},alt:null!==(o=null==Z?void 0:Z.createdByName)&&void 0!==o?o:"Ảnh xem trước"}),s.length>1&&x.default.createElement(x.default.Fragment,null,x.default.createElement(CEt,{onClick:B},x.default.createElement(Dnt,{fontSize:28})),x.default.createElement(MEt,{onClick:$},x.default.createElement(Pnt,{fontSize:28}))))),x.default.createElement(EEt,null,x.default.createElement("div",{className:"d-flex flex-column w-100"},x.default.createElement("div",{className:"d-flex justify-content-between mb-1"},x.default.createElement("div",null,x.default.createElement("strong",null,null!==(a=null==Z?void 0:Z.createdByName)&&void 0!==a?a:""),x.default.createElement("p",{className:"m-0"},W))),s.length>1&&x.default.createElement(_Et,null,s.map((function(e,t){var n,r;return x.default.createElement(NEt,{key:t,src:"".concat(c,"/").concat(null!==(r=null!==(n=null==e?void 0:e.urlExternal)&&void 0!==n?n:null==e?void 0:e.path)&&void 0!==r?r:""),active:t===p,onClick:function(){return f(t)},alt:"Thumbnail ".concat(t+1)})}))))))},OEt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,IEt=G8e.div(TEt||(TEt=x0e(["\n.nav-item {\n border-bottom: 2px solid #fff;\n &.active {\n border-bottom: 2px solid #eb4619;\n }\n .nav-link .active{\n color: #eb4619;\n }\n}\n"],["\n.nav-item {\n border-bottom: 2px solid #fff;\n &.active {\n border-bottom: 2px solid #eb4619;\n }\n .nav-link .active{\n color: #eb4619;\n }\n}\n"]))),DEt=G8e.div(HEt||(HEt=x0e(["\n &.chat-input-container {\n background-color: #fff;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n justify-content: flex-end;\n width: 100%;\n .editor-container {\n min-width: calc(100% - 50px);\n flex-grow: 1;\n max-height: 150px;\n overflow: auto;\n background: #fff;\n border-radius: 0;\n color: #000;\n font-weight: 400;\n line-height: 20px;\n position: relative;\n text-align: left;\n .editor-input {\n padding: 10px 12px;\n caret-color: #444;\n font-size: 15px;\n outline: 0;\n position: relative;\n resize: none;\n tab-size: 1;\n p{\n margin: 0;\n }\n }\n }\n .send.btn.btn-outline-secondary {\n border: 0 !important;\n }\n }\n .editor-placeholder {\n color: #999;\n display: inline-block;\n font-size: 15px;\n left: 10px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: 10px;\n user-select: none;\n }\n"],["\n &.chat-input-container {\n background-color: #fff;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n justify-content: flex-end;\n width: 100%;\n .editor-container {\n min-width: calc(100% - 50px);\n flex-grow: 1;\n max-height: 150px;\n overflow: auto;\n background: #fff;\n border-radius: 0;\n color: #000;\n font-weight: 400;\n line-height: 20px;\n position: relative;\n text-align: left;\n .editor-input {\n padding: 10px 12px;\n caret-color: #444;\n font-size: 15px;\n outline: 0;\n position: relative;\n resize: none;\n tab-size: 1;\n p{\n margin: 0;\n }\n }\n }\n .send.btn.btn-outline-secondary {\n border: 0 !important;\n }\n }\n .editor-placeholder {\n color: #999;\n display: inline-block;\n font-size: 15px;\n left: 10px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: 10px;\n user-select: none;\n }\n"])));function PEt(){return x.default.createElement("div",{className:"editor-placeholder ms-25"},"Nhập bình luận...")}var TEt,HEt,LEt=function(t){var n,r,o,a=t.data,i=t.type,l=t.setType,s=t.t,c=t.checkInitComment,u=t.getCommentPagingApi,d=t.addCommentApi,h=t.getProcessApi,p=t.uploadFileApi,f=t.CDN_URL_VIEW,m="comment"===i,v=function(){l("")},g=e.useState({}),b=g[0],y=g[1],w=e.useState([]),E=w[0],k=w[1],S=e.useState(null),C=S[0],M=S[1],_=e.useState(0),N=_[0],A=_[1],O=e.useState(!1),I=O[0],D=O[1],P=function(){D(!I)},T=e.useRef(null),H=e.useRef(null),L=e.useState(!1),z=L[0],R=L[1];e.useEffect((function(){m&&(h?h({ticketId:null==a?void 0:a.id,status:0}).unwrap().then((function(e){y(e?e[0]:{})})).catch((function(){return knt(s("getDataError"))})):knt(s("getProcessApi không hợp lệ!")))}),[m]),e.useEffect((function(){m?c&&(u?u({Keyword:"",Filter:"ticketId==".concat(a.id,";and"),Order:"",PageNumber:1,PageSize:200}).unwrap().then((function(e){k(e.items)})).catch((function(){return knt(s("getDataError"))})):knt(s("getCommentPagingApi không hợp lệ!"))):(k([]),M(null))}),[c,m]);var B,$,Z,V,j=e.useCallback((function(e){T&&T.current&&T.current.clientHeight>50?R(!0):R(!1),e.read((function(){}))}),[]),W=function(e,t){if(e.trim().length||(null==t?void 0:t.trim().length)){var n={parentId:(null==C?void 0:C.id)||void 0,comment:e.trim(),files:t,sortOrder:E.length+1,ticketId:a.id};d?d(n).unwrap().then((function(e){e.isValid?M(null):knt(s("SendFail"))})).catch((function(){return knt(s("SendFail"))})):knt(s("addCommentApi không hợp lệ!"))}};return x.default.createElement(Fxt,{initialConfig:($=["@"],Z=[Ubt],V=[],{namespace:"chatEditor",theme:Uxt,onError:function(e){throw e},editorState:Gxt("",$,V),nodes:w0e(w0e(w0e([],Z,!0),[Lbt],!0),[hbt],!1)})},x.default.createElement(yEt,{open:m,toggleSidebar:v,width:800},x.default.createElement(Znt,{typeModal:"View_Process",handleModal:v,title:s("ProcessingInformation")}),x.default.createElement("div",{className:"sidebar"},x.default.createElement("div",{className:"sidebar-content sidebar-content-right h-100"},x.default.createElement(IEt,{className:"d-flex flex-column align-items-center",style:{backgroundColor:"#fff"}},x.default.createElement("div",{className:"d-flex flex-column w-100"},x.default.createElement(r2e,{tabs:!0,fill:!0,style:{borderBottom:"1px solid #e0e0e0",justifyContent:"start"}},x.default.createElement(l2e,{style:{flex:"none"},active:0===N,onClick:function(){return A(0)}},x.default.createElement(v2e,{style:{paddingLeft:"1.5rem",paddingRight:"1.5rem"}},x.default.createElement("span",{className:w1e("",{active:0===N})},"".concat(s("Comment")," ").concat((null==b?void 0:b.numberOfComments)>0?"(".concat(null==b?void 0:b.numberOfComments,")"):"")))),x.default.createElement(l2e,{style:{flex:"none"},active:1===N,onClick:function(){return A(1)}},x.default.createElement(v2e,{style:{paddingLeft:"1.5rem",paddingRight:"1.5rem"}},x.default.createElement("span",{className:w1e("",{active:1===N})},"".concat(s("Watcher")," ").concat((null===(n=null==b?void 0:b.listWatcher)||void 0===n?void 0:n.length)>0?"(".concat(null===(r=null==b?void 0:b.listWatcher)||void 0===r?void 0:r.length,")"):""))))))),x.default.createElement(i3e,{style:{height:"95%"},activeTab:N},x.default.createElement(u3e,{tabId:0,className:"h-100"},x.default.createElement("div",{className:"chat-app-window",style:{display:"flex",flexDirection:"column",height:"calc(100% - 70px)"}},x.default.createElement("div",{style:{position:"relative",flex:1}},x.default.createElement(Q3e,{style:{height:"calc(100% - 10px)"}},x.default.createElement("div",{style:{padding:10}},null==E?void 0:E.map((function(e){return x.default.createElement(Lxt,{t:s,commentData:e,setReplyComment:M,handlePreviewImage:P,CDN_URL_VIEW:f})}))))),x.default.createElement("div",{className:"chat-app-form chat-toolbar",ref:H},x.default.createElement(X5e,{className:"attachment-icon mb-0",for:"attach-doc",title:s("FileAttached")},x.default.createElement("div",{className:"chat-btn me-75"},x.default.createElement(Hnt,{className:"cursor-pointer text-secondary",fontSize:18})),x.default.createElement("input",{type:"file",accept:"image/*",id:"attach-doc",hidden:!0,onChange:function(e){return function(e){if(e.target.files&&e.target.files[0]){for(var t=[],n=0;n<e.target.files.length;n++)t.push(e.target.files[n]);var r=new FormData;Array.from(t).map((function(e){r.append("files",e,e.name)})),p?p(r).unwrap().then((function(e){W("",JSON.stringify(null==e?void 0:e.infoFiles))})).catch((function(){return knt(s("SendFail"))})):knt(s("uploadFileApi không hợp lệ!"))}}(e)},multiple:!0})),x.default.createElement(X5e,{className:"attachment-icon mb-0",for:"attach-file",title:s("FileAttached")},x.default.createElement("div",{className:"chat-btn me-75"},x.default.createElement(znt,{className:"cursor-pointer text-secondary",fontSize:18})),x.default.createElement("input",{type:"file",id:"attach-file",hidden:!0,onChange:function(e){return function(e){if(e.target.files&&e.target.files[0]){for(var t=[],n=0;n<e.target.files.length;n++)t.push(e.target.files[n]);var r=new FormData;Array.from(t).map((function(e){r.append("files",e,e.name)})),p?p(r).unwrap().then((function(e){W("",JSON.stringify(null==e?void 0:e.infoFiles))})).catch((function(){return knt(s("SendFail"))})):knt(s("uploadFileApi không hợp lệ!"))}}(e)},multiple:!0}))),x.default.createElement("div",{className:"",style:{borderTop:"1px solid #c4c4c4"}},x.default.createElement("div",{className:w1e("chat-app-reply",{show:!!C})},x.default.createElement("div",{className:"reply-container"},x.default.createElement("div",{className:"reply-quote"}),x.default.createElement("div",{className:"flex flex-column d-inline-flex"},x.default.createElement("div",{className:"reply-content d-flex align-items-center"},x.default.createElement("div",null,x.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},x.default.createElement("path",{fill:"currentColor",d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})),"Trả lời ",x.default.createElement("strong",null,null==C?void 0:C.createdByName))),x.default.createElement("div",null,(null==(B=C)?void 0:B.files)&&(null==B?void 0:B.files.length)>0?"[Đính kèm]":null==B?void 0:B.comment," ")),x.default.createElement($nt,{className:"reply-clear-btn",fontSize:20,color:"#fff",onClick:function(){M(null)}}))),x.default.createElement(DEt,{className:"chat-input-container"},x.default.createElement("div",{ref:T,className:"editor-container",style:{minWidth:z?"100%":"calc(100% - 50px)"}},x.default.createElement(sxt,{contentEditable:x.default.createElement(Sxt,{className:"editor-input"}),placeholder:x.default.createElement(PEt,null),ErrorBoundary:gxt}),x.default.createElement(cEt,null),x.default.createElement(Ybt,null),x.default.createElement(Jbt,null),x.default.createElement(nyt,null),x.default.createElement(jbt,{items:[],targetContainer:H}),x.default.createElement(Wbt,{onEnter:function(e){W(e)},onKeyDown:function(e){e.shiftKey&&e.code}}),x.default.createElement(lyt,{onChange:j})),x.default.createElement(Bbt,{onClick:function(e){W(e)}},x.default.createElement(Bnt,{fontSize:18,color:"#006edc",className:""})))))),x.default.createElement(u3e,{tabId:1,className:"h-100"},x.default.createElement("div",{className:"chat-app-window",style:{display:"flex",flexDirection:"column",height:"calc(100% - 70px)"}},x.default.createElement("div",{style:{position:"relative",flex:1}},x.default.createElement(Q3e,{style:{height:"calc(100% - 10px)"}},null===(o=null==b?void 0:b.listWatcher)||void 0===o?void 0:o.map((function(e,t){return x.default.createElement("div",{key:t,style:{display:"flex",alignItems:"center",padding:"0.6rem 0.8rem",borderBottom:"1px solid #ddd"}},x.default.createElement("div",{style:{display:"flex",alignItems:"center",width:"100%"}},x.default.createElement("div",{style:{marginRight:"0.5rem",flexShrink:0}},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(f,"/").concat(null==e?void 0:e.photo):OEt,width:40,height:40,alt:"".concat(null==e?void 0:e.fullName,"'s avatar"),style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}})),x.default.createElement("div",{style:{flexGrow:1}},x.default.createElement("p",{style:{fontSize:"13px",fontWeight:"bold",margin:0}},null==e?void 0:e.fullName))))}))))))))),x.default.createElement(AEt,{openModal:I,handleModal:P,CDN_URL_VIEW:f,images:(null==E?void 0:E.flatMap((function(e){return e.files?e.files.map((function(t){return v0e(v0e({},t),{createdDate:e.createdDate,createdByName:e.createdByName})})).filter((function(e){return[".png",".jpg",".jpeg",".gif",".bmp",".webp"].includes(e.type)})):[]})))||[]})))},zEt=function(t){var n=t.t,r=t.nodes,o=t.connectors,a=t.handleContextMenuClick,i=t.contextMenuItems,l=void 0===i?[]:i,s=t.contextMenuOpen,c=t.setSelectedNode,u={lineColor:"#e0e0e0",lineIntervals:[1,9,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75]},d=e.useRef(null);function h(){var e=document.getElementById("palette-space");e&&window.matchMedia("(max-width:550px)").matches&&(e.classList.contains("sb-mobile-palette-open")?e.classList.remove("sb-mobile-palette-open"):e.classList.add("sb-mobile-palette-open"))}return e.useEffect((function(){!function(){var e;!function(){if(window.matchMedia("(max-width:550px)").matches){var e=document.getElementById("palette-icon");e&&e.addEventListener("click",h,!1)}}(),null===(e=d.current)||void 0===e||e.fitToPage()}()}),[]),x.default.createElement("div",{className:"control-pane diagram-scroll"},x.default.createElement("style",null,"\n \n .diagram-scroll .db-text-input {\n width: calc(100% - 15px);\n padding: 2px 2px 0px 0px;\n }\n \n .diagram-scroll .row{\n margin-right:-15px;\n margin-left:-15px;\n }"),x.default.createElement("div",{className:"control-section"},x.default.createElement("div",{style:{width:"100%"}},x.default.createElement("div",{id:"diagram-space",className:"sb-mobile-diagram",style:{width:"100%",float:"left"}},x.default.createElement(b.DiagramComponent,{id:"diagram",ref:d,width:"100%",height:"860px",tool:b.DiagramTools.ZoomPan,snapSettings:{horizontalGridlines:u,verticalGridlines:u},disabled:!0,scrollSettings:{scrollLimit:"Infinity",canAutoScroll:!0,autoScrollBorder:{left:30,right:30,top:30,bottom:30},scrollableArea:new b.Rect(0,0,1500,1500)},nodes:r,connectors:o,scrollChange:function(e){var t,n;if("Start"!==e.panState){var r=document.getElementById("btnZoomIncrement");r&&(r.content="".concat(Math.round(100*(null!==(n=null===(t=d.current)||void 0===t?void 0:t.scrollSettings.currentZoom)&&void 0!==n?n:1))," %"))}},selectionChange:function(e){var t,n;if("Changed"===e.state){var r=null===(t=d.current)||void 0===t?void 0:t.selectedItems.nodes;r&&1===(r=r.concat((null===(n=d.current)||void 0===n?void 0:n.selectedItems).connectors)).length&&c(r[0])}},contextMenuSettings:{show:!0,items:null==l?void 0:l.map((function(e){return v0e(v0e({},e),{text:n(e.text)})})),showCustomMenuOnly:!0},contextMenuOpen:s,contextMenuClick:function(e){if(d.current){var t=d.current.selectedItems.nodes[0];a&&a(v0e(v0e({},e),{node:t}))}}},x.default.createElement(b.Inject,{services:[b.ConnectorEditing,b.DiagramContextMenu,b.PrintAndExport,b.UndoRedo]}))))))},REt=function(t){var n=t.data,r=t.type,o=t.setType,a=t.t,i=t.checkInitProcess,l=t.getProcessApi,s="diagram"===r,c=function(){o("")},u=e.useState([]),d=u[0],h=u[1],p=e.useState([]),f=p[0],m=p[1];return e.useEffect((function(){i&&s&&(l?l({ticketId:n.id}).unwrap().then((function(e){var t;m([]),h([]);var n=e.find((function(e){return 0===e.sortOrder})),r=JSON.parse(n.logWorkflow),o=JSON.parse((null==r?void 0:r.WorkflowDefinition)||"{}"),a=JSON.parse((null==r?void 0:r.WorkflowState)||"[]"),i=JSON.parse((null==r?void 0:r.WorkflowTransition)||"[]"),l=JSON.parse((null==o?void 0:o.Diagram)||null);if(null!==l){var s=e.filter((function(e){return 1===e.status})).sort((function(e,t){return t.sortOrder-e.sortOrder}))[0],c=i.find((function(e){return e.Id===(null==s?void 0:s.workflowTransitionId)})),u=function(e,t,n){var r=new Set,o=[],a=[],i=function(e){if(r.add(e),o.push(e),e===t)return!0;for(var l=n.filter((function(t){return t.WorkflowStateId===e})),s=0,c=l;s<c.length;s++){var u=c[s];if(!r.has(u.WorkflowToStateId)){if(a.push(u.Id),i(u.WorkflowToStateId))return!0;a.pop()}}return o.pop(),!1};return i(e),{nodes:o,connectors:a}}((null===(t=a.find((function(e){return"Start"===e.Code})))||void 0===t?void 0:t.Id)||"",(null==c?void 0:c.WorkflowStateId)||"",i),d=w0e(w0e([],u.nodes,!0),[(null==c?void 0:c.WorkflowToStateId)||""],!1),p=w0e(w0e([],u.connectors,!0),[(null==c?void 0:c.Id)||""],!1);a.forEach((function(e){var t,n=l.nodes.find((function(t){return t.id===e.Id}));if(n){var r=d.includes(e.Id),o=v0e(v0e({},n),{style:r?{strokeColor:"#28a745",fill:"#28a745"}:void 0,data:e,annotations:[{content:null!==(t=e.Name)&&void 0!==t?t:"",style:{color:r?"#fff":void 0}}]});h((function(e){return w0e(w0e([],e,!0),[o],!1)}))}var a=i.filter((function(t){return t.WorkflowStateId===e.Id}));a.length>0&&a.forEach((function(t){var n,r=l.connectors.find((function(e){return e.id===t.Id}));if(r){var o=p.includes(t.Id),a=v0e(v0e({},r),{style:o?{strokeColor:"#28a745",fill:"#28a745"}:void 0,targetDecorator:o?{style:{strokeColor:"#28a745",fill:"#28a745"}}:void 0,data:t,annotations:[]});"Decision"===e.Description&&"Handle"!==e.Code&&(a.annotations=[{content:null!==(n=t.Name)&&void 0!==n?n:"",style:{color:o?"#28a745":void 0,fill:"white"}}]),m((function(e){return w0e(w0e([],e,!0),[a],!1)}))}}))}))}})).catch((function(){return knt(a("getDataError"))})):knt(a("getProcessApi không hợp lệ!")))}),[s]),x.default.createElement(h5e,{isOpen:s,backdrop:"static",keyboard:!1,toggle:c,className:"modal-dialog-centered modal-fullscreen",contentClassName:"p-0"},x.default.createElement(Znt,{typeModal:"View",handleModal:c,title:a("Workflow")}),x.default.createElement(zEt,{t:a,nodes:d,connectors:f}))},BEt=function(e){var t=e.data,n=e.listData,r=e.type,o=e.setType,a=e.t,i=e.checkInitProcess,l=e.getProcessApi,s=e.approveProcessApi,c=e.approveMultiProcessApi,u=e.checkInitComment,d=e.getCommentPagingApi,h=e.addCommentApi,p=e.deleteCommentApi,f=e.pagingEmployeeApi,m=e.pagingUserApi,v=e.uploadFileApi,g=e.CDN_URL_VIEW,b=e.token,y=e.saveUrl,w=e.approverId,E=e.approverName,k=e.onApproveCompleted;if(!r)return null;var S={approve:Gnt,multiApprove:Gnt,comment:LEt,diagram:REt}[r];return x.default.createElement(S,{data:t,listData:n,type:r,setType:o,t:a,checkInitProcess:i,getProcessApi:l,approveProcessApi:s,approveMultiProcessApi:c,checkInitComment:u,getCommentPagingApi:d,addCommentApi:h,deleteCommentApi:p,pagingEmployeeApi:f,pagingUserApi:m,uploadFileApi:v,CDN_URL_VIEW:g,token:b,saveUrl:y,approverId:w,approverName:E,onApproveCompleted:k})},$Et=function(t){var n,r,o,a,i,l,s,c,u=t.toolbarTemplate,d=t.paramToolbar,h=t.currentPageDefault,p=t.queryOrderDefault,f=t.rowsPerPageDefault,m=t.queryKeyDataView,v=t.isSelectMulti,g=t.canContextMenuItems,b=t.handleContextMenuClick,y=t.rowSelected,w=t.dataSourceFilter,E=t.listContextHide,k=t.querySelectDefault,S=t.t,C=t.contextMenuOpen,M=t.stateId,_=t.viewIdTable,N=t.height,A=t.maxHeight,O=t.hasIndex,I=t.dataSelected,D=t.showColumnChoose,P=t.typeCheckbox,T=t.format,H=t.rowSelection,L=t.dataSource,z=t.columns,Z=t.totalCount,V=t.breakText,j=t.handleDoubleContextMenuClick,W=t.allowResizing,F=t.summary,q=t.hasWorkflow,Y=t.apiWorkflow,U=t.rowClassName,K=t.showToolbar,G=t.allowPaging,X=t.checkInit,J=t.checkInit1,te=t.checkInit2,oe=localStorage.getItem("grid".concat(M)),ae=oe?JSON.parse(oe):null,ie=null==ae?void 0:ae.searchSettings.key,le=null==ae?void 0:ae.filterSettings.columns.map((function(e){return{key:e.fieldOriginal,keyCode:e.fieldOriginal,value:e.value,ope:ge[e.operator],predicate:be[e.predicate]}})),se=localStorage.getItem("sub"),ce=window.localStorage.getItem("i18nextLng"),ue=ce||"vi",de=require("@public/assets/data/locales/".concat(ue,".json")),he=e.useState(""),pe=he[0],fe=he[1],me=e.useState({}),ve=me[0],ye=me[1],we=e.useState(!1),xe=we[0],Ee=we[1],ke=e.useState({Data:[],Total:0}),Se=ke[0],Ce=ke[1],Me=e.useState(null!=h?h:1),_e=Me[0],Ne=Me[1],Ae=e.useState(null!=f?f:100),Oe=Ae[0],Ie=Ae[1],De=e.useState(null!=ie?ie:""),Pe=De[0],Te=De[1],He=e.useState(null!=p?p:[]),Le=He[0],ze=He[1],Re=e.useState(null!=le?le:[]),Be=Re[0],$e=Re[1],Ze=e.useState([]),Ve=Ze[0],je=Ze[1],We=Array.isArray(I)?I:[I],Fe={ascend:"asc",descend:"desc",asc:"asc",desc:"desc"},qe=function(t,n){var r=e.useState(t),o=r[0],a=r[1];return e.useEffect((function(){var e=setTimeout((function(){a(t)}),n);return function(){clearTimeout(e)}}),[t,n]),o}(Pe,500),Ye=function(){return R(void 0,void 0,void 0,(function(){var e,t,n,r,o,a,i,l,s,c,u,h;return B(this,(function(p){switch(p.label){case 0:return M&&Q(L)?(Ee(!0),e=$([],null!=k?k:[],!0),null==d||d.map((function(t){var n,r;("daterange"===t.type||"listDate"===t.type)&&(null===(n=t.data)||void 0===n?void 0:n.length)>0?(e.unshift({key:t.keyCode,value:ee(t.data[0],">="),ope:">=",predicate:";"}),e.unshift({key:t.keyCode,value:ee(t.data[1],"<="),ope:"<=",predicate:";"})):"select"===t.type&&t.isMulti&&(null===(r=t.data)||void 0===r?void 0:r.length)>0?t.data.forEach((function(n){e.unshift({key:t.keyCode,value:n,ope:"==",predicate:";"})})):"select"!==t.type||t.isMulti||Q(t.data)||e.unshift({key:t.keyCode,value:t.data,ope:"==",predicate:";"})})),t=$($([],Be,!0),e,!0).filter((function(e){return!Q(e.value)&&""!==e.value})).map((function(e){return{keyCode:e.key,value:e.value,ope:e.ope,predicate:e.predicate}})),n=null==Le?void 0:Le.map((function(e){return"".concat(e.field,",").concat(Fe[e.order])})).join(";"),[4,_be({ParaJson:JSON.stringify({Filter:JSON.stringify(t),Order:n,PageNumber:_e,PageSize:Oe,Keyword:Pe,ViewId:_,StateId:M})})]):[3,2];case 1:r=p.sent(),o=JSON.parse(null!==(s=null===(l=null==r?void 0:r[0])||void 0===l?void 0:l.dataJson)&&void 0!==s?s:"[]"),a=JSON.parse(null!==(u=null===(c=null==r?void 0:r[0])||void 0===c?void 0:c.workflow)&&void 0!==u?u:"[]"),i={Data:null===(h=JSON.parse(o[0].Data))||void 0===h?void 0:h.map((function(e,t){var n,r,o,i=null==a?void 0:a[e.id];return e.currentProcessCode=null==i?void 0:i.WorkflowStateCode,e.currentProcess=null!==(n=null==i?void 0:i.ProcessStatus)&&void 0!==n?n:S("Unknown"),e.approverId=null==i?void 0:i.ApproverId,e.approver=null==i?void 0:i.ApproverName,e.deadlineStatus=null==i?void 0:i.DeadlineStatus,e.timeLeft=null==i?void 0:i.TimeLeft,e.durationUnit=null==i?void 0:i.DurationUnit,e.hasPermissionApprove=null!==(o=null===(r=null==i?void 0:i.ApproverId)||void 0===r?void 0:r.includes(null!=se?se:""))&&void 0!==o&&o,e.numberOfComments=null==i?void 0:i.NumberOfComments,e.STT=t+1,e})),Total:o[0].Total},setTimeout((function(){Ee(!1),Ce(i)}),150),p.label=2;case 2:return[2]}}))}))};e.useEffect((function(){clearTimeout(c),c=setTimeout((function(){(!Q(X)&&(re(X)&&0===X||ne(X)&&X)||Q(X))&&Ye()}),200)}),$($([qe,_e,Be,Le,Oe,_,M],null!=m?m:[],!0),[X],!1)),e.useEffect((function(){!Q(J)&&(re(J)&&0===J||ne(J)&&J)&&(clearTimeout(c),c=setTimeout((function(){Ye()}),200))}),[J]),e.useEffect((function(){!Q(te)&&(re(te)&&0===te||ne(te)&&te)&&(clearTimeout(c),c=setTimeout((function(){Ye()}),200))}),[te]),e.useEffect((function(){if(_&&Q(z)){R(void 0,void 0,void 0,(function(){var e,t;return B(this,(function(n){switch(n.label){case 0:return[4,Mbe({ParaJson:JSON.stringify({ViewId:_})})];case 1:return e=n.sent(),t=io(e,S,{hasIndex:null==O||O,breakText:V,hasWorkflow:q}),je(t),[2]}}))}))}}),[_]);var Ue=function(e){var t,n=null===(t=e.rowInfo)||void 0===t?void 0:t.rowData;n&&(ye(n),"VIEW_COMMENT"===e.item.id?fe("comment"):"VIEW_PROCESS"===e.item.id?fe("diagram"):"APPROVE_PROCESS"===e.item.id?fe("approve"):"RESET_PROCESS"===e.item.id&&(null==Y?void 0:Y.checkInitProcess)&&function(e,t,n,r,o){var a=hbe(bnt);a.fire({title:e("Confirm"),text:e("ConfirmResetWorkflow"),allowOutsideClick:!1,showCancelButton:!0,confirmButtonText:e("Confirm"),cancelButtonText:e("Cancel"),customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ms-1"},buttonsStyling:!1}).then((function(i){if(i.value){var l={ticketId:n.id,ticketInfo:JSON.stringify(qnt(n)),organizationId:n.organizationId,workflowDefinitionCode:r,isResetProcess:!0,createdBy:null==n?void 0:n.createdBy,createdByName:(null==n?void 0:n.createdByName)||(null==n?void 0:n.createdName)};t(l).unwrap().then((function(t){t.isValid?(o&&o(t),Ent(e("ResetSuccessful"))):knt(e("ResetFail"))})).catch((function(){knt(e("ResetFail"))}))}else i.dismiss,a.DismissReason.cancel}))}(S,null==Y?void 0:Y.initProcessApi,n,M))};return x.default.createElement("div",{className:"App"},x.default.createElement("div",{style:{padding:"0rem"}},x.default.createElement(mbe,{sortMultiple:!0,loading:xe,lang:ue,locale:null===(n=null==de?void 0:de.gridTable)||void 0===n?void 0:n.table,rowKey:"id",showToolbar:K,columns:null!==(r=null!=z?z:Ve)&&void 0!==r?r:[],dataSource:null!==(o=null!=L?L:null==Se?void 0:Se.Data)&&void 0!==o?o:[],height:N,pagination:!1!==G&&{total:null!==(a=null!=Z?Z:null==Se?void 0:Se.Total)&&void 0!==a?a:0,pageSize:Oe,pageSizeOptions:[20,50,100,1e3,1e4],onChange:function(e,t){Ne(e),Ie(t)},locale:null===(i=null==de?void 0:de.gridTable)||void 0===i?void 0:i.pager,showTotal:function(e,t){var n,r,o;return"".concat(t[0],"-").concat(t[1]," / ").concat(e," ").concat(S?S(null!==(o=null===(r=null===(n=null==de?void 0:de.gridTable)||void 0===n?void 0:n.pager)||void 0===r?void 0:r.items)&&void 0!==o?o:"items"):"items")}},scroll:{y:null!=A?A:N},toolbarItems:$([{template:x.default.createElement(wbe,{callback:function(e){Te(null!=e?e:"")},width:250,placeholder:S("Search"),isChangeValueOnEnter:!0}),position:"left"}],null!=u?u:[],!0),recordDoubleClick:function(e){j&&j(e)},format:null!=T?T:{thousandSeparator:",",decimalSeparator:".",decimalScale:2},allowResizing:null==W||W,summary:F,rowClassName:U,showColumnChoose:null==D||D,contextMenuItems:g,contextMenuClick:function(e){b&&(b(e),Ue(e))},contextMenuOpen:C,contextMenuHidden:null!==(l=null==E?void 0:E.list)&&void 0!==l?l:[],rowSelected:y,onFilter:function(e){var t,n=null!==(t=null==e?void 0:e.map((function(e){return(null!=z?z:Ve).some((function(t){return t.field===e.field&&("date"===t.type||"datetime"===t.type)}))&&(e.value=ee(e.value,ge[e.operator])),{key:e.field,keyCode:e.field,value:e.value,ope:ge[e.operator],predicate:be[e.predicate]}})))&&void 0!==t?t:[];$e(n)},onSorter:function(e){Array.isArray(e)?ze(e):Q(null==e?void 0:e.field)?ze([]):ze([e])},selectionSettings:{type:v?"multiple":"single",mode:null!=P?P:void 0,columnWidth:50,hideSelectAll:!1,defaultSelectedRowKeys:null!==(s=null==We?void 0:We.map((function(e){var t;return null!==(t=null==e?void 0:e.rowId)&&void 0!==t?t:null==e?void 0:e.id})))&&void 0!==s?s:[]},editAble:!1,rowSelection:H,t:S,dataSourceFilter:w,onFilterClick:function(e,t){var n=[{value:"equal",label:S("Equal"),key:"=="},{value:"greaterthan",label:S("Greater than"),key:">"},{value:"greaterthanorequal",label:S("Greater Than Or Equal"),key:">="},{value:"lessthan",label:S("Less Than"),key:"<"},{value:"lessthanorequal",label:S("Less Than Or Equal"),key:"<="},{value:"notequal",label:S("Not Equal"),key:"!="}];"building"===e.key&&t(e.key,n)}})),q&&x.default.createElement(BEt,{type:pe,setType:fe,data:ve,listData:[],t:S,checkInitProcess:null==Y?void 0:Y.checkInitProcess,getProcessApi:null==Y?void 0:Y.getProcessApi,approveProcessApi:null==Y?void 0:Y.approveProcessApi,approveMultiProcessApi:null==Y?void 0:Y.approveMultiProcessApi,checkInitComment:null==Y?void 0:Y.checkInitComment,getCommentPagingApi:null==Y?void 0:Y.getCommentPagingApi,addCommentApi:null==Y?void 0:Y.addCommentApi,deleteCommentApi:null==Y?void 0:Y.deleteCommentApi,pagingUserApi:null==Y?void 0:Y.getUserCorePagingApi,uploadFileApi:null==Y?void 0:Y.uploadFileApi,CDN_URL_VIEW:Sbe||"",token:Cbe()||"",saveUrl:"".concat(xbe,"/api/file/upload")}))};function ZEt({children:e,style:t,className:n,role:r,title:o}){return x.default.createElement("div",{role:r,title:o,className:n,style:t},e)}function VEt(e,t){return`${e}__${t}`}function jEt(e,t){return`${e}--${t}`}const WEt="react-split",FEt=jEt(WEt,"dragging"),qEt=jEt(WEt,"vertical"),YEt=jEt(WEt,"horizontal"),UEt=jEt(WEt,"disabled"),KEt=VEt(WEt,"pane"),GEt=VEt(WEt,"sash"),XEt=jEt(GEt,"vertical"),QEt=jEt(GEt,"horizontal"),JEt=jEt(GEt,"disabled");function ekt(...e){const t=[];for(const n of e){if(!n)continue;const e=typeof n;if("string"!==e&&"number"!==e){if("object"===e){if(n.toString!==Object.prototype.toString){t.push(n.toString());continue}for(const e in n)Object.hasOwnProperty.call(n,e)&&n[e]&&t.push(e)}}else t.push(`${n}`)}return t.join(" ")}function tkt(e,t,n=1/0){return void 0===e?n:"number"==typeof e?e:e.endsWith("%")?t*(+e.replace("%","")/100):e.endsWith("px")?+e.replace("px",""):n}var nkt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function rkt(t){var{className:n,render:r,onDragStart:o,onDragging:a,onDragEnd:i}=t,l=nkt(t,["className","render","onDragStart","onDragging","onDragEnd"]);const s=e.useRef(null),[c,u]=e.useState(!1),[d,h]=e.useState(!1),p=function(e){a(e)},f=function(e){h(!1),i(e),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",f)};return x.default.createElement("div",Object.assign({role:"Resizer",className:ekt(GEt,n),onMouseEnter:()=>{s.current=setTimeout((()=>{u(!0)}),150)},onMouseLeave:()=>{s.current&&(u(!1),clearTimeout(s.current))},onMouseDown:e=>{h(!0),o(e),window.addEventListener("mousemove",p),window.addEventListener("mouseup",f)}},l),r(d||c))}var okt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function akt(e){var{className:t,children:n,active:r,type:o}=e,a=okt(e,["className","children","active","type"]);return x.default.createElement("div",Object.assign({className:ekt("split-sash-content",r&&"split-sash-content-active",o&&`split-sash-content-${o}`,t)},a),n)}var ikt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const lkt=t=>{var n,{children:r,sizes:o,allowResize:a=!0,split:i="vertical",className:l,sashRender:s=(e,t)=>x.default.createElement(akt,{active:t,type:"vscode"}),resizerSize:c=4,performanceMode:u=!1,onChange:d=()=>null,onDragStart:h=()=>null,onDragEnd:p=()=>null}=t,f=ikt(t,["children","sizes","allowResize","split","className","sashRender","resizerSize","performanceMode","onChange","onDragStart","onDragEnd"]);const m=e.useRef({x:0,y:0}),v=e.useRef(null),g=e.useRef({sizes:[],sashPosSizes:[]}),[b,y]=e.useState({}),[w,E]=e.useState(!1);e.useEffect((()=>{const e=new ResizeObserver((()=>{var e,t;y(null!==(t=null===(e=null==v?void 0:v.current)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==t?t:{})}));return e.observe(v.current),()=>{e.disconnect()}}),[]);const{sizeName:k,splitPos:S,splitAxis:C}=e.useMemo((()=>({sizeName:"vertical"===i?"width":"height",splitPos:"vertical"===i?"left":"top",splitAxis:"vertical"===i?"x":"y"})),[i]),M=null!==(n=b[k])&&void 0!==n?n:0,_=e.useMemo((()=>r.map((e=>{const t=[0,1/0];if(e.type===ZEt){const{minSize:n,maxSize:r}=e.props;t[0]=tkt(n,M,0),t[1]=tkt(r,M)}return t}))),[r,M]),N=e.useMemo((function(){let e=0,t=0;const n=r.map(((n,r)=>{const a=tkt(o[r],M);return a===1/0?e++:t+=a,a}));if(t>M||!e&&t<M){const e=(t-M)/t;return n.map((t=>t===1/0?0:t-t*e))}if(e>0){const r=(M-t)/e;return n.map((e=>e===1/0?r:e))}return n}),[...o,r.length,M]),A=e.useMemo((()=>N.reduce(((e,t)=>[...e,e[e.length-1]+t]),[0])),[...N]),O=e.useCallback((function(e){var t,n;null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.classList)||void 0===n||n.add(UEt),m.current={x:e.pageX,y:e.pageY},g.current={sizes:N,sashPosSizes:A},E(!0),h(e)}),[h,N,A]),I=e.useCallback((function(e){var t,n;null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.classList)||void 0===n||n.remove(UEt),m.current={x:e.pageX,y:e.pageY},g.current={sizes:N,sashPosSizes:A},E(!1),p(e)}),[p,N,A]),D=e.useCallback((function(e,t){let n={x:e.pageX,y:e.pageY}[C]-m.current[C];const r=-Math.min(N[t]-_[t][0],_[t+1][1]-N[t+1]),o=Math.min(N[t+1]-_[t+1][0],_[t][1]-N[t]);n<r&&(n=r),n>o&&(n=o);const a=[...N];a[t]+=n,a[t+1]-=n,d(a)}),[_,d]),P=!(u&&w),T=P?N:g.current.sizes,H=P?A:g.current.sashPosSizes;return x.default.createElement("div",Object.assign({className:ekt(WEt,"vertical"===i&&qEt,"horizontal"===i&&YEt,w&&FEt,l),ref:v},f),r.map(((e,t)=>{const n=e.type===ZEt,r=n?e.props:{};return x.default.createElement(ZEt,{key:t,className:ekt(KEt,r.className),style:Object.assign(Object.assign({},r.style),{[k]:T[t],[S]:H[t]})},n?r.children:e)})),A.slice(1,-1).map(((e,t)=>x.default.createElement(rkt,{key:t,className:ekt(!a&&JEt,"vertical"===i?XEt:QEt),style:{[k]:c,[S]:e-c/2},render:s.bind(null,t),onDragStart:O,onDragging:e=>D(e,t),onDragEnd:I}))))};Pa(".react-split {\n flex: 1;\n height: 100%;\n position: relative;\n width: 100%;\n}\n.react-split__pane {\n height: 100%;\n position: absolute;\n white-space: normal;\n width: 100%;\n overflow: hidden;\n}\n.react-split__sash {\n height: 100%;\n position: absolute;\n top: 0;\n transition: background-color 0.1s;\n width: 100%;\n z-index: 2;\n}\n.react-split__sash--disabled {\n pointer-events: none;\n}\n.react-split__sash--vertical {\n cursor: col-resize;\n}\n.react-split__sash--horizontal {\n cursor: row-resize;\n}\n.react-split__sash-content {\n width: 100%;\n height: 100%;\n}\n.react-split__sash-content--active {\n background-color: #175ede;\n}\n.react-split--dragging.react-split--vertical {\n cursor: col-resize;\n}\n.react-split--dragging.react-split--horizontal {\n cursor: row-resize;\n}\n\nbody.react-split--disabled {\n user-select: none;\n}\n\n.split-sash-content {\n width: 100%;\n height: 100%;\n}\n.split-sash-content.split-sash-content-vscode.split-sash-content-active {\n background-color: #175ede;\n}");var skt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ckt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},ukt="e-rtl",dkt="e-overlay",hkt="e-nav-arrow",pkt="e-nav-right-arrow",fkt="e-nav-left-arrow",mkt="e-scroll-nav",vkt="e-scroll-right-nav",gkt="e-scroll-left-nav",bkt="e-scroll-device",ykt="e-scroll-overlay",wkt="e-scroll-right-overlay",xkt="e-scroll-left-overlay",Ekt=function(e){function t(t,n){return e.call(this,t,n)||this}return skt(t,e),t.prototype.preRender=function(){this.browser=zKe.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=zKe.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=jUe("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(ukt)},t.prototype.render=function(){this.touchModule=new uXe(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),RKe.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(bkt),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){ZUe(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var n=this.element,r=0,o=[].slice.call(n.children);r<o.length;r++){var a=o[r];e.appendChild(a)}t.appendChild(e),n.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var t=this.element;t.style.display="",t.classList.remove("e-hscroll"),t.classList.remove(bkt);var n=QKe(".e-"+t.id+"_nav."+mkt,t),r=QKe("."+ykt,t);[].slice.call(r).forEach((function(e){UKe(e)}));for(var o=0,a=[].slice.call(this.scrollItems.children);o<a.length;o++){var i=a[o];t.appendChild(i)}this.uniqueId&&this.element.removeAttribute("id"),UKe(this.scrollEle),n.length>0&&(UKe(n[0]),ZUe(n[1])||UKe(n[1])),RKe.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},t.prototype.disable=function(e){var t=QKe(".e-scroll-nav:not(."+dkt+")",this.element);e?this.element.classList.add(dkt):this.element.classList.remove(dkt),[].slice.call(t).forEach((function(t){t.setAttribute("tabindex",e?"-1":"0")}))},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),n=this.createElement("div",{className:ykt+" "+wkt}),r="e-"+e.id.concat("_nav "+mkt+" "+vkt),o=this.createElement("div",{id:t.concat("_right"),className:r}),a=this.createElement("div",{className:pkt+" "+hkt+" e-icons"});o.appendChild(a);var i=this.createElement("div",{className:ykt+" "+xkt});this.ieCheck&&o.classList.add("e-ie-align"),e.appendChild(n),e.appendChild(o),e.insertBefore(i,e.firstChild),this.eventBinding([o])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav "+mkt+" "+vkt),r={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},o=this.createElement("div",{className:n,attrs:r});o.setAttribute("aria-disabled","false");var a=this.createElement("div",{className:pkt+" "+hkt+" e-icons"}),i="e-"+e.id.concat("_nav "+mkt+" "+gkt),l={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},s=this.createElement("div",{className:i+" "+dkt,attrs:l});s.setAttribute("aria-disabled","true");var c=this.createElement("div",{className:fkt+" "+hkt+" e-icons"});s.appendChild(c),o.appendChild(a),e.appendChild(o),e.insertBefore(s,e.firstChild),this.ieCheck&&(o.classList.add("e-ie-align"),s.classList.add("e-ie-align")),this.eventBinding([o,s])},t.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout((function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)}),100)}},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach((function(e){new uXe(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",(function(e){e.preventDefault()})),RKe.add(e,"click",t.clickEventHandler,t)}))},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,n=e.originalEvent.target;n=this.contains(n,mkt)?n.firstElementChild:n;this.timeout=window.setInterval((function(){t.eleScrolling(10,n,!0)}),50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,n){var r=this.element,o=t.classList;o.contains(mkt)&&(o=t.querySelector("."+hkt).classList),this.contains(r,ukt)&&this.browserCheck&&(e=-e),!this.contains(r,ukt)||this.browserCheck||this.ieCheck?o.contains(pkt)?this.frameScrollRequest(e,"add",n):this.frameScrollRequest(e,"",n):o.contains(fkt)?this.frameScrollRequest(e,"add",n):this.frameScrollRequest(e,"",n)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(e){var t,n=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var r=.5,o=function(){var a=Math.sin(r);a<=0?window.cancelAnimationFrame(a):("Left"===e.swipeDirection?n.scrollLeft+=t*a:"Right"===e.swipeDirection&&(n.scrollLeft-=t*a),r-=.5,window.requestAnimationFrame(o))};o()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e},t.prototype.frameScrollRequest=function(e,t,n){var r=this;if(n)this.scrollUpdating(e,t);else{this.customStep||[].slice.call(QKe("."+ykt,this.element)).forEach((function(t){e-=t.offsetWidth}));var o=function(){var n,a;r.contains(r.element,ukt)&&r.browserCheck?(n=-e,a=-10):(n=e,a=10),n<10?window.cancelAnimationFrame(a):(r.scrollUpdating(a,t),e-=a,window.requestAnimationFrame(o))};o()}},t.prototype.touchHandler=function(e){var t=this.scrollEle,n=e.distanceX;this.ieCheck&&this.contains(this.element,ukt)&&(n=-n),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+n:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-n)},t.prototype.arrowDisabling=function(e,t){if(this.isDevice){var n=(ZUe(e)?t:e).querySelector("."+hkt);ZUe(e)?nGe(n,[pkt],[fkt]):nGe(n,[fkt],[pkt])}else e&&t&&(e.classList.add(dkt),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(dkt),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0"));this.repeatScroll()},t.prototype.scrollHandler=function(e){var t=e.target,n=t.offsetWidth;this.element;var r=this.element.querySelector("."+gkt),o=this.element.querySelector("."+vkt),a=this.element.querySelector("."+xkt),i=this.element.querySelector("."+wkt),l=t.scrollLeft;if(l<=0&&(l=-l),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(a=this.element.querySelector("."+wkt),i=this.element.querySelector("."+xkt)),a.style.width=l<40?l+"px":"40px",t.scrollWidth-Math.ceil(n+l)<40?i.style.width=t.scrollWidth-Math.ceil(n+l)+"px":i.style.width="40px"),0===l)this.arrowDisabling(r,o);else if(Math.ceil(n+l+.1)>=t.scrollWidth)this.arrowDisabling(o,r);else{var s=this.element.querySelector("."+mkt+"."+dkt);s&&(s.classList.remove(dkt),s.setAttribute("aria-disabled","false"),s.setAttribute("tabindex","0"))}},t.prototype.onPropertyChanged=function(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(ukt):this.element.classList.remove(ukt)}}},ckt([vGe(null)],t.prototype,"scrollStep",void 0),t=ckt([wGe],t)}(qGe),kkt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Skt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Ckt="e-rtl",Mkt="e-overlay",_kt="e-nav-arrow",Nkt="e-nav-up-arrow",Akt="e-nav-down-arrow",Okt="e-scroll-nav",Ikt="e-scroll-up-nav",Dkt="e-scroll-down-nav",Pkt="e-scroll-device",Tkt="e-scroll-overlay",Hkt="e-scroll-up-overlay",Lkt="e-scroll-down-overlay",zkt=function(e){function t(t,n){return e.call(this,t,n)||this}return kkt(t,e),t.prototype.preRender=function(){this.browser=zKe.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=zKe.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=jUe("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(Ckt)},t.prototype.render=function(){this.touchModule=new uXe(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),RKe.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(Pkt),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),RKe.add(this.element,"wheel",this.wheelEventHandler,this)},t.prototype.setScrollState=function(){ZUe(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){var e=$Ke("div",{className:"e-vscroll-content"}),t=$Ke("div",{className:"e-vscroll-bar"});t.setAttribute("tabindex","-1");for(var n=this.element,r=0,o=[].slice.call(n.children);r<o.length;r++){var a=o[r];e.appendChild(a)}t.appendChild(e),n.appendChild(t),t.style.overflow="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"vScroll"},t.prototype.destroy=function(){var t=this.element;t.style.display="",VKe([this.element],["e-vscroll",Pkt]);var n=QKe(".e-"+t.id+"_nav."+Okt,t),r=QKe("."+Tkt,t);[].slice.call(r).forEach((function(e){UKe(e)}));for(var o=0,a=[].slice.call(this.scrollItems.children);o<a.length;o++){var i=a[o];t.appendChild(i)}this.uniqueId&&this.element.removeAttribute("id"),UKe(this.scrollEle),n.length>0&&(UKe(n[0]),ZUe(n[1])||UKe(n[1])),RKe.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},t.prototype.disable=function(e){var t=QKe(".e-scroll-nav:not(."+Mkt+")",this.element);e?this.element.classList.add(Mkt):this.element.classList.remove(Mkt),[].slice.call(t).forEach((function(t){t.setAttribute("tabindex",e?"-1":"0")}))},t.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),n=$Ke("div",{className:Tkt+" "+Lkt}),r="e-"+e.id.concat("_nav "+Okt+" "+Dkt),o=$Ke("div",{id:t.concat("down"),className:r}),a=$Ke("div",{className:Akt+" "+_kt+" e-icons"});o.appendChild(a);var i=$Ke("div",{className:Tkt+" "+Hkt});this.ieCheck&&o.classList.add("e-ie-align"),e.appendChild(n),e.appendChild(o),e.insertBefore(i,e.firstChild),this.eventBinding([o])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav "+Okt+" "+Dkt),r=$Ke("div",{id:t.concat("_down"),className:n});r.setAttribute("aria-disabled","false");var o=$Ke("div",{className:Akt+" "+_kt+" e-icons"}),a="e-"+e.id.concat("_nav "+Okt+" "+Ikt),i=$Ke("div",{id:t.concat("_up"),className:a+" "+Mkt});i.setAttribute("aria-disabled","true");var l=$Ke("div",{className:Nkt+" "+_kt+" e-icons"});i.appendChild(l),r.appendChild(o),r.setAttribute("tabindex","0"),e.appendChild(r),e.insertBefore(i,e.firstChild),this.ieCheck&&(r.classList.add("e-ie-align"),i.classList.add("e-ie-align")),this.eventBinding([r,i])},t.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout((function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)}),100)}},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach((function(e){new uXe(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",(function(e){e.preventDefault()})),RKe.add(e,"click",t.clickEventHandler,t)}))},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,n=e.originalEvent.target;n=this.contains(n,Okt)?n.firstElementChild:n;this.timeout=window.setInterval((function(){t.eleScrolling(10,n,!0)}),50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,n){var r=t.classList;r.contains(Okt)&&(r=t.querySelector("."+_kt).classList),r.contains(Akt)?this.frameScrollRequest(e,"add",n):r.contains(Nkt)&&this.frameScrollRequest(e,"",n)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},t.prototype.swipeHandler=function(e){var t,n=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var r=.5,o=function(){var a=Math.sin(r);a<=0?window.cancelAnimationFrame(a):("Up"===e.swipeDirection?n.scrollTop+=t*a:"Down"===e.swipeDirection&&(n.scrollTop-=t*a),r-=.02,window.requestAnimationFrame(o))};o()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},t.prototype.frameScrollRequest=function(e,t,n){var r=this;if(n)this.scrollUpdating(e,t);else{this.customStep||[].slice.call(QKe("."+Tkt,this.element)).forEach((function(t){e-=t.offsetHeight}));var o=function(){e<10?window.cancelAnimationFrame(10):(r.scrollUpdating(10,t),e-=10,window.requestAnimationFrame(o))};o()}},t.prototype.touchHandler=function(e){var t=this.scrollEle,n=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+n:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-n)},t.prototype.arrowDisabling=function(e,t){if(this.isDevice){var n=(ZUe(e)?t:e).querySelector("."+_kt);ZUe(e)?nGe(n,[Akt],[Nkt]):nGe(n,[Nkt],[Akt])}else e.classList.add(Mkt),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(Mkt),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0");this.repeatScroll()},t.prototype.scrollEventHandler=function(e){var t=e.target,n=t.offsetHeight,r=this.element.querySelector("."+Ikt),o=this.element.querySelector("."+Dkt),a=this.element.querySelector("."+Hkt),i=this.element.querySelector("."+Lkt),l=t.scrollTop;if(l<=0&&(l=-l),this.isDevice&&(a.style.height=l<40?l+"px":"40px",t.scrollHeight-Math.ceil(n+l)<40?i.style.height=t.scrollHeight-Math.ceil(n+l)+"px":i.style.height="40px"),0===l)this.arrowDisabling(r,o);else if(Math.ceil(n+l+.1)>=t.scrollHeight)this.arrowDisabling(o,r);else{var s=this.element.querySelector("."+Okt+"."+Mkt);s&&(s.classList.remove(Mkt),s.setAttribute("aria-disabled","false"),s.setAttribute("tabindex","0"))}},t.prototype.onPropertyChanged=function(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(Ckt):this.element.classList.remove(Ckt)}}},Skt([vGe(null)],t.prototype,"scrollStep",void 0),t=Skt([wGe],t)}(qGe),Rkt=function(){function e(e){return this.subQuery=null,this.isChild=!1,this.distincts=[],this.queries=[],this.key="",this.fKey="","string"==typeof e?this.fromTable=e:e&&e instanceof Array&&(this.lookups=e),this.expands=[],this.sortedColumns=[],this.groupedColumns=[],this.subQuery=null,this.isChild=!1,this.params=[],this.lazyLoad=[],this}return e.prototype.setKey=function(e){return this.key=e,this},e.prototype.using=function(e){return this.dataManager=e,this},e.prototype.execute=function(e,t,n,r){return(e=e||this.dataManager)?e.executeQuery(this,t,n,r):Zkt.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.executeLocal=function(e){return(e=e||this.dataManager)?e.executeLocal(this):Zkt.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.clone=function(){var t=new e;return t.queries=this.queries.slice(0),t.key=this.key,t.isChild=this.isChild,t.dataManager=this.dataManager,t.fromTable=this.fromTable,t.params=this.params.slice(0),t.expands=this.expands.slice(0),t.sortedColumns=this.sortedColumns.slice(0),t.groupedColumns=this.groupedColumns.slice(0),t.subQuerySelector=this.subQuerySelector,t.subQuery=this.subQuery,t.fKey=this.fKey,t.isCountRequired=this.isCountRequired,t.distincts=this.distincts.slice(0),t.lazyLoad=this.lazyLoad.slice(0),t},e.prototype.from=function(e){return this.fromTable=e,this},e.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},e.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.where=function(e,t,n,r,o){t=t?t.toLowerCase():null;var a=null;return"string"==typeof e?a=new Bkt(e,t,n,r,o):e instanceof Bkt&&(a=e),this.queries.push({fn:"onWhere",e:a}),this},e.prototype.search=function(e,t,n,r,o){"string"==typeof t&&(t=[t]),n&&"none"!==n||(n="contains");var a=Zkt.fnOperators[n];return this.queries.push({fn:"onSearch",e:{fieldNames:t,operator:n,searchKey:e,ignoreCase:r,ignoreAccent:o,comparer:a}}),this},e.prototype.sortBy=function(e,t,n){return this.sortByForeignKey(e,t,n)},e.prototype.sortByForeignKey=function(t,n,r,o){var a,i,l=ZUe(o)?"ascending":o;if("string"==typeof t&&Zkt.endsWith(t.toLowerCase()," desc")&&(t=t.replace(/ desc$/i,""),n="descending"),n&&"string"!=typeof n||(l=n?n.toLowerCase():"ascending",n=Zkt.fnSort(n)),r){a=e.filterQueries(this.queries,"onSortBy");for(var s=0;s<a.length;s++)if("string"==typeof(i=a[s].e.fieldName)){if(i===t)return this}else if(i instanceof Array)for(var c=0;c<i.length;c++)if(i[c]===t||t.toLowerCase()===i[c]+" desc")return this}return this.queries.push({fn:"onSortBy",e:{fieldName:t,comparer:n,direction:l}}),this},e.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},e.prototype.group=function(e,t,n){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:n||null}}),this},e.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},e.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},e.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},e.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},e.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},e.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},e.prototype.foreignKey=function(e){return this.fKey=e,this},e.prototype.requiresCount=function(){return this.isCountRequired=!0,this},e.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},e.filterQueries=function(e,t){return e.filter((function(e){return e.fn===t}))},e.filterQueryLists=function(e,t){for(var n=e.filter((function(e){return-1!==t.indexOf(e.fn)})),r={},o=0;o<n.length;o++)r[n[o].fn]||(r[n[o].fn]=n[o].e);return r},e}(),Bkt=function(){function e(t,n,r,o,a){return void 0===o&&(o=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof t?(this.field=t,this.operator=n.toLowerCase(),this.value=r,this.ignoreCase=o,this.ignoreAccent=a,this.isComplex=!1,this.comparer=Zkt.fnOperators.processOperator(this.operator)):(t instanceof e&&r instanceof e||r instanceof Array)&&(this.isComplex=!0,this.condition=n.toLowerCase(),this.predicates=[t],r instanceof Array?[].push.apply(this.predicates,r):this.predicates.push(r)),this}return e.and=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.combinePredicates([].slice.call(t,0),"and")},e.prototype.and=function(t,n,r,o,a){return e.combine(this,t,n,r,"and",o,a)},e.or=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.combinePredicates([].slice.call(t,0),"or")},e.prototype.or=function(t,n,r,o,a){return e.combine(this,t,n,r,"or",o,a)},e.fromJson=function(e){if(e instanceof Array){for(var t=[],n=0,r=e.length;n<r;n++)t.push(this.fromJSONData(e[n]));return t}var o=e;return this.fromJSONData(o)},e.prototype.validate=function(e){var t,n,r=this.predicates?this.predicates:[];if(!this.isComplex&&this.comparer)return this.comparer.call(this,Zkt.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);t="and"===this.condition;for(var o=0;o<r.length;o++)if(n=r[o].validate(e),t){if(!n)return!1}else if(n)return!0;return t},e.prototype.toJson=function(){var e,t;if(this.isComplex){e=[],t=this.predicates;for(var n=0;n<t.length;n++)e.push(t[n].toJson())}return{isComplex:this.isComplex,field:this.field,operator:this.operator,value:this.value,ignoreCase:this.ignoreCase,ignoreAccent:this.ignoreAccent,condition:this.condition,predicates:e}},e.combinePredicates=function(t,n){if(1===t.length){if(!(t[0]instanceof Array))return t[0];t=t[0]}return new e(t[0],n,t.slice(1))},e.combine=function(t,n,r,o,a,i,l){return n instanceof e?e[a](t,n):"string"==typeof n?e[a](t,new e(n,r,o,i,l)):Zkt.throwError("Predicate - "+a+" : invalid arguments")},e.fromJSONData=function(t){for(var n=t.predicates||[],r=n.length,o=[],a=0;a<r;a++)o.push(this.fromJSONData(n[a]));return t.isComplex?new e(o[0],t.condition,o.slice(1)):new e(t.field,t.operator,t.value,t.ignoreCase,t.ignoreAccent)},e}(),$kt={GroupGuid:"{271bbba0-1ee7}"},Zkt=function(){function e(){}return e.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},e.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},e.startsWith=function(e,t){return e.slice(0,t.length)===t},e.fnSort=function(t){return"ascending"===(t=t?e.toLowerCase(t):"ascending")?this.fnAscending:this.fnDescending},e.fnAscending=function(e,t){return ZUe(e)&&ZUe(t)||null==t?-1:"string"==typeof e?e.localeCompare(t):null==e?1:e-t},e.fnDescending=function(e,t){return ZUe(e)&&ZUe(t)?-1:null==t?1:"string"==typeof e?-1*e.localeCompare(t):null==e?-1:t-e},e.extractFields=function(e,t){for(var n={},r=0;r<t.length;r++)n=this.setValue(t[r],this.getObject(t[r],e),n);return n},e.select=function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(this.extractFields(e[r],t));return n},e.group=function(t,n,r,o,a,i,l){o=o||1;var s=t,c="GroupGuid";if(s.GroupGuid===$kt[c]){for(var u=function(e){if(ZUe(a))s[e].items=d.group(s[e].items,n,r,s.level+1,null,i,l),s[e].count=s[e].items.length;else{var t,o=a.filter((function(t){return t.key===s[e].key}));t=a.indexOf(o[0]),s[e].items=d.group(s[e].items,n,r,s.level+1,a[t].items,i,l),s[e].count=a[t].count}},d=this,h=0;h<s.length;h++)u(h);return s.childLevels+=1,s}var p={},f=[];f.GroupGuid=$kt[c],f.level=o,f.childLevels=0,f.records=s;for(var m=function(e){var t=v.getVal(s,e,n);if(ZUe(i)||(t=i(t,n)),!p[t]&&(p[t]={key:t,count:0,items:[],aggregates:{},field:n},f.push(p[t]),!ZUe(a))){var o=a.filter((function(e){return e.key===p[t].key}));p[t].count=o[0].count}p[t].count=ZUe(a)?p[t].count+=1:p[t].count,(!l||l&&r.length)&&p[t].items.push(s[e])},v=this,g=0;g<s.length;g++)m(g);if(r&&r.length){var b=function(t){for(var n={},o=void 0,i=r,l=0;l<r.length;l++)if(o=e.aggregates[r[l].type],ZUe(a))o&&(n[i[l].field+" - "+i[l].type]=o(f[t].items,i[l].field));else{var s=a.filter((function(e){return e.key===f[t].key}));o&&(n[i[l].field+" - "+i[l].type]=o(s[0].items,i[l].field))}f[t].aggregates=n};for(g=0;g<f.length;g++)b(g)}if(l&&f.length&&r.length)for(g=0;g<f.length;g++)f[g].items=[];return s.length&&f||s},e.buildHierarchy=function(e,t,n,r,o){var a,i={};for(r.result&&(r=r.result),r.GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),a=0;a<r.length;a++){(i[l=this.getObject(e,r[a])]||(i[l]=[])).push(r[a])}for(a=0;a<n.length;a++){var l=this.getObject(o||e,n[a]);n[a][t]=i[l]}},e.getFieldList=function(e,t,n){if(void 0===n&&(n=""),null==t)return this.getFieldList(e,[],n);for(var r=e,o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];"object"!=typeof r[i]||r[i]instanceof Array?t.push(n+i):this.getFieldList(r[i],t,n+i+".")}return t},e.getObject=function(e,t){if(!e)return t;if(t){if(-1===e.indexOf("."))return t[e];for(var n=t,r=e.split("."),o=0;o<r.length&&null!=n;o++)n=n[r[o]];return n}},e.setValue=function(e,t,n){var r,o,a=e.toString().split("."),i=n||{},l=i,s=a.length;for(r=0;r<s;r++)o=a[r],r+1===s?l[o]=void 0===t?void 0:t:ZUe(l[o])&&(l[o]={}),l=l[o];return i},e.sort=function(e,t,n){if(e.length<=1)return e;var r=parseInt((e.length/2).toString(),10),o=e.slice(0,r),a=e.slice(r);return o=this.sort(o,t,n),a=this.sort(a,t,n),this.merge(o,a,t,n)},e.ignoreDiacritics=function(t){return"string"!=typeof t?t:t.split("").map((function(t){return t in e.diacritics?e.diacritics[t]:t})).join("")},e.merge=function(e,t,n,r){for(var o,a=[];e.length>0||t.length>0;)o=e.length>0&&t.length>0?r?r(this.getVal(e,0,n),this.getVal(t,0,n),e[0],t[0])<=0?e:t:e[0][n]<e[0][n]?e:t:e.length>0?e:t,a.push(o.shift());return a},e.getVal=function(e,t,n){return n?this.getObject(n,e[t]):e[t]},e.toLowerCase=function(e){return e?"string"==typeof e?e.toLowerCase():e.toString():0===e||!1===e?e.toString():""},e.callAdaptorFunction=function(e,t,n,r){if(t in e){var o=e[t](n,r);ZUe(o)||(n=o)}return n},e.getAddParams=function(t,n,r){var o={};return e.callAdaptorFunction(t,"addParams",{dm:n,query:r,params:r.params,reqParams:o}),o},e.isPlainObject=function(e){return!!e&&e.constructor===Object},e.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},e.getGuid=function(e){var t;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,(function(e,n){if("crypto"in window&&"getRandomValues"in crypto){var r=new Uint8Array(1);window.crypto.getRandomValues(r),t=r[0]%16|0}else t=16*Math.random()|0;return"0123456789abcdef"[19===n?3&t|8:t]}))},e.isNull=function(e){return null==e},e.getItemFromComparer=function(t,n,r){var o,a,i,l=0,s="string"==typeof e.getVal(t,0,n);if(t.length)for(;ZUe(o)&&l<t.length;)o=e.getVal(t,l,n),i=t[l++];for(;l<t.length;l++)ZUe(a=e.getVal(t,l,n))||(s&&(o=+o,a=+a),r(o,a)>0&&(o=a,i=t[l]));return i},e.distinct=function(t,n,r){r=!ZUe(r)&&r;var o,a=[],i={};return t.forEach((function(l,s){(o="object"==typeof t[s]?e.getVal(t,s,n):t[s])in i||(a.push(r?t[s]:o),i[o]=1)})),a},e.processData=function(e,t){var n=this.prepareQuery(e),r=new Qkt(t);e.requiresCounts&&n.requiresCount();var o=r.executeLocal(n),a={result:e.requiresCounts?o.result:o,count:o.count,aggregates:JSON.stringify(o.aggregates)};return e.requiresCounts?a:o},e.prepareQuery=function(t){var n=this,r=new Rkt;(t.select&&r.select(t.select),t.where)&&e.parse.parseJson(t.where).filter((function(e){if(ZUe(e.condition))r.where(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent);else{var t=[];e.field?t.push(new Bkt(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent)):t=t.concat(n.getPredicate(e.predicates)),"or"==e.condition?r.where(Bkt.or(t)):"and"==e.condition&&r.where(Bkt.and(t))}}));t.search&&e.parse.parseJson(t.search).filter((function(e){return r.search(e.key,e.fields,e.operator,e.ignoreCase,e.ignoreAccent)}));return t.aggregates&&t.aggregates.filter((function(e){return r.aggregate(e.type,e.field)})),t.sorted&&t.sorted.filter((function(e){return r.sortBy(e.name,e.direction)})),t.skip&&r.skip(t.skip),t.take&&r.take(t.take),t.group&&t.group.filter((function(e){return r.group(e)})),r},e.getPredicate=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.field)t.push(new Bkt(r.field,r.operator,r.value,r.ignoreCase,r.ignoreAccent));else{for(var o=[],a=this.getPredicate(r.predicates),i=0,l=Object.keys(a);i<l.length;i++){var s=l[i];o.push(a[s])}t.push("or"==r.condition?Bkt.or(o):Bkt.and(o))}}return t},e.serverTimezoneOffset=null,e.timeZoneHandling=!0,e.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},e.aggregates={sum:function(t,n){for(var r,o=0,a="number"!=typeof e.getVal(t,0,n),i=0;i<t.length;i++)r=e.getVal(t,i,n),isNaN(r)||null===r||(a&&(r=+r),o+=r);return o},average:function(t,n){return e.aggregates.sum(t,n)/t.length},min:function(t,n){var r;return"function"==typeof n&&(r=n,n=null),e.getObject(n,e.getItemFromComparer(t,n,r||e.fnAscending))},max:function(t,n){var r;return"function"==typeof n&&(r=n,n=null),e.getObject(n,e.getItemFromComparer(t,n,r||e.fnDescending))},truecount:function(e,t){return new Qkt(e).executeLocal((new Rkt).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new Qkt(e).executeLocal((new Rkt).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},e.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},e.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},e.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof"},e.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains"},e.diacritics={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e.fnOperators={equal:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?e.toLowerCase(t)===e.toLowerCase(n):t===n},notequal:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),!e.fnOperators.equal(t,n,r)},lessthan:function(t,n,r){return r?e.toLowerCase(t)<e.toLowerCase(n):(ZUe(t)&&(t=void 0),t<n)},greaterthan:function(t,n,r){return r?e.toLowerCase(t)>e.toLowerCase(n):t>n},lessthanorequal:function(t,n,r){return r?e.toLowerCase(t)<=e.toLowerCase(n):(ZUe(t)&&(t=void 0),t<=n)},greaterthanorequal:function(t,n,r){return r?e.toLowerCase(t)>=e.toLowerCase(n):t>=n},contains:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?!ZUe(t)&&!ZUe(n)&&-1!==e.toLowerCase(t).indexOf(e.toLowerCase(n)):!ZUe(t)&&!ZUe(n)&&-1!==t.toString().indexOf(n)},notnull:function(e){return null!==e},isnull:function(e){return null===e},startswith:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?t&&n&&e.startsWith(e.toLowerCase(t),e.toLowerCase(n)):t&&n&&e.startsWith(t,n)},endswith:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?t&&n&&e.endsWith(e.toLowerCase(t),e.toLowerCase(n)):t&&n&&e.endsWith(t,n)},processSymbols:function(t){var n=e.operatorSymbols[t];return n?e.fnOperators[n]:e.throwError("Query - Process Operator : Invalid operator")},processOperator:function(t){var n=e.fnOperators[t];return n||e.fnOperators.processSymbols(t)}},e.parse={parseJson:function(t){return"string"==typeof t?t=JSON.parse(t,e.parse.jsonReviver):t instanceof Array?e.parse.iterateAndReviveArray(t):"object"==typeof t&&null!==t&&e.parse.iterateAndReviveJson(t),t},iterateAndReviveArray:function(t){for(var n=0;n<t.length;n++)"object"==typeof t[n]&&null!==t[n]?e.parse.iterateAndReviveJson(t[n]):"string"!=typeof t[n]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(t[n])?t[n]=e.parse.parseJson(t[n]):t[n]=e.parse.jsonReviver("",t[n])},iterateAndReviveJson:function(t){for(var n,r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];e.startsWith(a,"__")||("object"==typeof(n=t[a])?n instanceof Array?e.parse.iterateAndReviveArray(n):n&&e.parse.iterateAndReviveJson(n):t[a]=e.parse.jsonReviver(t[a],n))}},jsonReviver:function(t,n){if("string"==typeof n){var r=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(n),o=e.timeZoneHandling?e.serverTimezoneOffset:null;if(r)return e.dateParse.toTimeZone(new Date(parseInt(r[1],10)),o,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(n)){var a=n.indexOf("Z")>-1||n.indexOf("z")>-1,i=n.split(/[^0-9.]/);if(a)n=e.dateParse.toTimeZone(new Date(parseInt(i[0],10),parseInt(i[1],10)-1,parseInt(i[2],10),parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)),e.serverTimezoneOffset,!1);else{var l=new Date(parseInt(i[0],10),parseInt(i[1],10)-1,parseInt(i[2],10),parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)),s=parseInt(i[6],10),c=parseInt(i[7],10);if(isNaN(s)&&isNaN(c))return l;n.indexOf("+")>-1?l.setHours(l.getHours()-s,l.getMinutes()-c):l.setHours(l.getHours()+s,l.getMinutes()+c),n=e.dateParse.toTimeZone(l,e.serverTimezoneOffset,!1)}null==e.serverTimezoneOffset&&(n=e.dateParse.addSelfOffset(n))}}return n},isJson:function(t){return"string"==typeof t[0]?t:e.parse.parseJson(t)},isGuid:function(e){return null!=/[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i.exec(e)},replacer:function(t,n){return e.isPlainObject(t)?e.parse.jsonReplacer(t,n):t instanceof Array?e.parse.arrayReplacer(t):t instanceof Date?e.parse.jsonReplacer({val:t},n).val:t},jsonReplacer:function(t,n){for(var r,o=0,a=Object.keys(t);o<a.length;o++){var i=a[o];if((r=t[i])instanceof Date){var l=r;null==e.serverTimezoneOffset?t[i]=e.dateParse.toTimeZone(l,null).toJSON():(l=new Date(+l+36e5*e.serverTimezoneOffset),t[i]=e.dateParse.toTimeZone(e.dateParse.addSelfOffset(l),null).toJSON())}}return t},arrayReplacer:function(t){for(var n=0;n<t.length;n++)e.isPlainObject(t[n])?t[n]=e.parse.jsonReplacer(t[n]):t[n]instanceof Date&&(t[n]=e.parse.jsonReplacer({date:t[n]}).date);return t},jsonDateReplacer:function(t,n){if("value"===t&&n){if("string"==typeof n){var r=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(n);if(r)n=e.dateParse.toTimeZone(new Date(parseInt(r[1],10)),null,!0);else if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(n)){var o=n.split(/[^0-9]/);n=e.dateParse.toTimeZone(new Date(parseInt(o[0],10),parseInt(o[1],10)-1,parseInt(o[2],10),parseInt(o[3],10),parseInt(o[4],10),parseInt(o[5],10)),null,!0)}}if(n instanceof Date)return n=e.dateParse.addSelfOffset(n),null===e.serverTimezoneOffset?e.dateParse.toTimeZone(e.dateParse.addSelfOffset(n),null).toJSON():(n=e.dateParse.toTimeZone(n,n.getTimezoneOffset()/60*2-e.serverTimezoneOffset,!1)).toJSON()}return n}},e.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(t,n,r){if(null===n)return t;var o=r?e.dateParse.toUTC(t):t;return new Date(+o-36e5*n)},toLocalTime:function(e){var t=e,n=-t.getTimezoneOffset(),r=n>=0?"+":"-",o=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return t.getFullYear()+"-"+o(t.getMonth()+1)+"-"+o(t.getDate())+"T"+o(t.getHours())+":"+o(t.getMinutes())+":"+o(t.getSeconds())+r+o(n/60)+":"+o(n%60)}},e}(),Vkt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jkt={GroupGuid:"{271bbba0-1ee7}"},Wkt=function(){function e(t){this.options={from:"table",requestType:"json",sortBy:"sorted",select:"select",skip:"skip",group:"group",take:"take",search:"search",count:"requiresCounts",where:"where",aggregates:"aggregates",expand:"expand"},this.type=e,this.dataSource=t,this.pvt={}}return e.prototype.processResponse=function(e,t,n,r){return e},e}(),Fkt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vkt(t,e),t.prototype.processQuery=function(e,t){for(var n,r,o,a=e.dataSource.json.slice(0),i=a.length,l=!0,s={},c=0,u=[],d=0;d<t.lazyLoad.length;d++)c++,s[t.lazyLoad[d].key]=t.lazyLoad[d].value;var h={};for(d=0;d<t.queries.length;d++)"onPage"!==(r=t.queries[d]).fn&&"onGroup"!==r.fn||!t.lazyLoad.length?(n=this[r.fn].call(this,a,r.e,t),"onAggregates"===r.fn?h[r.e.field+" - "+r.e.type]=n:a=void 0!==n?n:a,"onPage"!==r.fn&&"onSkip"!==r.fn&&"onTake"!==r.fn&&"onRange"!==r.fn||(l=!1),l&&(i=a.length)):("onGroup"===r.fn&&u.push(r.e),"onPage"===r.fn&&(o=r.e));if(c){var p={query:t,lazyLoad:s,result:a,group:u,page:o},f=this.lazyLoadGroup(p);a=f.result,i=f.count}return t.isCountRequired&&(a={result:a,count:i,aggregates:h}),a},t.prototype.lazyLoadGroup=function(e){var t=0,n=this.getAggregate(e.query),r=e.result;if(ZUe(e.lazyLoad.onDemandGroupInfo)){i=e.group[0].fieldName;t=(r=Zkt.group(r,i,n,null,null,e.group[0].comparer,!0)).length;l=r;e.page&&(r=this.onPage(r,e.page,e.query)),this.formGroupResult(r,l)}else{for(var o=e.lazyLoad.onDemandGroupInfo,a=o.where.length-1;a>=0;a--)r=this.onWhere(r,o.where[a]);if(e.group.length!==o.level){var i=e.group[o.level].fieldName;r=Zkt.group(r,i,n,null,null,e.group[0].comparer,!0)}t=r.length;var l=r;r=(r=r.slice(o.skip)).slice(0,o.take),e.group.length!==o.level&&this.formGroupResult(r,l)}return{result:r,count:t}},t.prototype.formGroupResult=function(e,t){if(e.length&&t.length){var n="GroupGuid",r="childLevels",o="level",a="records";e[n]=t[n],e[r]=t[r],e[o]=t[o],e[a]=t[a]}return e},t.prototype.getAggregate=function(e){var t=Rkt.filterQueries(e.queries,"onAggregates"),n=[];if(t.length)for(var r=void 0,o=0;o<t.length;o++)r=t[o].e,n.push({type:r.type,field:Zkt.getValue(r.field,e)});return n},t.prototype.batchRequest=function(e,t,n){var r,o=t.deletedRecords.length;for(r=0;r<t.addedRecords.length;r++)this.insert(e,t.addedRecords[r]);for(r=0;r<t.changedRecords.length;r++)this.update(e,n.key,t.changedRecords[r]);for(r=0;r<o;r++)this.remove(e,n.key,t.deletedRecords[r]);return t},t.prototype.onWhere=function(e,t){return e&&e.length?e.filter((function(e){if(t)return t.validate(e)})):e},t.prototype.onAggregates=function(e,t){var n=Zkt.aggregates[t.type];return e&&n&&0!==e.length?n(e,t.field):null},t.prototype.onSearch=function(e,t){return e&&e.length?(0===t.fieldNames.length&&Zkt.getFieldList(e[0],t.fieldNames),e.filter((function(e){for(var n=0;n<t.fieldNames.length;n++)if(t.comparer.call(e,Zkt.getObject(t.fieldNames[n],e),t.searchKey,t.ignoreCase,t.ignoreAccent))return!0;return!1}))):e},t.prototype.onSortBy=function(e,t,n){if(!e||!e.length)return e;var r,o=Zkt.getValue(t.fieldName,n);if(!o)return e.sort(t.comparer);if(o instanceof Array){for(var a=(o=o.slice(0)).length-1;a>=0;a--)o[a]&&(r=t.comparer,Zkt.endsWith(o[a]," desc")&&(r=Zkt.fnSort("descending"),o[a]=o[a].replace(" desc","")),e=Zkt.sort(e,o[a],r));return e}return Zkt.sort(e,o,t.comparer)},t.prototype.onGroup=function(e,t,n){if(!e||!e.length)return e;var r=this.getAggregate(n);return Zkt.group(e,Zkt.getValue(t.fieldName,n),r,null,null,t.comparer)},t.prototype.onPage=function(e,t,n){var r=Zkt.getValue(t.pageSize,n),o=(Zkt.getValue(t.pageIndex,n)-1)*r,a=o+r;return e&&e.length?e.slice(o,a):e},t.prototype.onRange=function(e,t){return e&&e.length?e.slice(Zkt.getValue(t.start),Zkt.getValue(t.end)):e},t.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,Zkt.getValue(t.nos)):e},t.prototype.onSkip=function(e,t){return e&&e.length?e.slice(Zkt.getValue(t.nos)):e},t.prototype.onSelect=function(e,t){return e&&e.length?Zkt.select(e,Zkt.getValue(t.fieldNames)):e},t.prototype.insert=function(e,t,n,r,o){return ZUe(o)?e.dataSource.json.push(t):e.dataSource.json.splice(o,0,t)},t.prototype.remove=function(e,t,n,r){var o,a=e.dataSource.json;for("object"!=typeof n||n instanceof Date||(n=Zkt.getObject(t,n)),o=0;o<a.length&&Zkt.getObject(t,a[o])!==n;o++);return o!==a.length?a.splice(o,1):null},t.prototype.update=function(e,t,n,r){var o,a,i=e.dataSource.json;for(ZUe(t)||(a=TUe(t,n)),o=0;o<i.length&&(ZUe(t)||TUe(t,i[o])!==a);o++);return o<i.length?BUe(i[o],n):null},t}(Wkt),qkt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vkt(t,e),t.prototype.processQuery=function(e,t,n){var r,o,a=this.getQueryRequest(t),i=Rkt.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),l=t.params,s=e.dataSource.url,c=null,u=this.options,d={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in i?(r=i.onPage,o=((o=Zkt.getValue(r.pageIndex,t))-1)*(c=Zkt.getValue(r.pageSize,t))):"onRange"in i&&(o=(r=i.onRange).start,c=r.end-r.start);for(var h=0;h<a.sorts.length;h++)r=Zkt.getValue(a.sorts[h].e.fieldName,t),d.sorts.push(Zkt.callAdaptorFunction(this,"onEachSort",{name:r,direction:a.sorts[h].e.direction},t));n&&(r=this.getFiltersFrom(n,t))&&d.filters.push(Zkt.callAdaptorFunction(this,"onEachWhere",r.toJson(),t));for(h=0;h<a.filters.length;h++){var p=Zkt.callAdaptorFunction(this,"onEachWhere",a.filters[h].e.toJson(),t);this.getModuleName&&"ODataV4Adaptor"===this.getModuleName()&&!ZUe(a.filters[h].e.key)&&a.filters.length>1&&(p="("+p+")"),d.filters.push(p);for(var f=0,m="object"==typeof d.filters[h]?Object.keys(d.filters[h]):[];f<m.length;f++){var v=m[f];Zkt.isNull(d[v])&&delete d[v]}}for(h=0;h<a.searches.length;h++)r=a.searches[h].e,d.searches.push(Zkt.callAdaptorFunction(this,"onEachSearch",{fields:r.fieldNames,operator:r.operator,key:r.searchKey,ignoreCase:r.ignoreCase},t));for(h=0;h<a.groups.length;h++)d.groups.push(Zkt.getValue(a.groups[h].e.fieldName,t));for(h=0;h<a.aggregates.length;h++)r=a.aggregates[h].e,d.aggregates.push({type:r.type,field:Zkt.getValue(r.field,t)});var g={};if(this.getRequestQuery(u,t,i,d,g),Zkt.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:l,reqParams:g}),t.lazyLoad.length)for(h=0;h<t.lazyLoad.length;h++)g[t.lazyLoad[h].key]=t.lazyLoad[h].value;for(var b=0,y=Object.keys(g);b<y.length;b++){v=y[b];(Zkt.isNull(g[v])||""===g[v]||0===g[v].length)&&delete g[v]}u.skip in g&&u.take in g||null===c||(g[u.skip]=Zkt.callAdaptorFunction(this,"onSkip",o,t),g[u.take]=Zkt.callAdaptorFunction(this,"onTake",c,t));var w=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(g,Zkt.parse.jsonDateReplacer),url:s,pvtData:w,type:"POST",contentType:"application/json; charset=utf-8"}:(r=this.convertToQueryString(g,t,e),{type:"GET",url:(r=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+r).length?s.replace(/\/*$/,r):s,pvtData:w})},t.prototype.getRequestQuery=function(e,t,n,r,o){var a=o;a[e.from]=t.fromTable,e.apply&&t.distincts.length&&(a[e.apply]="onDistinct"in this?Zkt.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(a[e.expand]="onExpand"in this&&"onSelect"in n?Zkt.callAdaptorFunction(this,"onExpand",{selects:Zkt.getValue(n.onSelect.fieldNames,t),expands:t.expands},t):t.expands),a[e.select]="onSelect"in n&&!t.distincts.length?Zkt.callAdaptorFunction(this,"onSelect",Zkt.getValue(n.onSelect.fieldNames,t),t):"",a[e.count]=t.isCountRequired?Zkt.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",a[e.search]=r.searches.length?Zkt.callAdaptorFunction(this,"onSearch",r.searches,t):"",a[e.skip]="onSkip"in n?Zkt.callAdaptorFunction(this,"onSkip",Zkt.getValue(n.onSkip.nos,t),t):"",a[e.take]="onTake"in n?Zkt.callAdaptorFunction(this,"onTake",Zkt.getValue(n.onTake.nos,t),t):"",a[e.where]=r.filters.length||r.searches.length?Zkt.callAdaptorFunction(this,"onWhere",r.filters,t):"",a[e.sortBy]=r.sorts.length?Zkt.callAdaptorFunction(this,"onSortBy",r.sorts,t):"",a[e.group]=r.groups.length?Zkt.callAdaptorFunction(this,"onGroup",r.groups,t):"",a[e.aggregates]=r.aggregates.length?Zkt.callAdaptorFunction(this,"onAggregates",r.aggregates,t):"",a.param=[]},t.prototype.convertToQueryString=function(e,t,n){return""},t.prototype.processResponse=function(e,t,n,r,o,a){if(r&&r.getResponseHeader("Content-Type")&&-1!==r.getResponseHeader("Content-Type").indexOf("application/json")){var i=Zkt.timeZoneHandling;t&&!t.timeZoneHandling&&(Zkt.timeZoneHandling=!1),e=Zkt.parse.parseJson(e),Zkt.timeZoneHandling=i}var l=o,s=l.pvtData||{},c=e?e.groupDs:[];if(r&&r.getResponseHeader("Content-Type")&&-1!==r.getResponseHeader("Content-Type").indexOf("xml"))return n.isCountRequired?{result:[],count:0}:[];var u=JSON.parse(l.data);if(u&&"batch"===u.action&&e&&e.addedRecords)return a.addedRecords=e.addedRecords,a;e&&e.d&&(e=e.d);var d={};e&&"count"in e&&(d.count=e.count),d.result=e&&e.result?e.result:e;var h=!1;if(Array.isArray(e.result)&&e.result.length){if(ZUe(e.result[0].key)||(d.result=this.formRemoteGroupedData(d.result,1,s.groups.length-1)),n&&n.lazyLoad.length&&s.groups.length)for(var p=0;p<n.lazyLoad.length;p++)if("onDemandGroupInfo"===n.lazyLoad[p].key){var f=n.lazyLoad[p].value.level;s.groups.length===f&&(h=!0)}}return h||this.getAggregateResult(s,e,d,c,n),Zkt.isNull(d.count)?d.result:{result:d.result,count:d.count,aggregates:d.aggregates}},t.prototype.formRemoteGroupedData=function(e,t,n){for(var r=0;r<e.length;r++)e[r].items.length&&Object.keys(e[r].items[0]).indexOf("key")>-1&&this.formRemoteGroupedData(e[r].items,t+1,n-1);var o="GroupGuid",a="records";return e[o]=jkt[o],e.level=t,e.childLevels=n,e[a]=e[0].items.length?this.getGroupedRecords(e,!ZUe(e[0].items[a])):[],e},t.prototype.getGroupedRecords=function(e,t){for(var n=[],r=0;r<e.length;r++)if(t)n=n.concat(e[r].items.records);else for(var o=0;o<e[r].items.length;o++)n.push(e[r].items[o]);return n},t.prototype.onGroup=function(e){return this.pvt.groups=e,e},t.prototype.onAggregates=function(e){this.pvt.aggregates=e},t.prototype.batchRequest=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.removeUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify($Ue({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:n[undefined],key:n[undefined]},Zkt.getAddParams(this,e,r)))}},t.prototype.beforeSend=function(e,t){},t.prototype.insert=function(e,t,n,r){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:t,table:n,action:"insert"},Zkt.getAddParams(this,e,r)))}},t.prototype.remove=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{key:n,keyColumn:t,table:r,action:"remove"},Zkt.getAddParams(this,e,o)))}},t.prototype.update=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:n,action:"update",keyColumn:t,key:Zkt.getObject(t,n),table:r},Zkt.getAddParams(this,e,o)))}},t.prototype.getFiltersFrom=function(e,t){var n,r=t.fKey,o=r,a=t.key,i=[];"object"!=typeof e[0]&&(o=null);for(var l=0;l<e.length;l++)n="object"==typeof e[0]?Zkt.getObject(a||o,e[l]):e[l],i.push(new Bkt(r,"equal",n));return Bkt.or(i)},t.prototype.getAggregateResult=function(e,t,n,r,o){var a=t;if(t&&t.result&&(a=t.result),e&&e.aggregates&&e.aggregates.length){var i=e.aggregates,l=void 0,s=a,c={};t.aggregate&&(s=t.aggregate);for(var u=0;u<i.length;u++)(l=Zkt.aggregates[i[u].type])&&(c[i[u].field+" - "+i[u].type]=l(s,i[u].field));n.aggregates=c}var d=Array.isArray(t.result)&&t.result.length&&!ZUe(t.result[0].key);if(e&&e.groups&&e.groups.length&&!d){var h=e.groups;for(u=0;u<h.length;u++){ZUe(r)||(r=Zkt.group(r,h[u]));var p=Rkt.filterQueries(o.queries,"onGroup")[u].e;a=Zkt.group(a,h[u],e.aggregates,null,r,p.comparer)}n.result=a}return n},t.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=Rkt.filterQueries(e.queries,"onSortBy"),t.groups=Rkt.filterQueries(e.queries,"onGroup"),t.filters=Rkt.filterQueries(e.queries,"onWhere"),t.searches=Rkt.filterQueries(e.queries,"onSearch"),t.aggregates=Rkt.filterQueries(e.queries,"onAggregates"),t},t.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var n=0,r=e.params;n<r.length;n++){var o=r[n];if(t[o.key])throw new Error("Query() - addParams: Custom Param is conflicting other request arguments");t[o.key]=o.value,o.fn&&(t[o.key]=o.fn.call(e.query,o.key,e.query,e.dm)),t.params[o.key]=t[o.key]}},t}(Wkt),Ykt=function(e){function t(t){var n=e.call(this)||this;return n.options=$Ue({},n.options,{requestType:"get",accept:"application/json;odata=light;q=1,application/json;odata=verbose;q=0.5",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$inlinecount",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PUT"}),$Ue(n.options,t||{}),n}return Vkt(t,e),t.prototype.getModuleName=function(){return"ODataAdaptor"},t.prototype.onPredicate=function(e,n,r){var o,a,i="",l=e.value,s=typeof l,c=e.field?t.getField(e.field):null;if(l instanceof Date&&(l="datetime'"+Zkt.parse.replacer(l)+"'"),"string"===s&&(l=l.replace(/'/g,"''"),e.ignoreCase&&(l=l.toLowerCase()),l="'"+(l=encodeURIComponent(l))+"'",r&&(c="cast("+c+", 'Edm.String')"),Zkt.parse.isGuid(l)&&(a="guid"),e.ignoreCase&&(a||(c="tolower("+c+")"),l=l.toLowerCase())),o=Zkt.odBiOperator[e.operator])return i+=c,i+=o,a&&(i+=a),i+l;if("substringof"===(o=ZUe(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Zkt.odUniOperator[e.operator]:Zkt.odv4UniOperator[e.operator])){var u=l;l=c,c=u}return i+=o+"(",i+=c+",",a&&(i+=a),i+=l+")"},t.prototype.addParams=function(t){e.prototype.addParams.call(this,t),delete t.reqParams.params},t.prototype.onComplexPredicate=function(e,t,n){for(var r=[],o=0;o<e.predicates.length;o++)r.push("("+this.onEachWhere(e.predicates[o],t,n)+")");return r.join(" "+e.condition+" ")},t.prototype.onEachWhere=function(e,t,n){return e.isComplex?this.onComplexPredicate(e,t,n):this.onPredicate(e,t,n)},t.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},t.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&Zkt.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],n=0;n<e.fields.length;n++)t.push(new Bkt(e.fields[n],e.operator,e.key,e.ignoreCase));this.pvt.search=t},t.prototype.onSearch=function(e){return this.pvt.search=Bkt.or(this.pvt.search),""},t.prototype.onEachSort=function(e){var n=[];if(e.name instanceof Array)for(var r=0;r<e.name.length;r++)n.push(t.getField(e.name[r])+("descending"===e.direction?" desc":""));else n.push(t.getField(e.name)+("descending"===e.direction?" desc":""));return n.join(",")},t.prototype.onSortBy=function(e){return e.reverse().join(",")},t.prototype.onGroup=function(e){return this.pvt.groups=e,[]},t.prototype.onSelect=function(e){for(var n=0;n<e.length;n++)e[n]=t.getField(e[n]);return e.join(",")},t.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},t.prototype.onCount=function(e){return!0===e?"allpages":""},t.prototype.beforeSend=function(e,t,n){Zkt.endsWith(n.url,this.options.batch)&&"post"===n.type.toLowerCase()?(t.setRequestHeader("Accept",this.options.multipartAccept),t.setRequestHeader("DataServiceVersion","2.0"),t.overrideMimeType("text/plain; charset=x-user-defined")):t.setRequestHeader("Accept",this.options.accept),t.setRequestHeader("DataServiceVersion","2.0"),t.setRequestHeader("MaxDataServiceVersion","2.0")},t.prototype.processResponse=function(e,t,n,r,o,a){var i="odata.metadata";if(o&&"GET"===o.type&&!this.rootUrl&&e[i]){var l=e[i].split("/$metadata#");this.rootUrl=l[0],this.resourceTableName=l[1]}if(!ZUe(e.d)){var s=n&&n.isCountRequired?e.d.results:e.d,c="__metadata";if(!ZUe(s))for(var u=0;u<s.length;u++)ZUe(s[u][c])||delete s[u][c]}var d=o&&o.pvtData,h=this.processBatchResponse(e,n,r,o,a);if(h)return h;var p=r&&o.getResponseHeader("DataServiceVersion"),f=null,m=p&&parseInt(p,10)||2;if(n&&n.isCountRequired){var v="__count";(e[v]||e["odata.count"])&&(f=e[v]||e["odata.count"]),e.d&&(e=e.d),(e[v]||e["odata.count"])&&(f=e[v]||e["odata.count"])}3===m&&e.value&&(e=e.value),e.d&&(e=e.d),m<3&&e.results&&(e=e.results);var g={};return g.count=f,g.result=e,this.getAggregateResult(d,e,g,null,n),Zkt.isNull(f)?g.result:{result:g.result,count:g.count,aggregates:g.aggregates}},t.prototype.convertToQueryString=function(e,t,n){var r=[],o="table",a=e[o]||"";delete e[o],n.dataSource.requiresFormat&&(e.$format="json");for(var i=0,l=Object.keys(e);i<l.length;i++){var s=l[i];r.push(s+"="+e[s])}return r=r.join("&"),n.dataSource.url&&-1!==n.dataSource.url.indexOf("?")&&!a?r:r.length?a+"?"+r:a||""},t.prototype.localTimeReplacer=function(e,t){for(var n=0,r=ZUe(t)?[]:Object.keys(t);n<r.length;n++){var o=r[n];t[o]instanceof Date&&(t[o]=Zkt.dateParse.toLocalTime(t[o]))}return t},t.prototype.insert=function(e,t,n){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},t.prototype.remove=function(e,t,n,r){var o;return o="string"!=typeof n||Zkt.parse.isGuid(n)?"("+n+")":"('"+n+"')",{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:"")+o}},t.prototype.update=function(e,t,n,r,o,a){var i;return"PATCH"!==this.options.updateType||ZUe(a)||(n=this.compareAndRemove(n,a,t)),i="string"!=typeof n[t]||Zkt.parse.isGuid(n[t])?"("+n[t]+")":"('"+n[t]+"')",{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:"")+i,data:JSON.stringify(n,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},t.prototype.batchRequest=function(e,t,n,r,o){var a=n.guid=Zkt.getGuid(this.options.batchPre),i=this.rootUrl?this.rootUrl+"/"+this.options.batch:e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);n.url=this.resourceTableName?this.resourceTableName:n.url;var l={url:n.url,key:n.key,cid:1,cSet:Zkt.getGuid(this.options.changeSet)},s="--"+a+"\n";return s+="Content-Type: multipart/mixed; boundary="+l.cSet.replace("--","")+"\n",this.pvt.changeSet=0,s+=this.generateInsertRequest(t.addedRecords,l,e),s+=this.generateUpdateRequest(t.changedRecords,l,e,o?o.changedRecords:[]),s+=this.generateDeleteRequest(t.deletedRecords,l,e),s+=l.cSet+"--\n",{type:"POST",url:i,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+a,data:s+="--"+a+"--"}},t.prototype.generateDeleteRequest=function(e,t,n){if(!e)return"";var r={method:"DELETE ",url:function(e,t,n){var r=Zkt.getObject(n,e[t]);return"number"==typeof r||Zkt.parse.isGuid(r)?"("+r+")":r instanceof Date?"("+e[t][n].toJSON()+")":"('"+r+"')"},data:function(e,t){return""}};return this.generateBodyContent(e,t,r,n)+"\n"},t.prototype.generateInsertRequest=function(e,t,n){if(!e)return"";var r={method:"POST ",url:function(e,t,n){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,r,n)},t.prototype.generateUpdateRequest=function(e,t,n,r){var o=this;if(!e)return"";e.forEach((function(e){return e=o.compareAndRemove(e,r.filter((function(n){return Zkt.getObject(t.key,n)===Zkt.getObject(t.key,e)}))[0],t.key)}));var a={method:this.options.updateType+" ",url:function(e,t,n){return"number"==typeof e[t][n]||Zkt.parse.isGuid(e[t][n])?"("+e[t][n]+")":e[t][n]instanceof Date?"("+e[t][n].toJSON()+")":"('"+e[t][n]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,a,n)},t.getField=function(e){return e.replace(/\./g,"/")},t.prototype.generateBodyContent=function(e,t,n,r){for(var o="",a=0;a<e.length;a++)o+="\n"+t.cSet+"\n",o+=this.options.changeSetContent+"\n\n",o+=n.method,"POST "===n.method?o+=(r.dataSource.insertUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n":"PUT "===n.method||"PATCH "===n.method?o+=(r.dataSource.updateUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n":"DELETE "===n.method&&(o+=(r.dataSource.removeUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n"),o+="Accept: "+this.options.accept+"\n",o+="Content-Id: "+this.pvt.changeSet+++"\n",o+=this.options.batchChangeSetContentType+"\n",ZUe(e[a]["@odata.etag"])?o+="\n":(o+="If-Match: "+e[a]["@odata.etag"]+"\n\n",delete e[a]["@odata.etag"]),o+=n.data(e,a);return o},t.prototype.processBatchResponse=function(e,t,n,r,o){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return t.isCountRequired?{result:[],count:0}:[];if(r&&this.options.batch&&Zkt.endsWith(r.url,this.options.batch)&&"post"===r.type.toLowerCase()){var a=n.getResponseHeader("Content-Type"),i=void 0,l=void 0,s=e+"";if(a=a.substring(a.indexOf("=batchresponse")+1),(s=s.split(a)).length<2)return{};s=s[1];var c=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(s);c&&s.replace(c[0],"");for(var u=c?c[1]:"",d=(s=s.split(u)).length;d>-1;d--)/\bContent-ID:/i.test(s[d])&&/\bHTTP.+201/.test(s[d])&&(i=parseInt(/\bContent-ID: (\d+)/i.exec(s[d])[1],10),o.addedRecords[i]&&(l=Zkt.parse.parseJson(/^\{.+\}/m.exec(s[d])[0]),$Ue({},o.addedRecords[i],this.processResponse(l))));return o}return null},t.prototype.compareAndRemove=function(e,t,n){var r=this;return ZUe(t)||Object.keys(e).forEach((function(o){o!==n&&"@odata.etag"!==o&&(Zkt.isPlainObject(e[o])?(r.compareAndRemove(e[o],t[o]),0===Object.keys(e[o]).filter((function(e){return"@odata.etag"!==e})).length&&delete e[o]):(e[o]===t[o]||e[o]&&t[o]&&e[o].valueOf()===t[o].valueOf())&&delete e[o])})),e},t}(qkt);!function(e){function t(t){var n=e.call(this,t)||this;return n.options=$Ue({},n.options,{requestType:"get",accept:"application/json, text/javascript, */*; q=0.01",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$count",search:"$search",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PATCH",localTime:!1,apply:"$apply"}),$Ue(n.options,t||{}),n}Vkt(t,e),t.prototype.getModuleName=function(){return"ODataV4Adaptor"},t.prototype.onCount=function(e){return!0===e?"true":""},t.prototype.onPredicate=function(t,n,r){var o="",a=t.value,i=a instanceof Date;if(n instanceof Rkt)for(var l=this.getQueryRequest(n),s=0;s<l.filters.length;s++)l.filters[s].e.key===t.value&&(r=!0);return o=e.prototype.onPredicate.call(this,t,n,r),i&&(o=o.replace(/datetime'(.*)'$/,"$1")),Zkt.parse.isGuid(a)&&(o=o.replace("guid","").replace(/'/g,"")),o},t.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},t.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},t.prototype.onExpand=function(e){var t=this,n={},r={},o=e.expands.slice(),a=[];return e.selects.filter((function(e){return e.indexOf(".")>-1})).forEach((function(e){var r=e.split(".");if(r[0]in n||(n[r[0]]=[]),2==r.length)n[r[0]].length&&-1!==Object.keys(n).indexOf(r[0])?-1!==n[r[0]][0].indexOf("$expand")&&-1===n[r[0]][0].indexOf(";$select=")?n[r[0]][0]=n[r[0]][0]+";$select="+r[1]:n[r[0]][0]=n[r[0]][0]+","+r[1]:n[r[0]].push("$select="+r[1]);else{for(var o="$select="+r[r.length-1],a="",i="",l=1;l<r.length-1;l++)a=a+"$expand="+r[l]+"(",i+=")";var s=a+o+i;if(n[r[0]].length&&-1!==Object.keys(n).indexOf(r[0])&&t.expandQueryIndex(n[r[0]],!0)){var c=t.expandQueryIndex(n[r[0]]);n[r[0]][c]=n[r[0]][c]+s.replace("$expand=",",")}else n[r[0]].push(s)}})),Object.keys(n).forEach((function(e){-1===o.indexOf(e)&&o.push(e)})),o.forEach((function(e){r[e]=e in n?e+"("+n[e].join(";")+")":e})),Object.keys(r).forEach((function(e){return a.push(r[e])})),a.join(",")},t.prototype.expandQueryIndex=function(e,t){for(var n=0;n<e.length;n++)if(-1!==e[n].indexOf("$expand"))return!!t||n;return!t&&0},t.prototype.onDistinct=function(e){return"groupby(("+e.map((function(e){return Ykt.getField(e)})).join(",")+"))"},t.prototype.onSelect=function(t){return e.prototype.onSelect.call(this,t.filter((function(e){return-1===e.indexOf(".")})))},t.prototype.beforeSend=function(e,t,n){"POST"!==n.type&&"PUT"!==n.type&&"PATCH"!==n.type||t.setRequestHeader("Prefer","return=representation"),t.setRequestHeader("Accept",this.options.accept)},t.prototype.processResponse=function(t,n,r,o,a,i){var l="@odata.context";if(a&&"GET"===a.type&&!this.rootUrl&&t[l]){var s=t[l].split("/$metadata#");this.rootUrl=s[0],this.resourceTableName=s[1]}var c=a&&a.pvtData,u=e.prototype.processBatchResponse.call(this,t,r,o,a,i);if(u)return u;var d=null,h="@odata.count";r&&r.isCountRequired&&h in t&&(d=t[h]),t=ZUe(t.value)?t:t.value;var p={};return p.count=d,p.result=t,this.getAggregateResult(c,t,p,null,r),Zkt.isNull(d)?p.result:{result:p.result,count:d,aggregates:p.aggregates}}}(Ykt),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Vkt(t,e),t.prototype.getModuleName=function(){return"WebApiAdaptor"},t.prototype.insert=function(e,t,n){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},t.prototype.remove=function(e,t,n,r){return{type:"DELETE",url:e.dataSource.url+"/"+n,data:JSON.stringify(n)}},t.prototype.update=function(e,t,n,r){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(n)}},t.prototype.batchRequest=function(e,t,n){var r=this,o=n.guid=Zkt.getGuid(this.options.batchPre),a=e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);n.url=this.resourceTableName?this.resourceTableName:n.url;for(var i=[],l=function(r,a){t.addedRecords.forEach((function(a,l){var s=function(e,t,n){return""};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("POST /api/"+(e.dataSource.insertUrl||e.dataSource.crudUrl||n.url)+s(t.addedRecords,r,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")}))},s=0,c=t.addedRecords.length;s<c;s++)l(s);var u=function(a,l){t.changedRecords.forEach((function(l,s){r.options.updateType;var c=function(e,t,n){return""};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("PUT /api/"+(e.dataSource.updateUrl||e.dataSource.crudUrl||n.url)+c(t.changedRecords,a,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",l?JSON.stringify(l):"")}))};for(s=0,c=t.changedRecords.length;s<c;s++)u(s);var d=function(r,a){t.deletedRecords.forEach((function(a,l){var s=function(e,t,n){var r=Zkt.getObject(n,e[t]);return"number"==typeof r||Zkt.parse.isGuid(r)?"/"+r:r instanceof Date?"/"+e[t][n].toJSON():"/'"+r+"'"};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("DELETE /api/"+(e.dataSource.removeUrl||e.dataSource.crudUrl||n.url)+s(t.deletedRecords,r,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")}))};for(s=0,c=t.deletedRecords.length;s<c;s++)d(s);return i.push("--"+o+"--",""),{type:"POST",url:a,contentType:"multipart/mixed; boundary="+o,data:i.join("\r\n")}},t.prototype.beforeSend=function(e,t,n){t.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01")},t.prototype.processResponse=function(e,t,n,r,o,a){var i=o&&o.pvtData,l=null,s={};if(o&&"post"!==o.type.toLowerCase()){var c=r&&o.getResponseHeader("DataServiceVersion"),u=c&&parseInt(c,10)||2;n&&n.isCountRequired&&(Zkt.isNull(e.Count)||(l=e.Count)),u<3&&e.Items&&(e=e.Items),s.count=l,s.result=e,this.getAggregateResult(i,e,s,null,n)}return s.result=s.result||e,Zkt.isNull(l)?s.result:{result:s.result,count:s.count,aggregates:s.aggregates}}}(Ykt),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Vkt(t,e),t.prototype.processQuery=function(e,t,n){var r=(new qkt).processQuery(e,t,n),o=Zkt.parse.parseJson(r.data),a={};if(o.param)for(var i=0;i<o.param.length;i++){var l=o.param[i],s=Object.keys(l)[0];a[s]=l[s]}a.value=o;return{data:JSON.stringify(a),url:r.url,pvtData:r.pvtData,type:"POST",contentType:"application/json; charset=utf-8"}}}(qkt);var Ukt=function(e){function t(){var t=e.call(this)||this;return HUe("beforeSend",qkt.prototype.beforeSend,t),t}return Vkt(t,e),t.prototype.insert=function(e,t,n,r,o){return this.pvt.position=o,this.updateType="add",{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:t,table:n,action:"insert"},Zkt.getAddParams(this,e,r)))}},t.prototype.remove=function(t,n,r,o,a){return e.prototype.remove.call(this,t,n,r),{type:"POST",url:t.dataSource.removeUrl||t.dataSource.crudUrl||t.dataSource.url,data:JSON.stringify($Ue({},{key:r,keyColumn:n,table:o,action:"remove"},Zkt.getAddParams(this,t,a)))}},t.prototype.update=function(e,t,n,r,o){return this.updateType="update",this.updateKey=t,{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:n,action:"update",keyColumn:t,key:n[t],table:r},Zkt.getAddParams(this,e,o)))}},t.prototype.processResponse=function(t,n,r,o,a,i,l){var s;if(t="batch"===(a?JSON.parse(a.data):t).action?Zkt.parse.parseJson(t):t,"add"===this.updateType&&e.prototype.insert.call(this,n,t,null,null,this.pvt.position),"update"===this.updateType&&e.prototype.update.call(this,n,this.updateKey,t),this.updateType=void 0,t.added)for(s=0;s<t.added.length;s++)e.prototype.insert.call(this,n,t.added[s]);if(t.changed)for(s=0;s<t.changed.length;s++)e.prototype.update.call(this,n,l.key,t.changed[s]);if(t.deleted)for(s=0;s<t.deleted.length;s++)e.prototype.remove.call(this,n,l.key,t.deleted[s]);return t},t.prototype.batchRequest=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify($Ue({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:n.url,key:n.key},Zkt.getAddParams(this,e,r)))}},t.prototype.addParams=function(e){(new qkt).addParams(e)},t}(Fkt),Kkt=function(e){function t(t){var n=e.call(this)||this;return n.options=$Ue({},n.options,{getData:new Function,addRecord:new Function,updateRecord:new Function,deleteRecord:new Function,batchUpdate:new Function}),$Ue(n.options,t||{}),n}return Vkt(t,e),t.prototype.getModuleName=function(){return"CustomDataAdaptor"},t}(qkt);!function(e){function t(t){var n=e.call(this)||this;return n.opt=t,n.schema=n.opt.response,n.query=n.opt.query,n.getVariables=n.opt.getVariables?n.opt.getVariables:function(){},n.getQuery=function(){return n.query},n}Vkt(t,e),t.prototype.getModuleName=function(){return"GraphQLAdaptor"},t.prototype.processQuery=function(t,n){var r=e.prototype.processQuery.apply(this,arguments),o=JSON.parse(r.data),a={};["skip","take","sorted","table","select","where","search","requiresCounts","aggregates","params"].filter((function(e){a[e]="searchwhereparams".indexOf(e)>-1?JSON.stringify(o[e]):o[e]}));var i=this.getVariables()||{};i.datamanager=a;var l=JSON.stringify({query:this.getQuery(),variables:i});return r.data=l,r},t.prototype.processResponse=function(e,t,n,r,o){var a,i,l=e,s=TUe(this.schema.result,l.data);this.schema.count&&(a=TUe(this.schema.count,l.data)),this.schema.aggregates&&(i=ZUe(i=TUe(this.schema.aggregates,l.data))?i:Zkt.parse.parseJson(i));var c=o.pvtData||{},u={result:s,aggregates:i},d=u;return c&&c.groups&&c.groups.length&&this.getAggregateResult(c,d,u,null,n),ZUe(a)?u.result:{result:u.result,count:a,aggregates:i}},t.prototype.insert=function(){var t=e.prototype.insert.apply(this,arguments);return this.generateCrudData(t,"insert")},t.prototype.update=function(){var t=e.prototype.update.apply(this,arguments);return this.generateCrudData(t,"update")},t.prototype.remove=function(){var t=e.prototype.remove.apply(this,arguments);return this.generateCrudData(t,"remove")},t.prototype.batchRequest=function(t,n,r,o,a){var i=e.prototype.batchRequest.apply(this,arguments),l=JSON.parse(i.data);return l.key=r.key,i.data=JSON.stringify(l),this.generateCrudData(i,"batch")},t.prototype.generateCrudData=function(e,t){var n=JSON.parse(e.data);return e.data=JSON.stringify({query:this.opt.getMutation(t),variables:n}),e}}(qkt);var Gkt,Xkt=function(e){function t(t,n,r){var o=e.call(this)||this;o.isCrudAction=!1,o.isInsertAction=!1,ZUe(t)||(o.cacheAdaptor=t),o.pageSize=r,o.guidId=Zkt.getGuid("cacheAdaptor");window.localStorage.setItem(o.guidId,JSON.stringify({keys:[],results:[]}));var a=o.guidId;return ZUe(n)||setInterval((function(){var e;e=Zkt.parse.parseJson(window.localStorage.getItem(a));for(var t=[],r=0;r<e.results.length;r++){var o=+new Date,i=+new Date(e.results[r].timeStamp);e.results[r].timeStamp=o-i,o-i>n&&t.push(r)}for(r=0;r<t.length;r++)e.results.splice(t[r],1),e.keys.splice(t[r],1);window.localStorage.removeItem(a),window.localStorage.setItem(a,JSON.stringify(e))}),n),o}return Vkt(t,e),t.prototype.generateKey=function(e,t){var n=this.getQueryRequest(t),r=Rkt.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),o=e,a="onPage";a in r&&(o+=r[a].pageIndex),n.sorts.forEach((function(e){o+=e.e.direction+e.e.fieldName})),n.groups.forEach((function(e){o+=e.e.fieldName})),n.searches.forEach((function(e){o+=e.e.searchKey}));for(var i=0;i<n.filters.length;i++){var l=n.filters[i];if(l.e.isComplex){var s=t.clone();s.queries=[];for(var c=0;c<l.e.predicates.length;c++)s.queries.push({fn:"onWhere",e:l.e.predicates[c],filter:t.queries.filter});o+=l.e.condition+this.generateKey(e,s)}else o+=l.e.field+l.e.operator+l.e.value}return o},t.prototype.processQuery=function(e,t,n){var r,o=this.generateKey(e.dataSource.url,t),a=(r=Zkt.parse.parseJson(window.localStorage.getItem(this.guidId)))?r.results[r.keys.indexOf(o)]:null;return null==a||this.isCrudAction||this.isInsertAction?(this.isCrudAction=null,this.isInsertAction=null,this.cacheAdaptor.processQuery.apply(this.cacheAdaptor,[].slice.call(arguments,0))):a},t.prototype.processResponse=function(e,t,n,r,o,a){if(this.isInsertAction||o&&this.cacheAdaptor.options.batch&&Zkt.endsWith(o.url,this.cacheAdaptor.options.batch)&&"post"===o.type.toLowerCase())return this.cacheAdaptor.processResponse(e,t,n,r,o,a);e=this.cacheAdaptor.processResponse.apply(this.cacheAdaptor,[].slice.call(arguments,0));var i=n?this.generateKey(t.dataSource.url,n):t.dataSource.url,l={},s=(l=Zkt.parse.parseJson(window.localStorage.getItem(this.guidId))).keys.indexOf(i);for(-1!==s&&(l.results.splice(s,1),l.keys.splice(s,1)),l.results[l.keys.push(i)-1]={keys:i,result:e.result,timeStamp:new Date,count:e.count};l.results.length>this.pageSize;)l.results.splice(0,1),l.keys.splice(0,1);return window.localStorage.setItem(this.guidId,JSON.stringify(l)),e},t.prototype.beforeSend=function(e,t,n){!ZUe(this.cacheAdaptor.options.batch)&&Zkt.endsWith(n.url,this.cacheAdaptor.options.batch)&&"post"===n.type.toLowerCase()&&t.setRequestHeader("Accept",this.cacheAdaptor.options.multipartAccept),e.dataSource.crossDomain||t.setRequestHeader("Accept",this.cacheAdaptor.options.accept)},t.prototype.update=function(e,t,n,r){return this.isCrudAction=!0,this.cacheAdaptor.update(e,t,n,r)},t.prototype.insert=function(e,t,n){return this.isInsertAction=!0,this.cacheAdaptor.insert(e,t,n)},t.prototype.remove=function(e,t,n,r){return this.isCrudAction=!0,this.cacheAdaptor.remove(e,t,n,r)},t.prototype.batchRequest=function(e,t,n){return this.cacheAdaptor.batchRequest(e,t,n)},t}(qkt),Qkt=function(){function e(e,t,n){var r,o=this;return this.dateParse=!0,this.timeZoneHandling=!0,this.requests=[],e||this.dataSource||(e=[]),n=n||e.adaptor,e&&!1===e.timeZoneHandling&&(this.timeZoneHandling=e.timeZoneHandling),e instanceof Array?r={json:e,offline:!0}:"object"==typeof e?(e.json||(e.json=[]),r={url:e.url,insertUrl:e.insertUrl,removeUrl:e.removeUrl,updateUrl:e.updateUrl,crudUrl:e.crudUrl,batchUrl:e.batchUrl,json:e.json,headers:e.headers,accept:e.accept,data:e.data,timeTillExpiration:e.timeTillExpiration,cachingPageSize:e.cachingPageSize,enableCaching:e.enableCaching,requestType:e.requestType,key:e.key,crossDomain:e.crossDomain,jsonp:e.jsonp,dataType:e.dataType,offline:void 0!==e.offline?e.offline:!(e.adaptor instanceof Ukt||e.adaptor instanceof Kkt)&&!e.url,requiresFormat:e.requiresFormat}):Zkt.throwError("DataManager: Invalid arguments"),void 0!==r.requiresFormat||Zkt.isCors()||(r.requiresFormat=!!ZUe(r.crossDomain)||r.crossDomain),void 0===r.dataType&&(r.dataType="json"),this.dataSource=r,this.defaultQuery=t,r.url&&r.offline&&!r.json.length?(this.isDataAvailable=!1,this.adaptor=n||new Ykt,this.dataSource.offline=!1,this.ready=this.executeQuery(t||new Rkt),this.ready.then((function(e){o.dataSource.offline=!0,o.isDataAvailable=!0,r.json=e.result,o.adaptor=new Fkt}))):this.adaptor=r.offline?new Fkt:new Ykt,!r.jsonp&&this.adaptor instanceof Ykt&&(r.jsonp="callback"),this.adaptor=n||this.adaptor,r.enableCaching&&(this.adaptor=new Xkt(this.adaptor,r.timeTillExpiration,r.cachingPageSize)),this}return e.prototype.setDefaultQuery=function(e){return this.defaultQuery=e,this},e.prototype.executeLocal=function(t){this.defaultQuery||t instanceof Rkt||Zkt.throwError("DataManager - executeLocal() : A query is required to execute"),this.dataSource.json||Zkt.throwError("DataManager - executeLocal() : Json data is required to execute"),t=t||this.defaultQuery;var n=this.adaptor.processQuery(this,t);if(t.subQuery){var r=t.subQuery.fromTable,o=t.subQuery.lookups,a=t.isCountRequired?n.result:n;o&&o instanceof Array&&Zkt.buildHierarchy(t.subQuery.fKey,r,a,o,t.subQuery.key);for(var i=0;i<a.length;i++)a[i][r]instanceof Array&&(a[i]=$Ue({},{},a[i]),a[i][r]=this.adaptor.processResponse(t.subQuery.using(new e(a[i][r].slice(0))).executeLocal(),this,t))}return this.adaptor.processResponse(n,this,t)},e.prototype.executeQuery=function(t,n,r,o){var a=this,i="makeRequest";"function"==typeof t&&(o=r,r=n,n=t,t=null),t||(t=this.defaultQuery),t instanceof Rkt||Zkt.throwError("DataManager - executeQuery() : A query is required to execute");var l=new Jkt,s={query:t};if(!this.dataSource.offline&&void 0!==this.dataSource.url&&""!==this.dataSource.url||!ZUe(this.adaptor[i])||this.isCustomDataAdaptor(this.adaptor)){var c=this.adaptor.processQuery(this,t);ZUe(this.adaptor[i])?!ZUe(c.url)||this.isCustomDataAdaptor(this.adaptor)?this.makeRequest(c,l,s,t):(s=e.getDeferedArgs(t,c,s),l.resolve(s)):this.adaptor[i](c,l,s,t)}else e.nextTick((function(){var n=a.executeLocal(t);s=e.getDeferedArgs(t,n,s),l.resolve(s)}));return(n||r)&&l.promise.then(n,r),o&&l.promise.then(o,o),l.promise},e.getDeferedArgs=function(e,t,n){return e.isCountRequired?(n.result=t.result,n.count=t.count,n.aggregates=t.aggregates):n.result=t,n},e.nextTick=function(e){(window.setImmediate||window.setTimeout)(e,0)},e.prototype.extendRequest=function(e,t,n){return $Ue({},{type:"GET",dataType:this.dataSource.dataType,crossDomain:this.dataSource.crossDomain,jsonp:this.dataSource.jsonp,cache:!0,processData:!1,onSuccess:t,onFailure:n},e)},e.prototype.makeRequest=function(e,t,n,r){var o=this,a=!!r.subQuerySelector,i=function(e){n.error=e,t.reject(n)},l=function(e,r,o,a,i,l,s){n.xhr=o,n.count=r?parseInt(r.toString(),10):0,n.result=e,n.request=a,n.aggregates=l,n.actual=i,n.virtualSelectRecords=s,t.resolve(n)},s=function(e,t){var s=new Jkt,c={parent:n};r.subQuery.isChild=!0;var u=o.adaptor.processQuery(o,r.subQuery,e?o.adaptor.processResponse(e):t),d=o.makeRequest(u,s,c,r.subQuery);return a||s.then((function(t){e&&(Zkt.buildHierarchy(r.subQuery.fKey,r.subQuery.fromTable,e,t,r.subQuery.key),l(e,t.count,t.xhr))}),i),d},c=this.extendRequest(e,(function(e,t){if(o.isGraphQLAdaptor(o.adaptor)&&!ZUe(e.errors))return i(e.errors);o.isCustomDataAdaptor(o.adaptor)&&(t=$Ue({},o.ajaxReqOption,t)),-1===t.httpRequest.getResponseHeader("Content-Type").indexOf("xml")&&o.dateParse&&(e=Zkt.parse.parseJson(e));var n=o.adaptor.processResponse(e,o,r,t.httpRequest,t),c=0,u=null,d=e.virtualSelectRecords;r.isCountRequired&&(c=n.count,u=n.aggregates,n=n.result),r.subQuery?a||s(n,t):l(n,c,t.httpRequest,t.type,e,u,d)}),i);if(this.isCustomDataAdaptor(this.adaptor)){this.ajaxReqOption=c;var u=c;this.adaptor.options.getData({data:u.data,onSuccess:u.onSuccess,onFailure:u.onFailure})}else{var d=new _Ke(c);d.beforeSend=function(){o.beforeSend(d.httpRequest,d)},(c=d.send()).catch((function(e){return!0})),this.requests.push(d)}if(a){var h=r.subQuerySelector.call(this,{query:r.subQuery,parent:r});h&&h.length?Promise.all([c,s(null,h)]).then((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],i=o.adaptor.processResponse(n[0],o,r,o.requests[0].httpRequest,o.requests[0]),s=0;r.isCountRequired&&(s=i.count,i=i.result);var c=o.adaptor.processResponse(n[1],o,r.subQuery,o.requests[1].httpRequest,o.requests[1]);s=0,r.subQuery.isCountRequired&&(s=c.count,c=c.result),Zkt.buildHierarchy(r.subQuery.fKey,r.subQuery.fromTable,i,c,r.subQuery.key),a=!1,l(i,s,o.requests[0].httpRequest)})):a=!1}return c},e.prototype.beforeSend=function(e,t){this.adaptor.beforeSend(this,e,t);for(var n,r=this.dataSource.headers,o=0;r&&o<r.length;o++){n=[];for(var a=0,i=Object.keys(r[o]);a<i.length;a++){var l=i[a];n.push(l),e.setRequestHeader(l,r[o][l])}}},e.prototype.saveChanges=function(e,t,n,r,o){var a=this;n instanceof Rkt&&(r=n,n=null);var i={url:n,key:t||this.dataSource.key},l=this.adaptor.batchRequest(this,e,i,r||new Rkt,o),s="doAjaxRequest";if(this.dataSource.offline)return l;if(ZUe(this.adaptor[s])){if(this.isCustomDataAdaptor(this.adaptor))return this.doAjaxRequest(l,this.adaptor.options.batchUpdate);var c=new Jkt,u=new _Ke(l);return u.beforeSend=function(){a.beforeSend(u.httpRequest,u)},u.onSuccess=function(t,n){a.isGraphQLAdaptor(a.adaptor)&&(ZUe(t.errors)||u.onFailure(JSON.stringify(t.errors))),c.resolve(a.adaptor.processResponse(t,a,null,n.httpRequest,n,e,i))},u.onFailure=function(e){c.reject([{error:e}])},u.send().catch((function(e){return!0})),c.promise}return this.adaptor[s](l)},e.prototype.insert=function(e,t,n,r){t instanceof Rkt&&(n=t,t=null);var o=this.adaptor.insert(this,e,t,n,r),a="doAjaxRequest";return this.dataSource.offline?o:ZUe(this.adaptor[a])?this.doAjaxRequest(o,this.adaptor.options.addRecord):this.adaptor[a](o)},e.prototype.remove=function(e,t,n,r){"object"==typeof t&&(t=Zkt.getObject(e,t)),n instanceof Rkt&&(r=n,n=null);var o=this.adaptor.remove(this,e,t,n,r),a="doAjaxRequest";if(this.dataSource.offline)return o;if(ZUe(this.adaptor[a])){var i=this.adaptor.options.deleteRecord;return this.doAjaxRequest(o,i)}return this.adaptor[a](o)},e.prototype.update=function(e,t,n,r,o){n instanceof Rkt&&(r=n,n=null);var a=this.adaptor.update(this,e,t,n,r,o),i="doAjaxRequest";if(this.dataSource.offline)return a;if(ZUe(this.adaptor[i])){var l=this.adaptor.options.updateRecord;return this.doAjaxRequest(a,l)}return this.adaptor[i](a)},e.prototype.isCustomDataAdaptor=function(e){return this.adaptor.getModuleName&&"CustomDataAdaptor"===this.adaptor.getModuleName()},e.prototype.isGraphQLAdaptor=function(e){return this.adaptor.getModuleName&&"GraphQLAdaptor"===this.adaptor.getModuleName()},e.prototype.successFunc=function(e,t){if(this.isGraphQLAdaptor(this.adaptor)){var n=JSON.parse(e);ZUe(n.errors)||this.failureFunc(JSON.stringify(n.errors))}this.isCustomDataAdaptor(this.adaptor)&&(t=$Ue({},this.ajaxReqOption,t));try{Zkt.parse.parseJson(e)}catch(t){e=[]}e=this.adaptor.processResponse(Zkt.parse.parseJson(e),this,null,t.httpRequest,t),this.ajaxDeffered.resolve(e)},e.prototype.failureFunc=function(e){this.ajaxDeffered.reject([{error:e}])},e.prototype.doAjaxRequest=function(e,t){var n=this;if(e=$Ue({},{type:"POST",contentType:"application/json; charset=utf-8",processData:!1},e),this.ajaxDeffered=new Jkt,this.isCustomDataAdaptor(this.adaptor))this.ajaxReqOption=e,t.call(this,{data:e.data,onSuccess:this.successFunc.bind(this),onFailure:this.failureFunc.bind(this)});else{var r=new _Ke(e);r.beforeSend=function(){n.beforeSend(r.httpRequest,r)},r.onSuccess=this.successFunc.bind(this),r.onFailure=this.failureFunc.bind(this),r.send().catch((function(e){return!0}))}return this.ajaxDeffered.promise},e}(),Jkt=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)},eSt={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"};function tSt(e,t){var n={};if(ZUe(e)||"string"==typeof e||"number"==typeof e||!ZUe(e.isHeader))return e;for(var r=0,o=Object.keys(t);r<o.length;r++){var a=t[o[r]],i=ZUe(a)||"string"!=typeof a?void 0:TUe(a,e);ZUe(i)||(n[a]=i)}return n}function nSt(e){if(e)try{return document.querySelector(e)?LXe(document.querySelector(e).innerHTML.trim()):LXe(e)}catch(t){return LXe(e)}}!function(e){e.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null,sortBy:null};var t={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},n={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:e.defaultMappedFields,ariaAttributes:t,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};function r(e,t,n,r,a){return y(e,o(e,t,n,r,a),null,r)}function o(e,t,r,o,a){var i=[],l=$Ue({},n,o);eSt=v(l.moduleName);for(var s=p(),c=0;c<t.length;c++)if(!ZUe(t[c])){var u=void 0;if(l.itemCreating&&"function"==typeof l.itemCreating){var d={dataSource:t,curData:t[c],text:t[c],options:l};l.itemCreating(d)}if(u=r?m(e,t[c],void 0,null,null,[],null,s,c,o):b(e,t[c],void 0,null,null,o,a),l.itemCreated&&"function"==typeof l.itemCreated){d={dataSource:t,curData:t[c],text:t[c],item:u,options:l};l.itemCreated(d)}i.push(u)}return i}function a(r,o,a,i,l,s){var c=$Ue({},n,a);eSt=v(c.moduleName);var h,g=!s||"listview"!==s.getModuleName()&&"multiselect"!==s.getModuleName()?$Ue({},e.defaultMappedFields,c.fields):c.fields,y=$Ue({},t,c.ariaAttributes),w=[];i&&(y.level=i);var x,E,k=[];o&&o.length&&!ZUe(u(o).item)&&!u(o).item.hasOwnProperty(g.id)&&(h=p());for(var S=0;S<o.length;S++){var C=tSt(o[S],g);if(!ZUe(o[S])){if(c.itemCreating&&"function"==typeof c.itemCreating){var M={dataSource:o,curData:o[S],text:C[g.text],options:c,fields:g};c.itemCreating(M)}var _=o[S];c.itemCreating&&"function"==typeof c.itemCreating&&(C=tSt(o[S],g)),C.hasOwnProperty(g.id)&&!ZUe(C[g.id])&&(h=C[g.id]);var N=[];if(c.showCheckBox&&(c.itemNavigable&&(C[g.url]||C[g.urlAttributes])?w.push(r("input",{className:eSt.check,attrs:{type:"checkbox"}})):N.push(r("input",{className:eSt.check,attrs:{type:"checkbox"}}))),!0===l)c.showIcon&&C.hasOwnProperty(g.iconCss)&&!ZUe(C[g.iconCss])&&N.push(r("span",{className:eSt.icon+" "+C[g.iconCss]})),E=(x=m(r,_,C,g,c.itemClass,N,!(!_.hasOwnProperty("isHeader")||!_.isHeader),h,S,a)).querySelector("."+eSt.anchorWrap),c.itemNavigable&&w.length&&FKe(w,x.firstElementChild);else{if((x=b(r,_,C,g,c.itemClass,a,s)).classList.add(eSt.level+"-"+y.level),x.setAttribute("aria-level",y.level.toString()),E=x.querySelector("."+eSt.anchorWrap),C.hasOwnProperty(g.tooltip)&&x.setAttribute("title",C[g.tooltip]),C.hasOwnProperty(g.htmlAttributes)&&C[g.htmlAttributes]&&d(x,C[g.htmlAttributes]),C.hasOwnProperty(g.enabled)&&!1===C[g.enabled]&&x.classList.add(eSt.disabled),C.hasOwnProperty(g.isVisible)&&!1===C[g.isVisible]&&(x.style.display="none"),C.hasOwnProperty(g.imageUrl)&&!ZUe(C[g.imageUrl])&&!c.template){var A={src:C[g.imageUrl]};BUe(A,C[g.imageAttributes]);var O=r("img",{className:eSt.image,attrs:A});E?E.insertAdjacentElement("afterbegin",O):FKe([O],x.firstElementChild)}if(c.showIcon&&C.hasOwnProperty(g.iconCss)&&!ZUe(C[g.iconCss])&&!c.template){var I=r("div",{className:eSt.icon+" "+C[g.iconCss]});E?E.insertAdjacentElement("afterbegin",I):FKe([I],x.firstElementChild)}N.length&&FKe(N,x.firstElementChild),c.itemNavigable&&w.length&&FKe(w,x.firstElementChild),f(r,C,g,o,c,x,y.level)}if(E&&ZKe([x],[eSt.navigable]),c.itemCreated&&"function"==typeof c.itemCreated){M={dataSource:o,curData:o[S],text:C[g.text],item:x,options:c,fields:g};c.itemCreated(M)}w=[],k.push(x)}}return k}function i(e,t,r,o,i,l){var s=$Ue({},n,r);return y(e,a(e,t,r,o,i,l),s.listClass,r)}function l(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function s(e,t,n){if(void 0===n&&(n=new Rkt),"Ascending"===e)n.sortBy(t,"ascending",!0);else if("Descending"===e)n.sortBy(t,"descending",!0);else for(var r=0;r<n.queries.length;r++)"onSortBy"===n.queries[r].fn&&n.queries.splice(r,1);return n}function c(e,t){return new Qkt(e).executeLocal(t)}function u(e){for(var t={typeof:null,item:null},n=0;n<e.length;n++)if(!ZUe(e[n]))return{typeof:typeof e[n],item:e[n]};return t}function d(e,t){var n={};BUe(n,t),n.class&&(ZKe([e],n.class.split(" ")),delete n.class),GKe(e,n)}function h(e){for(var t={},n=e.attributes,r=0;r<n.length;r++)t[n[r].nodeName]=n[r].nodeValue;return t}function p(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function f(e,t,n,r,o,a,l){var s=t[n.child]||[],c=t[n.hasChildren];if(s.length&&(c=!0,a.classList.add(eSt.hasChild),o.processSubChild)){var u=i(e,s,o,++l);a.appendChild(u)}o.expandCollapse&&c&&!o.template&&(a.firstElementChild.classList.add(eSt.iconWrapper),("Left"===o.expandIconPosition?FKe:qKe)([e("div",{className:"e-icons "+o.expandIconClass})],a.querySelector("."+eSt.textContent)))}function m(e,r,o,a,i,l,s,c,u,h){var p,f,m=$Ue({},n,h),v=$Ue({},t,m.ariaAttributes),b=r,y=r;"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r&&(p=r,b="boolean"==typeof o[a.text]||"number"==typeof o[a.text]?o[a.text]:o[a.text]||"",y=o[a.value]),f=ZUe(p)||ZUe(o[a.id])||""===o[a.id]?c+"-"+u:c;var w=e("li",{className:(!0===s?eSt.group:eSt.li)+" "+(ZUe(i)?"":i),id:f,attrs:""!==v.groupItemRole&&""!==v.itemRole?{role:!0===s?v.groupItemRole:v.itemRole}:{}});return p&&o.hasOwnProperty(a.enabled)&&"false"===o[a.enabled].toString()&&w.classList.add(eSt.disabled),s?w.innerText=b:(w.setAttribute("data-value",ZUe(y)?"null":y),w.setAttribute("role","option"),p&&o.hasOwnProperty(a.htmlAttributes)&&o[a.htmlAttributes]&&d(w,o[a.htmlAttributes]),l.length&&!m.itemNavigable&&qKe(l,w),p&&(o[a.url]||o[a.urlAttributes]&&o[a.urlAttributes].href)?w.appendChild(g(e,p,a,b,l,m.itemNavigable)):(l.length&&m.itemNavigable&&qKe(l,w),w.appendChild(document.createTextNode(b)))),w}function v(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function g(e,t,n,r,o,a){var i,l=tSt(t,n),s={href:l[n.url]};if(l.hasOwnProperty(n.urlAttributes)&&l[n.urlAttributes]&&(BUe(s,l[n.urlAttributes]),s.href=l[n.url]?l[n.url]:l[n.urlAttributes].href),a){i=e("a",{className:eSt.text+" "+eSt.url});var c=e("div",{className:eSt.anchorWrap});o&&o.length&&qKe(o,c),c.appendChild(document.createTextNode(r)),qKe([c],i)}else i=e("a",{className:eSt.text+" "+eSt.url,innerHTML:r});return d(i,s),i}function b(e,r,o,a,i,l,s){var c,u,d,h=$Ue({},n,l),f=$Ue({},t,h.ariaAttributes),m=r;"string"!=typeof r&&"number"!=typeof r&&(d=r,m=o[a.text]||"",c=ZUe(o._id)?o[a.id]:o._id,u=!(!r.hasOwnProperty("isHeader")||!r.isHeader)),l&&l.enableHtmlSanitizer;var v=e("li",{className:(!0===u?eSt.group:eSt.li)+" "+(ZUe(i)?"":i),attrs:""!==f.groupItemRole&&""!==f.itemRole?{role:!0===u?f.groupItemRole:f.itemRole}:{}});if(!0==!ZUe(c)?v.setAttribute("data-uid",c):v.setAttribute("data-uid",p()),u&&l&&l.groupTemplate){var b=nSt(l.groupTemplate);if(s&&"listview"!==s.getModuleName())(y=b(r,s,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate,null,v))&&qKe(y,v);else qKe(b(r,s,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate),v)}else if(!u&&l&&l.template){var y;b=nSt(l.template);if(s&&"listview"!==s.getModuleName())(y=b(r,s,"template",h.templateID,!!h.isStringTemplate,null,v))&&qKe(y,v);else qKe(b(r,s,"template",h.templateID,!!h.isStringTemplate),v)}else{var w=e("div",{className:eSt.textContent,attrs:""!==f.wrapperRole?{role:f.wrapperRole}:{}});if(d&&(o[a.url]||o[a.urlAttributes]&&o[a.urlAttributes].href))w.appendChild(g(e,d,a,m,null,h.itemNavigable));else{var x=e("span",{className:eSt.text,attrs:""!==f.itemText?{role:f.itemText}:{}});l&&l.enableHtmlSanitizer?x.innerText=m:x.innerHTML=m,w.appendChild(x)}v.appendChild(w)}return v}function y(e,r,o,a){var i=$Ue({},n,a),l=$Ue({},t,i.ariaAttributes),s=e("ul",{className:(eSt=v(i.moduleName)).ul+" "+(ZUe(o)?"":o),attrs:""!==l.listRole?{role:l.listRole}:{}});return qKe(r,s),s}e.createList=function(e,o,a,l,s){var c=$Ue({},n,a),d=$Ue({},t,c.ariaAttributes),h=u(o).typeof;return"string"===h||"number"===h?r(e,o,l,a,s):i(e,o,a,d.level,l,s)},e.createListFromArray=r,e.createListItemFromArray=o,e.createListItemFromJson=a,e.createListFromJson=i,e.getSiblingLI=function(e,t,r){if(eSt=v(n.moduleName),e&&e.length){var o,a,i=Array.prototype.slice.call(e);for(o=i[(a=t?l(t,i):!0===r?i.length:-1)+(!0===r?-1:1)];o&&(!WKe(o)||o.classList.contains(eSt.disabled));)o=i[a+=!0===r?-1:1];return o}},e.indexOf=l,e.groupDataSource=function(t,n,r){void 0===r&&(r="None");var o=$Ue({},e.defaultMappedFields,n),a=(new Rkt).group(o.groupBy),i=c(t,a=s(r,"key",a));t=[];for(var l=0;l<i.length;l++){var u=i[l].items,d={};d[o.text]=i[l].key,d.isHeader=!0;var h=o.text;"id"===h&&(d[h="text"]=i[l].key),d._id="group-list-item-"+(i[l].key?i[l].key.toString().trim():"undefined"),d.items=u,t.push(d);for(var p=0;p<u.length;p++)t.push(u[p])}return t},e.addSorting=s,e.getDataSource=c,e.createJsonFromElement=function t(r,o){var a=$Ue({},n,o),i=$Ue({},e.defaultMappedFields,a.fields),l=r.cloneNode(!0),s=[];l.classList.add("json-parent");var c=l.querySelectorAll(".json-parent>li");l.classList.remove("json-parent");for(var u=0;u<c.length;u++){for(var d=c[u],f=d.querySelector("a"),m=d.querySelector("ul"),v={},g=f?f.childNodes:d.childNodes,b=Object.keys(g),y=0;y<g.length;y++)g[Number(b[y])].hasChildNodes()||(v[i.text]=g[Number(b[y])].textContent);var w=h(d);w.id?(v[i.id]=w.id,delete w.id):v[i.id]=p(),Object.keys(w).length&&(v[i.htmlAttributes]=w),f&&(w=h(f),Object.keys(w).length&&(v[i.urlAttributes]=w)),m&&(v[i.child]=t(m,o)),s.push(v)}return s},e.renderContentTemplate=function(t,r,o,a,i,l){for(var s,c=t("ul",{className:(eSt=v(n.moduleName)).ul,attrs:{role:"presentation"}}),u=$Ue({},n,i),d=$Ue({},e.defaultMappedFields,a),h=nSt(r),f=[],m=p(),g=0;g<o.length;g++){var b=tSt(o[g],d),y=o[g],w=y.isHeader;if(s="string"==typeof o[g]||"number"==typeof o[g]?y:b[d.value],u.itemCreating&&"function"==typeof u.itemCreating){var x={dataSource:o,curData:y,text:s,options:u,fields:d};u.itemCreating(x)}u.itemCreating&&"function"==typeof u.itemCreating&&(b=tSt(o[g],d),s="string"==typeof o[g]||"number"==typeof o[g]?y:b[d.value]);var E=t("li",{id:m+"-"+g,className:w?eSt.group:eSt.li,attrs:{role:"presentation"}});if(w)"string"==typeof o[g]||"number"==typeof o[g]?E.innerText=y:E.innerText=b[d.text];else{var k,S=w?u.groupTemplateID:u.templateID;if(w)if(l&&"listview"!=l.getModuleName())(k=h(y,l,"headerTemplate",S,!!u.isStringTemplate,null,E))&&qKe(k,E);else qKe(h(y,l,"headerTemplate",S,!!u.isStringTemplate),E);else if(l&&"listview"!==l.getModuleName())(k=h(y,l,"template",S,!!u.isStringTemplate,null,E))&&qKe(k,E);else qKe(h(y,l,"template",S,!!u.isStringTemplate),E);E.setAttribute("data-value",ZUe(s)?"null":s),E.setAttribute("role","option")}if(u.itemCreated&&"function"==typeof u.itemCreated){x={dataSource:o,curData:y,text:s,item:E,options:u,fields:d};u.itemCreated(x)}f.push(E)}return qKe(f,c),c},e.renderGroupTemplate=function(t,r,o,a,i,l){for(var s=nSt(t),c=$Ue({},e.defaultMappedFields,o),u=$Ue({},n,i),d=c.groupBy,h=0,p=a;h<p.length;h++){var f=p[h],m={};if(m[d]=f.textContent,f.innerHTML="",l&&"listview"!==l.getModuleName()){var v=s(m,l,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate,null,f);v&&qKe(v,f)}else qKe(s(m,l,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),f)}return a},e.generateId=p,e.generateUL=y,e.generateIcon=function(e,t,r,o){var a=$Ue({},n,o);return eSt=v(a.moduleName),("Left"===a.expandIconPosition?FKe:qKe)([e("div",{className:"e-icons "+a.expandIconClass+" "+(ZUe(r)?"":r)})],t.querySelector("."+eSt.textContent)),t}}(Gkt||(Gkt={}));var rSt,oSt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),aSt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},iSt="e-vertical",lSt="e-toolbar-items",sSt="e-toolbar-item",cSt="e-rtl",uSt="e-separator",dSt="e-popup-up-icon",hSt="e-popup-down-icon",pSt="e-popup-open",fSt="e-template",mSt="e-overlay",vSt="e-toolbar-text",gSt="e-popup-text",bSt="e-overflow-show",ySt="e-overflow-hide",wSt="e-hor-nav",xSt="e-scroll-nav",ESt="e-toolbar-center",kSt="e-tbar-pos",SSt="e-hscroll-bar",CSt="e-toolbar-pop",MSt="e-toolbar-popup",_St="e-nav-active",NSt="e-ignore",ASt="e-popup-alone",OSt="e-hidden",ISt="e-toolbar-multirow",DSt="e-multirow-pos",PSt="e-multirow-separator",TSt="e-extended-separator",HSt="e-extended-toolbar",LSt="e-toolbar-extended",zSt="e-tbar-extended",RSt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oSt(t,e),aSt([vGe("")],t.prototype,"id",void 0),aSt([vGe("")],t.prototype,"text",void 0),aSt([vGe("auto")],t.prototype,"width",void 0),aSt([vGe("")],t.prototype,"cssClass",void 0),aSt([vGe(!1)],t.prototype,"showAlwaysInPopup",void 0),aSt([vGe(!1)],t.prototype,"disabled",void 0),aSt([vGe("")],t.prototype,"prefixIcon",void 0),aSt([vGe("")],t.prototype,"suffixIcon",void 0),aSt([vGe(!0)],t.prototype,"visible",void 0),aSt([vGe("None")],t.prototype,"overflow",void 0),aSt([vGe("")],t.prototype,"template",void 0),aSt([vGe("Button")],t.prototype,"type",void 0),aSt([vGe("Both")],t.prototype,"showTextOn",void 0),aSt([vGe(null)],t.prototype,"htmlAttributes",void 0),aSt([vGe("")],t.prototype,"tooltipText",void 0),aSt([vGe("Left")],t.prototype,"align",void 0),aSt([yGe()],t.prototype,"click",void 0),t}(HGe),BSt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.resizeContext=r.resize.bind(r),r.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},r}return oSt(t,e),t.prototype.destroy=function(){var t=this;(this.isReact||this.isAngular)&&this.clearTemplate();var n=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(n).forEach((function(e){ZUe(e)||ZUe(e.ej2_instances)||ZUe(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()})),this.unwireEvents(),this.tempId.forEach((function(e){ZUe(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),UKe(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&VKe([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach((function(e){return t.element.removeAttribute(e)})),e.prototype.destroy.call(this)},t.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(iSt),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,cSt)},t.prototype.wireEvents=function(){RKe.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),this.allowKeyboard&&this.wireKeyboardEvent()},t.prototype.wireKeyboardEvent=function(){this.keyModule=new oXe(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),RKe.add(this.element,"keydown",this.docKeyDown,this),this.element.setAttribute("tabIndex","0")},t.prototype.unwireKeyboardEvent=function(){this.keyModule&&(RKe.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},t.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var t=!ZUe(this.popObj)&&WKe(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},t.prototype.unwireEvents=function(){RKe.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),RKe.remove(document,"scroll",this.docEvent),RKe.remove(document,"click",this.docEvent)},t.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},t.prototype.docEvent=function(e){var t=eGe(e.target,".e-popup");this.popObj&&WKe(this.popObj.element)&&!t&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},t.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,kSt),this.scrollModule.destroy(),this.scrollModule=null)},t.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+sSt)).forEach((function(e){UKe(e)})),this.tbarAlign){var e=this.element.querySelector("."+lSt);[].slice.call(e.children).forEach((function(e){UKe(e)})),this.tbarAlign=!1,this.remove(e,kSt)}this.clearProperty()},t.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,cSt),this.destroyScroll()),this.remove(this.element,zSt),this.remove(this.element,HSt);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,ISt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},t.prototype.add=function(e,t){e.classList.add(t)},t.prototype.remove=function(e,t){e.classList.remove(t)},t.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},t.prototype.clstElement=function(e,t){return e&&this.popObj&&WKe(this.popObj.element)?this.popObj.element.querySelector("."+sSt):this.element===t||e?this.element.querySelector("."+sSt+":not(."+mSt+" ):not(."+uSt+" ):not(."+OSt+" )"):eGe(t,"."+sSt)},t.prototype.keyHandling=function(e,t,n,r,o){var a,i,l=this.popObj,s=this.element,c={name:"FadeOut",duration:100},u="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":if(this.isVertical)return;s===n?this.elementFocus(e):r||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;r||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var d=eGe(e,".e-popup"),h=this.element.querySelector("."+LSt);"Extended"===this.overflowMode&&h&&h.classList.contains("e-popup-open")&&(d="end"===t.action?h:null),d?WKe(this.popObj.element)&&(i=[].slice.call(d.children),a="home"===t.action?i[0]:i[i.length-1]):(i=this.element.querySelectorAll("."+lSt+" ."+sSt+":not(."+uSt+")"),a="home"===t.action?i[0]:i[i.length-1]),a&&this.elementFocus(a)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(l&&eGe(n,".e-popup")){var p=l.element,f=p.firstElementChild;if("previous"===u&&f===e||"next"===u&&p.lastElementChild===e)return;this.eleFocus(e,u)}else"moveDown"===t.action&&l&&WKe(l.element)&&this.elementFocus(e);break;case"tab":if(!o&&!r){var m=e.firstElementChild;s===n&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(m),m.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":l&&"Extended"!==this.overflowMode&&l.hide(c);break;case"popupOpen":if(!r)return;l&&!WKe(l.element)?(l.element.style.top=s.offsetHeight+"px",l.show({name:"FadeIn",duration:100})):l.hide(c)}},t.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains(mSt)){e.preventDefault();var n=t.classList.contains(wSt),r=t.classList.contains(xSt),o=this.clstElement(n,t);(o||r)&&this.keyHandling(o,e,t,n,r)}},t.prototype.disable=function(e){var t=this.element;e?t.classList.add(mSt):t.classList.remove(mSt),t.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(WKe(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},t.prototype.eleContains=function(e){return e.classList.contains(uSt)||e.classList.contains(mSt)||e.getAttribute("disabled")||e.classList.contains(OSt)||!WKe(e)},t.prototype.eleFocus=function(e,t){var n=Object(e)[t+"ElementSibling"];if(n){if(this.eleContains(n))return void this.eleFocus(n,t);this.elementFocus(n)}else if(this.tbarAlign){var r=Object(e.parentElement)[t+"ElementSibling"];if(ZUe(r)||0!==r.children.length||(r=Object(r)[t+"ElementSibling"]),!ZUe(r)&&r.children.length>0)if("next"===t){var o=r.querySelector("."+sSt);this.eleContains(o)?this.eleFocus(o,t):(o.firstElementChild.focus(),this.activeEleSwitch(o))}else{o=r.lastElementChild;this.eleContains(o)?this.eleFocus(o,t):this.elementFocus(o)}}},t.prototype.clickHandler=function(e){var t,n=this,r=e.target,o=this.element,a=!ZUe(eGe(r,"."+CSt)),i=r.classList,l=eGe(r,"."+wSt);l||(l=r),o.children[0].classList.contains("e-hscroll")||o.children[0].classList.contains("e-vscroll")||!i.contains(wSt)||(i=r.querySelector(".e-icons").classList),(i.contains(dSt)||i.contains(hSt))&&this.popupClickHandler(o,l,cSt);var s=eGe(e.target,"."+sSt);if(!ZUe(s)&&!s.classList.contains(mSt)||l.classList.contains(wSt)){if(s)t=this.items[this.tbarEle.indexOf(s)];var c={originalEvent:e,item:t};t&&!ZUe(t.click)&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",c),c.cancel||this.trigger("clicked",c,(function(e){!ZUe(n.popObj)&&a&&!e.cancel&&"Popup"===n.overflowMode&&e.item&&"Input"!==e.item.type&&n.popObj.hide({name:"FadeOut",duration:100})}))}},t.prototype.popupClickHandler=function(e,t,n){var r=this.popObj;WKe(r.element)?(t.classList.remove(_St),r.hide({name:"FadeOut",duration:100})):(e.classList.contains(n)&&(r.enableRtl=!0,r.position={X:"left",Y:"top"}),0!==r.offsetX||e.classList.contains(n)||(r.enableRtl=!1,r.position={X:"right",Y:"top"}),r.dataBind(),r.refreshPosition(),r.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(r.element.style.minHeight="0px"),t.classList.add(_St),r.show({name:"FadeIn",duration:100}))},t.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},t.prototype.initialize=function(){var e=qUe(this.width),t=qUe(this.height);"msie"===zKe.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||tGe(this.element,{height:t}),tGe(this.element,{width:e});var n={role:"toolbar","aria-disabled":"false","aria-haspopup":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};GKe(this.element,n),this.cssClass&&ZKe([this.element],this.cssClass.split(" "))},t.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},t.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},t.prototype.itemsAlign=function(e,t){var n,r;this.tbarEle||(this.tbarEle=[]);for(var o=0;o<e.length;o++)n=this.renderSubComponent(e[o],o),-1===this.tbarEle.indexOf(n)&&this.tbarEle.push(n),this.tbarAlign||this.tbarItemAlign(e[o],t,o),(r=t.querySelector(".e-toolbar-"+e[o].align.toLowerCase()))?(e[o].showAlwaysInPopup&&"Show"!==e[o].overflow||this.tbarAlgEle[(e[o].align+"s").toLowerCase()].push(n),r.appendChild(n)):t.appendChild(n);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},t.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(iSt),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(iSt),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),tGe(this.element,{height:qUe(this.height),width:qUe(this.width)})),this.destroyMode(),this.refreshOverflow()},t.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+lSt+" ."+ESt).removeAttribute("style"),this.isVertical?this.scrollModule=new zkt({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new Ekt({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&ZKe([t[0]],this.cssClass.split(" ")),this.remove(this.scrollModule.element,kSt),tGe(this.element,{overflow:"hidden"}))},t.prototype.itemWidthCal=function(e){var t,n=this,r=0;return[].slice.call(QKe("."+sSt,e)).forEach((function(e){WKe(e)&&(t=window.getComputedStyle(e),r+=n.isVertical?e.offsetHeight:e.offsetWidth,r+=parseFloat(n.isVertical?t.marginTop:t.marginRight),r+=parseFloat(n.isVertical?t.marginBottom:t.marginLeft))})),r},t.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},t.prototype.checkOverflow=function(e,t){if(ZUe(e)||ZUe(t)||!WKe(e))return!1;var n=this.isVertical?e.offsetHeight:e.offsetWidth,r=this.isVertical?t.offsetHeight:t.offsetWidth;(this.tbarAlign||this.scrollModule||n===r)&&(r=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t));var o=e.querySelector("."+wSt),a=e.querySelector("."+xSt),i=0;return o?i=this.isVertical?o.offsetHeight:o.offsetWidth:a&&(i=this.isVertical?2*a.offsetHeight:2*a.offsetWidth),r>n-i},t.prototype.refreshOverflow=function(){this.resize()},t.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,kSt),this.itemPositioning())},t.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+lSt),n=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===zKe.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":ZUe(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(lSt)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||n)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,ISt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,DSt)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==zKe.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,HSt),(this.checkOverflow(e,t)||n)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},t.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(QKe("."+lSt+" ."+sSt,e))),this.element.querySelector("."+wSt).setAttribute("tabIndex","0"),this.element.querySelector("."+wSt).setAttribute("role","list")},t.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+uSt)),n=e.querySelector("."+PSt),r=e.querySelector("."+TSt),o="MultiRow"===this.overflowMode?n:r;null!==o&&("MultiRow"===this.overflowMode?o.classList.remove(PSt):"Extended"===this.overflowMode&&o.classList.remove(TSt));for(var a=0;a<=t.length-1;a++)t[a].offsetLeft<30&&0!==t[a].offsetLeft&&("MultiRow"===this.overflowMode?t[a].classList.add(PSt):"Extended"===this.overflowMode&&t[a].classList.add(TSt))},t.prototype.createPopupEle=function(e,t){var n=e.querySelector("."+wSt),r=this.isVertical;n||this.createPopupIcon(e),n=e.querySelector("."+wSt);var o=r?n.offsetHeight:n.offsetWidth,a=(r?e.offsetHeight:e.offsetWidth)-o;this.element.classList.remove("e-rtl"),tGe(this.element,{direction:"initial"}),this.checkPriority(e,t,a,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},t.prototype.pushingPoppedEle=function(e,t,n,r,o){var a=e.element,i=[].slice.call(QKe("."+MSt,a.querySelector("."+lSt))),l=QKe("."+bSt,n),s=0,c=0;i.forEach((function(a,i){l=QKe("."+bSt,n),a.classList.contains(bSt)&&l.length>0?e.tbResize&&l.length>i?(n.insertBefore(a,l[i]),++c):(n.insertBefore(a,n.children[l.length]),++c):a.classList.contains(bSt)||e.tbResize&&a.classList.contains(ySt)&&n.children.length>0&&0===l.length?(n.insertBefore(a,n.firstChild),++c):a.classList.contains(ySt)?t.push(a):e.tbResize?(n.insertBefore(a,n.childNodes[s+c]),++s):n.appendChild(a),a.classList.contains(uSt)?tGe(a,{display:"",height:o+"px"}):tGe(a,{display:"",height:r+"px"})})),t.forEach((function(e){n.appendChild(e)}));for(var u=QKe("."+sSt,a.querySelector("."+lSt)),d=u.length-1;d>=0;d--){var h=u[d];if(!h.classList.contains(uSt)||"Extended"===this.overflowMode)break;tGe(h,{display:"none"})}},t.prototype.createPopup=function(){var e,t,n=this.element;"Extended"===this.overflowMode&&(t=n.querySelector("."+uSt+":not(."+MSt+")"),e="auto"===n.style.height||""===n.style.height?null:t.offsetHeight);var r,o=n.querySelector("."+sSt+":not(."+uSt+"):not(."+MSt+")"),a="auto"===n.style.height||""===n.style.height?null:o&&o.offsetHeight;if(XKe("#"+n.id+"_popup."+CSt,n))r=XKe("#"+n.id+"_popup."+CSt,n);else{var i=this.createElement("div",{id:n.id+"_popup",className:CSt+" "+LSt}),l=this.createElement("div",{id:n.id+"_popup",className:CSt});r="Extended"===this.overflowMode?i:l}this.pushingPoppedEle(this,[],r,a,e),this.popupInit(n,r)},t.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},t.prototype.popupInit=function(e,t){if(this.popObj){var n=this.popObj.element;tGe(n,{maxHeight:"",display:"block"}),tGe(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(t),this.cssClass&&ZKe([t],this.cssClass.split(" ")),tGe(this.element,{overflow:""});var r=window.getComputedStyle(this.element),o=new IQe(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if(o.appendTo(t),"Extended"===this.overflowMode&&(o.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth),o.offsetX=0),RKe.add(document,"scroll",this.docEvent.bind(this)),RKe.add(document,"click ",this.docEvent.bind(this)),o.element.style.maxHeight=o.element.offsetHeight+"px",this.isVertical&&(o.element.style.visibility="hidden"),this.isExtendedOpen){var a=this.element.querySelector("."+wSt);a.classList.add(_St),nGe(a.firstElementChild,[dSt],[hSt]),this.element.querySelector("."+LSt).classList.add(pSt)}else o.hide();this.popObj=o,this.element.setAttribute("aria-haspopup","true")}},t.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,zSt):this.remove(this.element,zSt))},t.prototype.popupOpen=function(e){var t=this.popObj;this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,o=r.querySelector("."+wSt);tGe(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px","Extended"===this.overflowMode&&(t.element.style.minHeight="");var a=n.offsetTop+n.offsetHeight+KXe(r).top,i=o.firstElementChild;o.classList.add(_St),nGe(i,[dSt],[hSt]),this.tbarPopupHandler(!0);var l=ZUe(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+l<a&&this.element.offsetTop<n.offsetHeight){var s=n.offsetHeight-(a-window.innerHeight-l+5);t.height=s+"px";for(var c=0;c<=n.childElementCount;c++){var u=n.children[c];if(u.offsetTop+u.offsetHeight>s){s=u.offsetTop;break}}tGe(t.element,{maxHeight:s+"px"})}else if(this.isVertical){var d=this.element.getBoundingClientRect();tGe(t.element,{maxHeight:d.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(t){var h=n.getBoundingClientRect();h.right>document.documentElement.clientWidth&&h.width>r.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition()}},t.prototype.popupClose=function(e){var t=this.element.querySelector("."+wSt),n=t.firstElementChild;t.classList.remove(_St),nGe(n,[hSt],[dSt]),this.tbarPopupHandler(!1)},t.prototype.checkPriority=function(e,t,n,r){for(var o,a=this.popupPriCount>0,i=n,l=0,s=0,c=0,u=function(e,t){var n=!1;return t.forEach((function(t){e.classList.contains(t)&&(n=!0)})),n},d=t.length-1;d>=0;d--){var h=void 0,p=window.getComputedStyle(t[d]);this.isVertical?(h=parseFloat(p.marginTop),h+=parseFloat(p.marginBottom)):(h=parseFloat(p.marginRight),h+=parseFloat(p.marginLeft));var f=t[d]===this.tbarEle[0];f&&(this.tbarEleMrgn=h),o=this.isVertical?t[d].offsetHeight:t[d].offsetWidth;var m=f?o+h:o;if(u(t[d],[ASt])&&a&&(t[d].classList.add(MSt),this.isVertical?tGe(t[d],{display:"none",minHeight:m+"px"}):tGe(t[d],{display:"none",minWidth:m+"px"}),c++),this.isVertical?t[d].offsetTop+t[d].offsetHeight+h>n:t[d].offsetLeft+t[d].offsetWidth+h>n){if(t[d].classList.contains(uSt)){if("Extended"===this.overflowMode){if(s===c)u(v=t[d],[uSt,NSt])&&(t[d].classList.add(MSt),c++);s++}else if("Popup"===this.overflowMode){var v;if(l>0&&s===c)u(v=t[d+s+(l-1)],[uSt,NSt])&&tGe(v,{display:"none"});l++,s=0,c=0}}else s++;t[d].classList.contains(bSt)&&r||u(t[d],[uSt,NSt])?n-=(this.isVertical?t[d].offsetHeight:t[d].offsetWidth)+h:(t[d].classList.add(MSt),this.isVertical?tGe(t[d],{display:"none",minHeight:m+"px"}):tGe(t[d],{display:"none",minWidth:m+"px"}),c++)}}if(r){var g=QKe("."+sSt+":not(."+MSt+")",this.element);this.checkPriority(e,g,i,!1)}},t.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav e-hor-nav");n="Extended"===this.overflowMode?n+" e-expended-nav":n;var r=this.createElement("div",{id:t,className:n});"msie"!==zKe.info.name&&"edge"!==zKe.info.name||r.classList.add("e-ie-align");var o=this.createElement("div",{className:hSt+" e-icons"});r.appendChild(o),r.setAttribute("tabindex","0"),r.setAttribute("role","list"),e.appendChild(r)},t.prototype.tbarPriRef=function(e,t,n,r,o,a,i,l){var s=l,c=this.popObj.element,u="."+sSt+":not(."+uSt+"):not(."+bSt+")",d=QKe("."+MSt+":not(."+bSt+")",c).length,h=function(e,t){return e.classList.contains(t)};if(0===QKe(u,e).length){var p=e.children[t-(t-n)-1],f=!ZUe(p)&&h(p,NSt);if(!ZUe(p)&&h(p,uSt)&&!WKe(p)||f){p.style.display="inherit";var m=p.offsetWidth+2*parseFloat(window.getComputedStyle(p).marginRight),v=p.previousElementSibling;a+m<i||o?(e.insertBefore(r,e.children[t+s-(t-n)]),ZUe(v)||(v.style.display="")):v.classList.contains(uSt)&&(v.style.display="none"),p.style.display=""}else e.insertBefore(r,e.children[t+s-(t-n)])}else e.insertBefore(r,e.children[t+s-d])},t.prototype.popupRefresh=function(e,t){var n=this,r=this.element,o=this.isVertical,a=r.querySelector("."+lSt),i=r.querySelector("."+wSt);if(!ZUe(i)){var l;a.removeAttribute("style"),e.style.display="block",l=o?r.offsetHeight-(i.offsetHeight+a.offsetHeight):r.offsetWidth-(i.offsetWidth+a.offsetWidth);var s=0;[].slice.call(e.children).forEach((function(e){s+=n.popupEleWidth(e),tGe(e,{position:""})})),l+(o?i.offsetHeight:i.offsetWidth)>s&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(l,e,t),e.style.display="",0===e.children.length&&i&&this.popObj&&(UKe(i),i=null,this.popObj.destroy(),UKe(this.popObj.element),this.popObj=null,r.setAttribute("aria-haspopup","false"))}},t.prototype.ignoreEleFetch=function(e,t){var n=[].slice.call(t.querySelectorAll("."+NSt)),r=[],o=0;return n.length>0?(n.forEach((function(e){r.push([].slice.call(t.children).indexOf(e))})),r.forEach((function(t){t<=e&&o++})),o):0},t.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var n=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var r=e.offsetWidth-e.querySelector("."+wSt).offsetWidth,o=e.querySelector("."+lSt).offsetWidth;return t.style.removeProperty("display"),r>n+o},t.prototype.popupEleWidth=function(e){e.style.position="absolute";var t=this.isVertical?e.offsetHeight:e.offsetWidth,n=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains(gSt)){var r=e.children[0];!ZUe(n)&&e.classList.contains(gSt)?n.style.display="none":!ZUe(n)&&e.classList.contains(vSt)&&(n.style.display="block"),r.style.minWidth="0%",t=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),r.style.minWidth="",r.style.minHeight="",ZUe(n)||(n.style.display="")}return t},t.prototype.popupEleRefresh=function(e,t,n){for(var r,o,a=this.popupPriCount>0,i=this.tbarEle,l=this.element.querySelector("."+lSt),s=0,c=function(t){if(t.classList.contains(ASt)&&a&&!n)return"continue";var c=u.popupEleWidth(t);if(t===u.tbarEle[0]&&(c+=u.tbarEleMrgn),t.style.position="",!(c<e||n))return"break";if(tGe(t,{minWidth:"",height:"",minHeight:""}),t.classList.contains(ySt)||t.classList.remove(MSt),o=u.tbarEle.indexOf(t),u.tbarAlign){var d=u.items[o].align;o=u.tbarAlgEle[(d+"s").toLowerCase()].indexOf(t),i=u.tbarAlgEle[(d+"s").toLowerCase()],l=u.element.querySelector("."+lSt+" .e-toolbar-"+d.toLowerCase())}var h=0;"Extended"!==u.overflowMode&&i.slice(0,o).forEach((function(t){(t.classList.contains(bSt)||t.classList.contains(uSt))&&(t.classList.contains(uSt)&&(t.style.display="",e-=t.offsetWidth),h++)})),s=u.ignoreEleFetch(o,l),t.classList.contains(bSt)?(u.tbarPriRef(l,o,h,t,n,c,e,s),e-=t.offsetWidth):0===o?(l.insertBefore(t,l.firstChild),e-=t.offsetWidth):(r=QKe("."+bSt,u.popObj.element).length,l.insertBefore(t,l.children[o+s-r]),e-=t.offsetWidth),t.style.height=""},u=this,d=0,h=[].slice.call(t.children);d<h.length;d++){if("break"===c(h[d]))break}this.checkOverflow(this.element,this.element.getElementsByClassName(lSt)[0])&&!n&&this.renderOverflowMode()},t.prototype.removePositioning=function(){var e=this.element.querySelector("."+lSt);if(!ZUe(e)&&e.classList.contains(kSt)){this.remove(e,kSt);var t=[].slice.call(e.childNodes);t[1].removeAttribute("style"),t[2].removeAttribute("style")}},t.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+lSt);this.add(e,kSt),this.itemPositioning()},t.prototype.itemPositioning=function(){var e,t=this.element.querySelector("."+lSt);if(!ZUe(t)&&t.classList.contains(kSt)){var n,r=this.element.querySelector("."+wSt);if(this.scrollModule){var o=this.isVertical?"e-vscroll-content":"e-hscroll-content";n=[].slice.call(t.querySelector("."+o).children)}else n=[].slice.call(t.childNodes);e=this.isVertical?n[0].offsetHeight+n[2].offsetHeight:n[0].offsetWidth+n[2].offsetWidth;var a=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(r){a-=this.isVertical?r.offsetHeight:r.offsetWidth;var i=(this.isVertical?r.offsetHeight:r.offsetWidth)+"px";n[2].removeAttribute("style"),this.isVertical?this.enableRtl?n[2].style.top=i:n[2].style.bottom=i:this.enableRtl?n[2].style.left=i:n[2].style.right=i}if(!(a<=e)){var l=(a-e-(this.isVertical?n[1].offsetHeight:n[1].offsetWidth))/2;n[1].removeAttribute("style");var s=(this.isVertical?n[0].offsetHeight:n[0].offsetWidth)+l+"px";this.isVertical?this.enableRtl?n[1].style.marginBottom=s:n[1].style.marginTop=s:this.enableRtl?n[1].style.marginRight=s:n[1].style.marginLeft=s}}},t.prototype.tbarItemAlign=function(e,t,n){var r=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var o=[];if(o.push(this.createElement("div",{className:"e-toolbar-left"})),o.push(this.createElement("div",{className:ESt})),o.push(this.createElement("div",{className:"e-toolbar-right"})),0===n&&"Left"!==e.align)o.forEach((function(e){t.appendChild(e)})),this.tbarAlign=!0,this.add(t,kSt);else if("Left"!==e.align){var a=t.childNodes,i=o[0];[].slice.call(a).forEach((function(e){r.tbarAlgEle.lefts.push(e),i.appendChild(e)})),t.appendChild(i),t.appendChild(o[1]),t.appendChild(o[2]),this.tbarAlign=!0,this.add(t,kSt)}}},t.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,lSt),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach((function(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,sSt))}))},t.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var n=void 0;e&&e.children.length>0&&(n=e.querySelector("."+lSt)),n||(n=this.createElement("div",{className:lSt})),this.itemsAlign(t,n),e.appendChild(n)}},t.prototype.setAttr=function(e,t){for(var n,r=Object.keys(e),o=0;o<r.length;o++)"class"===(n=r[o])?this.add(t,e[n]):t.setAttribute(n,e[n])},t.prototype.enableItems=function(e,t){var n,r=e,o=r.length;ZUe(t)&&(t=!0);var a=function(e,t){e?(t.classList.remove(mSt),t.setAttribute("aria-disabled","false")):(t.classList.add(mSt),t.setAttribute("aria-disabled","true"))};if(!ZUe(o)&&o>=1){for(var i=0,l=[].slice.call(r);i<o;i++){var s=l[i];if("number"==typeof s){if(ZUe(n=this.getElementByIndex(s)))return;r[i]=n}else n=s;a(t,n)}t?VKe(r,mSt):ZKe(r,mSt)}else{if("number"==typeof r){if(ZUe(n=this.getElementByIndex(r)))return}else n=e;a(t,n)}},t.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]:null},t.prototype.addItems=function(e,t){var n;this.extendedOpen();var r=this.element.querySelector("."+lSt);if(ZUe(r))this.itemsRerender(e);else{var o,a="Left";ZUe(t)&&(t=0),e.forEach((function(e){ZUe(e.align)||"Left"===e.align||"Left"!==a||(a=e.align)}));for(var i=0,l=e;i<l.length;i++){var s=l[i];if(ZUe(s.type)&&(s.type="Button"),n=QKe("."+sSt,this.element),s.align=a,o=this.renderSubComponent(s,t),this.tbarEle.length>=t&&n.length>=0){ZUe(this.scrollModule)&&this.destroyMode();var c="L"===s.align[0]?0:"C"===s.align[0]?1:2,u=void 0;this.tbarAlign||"Left"===a?this.tbarAlign?((u=eGe(n[0],"."+lSt).children[c]).insertBefore(o,u.children[t]),this.tbarAlgEle[(s.align+"s").toLowerCase()].splice(t,0,o),this.refreshPositioning()):0===n.length?(n=QKe("."+lSt,this.element))[0].appendChild(o):n[0].parentNode.insertBefore(o,n[t]):(this.tbarItemAlign(s,r,1),this.tbarAlign=!0,(u=eGe(n[0],"."+lSt).children[c]).appendChild(o),this.tbarAlgEle[(s.align+"s").toLowerCase()].push(o),this.refreshPositioning()),this.items.splice(t,0,s),s.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,o),t++,this.offsetWid=r.offsetWidth}}r.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},t.prototype.removeItems=function(e){var t,n=e,r=[].slice.call(QKe("."+sSt,this.element));if("number"==typeof n)t=parseInt(e.toString(),10),this.removeItemByIndex(t,r);else if(n&&n.length>1)for(var o=0,a=[].slice.call(n);o<a.length;o++){var i=a[o];t=this.tbarEle.indexOf(i),this.removeItemByIndex(t,r),r=QKe("."+sSt,this.element)}else{i=n&&n.length&&1===n.length?n[0]:e;t=r.indexOf(i),this.removeItemByIndex(t,r)}this.resize()},t.prototype.removeItemByIndex=function(e,t){if(this.tbarEle[e]&&t[e]){var n=this.tbarEle.indexOf(t[e]);if(this.tbarAlign){var r=this.tbarAlgEle[(this.items[n].align+"s").toLowerCase()].indexOf(this.tbarEle[n]);this.tbarAlgEle[(this.items[n].align+"s").toLowerCase()].splice(r,1)}this.isReact&&this.clearTemplate();var o=t[e].querySelector(".e-control.e-btn");ZUe(o)||ZUe(o.ej2_instances[0])||o.ej2_instances[0].isDestroyed||o.ej2_instances[0].destroy(),UKe(t[e]),this.items.splice(n,1),this.tbarEle.splice(n,1)}},t.prototype.templateRender=function(e,t,n,r){var o,a=n.type,i=e;if("object"==typeof e&&(o="function"==typeof i.appendTo),"string"!=typeof e&&o){if("Input"===a){u=this.createElement("input");n.id?u.id=n.id:u.id=jUe("tbr-ipt"),t.appendChild(u),i.appendTo(u)}}else{var l,s=void 0,c=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);l="string"==typeof e?e.trim():e;try{if("object"!=typeof e||ZUe(e.tagName))if("string"==typeof e&&c.test(l))t.innerHTML=l;else if(document.querySelectorAll(l).length){var u,d=(u=document.querySelector(l)).outerHTML.trim();t.appendChild(u),u.style.display="",ZUe(d)||this.tempId.push(l)}else s=LXe(l);else t.appendChild(e)}catch(e){s=LXe(l)}var h=void 0;if(!ZUe(s))h=s({},this,"template",this.element.id+r+"_template",this.isStringTemplate);!ZUe(h)&&h.length>0&&[].slice.call(h).forEach((function(e){ZUe(e.tagName)||(e.style.display=""),t.appendChild(e)}))}this.add(t,fSt),this.tbarEle.push(t)},t.prototype.buttonRendering=function(e,t){var n=this.createElement("button",{className:"e-tbar-btn"});n.setAttribute("type","button");var r,o,a=e.text;e.id?n.id=e.id:n.id=jUe("e-tbr-btn");var i=this.createElement("span",{className:"e-tbar-btn-text"});a?(i.innerHTML=this.enableHtmlSanitizer?YXe.sanitize(a):a,n.appendChild(i),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(r=e.prefixIcon+" e-icons",o="Left"):(r=e.suffixIcon+" e-icons",o="Right"));var l=new BQe({iconCss:r,iconPosition:o});return l.createElement=this.createElement,l.appendTo(n),e.width&&tGe(n,{width:qUe(e.width)}),n},t.prototype.renderSubComponent=function(e,t){var n,r=this.createElement("div",{className:sSt});r.setAttribute("aria-disabled","false");var o=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?YXe.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,r),e.tooltipText&&r.setAttribute("title",o.textContent),e.cssClass&&(r.className=r.className+" "+e.cssClass),e.template)this.templateRender(e.template,r,e,t);else switch(e.type){case"Button":(n=this.buttonRendering(e,r)).setAttribute("tabindex","-1"),n.setAttribute("aria-label",e.text||e.tooltipText),r.appendChild(n),r.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(r,uSt)}if(e.showTextOn){var a=e.showTextOn;"Toolbar"===a?(this.add(r,vSt),this.add(r,"e-tbtn-align")):"Overflow"===a&&this.add(r,gSt)}if(e.overflow){var i=e.overflow;"Show"===i?this.add(r,bSt):"Hide"===i&&(r.classList.contains(uSt)||this.add(r,ySt))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!r.classList.contains(uSt)&&(this.add(r,ASt),this.popupPriCount++),e.disabled&&this.add(r,mSt),!1===e.visible&&this.add(r,OSt),r},t.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},t.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},t.prototype.activeEleRemove=function(e){ZUe(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,ZUe(this.trgtEle)&&!e.parentElement.classList.contains(fSt)?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.getModuleName=function(){return"toolbar"},t.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},t.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var t=this.checkOverflow(e,e.getElementsByClassName(lSt)[0]);if(!t){this.destroyScroll();var n=e.querySelector("."+lSt);ZUe(n)||(this.remove(n,DSt),this.tbarAlign&&this.add(n,kSt))}if(!t||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||t)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var r=window.getComputedStyle(this.element);this.popObj.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth)}this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()}this.element.querySelector("."+SSt)&&(this.scrollStep=this.element.querySelector("."+SSt).offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator()}},t.prototype.extendedOpen=function(){var e=this.element.querySelector("."+LSt);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(pSt))},t.prototype.onPropertyChanged=function(e,t){var n=this.element,r=n.offsetWidth;this.extendedOpen();for(var o=0,a=Object.keys(e);o<a.length;o++){switch(a[o]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var i=Object.keys(e.items),l=0;l<i.length;l++){var s=parseInt(Object.keys(e.items)[l],10),c=Object.keys(e.items[s])[0],u=Object(e.items[s])[c];if("function"!=typeof u){if(this.tbarAlign||"align"===c){this.refresh(),this.trigger("created");break}var d="showAlwaysInPopup"===c&&!u,h="overflow"===c&&0!==this.popupPriCount;(d||this.items[s].showAlwaysInPopup&&h)&&--this.popupPriCount,ZUe(this.scrollModule)&&this.destroyMode();var p=[].slice.call(QKe("."+lSt+" ."+sSt,n));this.isReact&&this.clearTemplate(),UKe(p[s]),this.tbarEle.splice(s,1),this.addItems([this.items[s]],s),this.items.splice(s,1),this.items[s].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":tGe(n,{width:qUe(e.width)}),this.renderOverflowMode(),this.popObj&&r<n.offsetWidth&&this.popupRefresh(this.popObj.element,!1);break;case"height":tGe(this.element,{height:qUe(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(n,cSt),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(n,cSt):this.remove(n,cSt),ZUe(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,cSt):this.remove(this.scrollModule.element,cSt)),ZUe(this.popObj)||(e.enableRtl?this.add(this.popObj.element,cSt):this.remove(this.popObj.element,cSt)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":t.cssClass&&VKe([this.element],t.cssClass.split(" ")),e.cssClass&&ZKe([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}}},t.prototype.hideItem=function(e,t){var n,r,o="object"==typeof e,a=e,i=[].slice.call(QKe("."+sSt,this.element));if(o)r=e;else if(this.tbarEle[a]){r=[].slice.call(QKe("."+sSt,this.element))[a]}if(r){if(t?r.classList.add(OSt):r.classList.remove(OSt),t&&ZUe(this.element.getAttribute("tabindex"))&&!r.classList.contains(uSt)){if(ZUe(r.firstElementChild.getAttribute("tabindex"))){r.firstElementChild.setAttribute("tabindex","-1");var l=[].slice.call(QKe("."+sSt,this.element));o&&(a=l.indexOf(r));for(var s=l[++a];s;){if(!this.eleContains(s)){s.firstElementChild.removeAttribute("tabindex");break}s=l[++a]}}}else if(ZUe(this.element.getAttribute("tabindex"))&&!r.classList.contains(uSt))for(var c=!1,u=!1,d=i[n=0];d;)if(d.classList.contains(uSt))d=i[++n];else if(ZUe(d.firstElementChild.getAttribute("tabindex")))d.firstElementChild.setAttribute("tabindex","-1"),c=!0;else{if(c&&u)break;this.eleContains(d)||(d.firstElementChild.removeAttribute("tabindex"),u=!0),d=i[++n]}this.refreshOverflow()}},aSt([bGe([],RSt)],t.prototype,"items",void 0),aSt([vGe("auto")],t.prototype,"width",void 0),aSt([vGe("auto")],t.prototype,"height",void 0),aSt([vGe("")],t.prototype,"cssClass",void 0),aSt([vGe("Scrollable")],t.prototype,"overflowMode",void 0),aSt([vGe()],t.prototype,"scrollStep",void 0),aSt([vGe(!0)],t.prototype,"enableCollision",void 0),aSt([vGe(!0)],t.prototype,"enableHtmlSanitizer",void 0),aSt([vGe(!0)],t.prototype,"allowKeyboard",void 0),aSt([yGe()],t.prototype,"clicked",void 0),aSt([yGe()],t.prototype,"created",void 0),aSt([yGe()],t.prototype,"destroyed",void 0),aSt([yGe()],t.prototype,"beforeCreate",void 0),t=aSt([wGe],t)}(qGe),$St=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZSt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},VSt="e-tab",jSt="e-tab-header",WSt="e-content",FSt="e-nested",qSt="e-item",YSt="e-template",USt="e-rtl",KSt="e-active",GSt="e-disable",XSt="e-hidden",QSt="e-focused",JSt="e-icons",eCt="e-icon",tCt="e-icon-tab",nCt="e-close-icon",rCt="e-close-show",oCt="e-tab-text",aCt="e-indicator",iCt="e-tab-wrap",lCt="e-text-wrap",sCt="e-tab-icon",cCt="e-toolbar-items",uCt="e-toolbar-item",dCt="e-toolbar-pop",hCt="e-toolbar-popup",pCt="e-progress",fCt="e-overlay",mCt="e-vertical-tab",vCt="e-vertical",gCt="e-vertical-left",bCt="e-vertical-right",yCt="e-horizontal-bottom",wCt="e-fill-mode",xCt="tabitem_",ECt="e-reorder-active-item",kCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([vGe("SlideLeftIn")],t.prototype,"effect",void 0),ZSt([vGe(600)],t.prototype,"duration",void 0),ZSt([vGe("ease")],t.prototype,"easing",void 0),t}(HGe),SCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([gGe({effect:"SlideLeftIn",duration:600,easing:"ease"},kCt)],t.prototype,"previous",void 0),ZSt([gGe({effect:"SlideRightIn",duration:600,easing:"ease"},kCt)],t.prototype,"next",void 0),t}(HGe),CCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([vGe("")],t.prototype,"text",void 0),ZSt([vGe("")],t.prototype,"iconCss",void 0),ZSt([vGe("left")],t.prototype,"iconPosition",void 0),t}(HGe),MCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([gGe({},CCt)],t.prototype,"header",void 0),ZSt([vGe(null)],t.prototype,"headerTemplate",void 0),ZSt([vGe("")],t.prototype,"content",void 0),ZSt([vGe("")],t.prototype,"cssClass",void 0),ZSt([vGe(!1)],t.prototype,"disabled",void 0),ZSt([vGe(!0)],t.prototype,"visible",void 0),ZSt([vGe()],t.prototype,"id",void 0),t}(HGe),_Ct=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.show={},r.hide={},r.maxHeight=0,r.title="Close",r.isInteracted=!1,r.lastIndex=0,r.isAdd=!1,r.isIconAlone=!1,r.draggableItems=[],r.resizeContext=r.refreshActiveTabBorder.bind(r),r.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},r}return $St(t,e),t.prototype.destroy=function(){var t=this;if((this.isReact||this.isAngular)&&this.clearTemplate(),ZUe(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation","aria-owns"].forEach((function(e){t.element.removeAttribute(e)})),this.expTemplateContent(),this.isTemplate){var n=XKe(".e-tab > ."+WSt,this.element);this.element.classList.remove(YSt),ZUe(n)||(n.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)KKe(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var r=0;r<this.draggableItems.length;r++)this.draggableItems[r].destroy(),this.draggableItems[r]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},t.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},t.prototype.preRender=function(){var e=eGe(this.element,"."+WSt);this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=ZUe(this.dragArea)?"#"+this.element.id+" ."+jSt:this.dragArea),ZUe(e)||(e.parentElement.classList.add(FSt),this.isNested=!0);var t=zKe.info.name,n="msie"===t?"e-ie":"edge"===t?"e-edge":"safari"===t?"e-safari":"";tGe(this.element,{width:qUe(this.width),height:qUe(this.height)}),this.setCssClass(this.element,this.cssClass,!0),GKe(this.element,{role:"tablist","aria-disabled":"false","aria-activedescendant":"","aria-owns":this.element.id+"_tab_header_items"}),this.setCssClass(this.element,n,!0),this.updatePopAnimationConfig()},t.prototype.render=function(){this.btnCls=this.createElement("span",{className:JSt+" "+nCt,attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:"-"+Math.random().toString(36).substr(2,5),this.renderContainer(),this.wireEvents(),this.initRender=!1},t.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach((function(e,t){ZUe(e.id)&&!ZUe(e.setProperties)&&e.setProperties({id:xCt+t.toString()},!0)})),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:WSt})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:jSt})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add(YSt);var t=e.querySelector("."+jSt);t&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,t)}if(!ZUe(XKe("."+jSt,this.element))&&!ZUe(XKe("."+WSt,this.element))){if(this.renderHeader(),this.tbItems=XKe("."+jSt+" ."+cCt,this.element),ZUe(this.tbItems)||_Ge(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),QKe("."+uCt,this.element).length>0){this.tbItems=XKe("."+jSt+" ."+cCt,this.element),this.bdrLine=this.createElement("div",{className:aCt+" "+XSt+" e-ignore"});var n=XKe("."+this.scrCntClass,this.tbItems);ZUe(n)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):n.insertBefore(this.bdrLine,n.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}if(!ZUe(this.tbItem))for(var r=0;r<this.items.length;r++)if(this.items[r]){var o=this.items[r].id;this.tbItem[r].setAttribute("data-id",o)}this.setRTL(this.enableRtl)}},t.prototype.renderHeader=function(){var e=this,t=this.headerPlacement,n=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(jSt)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r=this.hdrEle.children.length,o=[],a=0;a<r;a++)o.push(this.hdrEle.children.item(a).innerHTML);if(r>0){for(;this.hdrEle.firstElementChild;)UKe(this.hdrEle.firstElementChild);var i=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(i),o.forEach((function(t,n){e.lastIndex=n;var r={className:qSt,id:qSt+e.tabId+"_"+n,attrs:{role:"tab","aria-controls":WSt+e.tabId+"_"+n,"aria-selected":"false"}},o=e.createElement("span",{className:oCt,innerHTML:t,attrs:{role:"presentation"}}).outerHTML,a=e.createElement("div",{className:lCt,innerHTML:o+e.btnCls.outerHTML}).outerHTML,l=e.createElement("div",{className:iCt,innerHTML:a,attrs:{tabIndex:"-1"}});i.appendChild(e.createElement("div",r)),QKe("."+qSt,i)[n].appendChild(l)}))}}else n=this.parseObject(this.items,0);this.tbObj=new BSt({width:"Left"===t||"Right"===t?"auto":"100%",height:"Left"===t||"Right"===t?"100%":"auto",overflowMode:this.overflowMode,items:0!==n.length?n:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),GKe(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton);var l=this.tbObj.element.querySelector("."+cCt);ZUe(l)||((ZUe(l.id)||""===l.id)&&(l.id=this.element.id+"_tab_header_items"),this.element.setAttribute("aria-owns",l.id))},t.prototype.renderContent=function(){this.cntEle=XKe("."+WSt,this.element);var e=QKe("."+uCt,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,n=0;n<e.length;n++)t.length-1>=n&&(ZKe([t.item(n)],qSt),GKe(t.item(n),{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_"+n}),t.item(n).id=WSt+this.tabId+"_"+n)}},t.prototype.reRenderItems=function(){this.renderContainer(),ZUe(this.cntEle)||(this.touchModule=new uXe(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},t.prototype.parseObject=function(e,t){var n=this,r=QKe(".e-tab-header ."+uCt,this.element),o=this.lastIndex;if(!this.isReplace&&r.length>0){var a=[];r.forEach((function(e){a.push(parseInt(e.id.slice(e.id.indexOf("_")+1),10))})),o=Math.max.apply(Math,a)}var i,l=[],s=[];return e.forEach((function(e,a){var c=ZUe(e.header)||ZUe(e.header.iconPosition)?"":e.header.iconPosition,u=ZUe(e.header)||ZUe(e.header.iconCss)?"":e.header.iconCss;if(ZUe(e.headerTemplate)&&(ZUe(e.header)||ZUe(e.header.text)||0===e.header.text.length&&""===u))s.push(a);else{var d,h=e.headerTemplate||e.header.text;if("string"==typeof h&&n.enableHtmlSanitizer&&(h=YXe.sanitize(h)),n.isReplace&&!ZUe(n.tbId)&&""!==n.tbId){var p=n.tbId.indexOf("_");d=parseInt(n.tbId.substring(p+1),10),n.tbId=""}else d=t+a;n.lastIndex=0===r.length?a:n.isReplace?d:o+1+a;var f=e.disabled?" "+GSt+" "+fCt:"",m=!1===e.visible?" "+XSt:"";i=n.createElement("div",{className:oCt,attrs:{role:"presentation"}});var v=h instanceof Object?h.outerHTML:h,g=!ZUe(v)&&""!==v;ZUe(h.tagName)?n.headerTextCompile(i,h,a):i.appendChild(h);var b=n.createElement("span",{className:JSt+" "+sCt+" "+eCt+"-"+c+" "+u}),y=n.createElement("div",{className:lCt});y.appendChild(i),""!==h&&void 0!==h&&""!==u?("left"===c||"top"===c?y.insertBefore(b,y.firstElementChild):y.appendChild(b),n.isIconAlone=!1):(""===u?i:b)===b&&(UKe(i),y.appendChild(b),n.isIconAlone=!0);var w=e.disabled?{}:{tabIndex:"-1"};y.appendChild(n.btnCls.cloneNode(!0));var x=n.createElement("div",{className:iCt,attrs:w});x.appendChild(y),n.itemIndexArray===[]?n.itemIndexArray.push(qSt+n.tabId+"_"+n.lastIndex):n.itemIndexArray.splice(t+a,0,qSt+n.tabId+"_"+n.lastIndex);var E={htmlAttributes:{id:qSt+n.tabId+"_"+n.lastIndex,role:"tab","aria-selected":"false"},template:x};E.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+f+" "+m+" "+(""!==u?"e-i"+c:"")+" "+(g?"":eCt),"top"!==c&&"bottom"!==c||n.element.classList.add("e-vertical-icon"),l.push(E),a++}})),this.isAdd||s.forEach((function(e){n.items.splice(e,1)})),this.isIconAlone?this.element.classList.add(tCt):this.element.classList.remove(tCt),l},t.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var t=QKe("."+uCt+"."+KSt,e);[].slice.call(t).forEach((function(e){return e.classList.remove(KSt)}))}},t.prototype.checkPopupOverflow=function(e){this.tbPop=XKe("."+dCt,this.element);var t=XKe(".e-hor-nav",this.element),n=XKe("."+cCt,this.element),r=n.lastChild,o=!1;return(!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>n.offsetLeft||!this.enableRtl&&t.offsetLeft<n.offsetWidth)||this.isVertical()&&t.offsetTop<r.offsetTop+r.offsetHeight)&&(o=!0),o&&(e.classList.add(hCt),this.tbPop.insertBefore(e,QKe("."+hCt,this.tbPop)[0])),!0},t.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element");ZUe(t)||(t.outerHTML="",e.querySelector("."+iCt).classList.remove("e-ripple")),this.tbItem=QKe("."+cCt+" ."+uCt,this.hdrEle);var n=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(hCt),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(n)){var r=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(r)}this.isPopup=!0}return QKe("."+uCt,this.tbItems).length-1},t.prototype.updateOrientationAttribute=function(){GKe(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},t.prototype.setCloseButton=function(e){var t=XKe("."+jSt,this.element);!0===e?t.classList.add(rCt):t.classList.remove(rCt),this.tbObj.refreshOverflow(),this.refreshActiveTabBorder()},t.prototype.prevCtnAnimation=function(e,t){return this.enableRtl||this.element.classList.contains(USt),this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},t.prototype.triggerPrevAnimation=function(e,t){var n=this,r=this.prevCtnAnimation(t,this.selectedItem);ZUe(r)?e.classList.remove(KSt):(r.begin=function(){tGe(e,{position:"absolute"}),e.classList.add(pCt),e.classList.add("e-view")},r.end=function(){e.style.display="none",e.classList.remove(KSt),e.classList.remove(pCt),e.classList.remove("e-view"),tGe(e,{display:"",position:""}),0!==e.childNodes.length||n.isTemplate||UKe(e)},new MGe(r).animate(e))},t.prototype.triggerAnimation=function(e,t){var n,r=this,o=this.prevIndex;[].slice.call(this.element.querySelector("."+WSt).children).forEach((function(e){e.id===r.prevActiveEle&&(n=e)}));var a=this.tbItem[o],i=this.getTrgContent(this.cntEle,this.extIndex(e));if(ZUe(n)&&!ZUe(a)){var l=this.extIndex(a.id);n=this.getTrgContent(this.cntEle,l)}if(ZUe(i)||(this.prevActiveEle=i.id),this.initRender||!1===t||this.animation==={}||ZUe(this.animation))n&&n!==i&&n.classList.remove(KSt);else{var s,c=XKe("."+WSt,this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var u=this.animation.previous.effect;s={name:"None"===u?"":"SlideLeftIn"!==u?u:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var d=this.animation.next.effect;s={name:"None"===d?"":"SlideRightIn"!==d?d:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}s.progress=function(){c.classList.add(pCt),r.setActiveBorder()},s.end=function(){c.classList.remove(pCt),i.classList.add(KSt)},this.initRender||ZUe(n)||this.triggerPrevAnimation(n,o),this.isPopup=!1,""===s.name?i.classList.add(KSt):new MGe(s).animate(i)}},t.prototype.keyPressed=function(e){var t=eGe(e,"."+jSt+" ."+uCt),n=this.getEleIndex(t);!ZUe(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():ZUe(t)||!1!==t.classList.contains(KSt)||(this.selectTab(n,null,!0),ZUe(this.popEle)||this.popObj.hide(this.hide))},t.prototype.getTabHeader=function(){if(!ZUe(this.element)){var e=[].slice.call(this.element.children).filter((function(e){return e.classList.contains(jSt)}));if(e.length>0)return e[0];var t=[].slice.call(this.element.children).filter((function(e){return!e.classList.contains("blazor-template")}))[0];if(t)return[].slice.call(t.children).filter((function(e){return e.classList.contains(jSt)}))[0]}},t.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(QKe("."+uCt,this.getTabHeader()),e)},t.prototype.extIndex=function(e){return e.replace(qSt+this.tabId+"_","")},t.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach((function(t){ZUe(e.element.querySelector(t))||(document.body.appendChild(e.element.querySelector(t)).style.display="none")}))},t.prototype.templateCompile=function(e,t,n){var r=this.createElement("div");this.compileElement(r,t,"content",n),0!==r.childNodes.length&&e.appendChild(r),this.isReact&&this.renderReactTemplates()},t.prototype.compileElement=function(e,t,n,r){var o,a;"string"==typeof t?(t=t.trim(),this.isVue?o=LXe(YXe.sanitize(t)):e.innerHTML=YXe.sanitize(t)):o=LXe(t),ZUe(o)||(a=o({},this,n)),!ZUe(o)&&a.length>0&&[].slice.call(a).forEach((function(t){e.appendChild(t)}))},t.prototype.headerTextCompile=function(e,t,n){this.compileElement(e,t,"headerTemplate",n)},t.prototype.getContent=function(e,t,n,r){var o;if("string"==typeof(t=ZUe(t)?"":t)||ZUe(t.innerHTML))if("string"==typeof t&&this.enableHtmlSanitizer&&(t=YXe.sanitize(t)),"."===t[0]||"#"===t[0])if(document.querySelectorAll(t).length){var a=document.querySelector(t);o=a.outerHTML.trim(),"clone"===n?e.appendChild(a.cloneNode(!0)):(e.appendChild(a),a.style.display="")}else this.templateCompile(e,t,r);else this.templateCompile(e,t,r);else e.appendChild(t);ZUe(o)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},t.prototype.getTrgContent=function(e,t){return this.element.classList.contains(FSt)?XKe("."+FSt+"> ."+WSt+" > #"+WSt+this.tabId+"_"+t,this.element):this.findEle(e.children,WSt+this.tabId+"_"+t)},t.prototype.findEle=function(e,t){for(var n,r=0;r<e.length;r++)if(e[r].id===t){n=e[r];break}return n},t.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},t.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?gCt:bCt;ZKe([this.hdrEle],[vCt,e]),this.element.classList.contains(FSt)?ZKe([this.hdrEle],[mCt,e]):ZKe([this.element],[mCt,e])}"Bottom"===this.headerPlacement&&ZKe([this.hdrEle],[yCt])},t.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},t.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var t=this.hdrEle.querySelector("."+KSt),n=!!this.hdrEle.classList.contains(vCt);VKe([this.element],[mCt]),VKe([this.hdrEle],[vCt,gCt,bCt]),n!==this.isVertical()&&(this.changeToolbarOrientation(),!ZUe(t)&&t.classList.contains(hCt)&&this.popupHandler(t)),this.addVerticalClass(),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},t.prototype.focusItem=function(){var e=XKe(" #"+qSt+this.tabId+"_"+this.selectedItem,this.hdrEle);ZUe(e)||e.firstElementChild.focus()},t.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},t.prototype.setOrientation=function(e,t){var n=Array.prototype.indexOf.call(this.element.children,t),r=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+WSt));"Bottom"===e&&r>n?this.element.appendChild(t):(VKe([t],[yCt]),this.element.insertBefore(t,XKe("."+WSt,this.element)))},t.prototype.setCssClass=function(e,t,n){if(""!==t)for(var r=t.split(" "),o=0;o<r.length;o++)n?e.classList.add(r[o]):e.classList.remove(r[o])},t.prototype.setContentHeight=function(e){if(this.element.classList.contains(wCt)&&VKe([this.element],[wCt]),!ZUe(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode){if("auto"===this.height)return;this.isVertical()||tGe(this.cntEle,{height:this.element.offsetHeight-t.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)ZKe([this.element],[wCt]),tGe(this.element,{height:"100%"}),tGe(this.cntEle,{height:this.element.offsetHeight-t.offsetHeight+"px"});else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var n=QKe("."+WSt+" > ."+qSt,this.element),r=0;r<n.length;r++)n[r].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n[r])),n[r].style.removeProperty("display"),n[r].style.removeProperty("visibility");else{this.cntEle=XKe("."+WSt,this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:WSt+this.tabId+"_0",className:qSt+" "+KSt,attrs:{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_0"}}));var o=this.cntEle.children.item(0);for(r=0;r<this.items.length;r++)for(this.getContent(o,this.items[r].content,"clone",r),this.maxHeight=Math.max(this.maxHeight,this.getHeight(o));o.firstChild;)o.removeChild(o.firstChild);this.isReact&&this.clearTemplate(["content"]),this.templateEle=[],this.getContent(o,this.items[0].content,"render",0),this.prevIndex!==this.selectedItem&&o.classList.remove(KSt)}tGe(this.cntEle,{height:this.maxHeight+"px"})}else tGe(this.cntEle,{height:"auto"})}},t.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},t.prototype.setActiveBorder=function(){var e=this.getTabHeader(),t=XKe("."+uCt+"."+KSt,e);if(!ZUe(t)){this.reorderActiveTab?e&&e.classList.remove(ECt):(t.classList.contains(hCt)&&!this.bdrLine.classList.contains(XSt)&&this.bdrLine.classList.add(XSt),e&&!e.classList.contains(ECt)&&e.classList.add(ECt));var n=eGe(t,"."+VSt);if(this.element===n){this.tbItems=XKe("."+cCt,e);var r=XKe("."+aCt,e),o=XKe("."+cCt+" ."+this.scrCntClass,e);if(this.isVertical()){tGe(r,{left:"",right:""}),tGe(r,0!==(ZUe(o)?this.tbItems.offsetHeight:o.offsetHeight)?{top:t.offsetTop+"px",height:t.offsetHeight+"px"}:{top:0,height:0})}else{if("MultiRow"===this.overflowMode)tGe(XKe("."+aCt,this.element),{top:t.offsetHeight+t.offsetTop+"px",height:""});else tGe(r,{top:"",height:""});var a=ZUe(o)?this.tbItems.offsetWidth:o.offsetWidth;tGe(r,0!==a?{left:t.offsetLeft+"px",right:a-(t.offsetLeft+t.offsetWidth)+"px"}:{left:"auto",right:"auto"})}ZUe(this.bdrLine)||t.classList.contains(hCt)||this.bdrLine.classList.remove(XSt)}}},t.prototype.setActive=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1),this.tbItem=QKe("."+uCt,this.getTabHeader());var r=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length))if(e>=0&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),r.classList.contains(KSt))this.setActiveBorder();else{if(!this.isTemplate){var o=this.tbItem[this.prevIndex];ZUe(o)||o.removeAttribute("aria-controls"),GKe(r,{"aria-controls":WSt+this.tabId+"_"+e})}var a=r.id;this.removeActiveClass(),r.classList.add(KSt),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),r.setAttribute("aria-selected","true");var i=Number(this.extIndex(a));if(ZUe(this.prevActiveEle)&&(this.prevActiveEle=WSt+this.tabId+"_"+i),GKe(this.element,{"aria-activedescendant":a}),this.isTemplate){if(XKe("."+WSt,this.element).children.length>0){var l=this.findEle(XKe("."+WSt,this.element).children,WSt+this.tabId+"_"+i);ZUe(l)||l.classList.add(KSt),this.triggerAnimation(a,this.enableAnimation)}}else{this.cntEle=XKe(".e-tab > ."+WSt,this.element);var s=this.getTrgContent(this.cntEle,this.extIndex(a));if(ZUe(s)){this.cntEle.appendChild(this.createElement("div",{id:WSt+this.tabId+"_"+this.extIndex(a),className:qSt+" "+KSt,attrs:{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_"+this.extIndex(a)}}));var c=this.getTrgContent(this.cntEle,this.extIndex(a)),u=Array.prototype.indexOf.call(this.itemIndexArray,a);this.getContent(c,this.items[u].content,"render",u)}else s.classList.add(KSt);this.triggerAnimation(a,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(r),!this.initRender&&!t){r.firstElementChild.focus();var d={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:r,selectedIndex:e,selectedContent:XKe("#"+WSt+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:n};this.trigger("selected",d)}}},t.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=XKe("."+cCt,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},t.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,USt,e),this.refreshActiveBorder()},t.prototype.refreshActiveBorder=function(){ZUe(this.bdrLine)||this.bdrLine.classList.add(XSt),this.setActiveBorder()},t.prototype.showPopup=function(e){var t=XKe(".e-popup.e-toolbar-pop",this.hdrEle);if(t.classList.contains("e-popup-close")){var n=t&&t.ej2_instances[0];n.position.X="Left"===this.headerPlacement?"left":"right",n.dataBind(),n.show(e)}},t.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector("."+jSt);if(t)t.querySelectorAll("."+uCt).forEach((function(t){e.initializeDrag(t)}))}},t.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),RKe.add(this.element,"mouseover",this.hoverHandler,this),RKe.add(this.element,"keydown",this.spaceKeyDown,this),ZUe(this.cntEle)||(this.touchModule=new uXe(this.cntEle,{swipe:this.swipeHandler.bind(this)})),this.keyModule=new oXe(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new oXe(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},t.prototype.unWireEvents=function(){ZUe(this.keyModule)||this.keyModule.destroy(),ZUe(this.tabKeyModule)||this.tabKeyModule.destroy(),ZUe(this.cntEle)||ZUe(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),RKe.remove(this.element,"mouseover",this.hoverHandler),RKe.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(USt),this.element.classList.remove(QSt)},t.prototype.clickHandler=function(e){this.element.classList.remove(QSt);var t=e.originalEvent.target,n=eGe(t,"."+uCt),r=this.getEleIndex(n);t.classList.contains(nCt)?this.removeTab(r):this.isVertical()&&eGe(t,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,ZUe(n)||r===this.selectedItem&&r===this.prevIndex||this.selectTab(r,e.originalEvent,!0))},t.prototype.swipeHandler=function(e){if(!(e.velocity<3&&ZUe(e.originalEvent.changedTouches))){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var n=this.selectedItem-1;n>=0;n--)if(!this.tbItem[n].classList.contains(XSt)){this.selectTab(n,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==QKe("."+uCt,this.element).length-1)for(var r=this.selectedItem+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(XSt)){this.selectTab(r,null,!0);break}this.isSwipeed=!1}}},t.prototype.spaceKeyDown=function(e){(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(ZUe(eGe(e.target,"."+jSt))||e.preventDefault())},t.prototype.keyHandler=function(e){if(!this.element.classList.contains(GSt)){this.element.classList.add(QSt);var t=e.target,n=this.getTabHeader(),r=XKe("."+KSt,n);this.popEle=XKe("."+dCt,n),ZUe(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var o=eGe(document.activeElement,"."+uCt),a=eGe(t,"."+uCt);switch(e.action){case"space":case"enter":if(t.parentElement.classList.contains(GSt))return;if("enter"===e.action&&t.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(t);break;case"tab":case"shiftTab":t.classList.contains(iCt)&&!1===eGe(t,"."+uCt).classList.contains(KSt)&&t.setAttribute("tabindex","-1"),this.popObj&&WKe(this.popObj.element)&&this.popObj.hide(this.hide),r.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":ZUe(o)||this.refreshItemVisibility(o);break;case"openPopup":e.preventDefault(),!ZUe(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!ZUe(a)){var i=a.nextSibling;!ZUe(i)&&i.classList.contains(uCt)&&i.firstElementChild.focus(),this.removeTab(this.getEleIndex(a))}this.setActiveBorder()}}},t.prototype.refreshActiveTabBorder=function(){var e=XKe("."+uCt+"."+hCt+"."+KSt,this.element);!ZUe(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},t.prototype.refreshItemVisibility=function(e){var t=XKe("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!ZUe(t)){var n=XKe(".e-hscroll-bar",this.tbItems),r=n.scrollLeft,o=r+n.offsetWidth,a=e.offsetLeft,i=e.offsetWidth,l=e.offsetLeft+e.offsetWidth;if(r<a&&o<l){var s=o-a;n.scrollLeft=r+(i-s)}else if(r>a&&o>l){s=l-r;n.scrollLeft=r-(i-s)}}},t.prototype.hoverHandler=function(e){var t=e.target;!ZUe(t.classList)&&t.classList.contains(nCt)&&t.setAttribute("title",new aXe("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},t.prototype.evalOnPropertyChangeItems=function(e,t){if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,ZUe(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var n=XKe(".e-tab > ."+WSt,this.element);n.firstElementChild;)UKe(n.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else for(var r=Object.keys(e.items),o=0;o<r.length;o++)for(var a=parseInt(Object.keys(e.items)[o],10),i=Object.keys(e.items[a]),l=0;l<i.length;l++){var s=Object(t.items[a])[i[l]],c=Object(e.items[a])[i[l]],u=this.element.querySelectorAll("."+uCt)[a],d=void 0;if(u&&!ZUe(u.id)&&""!==u.id){var h=u.id.lastIndexOf("_");d=parseInt(u.id.substring(h+1),10)}else d=a;var p=XKe("."+cCt+" #"+qSt+this.tabId+"_"+d,this.element),f=XKe("."+WSt+" #"+WSt+this.tabId+"_"+d,this.element);if("header"===i[l]||"headerTemplate"===i[l]){var m=ZUe(this.items[a].header)||ZUe(this.items[a].header.iconCss)?"":this.items[a].header.iconCss;if(""===(this.items[a].headerTemplate||this.items[a].header.text)&&""===m)this.removeTab(a);else{this.tbId=u.id;var v=[];v.push(this.items[a]),this.items.splice(a,1),this.itemIndexArray.splice(a,1),this.tbObj.items.splice(a,1);var g=p.classList.contains(XSt);UKe(p),this.isReplace=!0,this.addTab(v,a),g&&this.hideTab(a),this.isReplace=!1}}if("content"===i[l]&&!ZUe(f))if(("string"==typeof c||ZUe(c.innerHTML))&&("."===c[0]||"#"===c[0])&&c.length){var b=document.querySelector(c);f.appendChild(b),b.style.display=""}else""===c&&"#"===s[0]?(document.body.appendChild(this.element.querySelector(s)).style.display="none",f.innerHTML=c):this.isReact?(f.innerHTML="",this.templateCompile(f,c,a)):"function"!=typeof c&&(f.innerHTML=c);"cssClass"===i[l]&&(ZUe(p)||(p.classList.remove(s),p.classList.add(c)),ZUe(f)||(f.classList.remove(s),f.classList.add(c))),"disabled"===i[l]&&this.enableTab(a,!0!==c),"visible"===i[l]&&this.hideTab(a,!0!==c)}},t.prototype.initializeDrag=function(e){var t=this,n=new QGe(e,{dragArea:this.dragArea,dragTarget:"."+uCt,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var n,r,o=t.getEleIndex(t.dragItem),a={draggedItem:t.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+uCt),clonedElement:t.cloneElement,index:o};if(ZUe(e.target.closest("."+VSt))||e.target.closest("."+VSt).isEqualNode(t.element)||t.dragArea==="."+jSt){if(e.target.closest(t.dragArea)||"Popup"===t.overflowMode?(document.body.style.cursor="",t.dragItem.querySelector("."+iCt).style.visibility="hidden",t.cloneElement.classList.contains(XSt)&&VKe([t.cloneElement],XSt)):(document.body.style.cursor="not-allowed",ZKe([t.cloneElement],XSt),t.dragItem.classList.contains(XSt)&&VKe([t.dragItem],XSt),t.dragItem.querySelector("."+iCt).style.visibility="visible"),"Scrollable"===t.overflowMode&&!ZUe(t.element.querySelector(".e-hscroll"))){var i=t.element.querySelector(".e-scroll-right-nav"),l=t.element.querySelector(".e-scroll-left-nav"),s=t.element.querySelector(".e-hscroll-bar");!ZUe(i)&&Math.abs(i.offsetWidth/2+i.offsetLeft)>t.cloneElement.offsetLeft+t.cloneElement.offsetWidth&&(s.scrollLeft-=10),!ZUe(l)&&Math.abs(l.offsetLeft+l.offsetWidth-t.cloneElement.offsetLeft)>l.offsetWidth/2&&(s.scrollLeft+=10)}t.cloneElement.style.pointerEvents="none",r=eGe(e.target,"."+uCt+".e-draggable");var c=0;"Scrollable"!==t.overflowMode||ZUe(t.element.querySelector(".e-hscroll"))||(c=t.element.querySelector(".e-hscroll-content").offsetWidth),null!=r&&!r.isSameNode(t.dragItem)&&r.closest("."+VSt).isSameNode(t.dragItem.closest("."+VSt))&&((n=t.getEleIndex(r))<o&&Math.abs(r.offsetLeft+r.offsetWidth-t.cloneElement.offsetLeft)>r.offsetWidth/2&&t.dragAction(r,o,n),n>o&&Math.abs(r.offsetWidth/2)+r.offsetLeft-c<t.cloneElement.offsetLeft+t.cloneElement.offsetWidth&&t.dragAction(r,o,n)),t.droppedIndex=t.getEleIndex(t.dragItem),t.trigger("dragging",a)}else t.trigger("dragging",a)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(n)},t.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),ZKe([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+jSt).classList.contains(rCt)&&ZKe([this.cloneElement],rCt),VKe([this.cloneElement.querySelector("."+iCt)],"e-ripple"),ZUe(this.cloneElement.querySelector(".e-ripple-element"))||KKe(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},t.prototype.itemDragStart=function(e){var t=this;this.draggingItems=this.items.map((function(e){return e})),this.dragItem=e.element;var n={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",n,(function(e){e.cancel?UKe(t.cloneElement):(t.removeActiveClass(),ZKe([t.tbItems.querySelector("."+aCt)],XSt),t.dragItem.querySelector("."+iCt).style.visibility="hidden")}))},t.prototype.dragAction=function(e,t,n){if(this.items.length>0){var r=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(n,0,r)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>n)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){var o=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(e.parentElement.lastChild,o.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var a=e.parentElement.lastChild;if(e.isSameNode(a)){o=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(a,o.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<n&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(e,this.dragItem):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},t.prototype.itemDragStop=function(e){var t=this;UKe(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+iCt).style.visibility="visible",document.body.style.cursor="";var n={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",n,(function(e){e.cancel?t.refresh():t.items.length>0&&t.draggingItems.length>0?(t.items=t.draggingItems,t.selectedItem=t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+iCt).style.visibility="",VKe([t.tbItems.querySelector("."+aCt)],XSt),t.selectTab(t.droppedIndex,null,!0))})),this.dragItem=null},t.prototype.enableTab=function(e,t){var n=QKe("."+uCt,this.element)[e];ZUe(n)||(!0===t?(n.classList.remove(GSt,fCt),n.firstElementChild.setAttribute("tabindex","-1")):(n.classList.add(GSt,fCt),n.firstElementChild.removeAttribute("tabindex"),n.classList.contains(KSt)&&this.select(e+1)),ZUe(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),n.setAttribute("aria-disabled",!0===t?"false":"true"))},t.prototype.addTab=function(e,t){var n=this,r={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):this.trigger("adding",r,(function(r){r.cancel||n.addingTabContent(e,t)})),this.isReact&&this.renderReactTemplates()},t.prototype.addingTabContent=function(e,t){var n=this,r=0;if(this.hdrEle=XKe("."+jSt,this.element),ZUe(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var o=QKe(".e-tab-header ."+uCt,this.element).length;if(0!==o&&(r=this.lastIndex+1),ZUe(t)&&(t=o-1),o<t||t<0||isNaN(t))return;0!==o||ZUe(this.hdrEle)||(this.hdrEle.style.display=""),ZUe(this.bdrLine)||this.bdrLine.classList.add(XSt),this.tbItems=XKe("."+cCt,this.getTabHeader()),this.isAdd=!0;var a=this.parseObject(e,t);this.isAdd=!1;var i,l=0;e.forEach((function(e,o){if(i=e.headerTemplate||e.header.text,ZUe(e.headerTemplate||e.header)||ZUe(i)||0===i.length&&!ZUe(e.header)&&ZUe(e.header.iconCss)||(a[o]&&(ZUe(e.id)&&(e.id=xCt+(r+o).toString()),a[o].htmlAttributes["data-id"]=e.id),n.items.splice(t+l,0,e),l++),n.isTemplate&&!ZUe(e.header)&&!ZUe(e.header.text)){var s=r+o,c=n.createElement("div",{id:WSt+n.tabId+"_"+s,className:qSt,attrs:{role:"tabpanel","aria-labelledby":qSt+"_"+s}});n.cntEle.insertBefore(c,n.cntEle.children[t+o]);var u=n.getTrgContent(n.cntEle,s.toString());n.getContent(u,e.content,"render",t)}})),this.tbObj.addItems(a,t),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===t?this.select(t):(this.setActiveBorder(),this.tbItem=QKe("."+uCt,this.getTabHeader())),this.bindDraggable()}},t.prototype.removeTab=function(e){var t=this,n=QKe("."+uCt,this.element)[e];if(!ZUe(n)){var r={removedItem:n,removedIndex:e,cancel:!1};this.trigger("removing",r,(function(r){if(!r.cancel){t.tbObj.removeItems(e),t.allowDragAndDrop&&e!==Array.prototype.indexOf.call(t.itemIndexArray,n.id)&&(e=Array.prototype.indexOf.call(t.itemIndexArray,n.id)),t.items.splice(e,1),t.itemIndexArray.splice(e,1),t.refreshActiveBorder();var o=XKe("#"+WSt+t.tabId+"_"+t.extIndex(n.id),XKe("."+WSt,t.element));ZUe(o)||UKe(o),t.trigger("removed",r),t.draggableItems&&t.draggableItems.length>0&&(t.draggableItems[e].destroy(),t.draggableItems[e]=null,t.draggableItems.splice(e,1)),n.classList.contains(KSt)?(e=e>QKe("."+uCt+":not(."+hCt+")",t.element).length-1?e-1:e,t.enableAnimation=!1,t.selectedItem=e,t.select(e)):e!==t.selectedItem&&(e<t.selectedItem&&(e=t.itemIndexArray.indexOf(t.tbItem[t.selectedItem].id),t.setProperties({selectedItem:e>-1?e:t.selectedItem},!0),t.prevIndex=t.selectedItem),t.tbItem=QKe("."+uCt,t.getTabHeader())),0===QKe("."+uCt,t.element).length&&(t.hdrEle.style.display="none"),t.enableAnimation=!0}}))}},t.prototype.hideTab=function(e,t){var n,r=QKe("."+uCt,this.element)[e];if(!ZUe(r)){if(ZUe(t)&&(t=!0),this.bdrLine.classList.add(XSt),!0===t)if(r.classList.add(XSt),0!==(n=QKe("."+uCt+":not(."+XSt+")",this.tbItems)).length&&r.classList.contains(KSt)){if(0!==e)for(var o=e-1;o>=0;o--){if(!this.tbItem[o].classList.contains(XSt)){this.select(o);break}if(0===o)for(var a=e+1;a<this.tbItem.length;a++)if(!this.tbItem[a].classList.contains(XSt)){this.select(a);break}}else for(a=e+1;a<this.tbItem.length;a++)if(!this.tbItem[a].classList.contains(XSt)){this.select(a);break}}else 0===n.length&&this.element.classList.add(XSt);else this.element.classList.remove(XSt),n=QKe("."+uCt+":not(."+XSt+")",this.tbItems),r.classList.remove(XSt),0===n.length&&this.select(e);this.setActiveBorder(),r.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},t.prototype.selectTab=function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1),this.isInteracted=n,this.select(e,t)},t.prototype.select=function(e,t){var n=this,r=this.getTabHeader();this.tbItems=XKe("."+cCt,r),this.tbItem=QKe("."+uCt,r),this.content=XKe("."+WSt,this.element),this.prevItem=this.tbItem[this.prevIndex],ZUe(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var o=this.tbItem[e];ZUe(o)?this.selectedID="0":this.selectingID=this.extIndex(o.id),ZUe(this.prevItem)||this.prevItem.classList.contains(GSt)||this.prevItem.children.item(0).setAttribute("tabindex","-1");var a={event:t,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:ZUe(this.content)?null:XKe("#"+WSt+this.tabId+"_"+this.selectedID,this.content),selectingItem:o,selectingIndex:e,selectingContent:ZUe(this.content)?null:XKe("#"+WSt+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",a,(function(t){t.cancel||n.selectingContent(e,n.isInteracted)})),this.isInteracted=!1},t.prototype.selectingContent=function(e,t){if("number"==typeof e){if(!ZUe(this.tbItem[e])&&(this.tbItem[e].classList.contains(GSt)||this.tbItem[e].classList.contains(XSt)))for(var n=e+1;n<this.items.length;n++){if(!1===this.items[n].disabled&&!0===this.items[n].visible){e=n;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(hCt)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!ZUe(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=QKe("."+cCt+" ."+uCt,this.hdrEle);var r=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,r);var o=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,o)}}else this.setActive(e,null,t);else this.setActive(0,null,t)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},t.prototype.getItemIndex=function(e){for(var t,n=0;n<this.tbItem.length;n++){if(e===this.tbItem[n].getAttribute("data-id")){t=n;break}}return t},t.prototype.disable=function(e){this.setCssClass(this.element,GSt,e),this.element.setAttribute("aria-disabled",""+e)},t.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},t.prototype.getModuleName=function(){return"tab"},t.prototype.onPropertyChanged=function(e,t){for(var n=this,r=0,o=Object.keys(e);r<o.length;r++){switch(o[r]){case"width":tGe(this.element,{width:qUe(e.width)});break;case"height":tGe(this.element,{height:qUe(e.height)}),this.setContentHeight(!1);break;case"cssClass":var a=this.element.querySelector("."+jSt);""===t.cssClass||ZUe(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),ZUe(a)||this.setCssClass(a,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),ZUe(a)||(this.setCssClass(a,t.cssClass,!1),this.setCssClass(a,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach((function(e){e.dragArea=n.dragArea})),this.refresh())}}},t.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+cCt),t=this.element.querySelector("."+uCt+"."+KSt),n=t.id,r=n.indexOf("_"),o=parseInt(n.substring(r+1),10),a=t.innerText,i=this.element.querySelector("."+WSt).querySelector("."+KSt).children[0],l=i.innerHTML;UKe(t),UKe(i);var s={className:uCt+" "+YSt+" "+KSt,id:qSt+this.tabId+"_"+o,attrs:{role:"tab","aria-controls":WSt+this.tabId+"_"+o,"aria-disabled":"false","aria-selected":"true"}},c=this.createElement("span",{className:oCt,innerHTML:a,attrs:{role:"presentation"}}).outerHTML,u=this.createElement("div",{className:lCt,innerHTML:c+this.btnCls.outerHTML}).outerHTML,d=this.createElement("div",{className:iCt,innerHTML:u,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",s),e.children[o+1]),this.element.querySelector("."+uCt+"."+KSt).appendChild(d);x=this.createElement("div",{innerHTML:l});this.element.querySelector("."+WSt).querySelector("."+KSt).appendChild(x)}else if(this.element.querySelector("."+uCt+"."+KSt)){UKe(this.element.querySelector("."+uCt+"."+KSt).children[0]),UKe(this.element.querySelector("."+WSt).querySelector("."+KSt).children[0]);var h=this.items[this.selectedItem],p=ZUe(h.header)||ZUe(h.header.iconPosition)?"":h.header.iconPosition,f=ZUe(h.header)||ZUe(h.header.iconCss)?"":h.header.iconCss,m=h.headerTemplate||h.header.text,v=this.createElement("div",{className:oCt,attrs:{role:"presentation"}});ZUe(m.tagName)?this.headerTextCompile(v,m,this.selectedItem):v.appendChild(m);var g=this.createElement("span",{className:JSt+" "+sCt+" "+eCt+"-"+p+" "+f}),b=this.createElement("div",{className:lCt});b.appendChild(v),""!==m&&void 0!==m&&""!==f?("left"===p||"top"===p?b.insertBefore(g,b.firstElementChild):b.appendChild(g),this.isIconAlone=!1):(""===f?v:g)===g&&(UKe(v),b.appendChild(g),this.isIconAlone=!0);var y=h.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var w=this.createElement("div",{className:iCt,attrs:y});w.appendChild(b),"top"!==p&&"bottom"!==p||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+uCt+"."+KSt).appendChild(w);var x=this.createElement("div"),E=h.content,k=void 0;if("string"==typeof E||ZUe(E.innerHTML))if("string"==typeof E&&this.enableHtmlSanitizer&&(E=YXe.sanitize(E)),"."===E[0]||"#"===E[0])if(document.querySelectorAll(E).length){var S=document.querySelector(E);k=S.outerHTML.trim(),x.appendChild(S),S.style.display=""}else this.compileElement(x,E,"content",this.selectedItem);else this.compileElement(x,E,"content",this.selectedItem);else x.appendChild(E);ZUe(k)||-1===this.templateEle.indexOf(E.toString())&&this.templateEle.push(E.toString()),this.element.querySelector("."+qSt+"."+KSt).appendChild(x)}this.isReact&&this.renderReactTemplates()},ZSt([bGe([],MCt)],t.prototype,"items",void 0),ZSt([vGe("100%")],t.prototype,"width",void 0),ZSt([vGe("auto")],t.prototype,"height",void 0),ZSt([vGe("")],t.prototype,"cssClass",void 0),ZSt([vGe(0)],t.prototype,"selectedItem",void 0),ZSt([vGe("Top")],t.prototype,"headerPlacement",void 0),ZSt([vGe("Content")],t.prototype,"heightAdjustMode",void 0),ZSt([vGe("Scrollable")],t.prototype,"overflowMode",void 0),ZSt([vGe("Dynamic")],t.prototype,"loadOn",void 0),ZSt([vGe(!1)],t.prototype,"enablePersistence",void 0),ZSt([vGe(!1)],t.prototype,"enableHtmlSanitizer",void 0),ZSt([vGe(!1)],t.prototype,"showCloseButton",void 0),ZSt([vGe(!0)],t.prototype,"reorderActiveTab",void 0),ZSt([vGe()],t.prototype,"scrollStep",void 0),ZSt([vGe()],t.prototype,"dragArea",void 0),ZSt([vGe(!1)],t.prototype,"allowDragAndDrop",void 0),ZSt([gGe({},SCt)],t.prototype,"animation",void 0),ZSt([yGe()],t.prototype,"created",void 0),ZSt([yGe()],t.prototype,"adding",void 0),ZSt([yGe()],t.prototype,"added",void 0),ZSt([yGe()],t.prototype,"selecting",void 0),ZSt([yGe()],t.prototype,"selected",void 0),ZSt([yGe()],t.prototype,"removing",void 0),ZSt([yGe()],t.prototype,"removed",void 0),ZSt([yGe()],t.prototype,"onDragStart",void 0),ZSt([yGe()],t.prototype,"dragging",void 0),ZSt([yGe()],t.prototype,"dragged",void 0),ZSt([yGe()],t.prototype,"destroyed",void 0),t=ZSt([wGe],t)}(qGe),NCt="e-rtl",ACt="e-disabled",OCt="e-input",ICt="e-multi-line-input",DCt="e-input-group",PCt="e-float-input",TCt="e-float-line",HCt="e-float-text",LCt="e-float-text-content",zCt="e-clear-icon",RCt="e-clear-icon-hide",BCt="e-label-top",$Ct="e-label-bottom",ZCt="e-no-float-label",VCt="e-input-custom-tag",jCt="e-float-custom-tag";!function(e){var t,n=!0;function r(e){o(e.floatLabelType,e.element),e.element.addEventListener("focus",(function(){var e=h(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")})),e.element.addEventListener("blur",(function(){var e=h(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")})),e.element.addEventListener("input",(function(){o(t,e.element)}))}function o(e,t){var n=t.value;""!==n&&!ZUe(n)&&t.parentElement?t.parentElement.classList.add("e-valid-input"):"Always"!==e&&t.parentElement&&t.parentElement.classList.remove("e-valid-input")}function a(){var e=h(this).getElementsByClassName("e-float-text")[0];ZUe(e)||(ZKe([e],BCt),e.classList.contains($Ct)&&VKe([e],$Ct))}function i(){var e=h(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var t=e.getElementsByClassName("e-float-text")[0];ZUe(t)||(t.classList.contains(BCt)&&VKe([t],BCt),ZKe([t],$Ct))}}function l(e){e.addEventListener("focus",a),e.addEventListener("blur",i)}function s(e,t,n){var r=ZUe(n)?$Ke:n;"Auto"===e.floatLabelType&&l(e.element),ZUe(t.container)?(t.container=m(e,PCt,jCt,"div",r),e.element.parentNode&&e.element.parentNode.insertBefore(t.container,e.element)):(ZUe(e.customTag)||t.container.classList.add(jCt),t.container.classList.add(PCt));var o=r("span",{className:TCt}),a=r("label",{className:HCt});if(ZUe(e.element.id)||""===e.element.id||(a.id="label_"+e.element.id.replace(/ /g,"_"),GKe(e.element,{"aria-labelledby":a.id})),ZUe(e.element.placeholder)||""===e.element.placeholder||(a.innerText=v(e.element.placeholder),e.element.removeAttribute("placeholder")),ZUe(e.properties)||ZUe(e.properties.placeholder)||""===e.properties.placeholder||(a.innerText=v(e.properties.placeholder)),a.innerText||t.container.classList.add(ZCt),t.container.classList.contains("e-float-icon-left")){var i=t.container.querySelector(".e-input-in-wrap");i.appendChild(e.element),i.appendChild(o),i.appendChild(a)}else t.container.appendChild(e.element),t.container.appendChild(o),t.container.appendChild(a);d(e.element.value,a),"Always"===e.floatLabelType&&(a.classList.contains($Ct)&&VKe([a],$Ct),ZKe([a],BCt)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",(function(t){d(e.element.value,a,e.element)})),e.element.addEventListener("blur",(function(t){d(e.element.value,a)}))),ZUe(e.element.getAttribute("id"))||a.setAttribute("for",e.element.getAttribute("id"))}function c(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function u(e,t,n){e&&!n?VKe([t],RCt):ZKe([t],RCt)}function d(e,t,n){(void 0===n&&(n=null),e)?(ZKe([t],BCt),t.classList.contains($Ct)&&VKe([t],$Ct)):(null==n||n!==document.activeElement)&&(t.classList.contains(BCt)&&VKe([t],BCt),ZKe([t],$Ct))}function h(e){var t=ZUe(e.parentNode)?e:e.parentNode;return t&&t.classList.contains("e-input-in-wrap")&&(t=t.parentNode),t}function p(e,t,r){(null==n||n)&&t.addEventListener("click",(function(n){e.classList.contains(ACt)||e.readOnly||(n.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",ZKe([t],RCt))})),e.addEventListener("input",(function(n){u(e.value,t)})),e.addEventListener("focus",(function(n){u(e.value,t,e.readOnly)})),e.addEventListener("blur",(function(e){setTimeout((function(){ZKe([t],RCt)}),200)}))}function f(e,t){if(h(e).classList.contains(PCt)&&"Auto"===t){var n=h(e).getElementsByClassName("e-float-text")[0];d(e.value,n,e)}}function m(e,t,n,r,o){var a,i=ZUe(o)?$Ke:o;return ZUe(e.customTag)?a=i(r,{className:t}):(a=i(e.customTag,{className:t})).classList.add(n),a.classList.add("e-control-wrapper"),a}function v(e){var t="";if(!ZUe(e)&&""!==e){var n=document.createElement("span");n.innerHTML='<input placeholder="'+e+'"/>',t=n.children[0].placeholder}return t}function g(e,t,n){ZUe(n)||""===n||VKe(t,n.split(" ")),ZUe(e)||""===e||ZKe(t,e.split(" "))}function b(e,t){ZUe(t.getElementsByClassName("e-float-text-content")[0])||(t.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&t.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(e.clientWidth<t.getElementsByClassName("e-float-text-content")[0].clientWidth||e.clientWidth===t.getElementsByClassName("e-float-text-content")[0].clientWidth)&&t.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function y(e,t){e=v(e);var n=h(t);n.classList.contains(PCt)?ZUe(e)||""===e?(n.classList.add(ZCt),n.getElementsByClassName("e-float-text-content")[0]?n.getElementsByClassName(HCt)[0].children[0].textContent="":n.getElementsByClassName(HCt)[0].textContent=""):(n.getElementsByClassName("e-float-text-content")[0]?n.getElementsByClassName(HCt)[0].children[0].textContent=e:n.getElementsByClassName(HCt)[0].textContent=e,n.classList.remove(ZCt),t.removeAttribute("placeholder")):ZUe(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):GKe(t,{placeholder:e,"aria-placeholder":e})}function w(e,t,n){e?GKe(t,{readonly:""}):t.removeAttribute("readonly"),ZUe(n)||f(t,n)}function x(e,t){e?ZKe(t,NCt):VKe(t,NCt)}function E(e,t,n,r){var o={disabled:"disabled","aria-disabled":"true"},a=!ZUe(r);e?(t.classList.remove(ACt),S(o,t),a&&VKe([r],ACt)):(t.classList.add(ACt),C(o,t),a&&ZKe([r],ACt)),ZUe(n)||f(t,n)}function k(e,t,n,r,o){var a=ZUe(o)?$Ke:o;e?n.clearButton=function(e,t,n,r){var o=(ZUe(r)?$Ke:r)("span",{className:zCt}),a=t.container;return ZUe(n)?(t.container.classList.contains(PCt)?t.container.querySelector("."+HCt):e).insertAdjacentElement("afterend",o):a.appendChild(o),!ZUe(a)&&a.classList.contains(PCt)&&ZKe([a],DCt),ZKe([o],RCt),p(e,o),o.setAttribute("aria-label","close"),o}(t,n,r,a):(KKe(n.clearButton),n.clearButton=null)}function S(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],a=h(t);"disabled"===o&&t.classList.remove(ACt),"disabled"===o&&a.classList.contains(DCt)&&a.classList.remove(ACt),"placeholder"===o&&a.classList.contains(PCt)?a.getElementsByClassName(HCt)[0].textContent="":t.removeAttribute(o)}}function C(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],a=h(t);"disabled"===o&&t.classList.add(ACt),"disabled"===o&&a.classList.contains(DCt)&&a.classList.add(ACt),"placeholder"===o&&a.classList.contains(PCt)?a.getElementsByClassName(HCt)[0].textContent=e[o]:t.setAttribute(o,e[o])}}function M(e,t){if(e.container.classList.contains("e-outline")&&e.container.getElementsByClassName("e-float-text")[0]){var n=t("span",{className:LCt});n.innerHTML=e.container.getElementsByClassName("e-float-text")[0].innerHTML,e.container.getElementsByClassName("e-float-text")[0].innerHTML="",e.container.getElementsByClassName("e-float-text")[0].appendChild(n)}}function _(e,t,n){var r=[];r.push(n);var o=ZUe(n)?t.querySelectorAll(".e-input-group-icon"):r;if(e&&o.length>0)for(var a=0;a<o.length;a++)o[a].addEventListener("mousedown",N,!1),o[a].addEventListener("mouseup",A,!1);else if(o.length>0)for(a=0;a<o.length;a++)o[a].removeEventListener("mousedown",N,this),o[a].removeEventListener("mouseup",A,this)}function N(){for(var e,t,n=this.parentElement;!n.classList.contains("e-input-group");)n=n.parentElement;t=this,(e=n).classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}function A(){var e=this;setTimeout((function(){e.classList.remove("e-input-btn-ripple")}),500)}function O(e,t){var n=t("span",{className:e});return n.classList.add("e-input-group-icon"),n}function I(e,t,n,r){var o=ZUe(r)?$Ke:r,a=O(e,o);t.classList.add("e-float-icon-left");var i=t.querySelector(".e-input-in-wrap");if(ZUe(i)){i=o("span",{className:"e-input-in-wrap"}),n.parentNode.insertBefore(i,n);var l=t.querySelectorAll(n.tagName+" ~ *");i.appendChild(n);for(var s=0;s<l.length;s++)i.appendChild(l[s])}return i.parentNode.insertBefore(a,i),t.classList.contains(DCt)||t.classList.add(DCt),_(!0,t,a),a}function D(e,t,n){var r=O(e,ZUe(n)?$Ke:n);return t.classList.contains(DCt)||t.classList.add(DCt),(t.classList.contains("e-float-icon-left")?t.querySelector(".e-input-in-wrap"):t).appendChild(r),_(!0,t,r),r}function P(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}e.createInput=function(e,o){var a=ZUe(o)?$Ke:o,i={container:null,buttons:[],clearButton:null};if(t=e.floatLabelType,n=e.bindClearAction,ZUe(e.floatLabelType)||"Never"===e.floatLabelType?(i.container=m(e,DCt,VCt,"span",a),e.element.parentNode.insertBefore(i.container,e.element),ZKe([e.element],OCt),i.container.appendChild(e.element)):s(e,i,a),r(e),ZUe(e.properties)||ZUe(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(k(e.properties.showClearButton,e.element,i,!0,a),i.clearButton.setAttribute("role","button"),i.container.classList.contains(PCt)&&ZKe([i.container],DCt)),!ZUe(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var l=0;l<e.buttons.length;l++)i.buttons.push(D(e.buttons[l],i.container,a));return ZUe(e.element)||"TEXTAREA"!==e.element.tagName||ZKe([i.container],ICt),P(i.container,e.element),i=function(e,t){if(!ZUe(e.properties))for(var n=0,r=Object.keys(e.properties);n<r.length;n++){switch(r[n]){case"cssClass":g(e.properties.cssClass,[t.container]),c(e.floatLabelType,t.container);break;case"enabled":E(e.properties.enabled,e.element,e.floatLabelType,t.container);break;case"enableRtl":x(e.properties.enableRtl,[t.container]);break;case"placeholder":y(e.properties.placeholder,e.element);break;case"readonly":w(e.properties.readonly,e.element)}}return t}(e,i),M(i,a),i},e.bindInitialEvent=r,e.wireFloatingEvents=l,e.wireClearBtnEvents=p,e.setValue=function(e,t,n,r){if(t.value=e,ZUe(t.getAttribute("value"))&&b(t,t.parentElement),ZUe(n)||"Auto"!==n||f(t,n),!ZUe(r)&&r){var a=h(t);if(!ZUe(a)){var i=a.getElementsByClassName(zCt)[0];ZUe(i)||(t.value&&a.classList.contains("e-input-focus")?VKe([i],RCt):ZKe([i],RCt))}}o(n,t)},e.setCssClass=g,e.calculateWidth=b,e.setWidth=function(e,t){"number"==typeof e?t.style.width=qUe(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:qUe(e)),b(t.firstChild,t)},e.setPlaceholder=y,e.setReadonly=w,e.setEnableRtl=x,e.setEnabled=E,e.setClearButton=k,e.removeAttributes=S,e.addAttributes=C,e.removeFloating=function(e){var t=e.container;if(!ZUe(t)&&t.classList.contains(PCt)){var n=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),r=t.querySelector("."+HCt).textContent,o=null!==t.querySelector(".e-clear-icon");UKe(t.querySelector("."+TCt)),UKe(t.querySelector("."+HCt)),nGe(t,[DCt],[PCt]),function(e){e.removeEventListener("focus",a),e.removeEventListener("blur",i)}(n),GKe(n,{placeholder:r}),n.classList.add(OCt),o||"INPUT"!==n.tagName||n.removeAttribute("required")}},e.addFloating=function(e,n,r,o){var a=ZUe(o)?$Ke:o,i=eGe(e,"."+DCt);if(t=n,"Never"!==n){var l=i.tagName,u={element:e,floatLabelType:n,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:r}},d=i.querySelector(".e-clear-icon"),h={container:i};e.classList.remove(OCt),s(u,h,a),M(h,a),b(u.element,h.container);var p=i.classList.contains("e-float-icon-left");if(ZUe(d))if(p)d=i.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon");else d=i.querySelector(".e-input-group-icon");if(ZUe(d))p&&(d=i.querySelector(".e-input-group-icon")),ZUe(d)&&i.classList.remove(DCt);else{var f=i.querySelector("."+TCt),m=i.querySelector("."+HCt),v=p?i.querySelector(".e-input-in-wrap"):i;v.insertBefore(e,d),v.insertBefore(f,d),v.insertBefore(m,d)}}c(n,e.parentElement)},e.createSpanElement=M,e.setRipple=function(e,t){for(var n=0;n<t.length;n++)_(e,t[n].container)},e.addIcon=function(e,t,n,r,o){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var i=0,l=a;i<l.length;i++){D(l[i],n,o)}else for(var s=0,c=a;s<c.length;s++){I(c[s],n,r,o)}n.getElementsByClassName("e-input-group-icon")[0]&&n.getElementsByClassName("e-float-text-overflow")[0]&&n.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},e.prependSpan=I,e.appendSpan=D,e.validateInputType=P}(rSt||(rSt={}));var WCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),FCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return WCt(t,e),t.moduleName="tabItem",t.complexTemplate={headerText:"header.text"},t}(s0e),qCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return WCt(t,e),t.propertyName="items",t.moduleName="tabItems",t}(s0e),YCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),UCt=function(e){function t(t){var n=e.call(this,t)||this;return n.initRenderCalled=!1,n.checkInjectedModules=!1,n.directivekeys={tabItems:"tabItem"},n.immediateRender=!1,n.portals=[],n}return YCt(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return E.createElement("div",this.getDefaultAttributes(),[].concat(this.props.children,this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(_Ct);i0e(UCt,[a0e,E.Component]);var KCt=function(t){var n=$be().t,r=t.listFile,o=t.height,a=[{headerText:"STT",field:"#",align:"center",width:50},{field:"title",type:"string",headerText:n("Title")},{field:"name",headerText:n("File name")},{field:"size",headerText:n("Size"),template:function(t){var n=t.size/Math.pow(1024,2);return x.default.createElement(e.Fragment,null,n.toFixed(2),"MB")}}];return x.default.createElement(e.Fragment,null,x.default.createElement(mbe,{key:"parent",dataSource:Array.isArray(JSON.parse(r))?JSON.parse(r):[],columns:null!=a?a:[],scroll:o,t:n,format:{decimalSeparator:X.decimalSeparatorDisplay,thousandSeparator:X.thousandSeparatorDisplay,decimalScale:oe("quantity")}}))},GCt=function(e){var t=e.breadCrumbTitle,n=e.breadCrumbParent,r=e.breadCrumbActive;return x.default.createElement("div",{className:"content-header row"},x.default.createElement("div",{className:"content-header-left col-md-9 col-12"},x.default.createElement("div",{className:"row breadcrumbs-top"},x.default.createElement("div",{className:"col-12"},t?x.default.createElement("h2",{className:"content-header-title float-start mb-0"},t):"",x.default.createElement("div",{className:"breadcrumb-wrapper vs-breadcrumbs d-sm-block d-none col-12"},x.default.createElement(Mt,{className:"breadcrumb-nowrap"},x.default.createElement(It,{tag:"li"},x.default.createElement("a",{href:"/"},x.default.createElement(Rn,{fontSize:20}))),n&&n.length>0&&(null==n?void 0:n.map((function(e,t){return x.default.createElement(It,{key:t,tag:"li"},e.link?x.default.createElement("a",{href:e.link},e.title):e.title)}))),x.default.createElement(It,{tag:"li",active:!0},r)))))))};GCt.propTypes={breadCrumbActive:pt.string.isRequired,breadCrumbParent:pt.object};var XCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),QCt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},JCt="e-other-month",eMt="e-other-year",tMt="e-calendar",nMt="e-device",rMt="e-rtl",oMt="e-year",aMt="e-month",iMt="e-decade",lMt="e-icons",sMt="e-disabled",cMt="e-overlay",uMt="e-week-number",dMt="e-selected",hMt="e-focused-date",pMt="e-month-hide",fMt="e-today",mMt="e-day",vMt="e-cell",gMt="e-zoomin",bMt="e-calendar-day-header-lg",yMt=864e5,wMt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.effect="",r.isPopupClicked=!1,r.isDateSelected=!0,r.isTodayClicked=!1,r.preventChange=!1,r.isAngular=!1,r}return XCt(t,e),t.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new kKe(this.locale),(ZUe(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(tMt),this.enableRtl&&this.element.classList.add(rMt),zKe.isDevice&&this.element.classList.add(nMt),GKe(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(tMt),this.enableRtl&&this.calendarElement.classList.add(rMt),zKe.isDevice&&this.calendarElement.classList.add(nMt),GKe(this.calendarElement,{role:"calendar"})),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){ZUe(e)&&this.setProperties({min:new Date(1900,0,1)},!0),ZUe(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},t.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!ZUe(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},t.prototype.setOverlayIndex=function(e,t,n,r){if(r&&!ZUe(t)&&!ZUe(n)&&!ZUe(e)){var o=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;n.style.zIndex=(o-1).toString(),e.style.zIndex=o.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?VKe([this.element],cMt):(this.setProperties({min:this.min},!0),ZKe([this.element],cMt)),this.min=ZUe(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=ZUe(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.createHeader=function(){this.headerElement=this.createElement("div",{className:"e-header"});var e=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),_Ge(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),GKe(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),_Ge(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(GKe(this.previousIcon,{tabIndex:"-1"}),GKe(this.nextIcon,{tabIndex:"-1"})),GKe(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),this.headerTitleElement=this.createElement("div",{className:mMt+" e-title"}),GKe(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+lMt})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next "+lMt})),e.appendChild(this.previousIcon),e.appendChild(this.nextIcon),this.headerElement.appendChild(e),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},t.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{tabIndex:"0",role:"grid","aria-activedescendant":""}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},t.prototype.getCultureValues=function(){var e,t,n=[],r="days.stand-alone."+this.dayHeaderFormat.toLowerCase();e="en"===this.locale||"en-US"===this.locale?TUe(r,SKe.getDependables(yKe,"",t,!1)[EKe[1]]):this.getCultureObjects(yKe,""+this.locale);for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];n.push(TUe(i,e))}return n},t.prototype.toCapitalize=function(e){return!ZUe(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content .e-week-header")[0])||UKe(this.element.querySelectorAll(".e-content .e-week-header")[0]):ZUe(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||UKe(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number"></th>',"calendar"===this.getModuleName()?ZKe([this.element],""+uMt):ZKe([this.calendarElement],""+uMt));for(var t=this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek),n=0;n<=6;n++)e+='<th class="">'+this.toCapitalize(t[n])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content tbody")[0])||UKe(this.element.querySelectorAll(".e-content tbody")[0]):ZUe(this.calendarElement.querySelectorAll(".e-content tbody")[0])||UKe(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},t.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today"))},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max);this.globalize=new kKe(this.locale),this.l10=new aXe(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),_Ge(this.todayElement),this.updateFooter(),ZKe([this.todayElement],["e-btn",fMt,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||ZKe([this.todayElement],sMt),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(sMt)||RKe.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,n,r){RKe.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new oXe(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new oXe(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,n,r){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,n),this.serverModuleName=r},t.prototype.todayButtonClick=function(e,t,n){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),n):this.navigateTo("Month",new Date(this.checkValue(t)),n))},t.prototype.resetCalendar=function(){this.calendarElement&&UKe(this.calendarElement),this.tableBodyElement&&UKe(this.tableBodyElement),this.table&&UKe(this.table),this.tableHeadElement&&UKe(this.tableHeadElement),this.nextIcon&&UKe(this.nextIcon),this.previousIcon&&UKe(this.previousIcon),this.footer&&UKe(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},t.prototype.keyActionHandle=function(e,t,n){var r,o=this.tableBodyElement.querySelector("tr td.e-focused-date");r=n?ZUe(o)||+t!==parseInt(o.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):o:this.tableBodyElement.querySelector("tr td.e-selected");var a=this.getViewNumber(this.currentView()),i=this.getViewNumber(this.depth),l=a===i&&this.getViewNumber(this.start)>=i;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,a,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,a,e,this.max,this.min),e.preventDefault();break;case"moveUp":0===a?this.keyboardNavigate(-7,a,e,this.max,this.min):this.keyboardNavigate(-4,a,e,this.max,this.min),e.preventDefault();break;case"moveDown":0===a?this.keyboardNavigate(7,a,e,this.max,this.min):this.keyboardNavigate(4,a,e,this.max,this.min),e.preventDefault();break;case"select":if(e.target===this.todayElement)this.todayButtonClick(e,t);else{var s=ZUe(o)?r:o;if(!ZUe(s)&&!s.classList.contains(sMt))if(l){var c=new Date(parseInt(""+s.id,0));this.selectDate(e,c,s)}else this.contentClick(null,--a,s,t)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":ZUe(o)&&(ZUe(r)||l)||this.contentClick(null,--a,o||r,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),UKe(this.tableBodyElement),0===a?this.renderMonths(e):1===a?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,a),UKe(this.tableBodyElement),0===a?this.renderMonths(e):1===a?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault()}"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.keyboardNavigate=function(e,t,n,r,o){var a=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderDecades(n)):this.currentDate=a;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderYears(n)):this.currentDate=a;break;case 0:this.addDay(this.currentDate,e,n,r,o),this.isMinMaxRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderMonths(n)):this.currentDate=a}},t.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},t.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),n=new Date(new Date(+this.min).setHours(0,0,0,0)),r=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+n&&+t!=+r||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,n){var r,o=this.weekNumber?8:7;r="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,n):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(r,o,aMt,e,t):this.islamicModule.islamicRenderTemplate(r,o,aMt,e,t)},t.prototype.renderDays=function(e,t,n,r,o){var a,i=[],l=o?new Date(+e):this.getDate(new Date,this.timezone),s=new Date(this.checkValue(e)),c=s.getMonth();this.titleUpdate(e,"days");var u=s;for(s=new Date(u.getFullYear(),u.getMonth(),0,u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds());s.getDay()!==this.firstDayOfWeek;)this.setStartDate(s,-864e5);for(var d=0;d<42;++d){var h=this.createElement("td",{className:vMt}),p=this.createElement("span");if(d%7==0&&this.weekNumber){var f="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,m=new Date(s.getFullYear(),s.getMonth(),s.getDate()+f);p.textContent=""+this.getWeek(m),h.appendChild(p),ZKe([h],""+uMt),i.push(h)}a=new Date(+s),s=this.minMaxDate(s);var v={type:"dateTime",skeleton:"full"},g=this.globalize.parseDate(this.globalize.formatDate(s,v),v),b=this.dayCell(s),y=this.globalize.formatDate(s,{type:"date",skeleton:"full"}),w=this.createElement("span");w.textContent=this.globalize.formatDate(s,{format:"d",type:"date",skeleton:"yMd"});var x=this.min>s||this.max<s;x?(ZKe([b],sMt),ZKe([b],cMt)):w.setAttribute("title",""+y),c!==s.getMonth()&&ZKe([b],JCt),0!==s.getDay()&&6!==s.getDay()||ZKe([b],"e-weekend"),b.appendChild(w),this.renderDayCellArgs={date:s,isDisabled:!1,element:b,isOutOfRange:x};var E=this.renderDayCellArgs;if(this.renderDayCellEvent(E),E.isDisabled){var k=new Date(this.checkValue(t)),S=new Date(this.checkValue(E.date));if(n){if(!ZUe(r)&&r.length>0)for(var C=0;C<r.length;C++){+new Date(this.globalize.formatDate(E.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(r[C],{type:"date",skeleton:"yMd"}))&&(r.splice(C,1),C=-1)}}else k&&+k==+S&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!b.classList.contains(dMt)&&(ZKe([b],sMt),ZKe([b],cMt),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var M=b.classList.contains(JCt),_=b.classList.contains(sMt);if(_||RKe.add(b,"click",this.clickHandler,this),!n||ZUe(r)||_)!_&&this.getDateVal(s,t)&&ZKe([b],dMt);else{for(var N=0;N<r.length;N++){var A={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(s,A)===this.globalize.formatDate(r[N],A)&&this.getDateVal(s,r[N])||this.getDateVal(s,t)?ZKe([b],dMt):this.updateFocus(M,_,s,b,e)}r.length<=0&&this.updateFocus(M,_,s,b,e)}this.updateFocus(M,_,s,b,e),g.getFullYear()===l.getFullYear()&&g.getMonth()===l.getMonth()&&g.getDate()===l.getDate()&&ZKe([b],fMt),i.push(this.renderDayCellArgs.element),s=new Date(+a),this.addDay(s,1,null,this.max,this.min)}return i},t.prototype.updateFocus=function(e,t,n,r,o){o.getDate()!==n.getDate()||e||t?(o>=this.max&&parseInt(r.id,0)===+this.max&&!e&&!t&&ZKe([r],hMt),o<=this.min&&parseInt(r.id,0)===+this.min&&!e&&!t&&ZKe([r],hMt)):ZKe([r],hMt)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var n=[],r=ZUe(t),o=new Date(this.checkValue(this.currentDate)),a=o.getMonth(),i=o.getFullYear(),l=o,s=l.getFullYear(),c=new Date(this.checkValue(this.min)).getFullYear(),u=new Date(this.checkValue(this.min)).getMonth(),d=new Date(this.checkValue(this.max)).getFullYear(),h=new Date(this.checkValue(this.max)).getMonth();l.setMonth(0),this.titleUpdate(this.currentDate,"months"),l.setDate(1);for(var p=0;p<12;++p){var f=this.dayCell(l),m=this.createElement("span"),v=t&&t.getMonth()===l.getMonth(),g=t&&t.getFullYear()===i&&v;m.textContent=this.toCapitalize(this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(s<c||p<u&&s===c)||this.max&&(s>d||p>h&&s>=d)?ZKe([f],sMt):!r&&g?ZKe([f],dMt):l.getMonth()===a&&this.currentDate.getMonth()===a&&ZKe([f],hMt),l.setDate(1),l.setMonth(l.getMonth()+1),f.classList.contains(sMt)||RKe.add(f,"click",this.clickHandler,this),f.appendChild(m),n.push(f)}this.renderTemplate(n,4,oMt,e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var n=[],r=new Date(this.checkValue(this.currentDate));r.setMonth(0),r.setDate(1);var o=r.getFullYear(),a=new Date(r.setFullYear(o-o%10)),i=new Date(r.setFullYear(o-o%10+9)),l=a.getFullYear(),s=i.getFullYear(),c=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),u=this.globalize.formatDate(i,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=c+" - "+u;for(var d=new Date(o-o%10-1,0,1).getFullYear(),h=0;h<12;++h){var p=d+h;r.setFullYear(p);var f=this.dayCell(r);GKe(f,{role:"gridcell"});var m=this.createElement("span");m.textContent=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"}),p<l||p>s?(ZKe([f],eMt),ZUe(t)||r.getFullYear()!==t.getFullYear()||ZKe([f],dMt),(p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear())&&ZKe([f],sMt)):p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear()?ZKe([f],sMt):ZUe(t)||r.getFullYear()!==t.getFullYear()?r.getFullYear()!==this.currentDate.getFullYear()||f.classList.contains(sMt)||ZKe([f],hMt):ZKe([f],dMt),f.classList.contains(sMt)||RKe.add(f,"click",this.clickHandler,this),f.appendChild(m),n.push(f)}this.renderTemplate(n,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},n=this.globalize.parseDate(this.globalize.formatDate(e,t),t).valueOf(),r={className:vMt,attrs:{id:""+jUe(""+n),"aria-selected":"false",role:"gridcell"}};return this.createElement("td",r)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+JCt):this.tableBodyElement.querySelectorAll("td:not(."+eMt);if(t.length)for(var n=0;n<t.length;n++)if(!t[n].classList.contains(sMt)){e=new Date(parseInt(t[n].id,0));break}return e},t.prototype.lastDay=function(e,t){var n=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var r=Math.abs(n.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return r&&n.setHours(this.firstDay(e).getHours()+r/60),this.findLastDay(n)}return this.findLastDay(this.firstDay(n))},t.prototype.checkDateValue=function(e){return!ZUe(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+eMt):this.tableBodyElement.querySelectorAll("td:not(."+JCt);if(t.length)for(var n=t.length-1;n>=0;n--)if(!t[n].classList.contains(sMt)){e=new Date(parseInt(t[n].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content table thead")[0])||UKe(this.tableHeadElement):ZUe(this.calendarElement.querySelectorAll(".e-content table thead")[0])||UKe(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,n,r,o){var a,i=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),VKe([this.contentElement,this.headerElement],[aMt,iMt,oMt]),ZKe([this.contentElement,this.headerElement],[n]);for(var l=t,s=0,c=0;c<e.length/t;++c){for(a=this.createElement("tr",{attrs:{role:"row"}}),s=0+s;s<l;s++)e[s].classList.contains("e-week-number")||ZUe(e[s].children[0])||(ZKe([e[s].children[0]],[mMt]),_Ge(e[s].children[0],{duration:600,isCenterRipple:!0})),a.appendChild(e[s]),this.weekNumber&&7===s&&e[7].classList.contains(JCt)&&ZKe([a],pMt),!this.weekNumber&&6===s&&e[6].classList.contains(JCt)&&ZKe([a],pMt),this.weekNumber?41===s&&e[41].classList.contains(JCt)&&ZKe([a],pMt):35===s&&e[35].classList.contains(JCt)&&ZKe([a],pMt);l+=t,s+=0,this.tableBodyElement.appendChild(a)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(i!==this.getViewNumber(this.currentView())||0===i&&i!==this.getViewNumber(this.currentView()))&&this.navigateHandler(r),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var n=e.currentTarget,r=this.getViewNumber(this.currentView());n.classList.contains(JCt)?this.contentClick(e,0,null,t):r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===r?this.contentClick(e,1,null,t):n.classList.contains(JCt)||0!==r?this.contentClick(e,0,n,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.clickEventEmitter=function(e){e.preventDefault()},t.prototype.contentClick=function(e,t,n,r){var o=this.getViewNumber(this.currentView()),a=this.getIdValue(e,n);switch(t){case 0:o===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(UKe(this.tableBodyElement),this.currentDate=a,this.effect=gMt,this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(a.getMonth()),a.getMonth()>0&&this.currentDate.getMonth()!==a.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(a.getFullYear())):this.currentDate=a,this.effect=gMt,UKe(this.tableBodyElement),this.renderMonths(e));break;case 1:if(o===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,a,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(a.getFullYear());else{var i=this.islamicModule.getIslamicDate(a);this.currentDate=this.islamicModule.toGregorian(i.year,i.month,1)}this.effect=gMt,UKe(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,n,r){switch(e){case 0:UKe(this.tableBodyElement),this.renderMonths(t,null,r),n&&!ZUe(this.tableBodyElement.querySelectorAll("."+hMt)[0])&&this.tableBodyElement.querySelectorAll("."+hMt)[0].classList.remove(hMt);break;case 1:UKe(this.tableBodyElement),this.renderYears(t);break;case 2:UKe(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(e,t,n,r){this.effect="";for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];switch(i){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===i?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&UKe(this.tableBodyElement),this.minMaxUpdate(),n&&this.validateValues(n,r),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(VKe([this.todayElement],sMt),UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new kKe(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():ZUe(this.todayElement)||ZUe(this.footer)||(UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!ZUe(t)&&t.length>0){for(var n=this.copyValues(t),r=0;r<n.length;r++){var o=n[r],a="Gregorian"===this.calendarMode?"gregorian":"islamic",i=void 0;i="Gregorian"===this.calendarMode?this.globalize.formatDate(o,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(o,{type:"dateTime",skeleton:"full",calendar:"islamic"});var l={type:"date",skeleton:"yMd",calendar:a},s=this.globalize.formatDate(this.min,l),c={type:"date",skeleton:"yMd",calendar:a},u=this.globalize.formatDate(this.max,c);(+new Date(i)<+new Date(s)||+new Date(i)>+new Date(u))&&(n.splice(r,1),r=-1)}this.setProperties({values:n},!0)}},t.prototype.setValueUpdate=function(){ZUe(this.tableBodyElement)||(UKe(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!ZUe(e)&&e.length>0)for(var n=0;n<e.length;n++)t.push(new Date(+e[n]));return t},t.prototype.titleUpdate=function(e,t){var n,r,o=new kKe(this.locale),a="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(n=o.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:a}),r=o.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:a})):(n=o.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:a}),r=o.formatDate(e,{type:"dateTime",format:"y",calendar:a})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(n);break;case"months":this.headerTitleElement.textContent=r}},t.prototype.setActiveDescendant=function(){var e,t,n=this.tableBodyElement.querySelector("tr td.e-focused-date"),r=this.tableBodyElement.querySelector("tr td.e-selected"),o="Gregorian"===this.calendarMode?"gregorian":"islamic",a=this.currentView();return t="Month"===a?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:o}):"Year"===a?"islamic"!==o?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:o}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:o}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:o}),(r||n)&&(ZUe(r)||r.setAttribute("aria-selected","true"),(n||r).setAttribute("aria-label",t),e=(n||r).getAttribute("id")),e},t.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&VKe([this.element],[tMt]),"calendar"===this.getModuleName()&&this.element&&(RKe.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&RKe.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),ZUe(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=gMt,this.switchView(++t,e)},t.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},t.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},t.prototype.navigatePrevious=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},t.prototype.navigateNext=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.navigateTo=function(e,t,n){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,n)},t.prototype.currentView=function(){return this.contentElement.classList.contains(oMt)?"Year":this.contentElement.classList.contains(iMt)?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!ZUe(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var n=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),r=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?TUe("main."+this.locale+n,e):TUe("main."+this.locale+r,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),n=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-n+yMt)/yMt/7)},t.prototype.setStartDate=function(e,t){var n=e.getTimezoneOffset(),r=new Date(e.getTime()+t),o=r.getTimezoneOffset()-n;e.setTime(r.getTime()+6e4*o)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var n=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(n,this.getMaxDays(e)))}else{var r=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(r.year,r.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var n=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(n,this.getMaxDays(e)))}else{var r=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(r.year+t,r.month,1)}},t.prototype.getIdValue=function(e,t){var n;n=e?e.currentTarget:t;var r={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},o=this.globalize.formatDate(new Date(parseInt(""+n.getAttribute("id"),0)),r),a=this.globalize.parseDate(o,r),i=a.valueOf()-a.valueOf()%1e3;return new Date(i)},t.prototype.adjustLongHeaderSize=function(){VKe([this.element],bMt),"Wide"===this.dayHeaderFormat&&ZKe(["calendar"===this.getModuleName()?this.element:this.calendarElement],bMt)},t.prototype.selectDate=function(e,t,n,r,o){var a=n||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(r&&!this.checkPresentDate(t,o)){var i=this.copyValues(o);!ZUe(o)&&i.length>0?(i.push(new Date(this.checkValue(t))),this.setProperties({values:i},!0),this.setProperties({value:o[o.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var l=eGe(a,"."+tMt);if(ZUe(l)&&(l=this.tableBodyElement),r||ZUe(l.querySelector("."+dMt))||VKe([l.querySelector("."+dMt)],dMt),r||ZUe(l.querySelector("."+hMt))||VKe([l.querySelector("."+hMt)],hMt),r){i=this.copyValues(o);for(var s=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),c=0;c<s.length;c++){var u=l.querySelectorAll("td."+hMt)[0],d=l.querySelectorAll("td."+dMt)[0];s[c]===u&&VKe([s[c]],hMt),s[c]!==d||this.checkPresentDate(new Date(parseInt(d.getAttribute("id").split("_")[0],10)),o)||VKe([s[c]],dMt)}if(a.classList.contains(dMt)){VKe([a],dMt);for(var h=0;h<i.length;h++){var p={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(t,p)===this.globalize.formatDate(i[h],p)){c=i.indexOf(i[h]);i.splice(c,1),ZKe([a],hMt)}}this.setProperties({values:i},!0)}else ZKe([a],dMt)}else ZKe([a],dMt);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var n=!1;if(!ZUe(t))for(var r=0;r<t.length;r++){var o="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:o})===this.globalize.formatDate(t[r],{format:null,type:"date",skeleton:"short",calendar:o})&&(n=!0)}return n},t.prototype.setAriaActiveDescendant=function(){GKe(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?(RKe.remove(this.previousIcon,"click",this.navigatePreviousHandler),ZKe([this.previousIcon],""+sMt),ZKe([this.previousIcon],""+cMt),this.previousIcon.setAttribute("aria-disabled","true")):(RKe.add(this.previousIcon,"click",this.navigatePreviousHandler),VKe([this.previousIcon],""+sMt),VKe([this.previousIcon],""+cMt),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){$Ue(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){$Ue(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},t.prototype.nextIconHandler=function(e){e?(RKe.remove(this.nextIcon,"click",this.navigateNextHandler),ZKe([this.nextIcon],sMt),ZKe([this.nextIcon],cMt),this.nextIcon.setAttribute("aria-disabled","true")):(RKe.add(this.nextIcon,"click",this.navigateNextHandler),VKe([this.nextIcon],sMt),VKe([this.nextIcon],cMt),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,n){var r,o,a=t.getFullYear();return r=a,o=0,n&&(r=(a-=a%n)-a%n+n-1),e.getFullYear()>r?o=1:e.getFullYear()<a&&(o=-1),o},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},t.prototype.compareYear=function(e,t){return this.compare(e,t,0)},t.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},t.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},t.prototype.addDay=function(e,t,n,r,o){var a=t,i=new Date(+e);if(!ZUe(this.tableBodyElement)&&!ZUe(n)){for(;this.findNextTD(new Date(+e),a,r,o);)a+=t;var l=new Date(i.setDate(i.getDate()+a));a=+l>+r||+l<+o?a===t?t-t:t:a}e.setDate(e.getDate()+a)},t.prototype.findNextTD=function(e,t,n,r){var o=new Date(e.setDate(e.getDate()+t)),a=[],i=!1;if((!ZUe(o)&&o.getMonth())===(!ZUe(this.currentDate)&&this.currentDate.getMonth())){a=("Gregorian"===this.calendarMode?this.renderDays(o):this.islamicModule.islamicRenderDays(this.currentDate,o)).filter((function(e){return e.classList.contains(sMt)}))}else a=this.tableBodyElement.querySelectorAll("td."+sMt);if(+o<=+n&&+o>=+r&&a.length)for(var l=0;l<a.length&&!(i=+o==+new Date(parseInt(a[l].id,0)));l++);return i},t.prototype.getMaxDays=function(e){var t,n=new Date(this.checkValue(e));t=28;for(var r=n.getMonth();n.getMonth()===r;)++t,n.setDate(t);return t-1},t.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},t.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},t.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},t.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},QCt([vGe(new Date(1900,0,1))],t.prototype,"min",void 0),QCt([vGe(!0)],t.prototype,"enabled",void 0),QCt([vGe(null)],t.prototype,"cssClass",void 0),QCt([vGe(new Date(2099,11,31))],t.prototype,"max",void 0),QCt([vGe(null)],t.prototype,"firstDayOfWeek",void 0),QCt([vGe("Gregorian")],t.prototype,"calendarMode",void 0),QCt([vGe("Month")],t.prototype,"start",void 0),QCt([vGe("Month")],t.prototype,"depth",void 0),QCt([vGe(!1)],t.prototype,"weekNumber",void 0),QCt([vGe("FirstDay")],t.prototype,"weekRule",void 0),QCt([vGe(!0)],t.prototype,"showTodayButton",void 0),QCt([vGe("Short")],t.prototype,"dayHeaderFormat",void 0),QCt([vGe(!1)],t.prototype,"enablePersistence",void 0),QCt([vGe(null)],t.prototype,"keyConfigs",void 0),QCt([vGe(null)],t.prototype,"serverTimezoneOffset",void 0),QCt([yGe()],t.prototype,"created",void 0),QCt([yGe()],t.prototype,"destroyed",void 0),QCt([yGe()],t.prototype,"navigated",void 0),QCt([yGe()],t.prototype,"renderDayCell",void 0),t=QCt([wGe],t)}(qGe);!function(e){function t(t,n){return e.call(this,t,n)||this}XCt(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&FUe("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!ZUe(this.values)&&this.values.length>0){for(var t=[],n=[],r=0;r<this.values.length;r++)-1===t.indexOf(+this.values[r])&&(t.push(+this.values[r]),n.push(this.values[r]));this.setProperties({values:n},!0);for(var o=0;o<this.values.length;o++)if(!this.checkDateValue(this.values[o]))if("string"==typeof this.values[o]&&this.checkDateValue(new Date(this.checkValue(this.values[o])))){var a=new Date(this.checkValue(this.values[o]));this.values.splice(o,1),this.values.splice(o,0,a)}else this.values.splice(o,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),e.prototype.render.call(this),"calendar"===this.getModuleName()){var i=eGe(this.element,"form");i&&RKe.add(i,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?VKe([this.element],sMt):ZKe([this.element],sMt)},t.prototype.setClass=function(e,t){ZUe(t)||(t=t.replace(/\s+/g," ").trim()),ZUe(e)||(e=e.replace(/\s+/g," ").trim()),ZUe(t)||""===t||VKe([this.element],t.split(" ")),ZUe(e)||ZKe([this.element],e.split(" "))},t.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},t.prototype.setTimeZone=function(e){if(!ZUe(this.serverTimezoneOffset)&&this.value){var t=e+(new Date).getTimezoneOffset()/60;t=this.isDayLightSaving()?t--:t,this.value=new Date(this.value.getTime()+60*t*60*1e3)}},t.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},t.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!ZUe(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},t.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!ZUe(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!ZUe(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||ZUe(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!ZUe(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!ZUe(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var n=new Date;return ZUe(this.timezone)||(n=e.prototype.getDate.call(this,n,this.timezone)),t&&ZUe(this.timezone)?(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),n.setMilliseconds(t.getMilliseconds())):n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),n},t.prototype.todayButtonClick=function(t){if(this.showTodayButton){var n=this.generateTodayVal(this.value);if(this.setProperties({value:n},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var r=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,n,this.values)||(r.push(n),this.setProperties({values:r}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},t.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},t.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},t.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},t.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},t.prototype.renderMonths=function(t,n,r){e.prototype.renderMonths.call(this,t,this.value,r)},t.prototype.renderDays=function(t,n,r,o,a){var i=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,a);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),i},t.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},t.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},t.prototype.renderTemplate=function(t,n,r,o){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,n,r,o,this.value):this.islamicModule.islamicRenderTemplate(t,n,r,o,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},t.prototype.clickHandler=function(t){var n=t.currentTarget;if(this.isPopupClicked=!0,n.classList.contains(JCt))if(this.isMultiSelection){var r=this.copyValues(this.values);r.push(this.getIdValue(t,null)),this.setProperties({values:r},!0),this.setProperties({value:this.values[this.values.length-1]},!0)}else this.setProperties({value:this.getIdValue(t,null)},!0);var o=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!ZUe(this.tableBodyElement.querySelectorAll("."+hMt)[0])&&"Year"===o&&this.tableBodyElement.querySelectorAll("."+hMt)[0].classList.remove(hMt)},t.prototype.switchView=function(t,n,r,o){e.prototype.switchView.call(this,t,n,this.isMultiSelection,o)},t.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},t.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},t.prototype.onPropertyChanged=function(t,n){this.effect="",this.rangeValidation(this.min,this.max);for(var r=0,o=Object.keys(t);r<o.length;r++){switch(o[r]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:n.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var a=this.copyValues(this.values),i=0;i<a.length;i++){var l=a[i];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,a)&&a.push(l)}this.setProperties({values:a},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,n.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,n,this.isMultiSelection,this.values)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var t=eGe(this.element,"form");t&&RKe.remove(t,"reset",this.formResetHandler.bind(this))}},t.prototype.navigateTo=function(t,n,r){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,n,r)},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.addDate=function(t){if("string"!=typeof t&&"number"!=typeof t){var n=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var r=t,o=0;o<r.length;o++)this.checkDateValue(r[o])&&!e.prototype.checkPresentDate.call(this,r[o],n)&&(!ZUe(n)&&n.length>0?n.push(r[o]):n=[new Date(+r[o])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,n)&&(!ZUe(n)&&n.length>0?n.push(t):n=[new Date(+t)]);this.setProperties({values:n},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,n),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!ZUe(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var n=e,r=0;r<n.length;r++)for(var o=0;o<t.length;o++)+t[o]==+n[r]&&t.splice(o,1);else for(o=0;o<t.length;o++)+t[o]==+e&&t.splice(o,1);this.setProperties({values:t},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.setTodayDate=function(t){var n=new Date(+t);this.setProperties({value:n},!0),e.prototype.todayButtonClick.call(this,null,n,!0)},t.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},t.prototype.selectDate=function(t,n,r){e.prototype.selectDate.call(this,t,n,r,this.isMultiSelection,this.values),this.isMultiSelection&&!ZUe(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(t)},t.prototype.changeEvent=function(e){((this.value&&this.value.valueOf())!==(this.previousDate&&+this.previousDate.valueOf())||this.isMultiSelection)&&(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},t.prototype.triggerChange=function(e){!ZUe(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!ZUe(e),ZUe(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||+this.value==+this.previousDate&&(null!=this.previousDate||isNaN(+this.value))?ZUe(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},QCt([vGe(null)],t.prototype,"value",void 0),QCt([vGe(null)],t.prototype,"values",void 0),QCt([vGe(!1)],t.prototype,"isMultiSelection",void 0),QCt([yGe()],t.prototype,"change",void 0),t=QCt([wGe],t)}(wMt);var xMt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EMt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},kMt="e-input-group",SMt="e-popup",CMt="e-left-calendar",MMt="e-right-calendar",_Mt="e-daterangepicker",NMt="e-error",AMt="e-active",OMt="e-start-date",IMt="e-end-date",DMt="e-start-btn",PMt="e-input-focus",TMt="e-range-hover",HMt="e-other-month",LMt="e-start-label",zMt="e-end-label",RMt="e-disabled",BMt="e-selected",$Mt="e-calendar",ZMt="e-next",VMt="e-prev",jMt="e-header",WMt="e-title",FMt="e-icon-container",qMt="e-date-range-container",YMt="e-presets",UMt="e-today",KMt="e-focused-date",GMt="e-content",XMt="e-day-span",QMt="e-week-number",JMt="e-date-disabled",e_t="e-icon-disabled",t_t="e-device",n_t="e-overlay",r_t="e-list-item",o_t="e-hover",a_t="e-range-overflow",i_t="e-flat",l_t="e-css",s_t="e-non-edit",c_t="e-daterange-hidden",u_t=["title","class","style"],d_t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xMt(t,e),EMt([vGe()],t.prototype,"label",void 0),EMt([vGe()],t.prototype,"start",void 0),EMt([vGe()],t.prototype,"end",void 0),t}(HGe),h_t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.isCustomRange=!1,r.isCustomWindow=!1,r.presetsItem=[],r.liCollections=[],r.previousEleValue="",r.isKeyPopup=!1,r.dateDisabled=!1,r.isRangeIconClicked=!1,r.isMaxDaysClicked=!1,r.disabledDays=[],r.preventBlur=!1,r.preventFocus=!1,r.invalidValueString=null,r.isAngular=!1,r.preventChange=!1,r.dateRangeOptions=t,r}return xMt(t,e),t.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},t.prototype.preRender=function(){if(this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),VKe([this.cloneElement],[_Mt,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=jUe("ej2-datetimepicker"),null!==this.angularTag&&GKe(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var t=this.value.split(" "+this.separator+" ");this.value=[new Date(t[0]),new Date(t[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=eGe(this.element,"form")},t.prototype.updateValue=function(){this.value&&this.value.length>0?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"==typeof this.value[0]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))):(this.startValue=null,this.setValue()),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):"string"==typeof this.value[1]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):"string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end)),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):ZUe(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},t.prototype.initProperty=function(){this.globalize=new kKe(this.locale),this.checkFormat(),this.checkView(),(ZUe(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},t.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||ZUe(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},t.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),BUe(this.defaultKeyConfigs,{shiftTab:"shift+tab",tab:"tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new aXe("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},t.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var n=0;n<this.element.attributes.length;n++)t[this.element.attributes[n].name]=this.element.getAttribute(this.element.attributes[n].name);for(var r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];0===a.indexOf("data")&&(this.firstHiddenChild.setAttribute(a,t[a]),this.secondHiddenChild.setAttribute(a,t[a]))}},t.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):GKe(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&VKe([this.inputWrapper.container],[s_t]):""===this.inputElement.value?VKe([this.inputWrapper.container],[s_t]):ZKe([this.inputWrapper.container],[s_t])},t.prototype.validationAttribute=function(e,t){var n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",n),e.removeAttribute("name");for(var r=["required","aria-required","form"],o=0;o<r.length;o++)if(!ZUe(e.getAttribute(r[o]))){var a=e.getAttribute(r[o]);t.setAttribute(r[o],a),e.removeAttribute(r[o])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!ZUe(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var n=t[e];if(u_t.indexOf(n)>-1)if("class"===n){var r=this.htmlAttributes[n].replace(/\s+/g," ").trim();""!==r&&ZKe([this.inputWrapper.container],r.split(" "))}else if("style"===n){var o=this.inputWrapper.container.getAttribute(n);o=ZUe(o)?this.htmlAttributes[n]:o+this.htmlAttributes[n],this.inputWrapper.container.setAttribute(n,o)}else this.inputWrapper.container.setAttribute(n,this.htmlAttributes[n])}},t.prototype.updateHtmlAttributeToElement=function(){if(!ZUe(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var n=t[e];u_t.indexOf(n)<0&&this.inputElement.setAttribute(n,this.htmlAttributes[n])}},t.prototype.updateCssClass=function(e,t){ZUe(t)||(t=t.replace(/\s+/g," ").trim()),ZUe(e)||(e=e.replace(/\s+/g," ").trim()),rSt.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&rSt.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,n=this.presets;t<n.length;t++){var r=n[t],o=r.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof r.end?this.presetsItem.push({id:o,text:r.label,end:new Date(this.checkValue(r.end)),start:new Date(this.checkValue(r.start))}):this.presetsItem.push({id:o,text:r.label,start:r.start,end:r.end})}var a=ZUe(this.startValue)?null:new Date(+this.startValue),i=ZUe(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:a,end:i}),ZUe(this.startValue)||ZUe(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){RKe.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),RKe.add(this.inputElement,"focus",this.inputFocusHandler,this),RKe.add(this.inputElement,"blur",this.inputBlurHandler,this),RKe.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&RKe.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new oXe(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&RKe.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){RKe.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),RKe.remove(this.inputElement,"blur",this.inputBlurHandler),RKe.remove(this.inputElement,"focus",this.inputFocusHandler),RKe.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&RKe.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||ZUe(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&RKe.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},t.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={type:"datetime",skeleton:"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.endDate,e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change")}},t.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&RKe.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e)}},t.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},t.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var t=this.inputElement.getAttribute("value");ZUe(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(ZUe(this.value)||ZUe(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),t="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(rSt.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},t.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&this.value.length>0&&this.setProperties({value:null},!0),rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),ZUe(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},t.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||ZUe(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),ZKe([this.inputWrapper.container],[PMt])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new kKe(this.locale);for(var t=e?ZUe(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],n={format:this.formatString,type:"date",skeleton:"yMd"},r=0,o=t;r<o.length;r++){var a=o[r];if(!ZUe(this.inputElement.getAttribute(a)))switch(a){case"disabled":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var i="disabled"===this.inputElement.getAttribute(a)||""===this.inputElement.getAttribute(a)||"true"===this.inputElement.getAttribute(a);this.setProperties({enabled:!i},!e)}break;case"readonly":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var l="readonly"===this.inputElement.getAttribute(a)||"true"===this.inputElement.getAttribute(a)||""===this.inputElement.getAttribute(a);this.setProperties({readonly:l},!e)}break;case"placeholder":(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(a)},!e);break;case"value":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var s=this.inputElement.getAttribute(a);this.setProperties(HUe(a,s,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(a));break;case"min":if(ZUe(this.min)||+this.min==+new Date(1900,0,1)||e){var c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.setProperties(HUe(a,c,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(a));break;case"max":if(ZUe(this.max)||+this.max==+new Date(2099,11,31)||e){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.setProperties(HUe(a,c,{}),!e)}break;case"startDate":if(ZUe(this.startDate)){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.startValue=c,this.setValue()}break;case"endDate":if(ZUe(this.endDate)){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.endValue=c,this.setValue()}break;case"minDays":ZUe(this.minDays)&&this.setProperties(HUe(a,parseInt(this.inputElement.getAttribute(a),10),{}),!0);break;case"maxDays":ZUe(this.maxDays)&&this.setProperties(HUe(a,parseInt(this.inputElement.getAttribute(a),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(a)&&this.inputElement.setAttribute("type","text")}}},t.prototype.createPopup=function(){for(var e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,n=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(t.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(n.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=$Ke("div",{id:this.element.id+"_popup",className:_Mt+" "+SMt}),this.adjustLongHeaderWidth();var r=!this.isCustomRange||this.isMobile;!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&r?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},t.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),ZUe(this.endValue)||ZUe(this.startValue)||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){RKe.clearEvents(this.leftCalPrevIcon),RKe.clearEvents(this.leftCalNextIcon),RKe.clearEvents(this.rightCalPrevIcon),RKe.clearEvents(this.rightCalNextIcon)},t.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},t.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(RMt)&&RKe.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(RMt)&&RKe.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(RMt)&&RKe.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(RMt)&&RKe.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),RKe.add(this.startButton.element,"click",this.deviceHeaderClick,this),RKe.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+MMt+" ."+jMt+" ."+WMt),this.headerTitleElement=this.popupObj.element.querySelector("."+CMt+" ."+jMt+" ."+WMt),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new oXe(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new oXe(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.calendarIconRipple=function(){_Ge(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),_Ge(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){RKe.clearEvents(this.nextIcon),RKe.clearEvents(this.previousIcon),_Ge(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(RMt)&&RKe.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(RMt)&&RKe.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=eGe(e.target,"."+$Mt);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=eGe(e.target,"."+$Mt);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+VMt),this.nextIcon=e.querySelector("."+ZMt),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+GMt),this.tableBodyElement=XKe("."+GMt+" tbody",e),this.table=e.querySelector("."+GMt).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+jMt+" ."+WMt),this.headerElement=e.querySelector("."+jMt))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains(DMt)&&!ZUe(this.startValue)){this.endButton.element.classList.remove(AMt),this.startButton.element.classList.add(AMt);var t=this.popupObj.element.querySelector("."+$Mt);this.updateDeviceCalendar(t),ZUe(this.calendarElement.querySelector("."+OMt+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),KKe(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!ZUe(this.startValue)&&!ZUe(this.endValue)){this.startButton.element.classList.remove(AMt),this.endButton.element.classList.add(AMt);t=this.popupObj.element.querySelector("."+$Mt);this.updateDeviceCalendar(t),ZUe(this.calendarElement.querySelector("."+IMt+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),KKe(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)),this.selectableDates()}},t.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.updateHiddenInput(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(ZUe(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!ZUe(t)&&""!==t.trim()){var n=t.split(" "+this.separator+" ");if(n.length>1){this.invalidValueString=null;var r={format:this.formatString,type:"date",skeleton:"yMd"},o=this.globalize.parseDate(n[0].trim(),r),a=this.globalize.parseDate(n[1].trim(),r);if(!(ZUe(o)||isNaN(+o)||ZUe(a)||isNaN(+a))){var i=this.startValue;this.startValue=o;var l=this.endValue;if(this.endValue=a,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var s={model:this};this.trigger("blur",s)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=i,this.endValue=l))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(ZUe(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(ZUe(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;s={model:this};this.trigger("blur",s)}}this.updateHiddenInput()}},t.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=this.inputElement.value.trim();(ZUe(this.endValue)&&ZUe(this.startValue)&&""!==e||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(ZKe([this.inputWrapper.container],NMt),GKe(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(VKe([this.inputWrapper.container],NMt),GKe(this.inputElement,{"aria-invalid":"false"}))},t.prototype.keyCalendarUpdate=function(e,t,n){return void 0===n&&(n=!0),n&&this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},t.prototype.navInCalendar=function(e,t,n,r,o){var a,i,l=this.getViewNumber(this.currentView()),s=this.min;switch(i=ZUe(this.maxDays)||!this.isMaxDaysClicked||ZUe(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":a=new Date(+this.currentDate),this.addDay(a,1,e,i,s),t&&+a==+r&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(1,l,e,i,s),this.keyNavigation(o,e);break;case"moveLeft":a=new Date(+this.currentDate),this.addDay(a,-1,e,i,s),t||+a==+n&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-1,l,e,i,s),this.keyNavigation(o,e);break;case"moveUp":0===l?(a=new Date(+this.currentDate),this.addDay(a,-7,e,i,s),+a<=+n&&!t&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-7,l,e,i,s)):this.keyboardNavigate(-4,l,e,this.max,this.min),this.keyNavigation(o,e);break;case"moveDown":0===l?(a=new Date(+this.currentDate),this.addDay(a,7,e,i,s),t&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(7,l,e,i,s)):this.keyboardNavigate(4,l,e,this.max,this.min),this.keyNavigation(o,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),KKe(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,l),KKe(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"tab":if(this.tabKeyValidation(o,CMt))ZUe((o=this.keyCalendarUpdate(!1,o,!1)).querySelector(".e-focused-date"))&&(this.currentDate=this.firstCellToFocus(this.rightCalendar)),this.keyboardNavigate(0,l,e,i,s),this.keyNavigation(o,e);break;case"shiftTab":if(this.tabKeyValidation(o,MMt))ZUe((o=this.keyCalendarUpdate(!0,o,!1)).querySelector(".e-focused-date"))&&(this.currentDate=this.firstCellToFocus(this.leftCalendar)),this.keyboardNavigate(0,l,e,i,s),this.keyNavigation(o,e)}},t.prototype.firstCellToFocus=function(e){var t=e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-month)"),n=t&&t.id?t.id.split("_")[0]:null,r=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return n?new Date(+n):r},t.prototype.keyInputHandler=function(t,n){var r,o=this.getViewNumber(this.currentView()),a=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),i=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),l=eGe(t.target,"."+MMt),s=(l=ZUe(l)?this.leftCalendar:l).classList.contains(CMt);this.updateCalendarElement(l);var c=this.tableBodyElement.querySelector("tr td.e-selected"),u=l.querySelector("tr td."+KMt),d=l.querySelector("tr td."+OMt),h=l.querySelector("tr td."+IMt),p=this.getViewNumber(this.depth),f=o===p&&this.getViewNumber(this.start)>=p,m=eGe(t.target,"."+CMt),v=eGe(t.target,"."+MMt),g=eGe(t.target,"."+YMt);switch(ZUe(u)?ZUe(h)||this.dateDisabled?ZUe(d)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",t.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(t),this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt]));break;case"select":if(f){var b=ZUe(u)?d:u;ZUe(b)||b.classList.contains(RMt)||this.selectRange(null,b)}else(ZUe(c)||f)&&ZUe(u)||(ZUe(this.value)||(n=this.calendarElement.classList.contains(CMt)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--o,u||c,n));t.preventDefault();break;case"controlHome":var y=new Date(this.currentDate.getFullYear(),0,1);!s&&+y<+i&&(l=this.keyCalendarUpdate(!0,l)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(l,t);break;case"altRightArrow":ZUe(m)?ZUe(v)?ZUe(g)||this.cancelButton.element.focus():ZUe(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":ZUe(m)?ZUe(v)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),t.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(CMt),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":ZUe(c)&&ZUe(u)||f||(ZUe(this.value)||(n=this.calendarElement.classList.contains(CMt)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--o,c||u,n)),t.preventDefault();break;case"controlEnd":y=new Date(this.currentDate.getFullYear(),11,31);s&&+y>+a&&(l=this.keyCalendarUpdate(!1,l)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(l,t);break;case"pageUp":r=new Date(+this.currentDate),this.addMonths(r,-1),!s&&+r<=+i&&(l=this.keyCalendarUpdate(!0,l)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"pageDown":r=new Date(+this.currentDate),this.addMonths(r,1),s&&+r>=+a&&(l=this.keyCalendarUpdate(!1,l)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftPageUp":r=new Date(+this.currentDate),this.addYears(r,-1),!s&&+r<=+i&&(l=this.keyCalendarUpdate(!0,l)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftPageDown":r=new Date(+this.currentDate),this.addYears(r,1),s&&+r>=+a&&(l=this.keyCalendarUpdate(!1,l)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftTab":ZUe(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),s&&t.preventDefault(),this.tabKeyValidation(l,MMt)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,s,i,a,l));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(l,CMt)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,s,i,a,l));break;default:this.navInCalendar(t,s,i,a,l),this.checkMinMaxDays()}this.presetHeight()},t.prototype.tabKeyValidation=function(e,t){var n=e.classList.contains(t),r=this.rightCalendar.querySelector(".e-header"),o=this.leftCalendar.querySelector(".e-header"),a=!!r&&r.classList.contains("e-month"),i=!!o&&o.classList.contains("e-month");return n&&i&&a&&!this.isMobile},t.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(CMt)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},t.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||ZUe(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},t.prototype.bindCalendarCellEvents=function(e){for(var t=0,n=e?e.querySelectorAll("."+$Mt+" td"):this.popupObj.element.querySelectorAll("."+$Mt+" td");t<n.length;t++){var r=n[t];RKe.clearEvents(r),r.classList.contains(RMt)||r.classList.contains(JMt)||r.classList.contains(QMt)||(this.isMobile||RKe.add(r,"mouseover",this.hoverSelection,this),RKe.add(r,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!ZUe(this.startValue)||!ZUe(this.endValue),t=0,n=this.popupObj.element.querySelectorAll("."+$Mt+" ."+KMt);t<n.length;t++){var r=n[t],o=new Date,a=this.getIdValue(null,r);("Month"===this.depth&&"Month"===this.currentView()&&(!r.classList.contains(UMt)||r.classList.contains(UMt)&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(o,a)&&!this.isSameYear(o,a)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(o,a)||e))&&(r.classList.remove(KMt),r.classList.contains(OMt)||r.classList.contains(IMt)||r.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var n=t||e.currentTarget,r=this.getIdValue(null,n);if(!ZUe(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&ZUe(this.endValue)&&ZUe(this.startValue)||!ZUe(this.startValue)&&ZUe(this.endValue)))for(var o=0,a=this.popupObj.element.querySelectorAll("."+$Mt+" td");o<a.length;o++){var i=a[o],l=!i.classList.contains(RMt)||i.classList.contains(JMt);if(!i.classList.contains(QMt)&&l){var s=this.getIdValue(null,i),c=new Date(+this.startValue);new Date(+s).setHours(0,0,0,0)>=c.setHours(0,0,0,0)&&+s<=+r?ZKe([i],TMt):VKe([i],[TMt])}}},t.prototype.isSameStartEnd=function(e,t){var n=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(n=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(n=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(n=!0),n},t.prototype.updateRange=function(e){if(!ZUe(this.startValue))for(var t=0,n=e;t<n.length;t++)for(var r=0,o=n[t].querySelectorAll("."+$Mt+" td");r<o.length;r++){var a=o[r];if(!a.classList.contains(QMt)&&!a.classList.contains(RMt)){var i=this.getIdValue(null,a),l=this.getIdValue(null,a);if(ZUe(this.endValue)?VKe([a],[TMt]):this.currentView()===this.depth&&+l.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+l.setHours(0,0,0,0)<=+new Date(+this.endValue).setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&ZKe([a],TMt),a.classList.contains(BMt)&&a.classList.contains(IMt)&&+l!=+this.endValue&&(VKe([a],[BMt]),VKe([a],[IMt])),a.classList.contains(TMt)&&+l>+this.endValue&&VKe([a],[TMt]),!a.classList.contains(HMt)){var s=new Date(+this.startValue),c=new Date(+i);this.currentView()===this.depth&&+c.setHours(0,0,0,0)==+s.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)>=+s.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(ZKe([a],[OMt,BMt]),this.addSelectedAttributes(a,this.startValue,!0));var u=new Date(+this.endValue);"Year"===this.currentView()?c=new Date(c.getFullYear(),c.getMonth()+1,0):"Decade"===this.currentView()&&(c=new Date(c.getFullYear(),11,31)),this.currentView()===this.depth&&!ZUe(this.endValue)&&+c.setHours(0,0,0,0)==+u.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)<=+u.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(ZKe([a],[IMt,BMt]),this.addSelectedAttributes(a,this.startValue,!1)),+i!=+this.startValue||ZUe(this.endValue)||+i!=+this.endValue||this.addSelectedAttributes(a,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!ZUe(this.minDays)&&this.minDays>0||!ZUe(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+CMt)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+MMt))))},t.prototype.rangeArgs=function(e){var t,n,r=ZUe(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),o=ZUe(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return ZUe(this.endValue)||ZUe(this.startValue)?(t="",n=0):(t=r+" "+this.separator+" "+o,n=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:n,event:e||null,element:this.element,isInteracted:!ZUe(e),text:t}},t.prototype.otherMonthSelect=function(e,t,n){var r=+this.getIdValue(null,e),o='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+r),a=this.popupObj&&this.popupObj.element.querySelector(o);ZUe(a)||(t?(ZKe([a],[OMt,BMt]),this.addSelectedAttributes(a,this.startValue,!0)):(ZKe([a],[IMt,BMt]),this.addSelectedAttributes(a,this.endValue,!0)),n&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var n,r;e&&e.preventDefault();var o=ZUe(e)?this.getIdValue(null,t):this.getIdValue(e,null),a=o.getFullYear(),i=o.getMonth(),l=new Date(a,i,1),s=new Date(a,i+1,0),c=new Date(a,0,1),u=new Date(a,11,31);ZUe(this.endValue)||ZUe(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(AMt)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(AMt))&&this.removeSelection();var d=t||e.currentTarget;if(ZUe(this.startValue))ZUe(this.previousStartValue)||(o.setHours(this.previousStartValue.getHours()),o.setMinutes(this.previousStartValue.getMinutes()),o.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?l:c,this.endValue=null,this.setValue(),ZKe([d],OMt),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(HMt)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(AMt),this.startButton.element.classList.remove(AMt),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+o==+this.startValue||+o>+this.startValue){if(+o==+this.startValue&&!ZUe(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),ZUe(this.previousEndValue)||(o.setHours(this.previousEndValue.getHours()),o.setMinutes(this.previousEndValue.getMinutes()),o.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?s:u,this.setValue();var h=this.popupObj.element.querySelectorAll("."+IMt);if(this.isMobile){this.startButton.element.classList.remove(AMt),this.endButton.element.classList.add(AMt);for(var p=0,f=h;p<f.length;p++){var m=f[p];m.removeAttribute("aria-label"),m.classList.contains(OMt)?(this.addSelectedAttributes(m,this.startValue,!0),VKe([m],[IMt])):(m.setAttribute("aria-selected","false"),VKe([m],[IMt,BMt]))}}ZKe([d],IMt),+this.endValue==+this.startValue?this.addSelectedAttributes(d,this.endValue,!1,!0):this.addSelectedAttributes(d,this.endValue,!1),d.classList.contains(HMt)&&(+this.endValue==+this.startValue?this.otherMonthSelect(d,!1,!0):this.otherMonthSelect(d,!1));for(var v=0,g=h=this.popupObj.element.querySelectorAll("."+IMt);v<g.length;v++){var b=g[v];b.classList.contains(OMt)&&VKe([b],[TMt])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+o<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?l:c,this.setValue(),this.removeSelectedAttributes(),VKe(this.popupObj.element.querySelectorAll("."+OMt),[OMt,BMt]),ZKe([d],OMt),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(HMt)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays());e&&(n=eGe(e.target,"."+CMt)),ZUe(n)?(e&&(r=e&&eGe(e.target,"."+MMt)),ZUe(r)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),ZKe([d],BMt),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!ZUe(this.startValue)){var e=this.calendarElement.querySelectorAll("."+$Mt+" td"),t=!1;if(this.currentView()===this.depth){for(var n=0,r=e;n<r.length;n++){if(!(i=r[n]).classList.contains(OMt)&&!i.classList.contains(QMt)&&!i.classList.contains(RMt)){if(+this.getIdValue(null,i)<+this.startValue){ZKe([i],[JMt,RMt,n_t]),RKe.clearEvents(i);continue}break}if(i.classList.contains(OMt)&&!i.classList.contains(HMt)){t=!0;break}}t&&(this.previousIcon.classList.contains(RMt)||ZKe([this.previousIcon],[e_t,RMt,n_t]))}else{for(var o=0,a=e;o<a.length;o++){var i=a[o],l=this.startValue.getMonth(),s=this.startValue.getFullYear(),c=this.getIdValue(null,i);if(this.startButton.element.classList.contains(AMt)||!("Year"===this.currentView()&&c.getMonth()<l&&c.getFullYear()<=s||"Decade"===this.currentView()&&c.getMonth()<=l&&c.getFullYear()<s))break;ZKe([i],[RMt])}e[0].classList.contains(RMt)?this.previousIconHandler(!0):e[e.length-1].classList.contains(RMt)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!ZUe(this.startValue)&&ZUe(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(AMt)){if(!ZUe(this.minDays)&&this.minDays>0||!ZUe(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),n=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),r=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));n=!ZUe(this.minDays)&&this.minDays>0?n:null,r=!ZUe(this.maxDays)&&this.maxDays>0?r:null,"Year"===this.currentView()?(n=ZUe(n)?null:new Date(n.getFullYear(),n.getMonth(),0),r=ZUe(r)?null:new Date(r.getFullYear(),r.getMonth(),1)):"Decade"===this.currentView()&&(n=ZUe(n)?null:new Date(n.getFullYear()-1,11,1),r=ZUe(r)?null:new Date(r.getFullYear(),0,1));for(var o=void 0,a=0,i=e.querySelectorAll("."+$Mt+" td");a<i.length;a++){var l=i[a];if(!l.classList.contains(OMt)&&!l.classList.contains(QMt)){var s=this.getIdValue(null,l);if(s=this.removeTimeValueFromDate(s),!ZUe(n)&&+s==+n&&l.classList.contains(RMt)&&n.setDate(n.getDate()+1),!l.classList.contains(RMt)){if(+s<=+t)continue;!ZUe(n)&&+s<+n&&(ZKe([l],[JMt,RMt,n_t]),RKe.clearEvents(l)),!ZUe(r)&&+s>+r&&(ZKe([l],[JMt,RMt,n_t]),this.isMaxDaysClicked=!0,RKe.clearEvents(l),ZUe(o)&&!l.classList.contains(HMt)&&(o=l))}}}if(!ZUe(o))if(this.isMobile)this.nextIcon.classList.contains(RMt)||ZKe([this.nextIcon],[e_t,RMt,n_t]);else{var c=eGe(o,"."+MMt);(c=ZUe(c)?this.leftCalendar:c).classList.contains(CMt)?(this.rightCalNextIcon.classList.contains(RMt)||ZKe([this.rightCalNextIcon],[e_t,RMt,n_t]),this.leftCalNextIcon.classList.contains(RMt)||ZKe([this.leftCalNextIcon],[e_t,RMt,n_t]),this.rightCalPrevIcon.classList.contains(RMt)||ZKe([this.rightCalPrevIcon],[e_t,RMt,n_t])):this.rightCalNextIcon.classList.contains(RMt)||ZKe([this.rightCalNextIcon],[e_t,RMt,n_t])}}}else this.isMaxDaysClicked=!1},t.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.prototype.removeClassDisabled=function(){for(var e=0,t=this.popupObj.element.querySelectorAll("."+$Mt+" td."+JMt);e<t.length;e++){var n=t[e];n.classList.contains(JMt)&&(VKe([n],[JMt,RMt,n_t]),RKe.add(n,"click",this.selectRange,this),this.isMobile||RKe.add(n,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(e_t)&&VKe([this.nextIcon],[e_t,RMt,n_t]),this.previousIcon.classList.contains(e_t)&&VKe([this.previousIcon],[e_t,RMt,n_t])):(this.rightCalNextIcon.classList.contains(e_t)&&VKe([this.rightCalNextIcon],[e_t,RMt,n_t]),this.rightCalPrevIcon.classList.contains(e_t)&&VKe([this.rightCalPrevIcon],[e_t,RMt,n_t]),this.leftCalNextIcon.classList.contains(e_t)&&VKe([this.leftCalNextIcon],[e_t,RMt,n_t]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(ZUe(this.endValue)||ZUe(this.startValue))this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;ZUe(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+XMt).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(ZUe(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),ZUe(this.endValue)||ZUe(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(ZUe(this.endValue)||ZUe(this.startValue)?this.popupObj.element.querySelector("."+zMt).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+zMt).textContent=this.globalize.formatDate(this.endValue,e),ZUe(this.startValue)?this.popupObj.element.querySelector("."+LMt).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+LMt).textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+LMt).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+zMt).textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},t.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+BMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+BMt),[OMt,IMt,BMt]),this.popupObj.element.querySelectorAll("."+KMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+KMt),KMt),this.popupObj.element.querySelectorAll("."+TMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+TMt),[TMt]))},t.prototype.addSelectedAttributes=function(e,t,n,r){if(e){var o=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!ZUe(r)&&r?e.setAttribute("aria-label","The current start and end date is "+o):e.setAttribute("aria-label","The current "+(n?"start":"end")+" date is "+o),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+OMt);e<t.length;e++){(o=t[e]).setAttribute("aria-selected","false"),o.removeAttribute("aria-label")}for(var n=0,r=this.popupObj.element.querySelectorAll("."+IMt);n<r.length;n++){var o;(o=r[n]).setAttribute("aria-selected","false"),o.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(CMt)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector("."+GMt),this.tableBodyElement=XKe("."+GMt+" tbody",e),this.table=e.querySelector("."+GMt).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+jMt+" ."+WMt),this.headerElement=e.querySelector("."+jMt)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=eGe(e.target,"."+CMt);t=ZUe(t)?eGe(e.target,"."+MMt):t,this.updateCalendarElement(t),this.navigatePrevious(e),!ZUe(this.startValue)&&ZUe(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+$Mt)]),this.endButton.element.classList.contains(AMt)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)),this.endButton.element.classList.contains(AMt)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(MMt)?this.rightCalCurrentDate=new Date(+(t||this.currentDate)):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},t.prototype.navNextMonth=function(e){e.preventDefault();var t=eGe(e.target,"."+CMt);t=ZUe(t)?eGe(e.target,"."+MMt):t,this.updateCalendarElement(t),this.navigateNext(e),!ZUe(this.startValue)&&ZUe(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!(ZUe(this.popupObj)||!this.popupObj.element.classList.contains(SMt))},t.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var t=this.createElement("button",{className:"e-end-btn"}),n=this.createElement("button",{className:DMt});this.startButton=new BQe({content:this.l10n.getConstant("startLabel")},n),this.endButton=new BQe({content:this.l10n.getConstant("endLabel")},t),e.appendChild(n),e.appendChild(t)}else{var r=this.createElement("a",{className:LMt}),o=this.createElement("a",{className:zMt}),a=this.createElement("span",{className:"e-change-icon e-icons"});GKe(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),GKe(o,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(r),e.appendChild(a),e.appendChild(o),r.textContent=this.l10n.getConstant("startLabel"),o.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?ZUe(this.previousStartValue)||ZUe(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),rSt.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){this.min=ZUe(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=ZUe(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(ZUe(this.minDays)||ZUe(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!ZUe(this.minDays)&&this.minDays<0&&(this.minDays=null),!ZUe(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},t.prototype.validateRangeStrict=function(){ZUe(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),ZUe(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},t.prototype.validateRange=function(){this.validateMinMaxDays()},t.prototype.validateMinMaxDays=function(){if(!ZUe(this.startValue)&&!ZUe(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!ZUe(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var t=new Date(+this.startValue);t.setDate(t.getDate()+(this.minDays-1)),+t>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=t,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();ZUe(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},t.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add($Mt),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),GKe(this.calendarElement,{role:"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isSameDecade=function(e,t){var n=e.getFullYear(),r=t.getFullYear();return n-n%10==r-r%10},t.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.selectNextMonth=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},t.prototype.selectNextYear=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1))},t.prototype.selectNextDecade=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10))},t.prototype.selectStartMonth=function(){ZUe(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!ZUe(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},t.prototype.createCalendar=function(){var t=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){ZUe(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var n=this.calendarElement.querySelector("."+$Mt+" ."+VMt),r=this.calendarElement.querySelector("."+$Mt+" ."+ZMt);KKe(this.calendarElement.querySelector("."+$Mt+" ."+FMt)),this.calendarElement.querySelector("."+$Mt+" ."+jMt).appendChild(r),this.calendarElement.querySelector("."+$Mt+" ."+jMt).appendChild(n),FKe([n],this.calendarElement.querySelector("."+$Mt+" ."+jMt)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+$Mt+" ."+jMt+" ."+WMt)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(CMt),this.leftCalPrevIcon=this.calendarElement.querySelector("."+CMt+" ."+VMt),this.leftCalNextIcon=this.calendarElement.querySelector("."+CMt+" ."+ZMt),this.leftTitle=this.calendarElement.querySelector("."+CMt+" ."+WMt),KKe(this.calendarElement.querySelector("."+CMt+" ."+FMt)),this.calendarElement.querySelector("."+CMt+" ."+jMt).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+CMt+" ."+jMt).appendChild(this.leftCalPrevIcon),FKe([this.leftCalPrevIcon],this.calendarElement.querySelector("."+CMt+" ."+jMt)),this.leftCalendar=this.calendarElement;var o=this.createElement("div",{className:"e-left-container"}),a=this.createElement("div",{className:"e-right-container"});o.appendChild(this.leftCalendar),t.appendChild(o),this.isMobile||RKe.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),ZKe([this.calendarElement],MMt),this.rightCalendar=this.calendarElement,VKe([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),VKe([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+MMt+" ."+VMt),this.rightCalNextIcon=this.calendarElement.querySelector("."+MMt+" ."+ZMt),this.rightTitle=this.calendarElement.querySelector("."+MMt+" ."+WMt),KKe(this.calendarElement.querySelector("."+MMt+" ."+FMt)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+MMt+" ."+jMt).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+MMt+" ."+jMt).appendChild(this.rightCalPrevIcon),FKe([this.rightCalPrevIcon],this.calendarElement.querySelector("."+MMt+" ."+jMt)),a.appendChild(this.rightCalendar),t.appendChild(a),this.isMobile||RKe.add(this.rightTitle,"click",this.rightNavTitle,this)}return t},t.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.calendarNavigation=function(t,n){this.table=n.querySelector("table"),this.headerTitleElement=n.querySelector(".e-title"),this.tableBodyElement=n.querySelector("tbody"),this.tableHeadElement=n.querySelector("thead"),this.contentElement=n.querySelector(".e-content"),this.updateCalendarElement(n),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},t.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.clickEventEmitter=function(e){this.isMobile||(eGe(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},t.prototype.navigatedEvent=function(t){if(this.trigger("navigated",this.navigatedArgs),!ZUe(this.popupObj)){var n=this.getCalendarView(this.currentView());if(this.isMobile)n===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||n!==this.depth)this.updateNavIcons(),this.calendarIconEvent();else{if((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!t||t.currentTarget.children[0].classList.contains("e-icons"))&&ZUe(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!ZUe(this.controlDown))&&(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&ZUe(this.endValue)&&("Month"===n&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()||"Year"===n&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear())?e.prototype.navigateTo.call(this,n,new Date(+this.startValue)):e.prototype.navigateTo.call(this,n,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null);else{this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,n,this.rightCalCurrentDate);var r=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,r),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:qMt}),t=this.createElement("div",{className:"e-range-header"}),n=this.createRangeHeader();t.appendChild(n);var r=this.createElement("div",{className:XMt});GKe(r,{"aria-label":"Selected Days"}),r.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(r);var o=this.createElement("div",{className:"e-separator"}),a=this.createCalendar();e.appendChild(t),e.appendChild(o),e.appendChild(a);var i=this.createElement("div",{className:"e-footer"}),l=this.createElement("button",{className:"e-cancel "+i_t+" "+l_t}),s=this.createElement("button");ZKe([s],["e-apply",i_t,"e-primary",l_t]),i.appendChild(s),i.appendChild(l);var c=!ZUe(this.startValue)&&!ZUe(this.endValue);(this.cancelButton=new BQe({content:this.l10n.getConstant("cancelText")},l),this.applyButton=new BQe({content:this.l10n.getConstant("applyText"),disabled:!c},s),RKe.add(s,"click",this.applyFunction,this),RKe.add(l,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile)||(VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),ZKe([e],"e-range-border"),ZKe([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector("."+YMt).style.height=this.popupWrapper.querySelector("."+qMt).getBoundingClientRect().height+"px"));this.popupWrapper.appendChild(i),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},t.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},t.prototype.deviceHeaderUpdate=function(){ZUe(this.startValue)&&ZUe(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(AMt)):ZUe(this.startValue)||this.startButton.element.classList.add(AMt)},t.prototype.applyFunction=function(e){var t=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),ZUe(this.startValue)||ZUe(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,rSt.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),eGe(e.target,"."+kMt)||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new oXe(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},t.prototype.onMouseClick=function(e,t){if("touchstart"!==e.type){var n=eGe(t||e.target,"."+r_t),r=n&&n.classList.contains(AMt);n&&n.classList.contains(r_t)&&this.setListSelection(n,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,n&&n.classList.contains(r_t)&&"custom_range"===n.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():r||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=eGe(e.target,"."+r_t);t&&t.classList.contains(r_t)&&!t.classList.contains(o_t)&&ZKe([t],o_t)},t.prototype.onMouseLeave=function(e){var t=eGe(e.target,"."+o_t);ZUe(t)||VKe([t],o_t)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(AMt)||this.isMobile&&e.classList.contains(AMt))){if(this.isMobile&&e.classList.contains(AMt))return this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id?void this.renderCustomPopup():void 0;this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),ZKe([e],AMt),e.setAttribute("aria-selected","true");var n=this.presetsItem[this.activeIndex];"custom_range"===n.id?this.renderCustomPopup():this.applyPresetRange(n,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+AMt);ZUe(e)||(VKe([e],AMt),e.removeAttribute("aria-selected"))},t.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},t.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},t.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},t.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:_Mt+" "+SMt}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},t.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){_Ge(t[e])}},t.prototype.createPresets=function(){if(!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:YMt,attrs:{tabindex:"0"}});var e=Gkt.createList(this.createElement,this.presetsItem,null,!0);GKe(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var t=this.presetElement.querySelector("#custom_range");ZUe(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+r_t),this.wireListEvents(),this.isMobile&&(this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!ZUe(this.activeIndex)&&this.activeIndex>-1&&ZKe([this.liCollections[this.activeIndex]],AMt)}},t.prototype.wireListEvents=function(){RKe.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(RKe.add(this.presetElement,"mouseover",this.onMouseOver,this),RKe.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){ZUe(this.presetElement)||(RKe.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(RKe.remove(this.presetElement,"mouseover",this.onMouseOver),RKe.remove(this.presetElement,"mouseout",this.onMouseLeave)))},t.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var t=this.popupWrapper.getBoundingClientRect().width;ZUe(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new IQe(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:ZUe(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-t,offsetY:4,collision:this.isMobile?VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){GKe(e.inputElement,{"aria-expanded":"true"}),ZKe([e.inputWrapper.buttons[0]],AMt),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new oXe(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new oXe(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),ZUe(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),ZUe(e.presetElement)||(e.keyInputConfigs=$Ue(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new oXe(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new oXe(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),ZUe(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!zKe.isDevice&&RKe.add(document,"keydown",e.popupCloseHandler,e)},close:function(){GKe(e.inputElement,{"aria-expanded":"false"}),VKe([e.inputWrapper.buttons[0]],AMt),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),VUe(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),ZUe(e.popupObj)||(ZUe(e.popupObj.element.parentElement)||UKe(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!zKe.isDevice&&RKe.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){zKe.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add(t_t),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(ZKe([this.modal],[t_t,_Mt,"e-range-modal"]),document.body.className+=" "+a_t,this.modal.style.display="block"),RKe.add(document,"mousedown touchstart",this.documentHandler,this)},t.prototype.popupCloseHandler=function(e){if(27===e.keyCode)this.hide(e)},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+OMt);if(e){var t=eGe(e,"."+MMt);t=ZUe(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),ZKe([e],KMt)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},t.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+YMt),t=this.popupObj&&this.popupObj.element.querySelector("."+qMt);ZUe(e)||ZUe(t)||(e.style.height=t.getBoundingClientRect().height+"px")},t.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var t=this.getHoverLI(),n=this.getActiveLI();if(!ZUe(this.leftCalendar)&&!ZUe(n))if(ZUe(t)||!ZUe(n)&&n===t)if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(n),"custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),n.classList.remove(o_t),void e.preventDefault();ZUe(t)&&ZUe(n)||this.onMouseClick(e,t||n),e.preventDefault();break;case"tab":if(this.leftCalendar){var r=this.getHoverLI();ZUe(r)||r.classList.remove(o_t)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),n=this.getActiveLI();if(ZUe(t))if(ZUe(n))ZKe([this.liCollections[0]],o_t);else{var r;!ZUe(r=n.nextElementSibling)&&r.classList.contains(r_t)&&ZKe([r],o_t)}else!ZUe(r=t.nextElementSibling)&&r.classList.contains(r_t)&&(VKe([t],o_t),ZKe([r],o_t))},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),n=this.getActiveLI();if(ZUe(t)){if(!ZUe(n)){var r;!ZUe(r=n.previousElementSibling)&&r.classList.contains(r_t)&&ZKe([r],o_t)}}else!ZUe(r=t.previousElementSibling)&&r.classList.contains(r_t)&&(VKe([t],o_t),ZKe([r],o_t))},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+o_t)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+AMt)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new oXe(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new oXe(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},t.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,t=this.presetElement.querySelector("."+o_t),n=this.presetElement.querySelector("."+AMt),r=ZUe(t)?n:t;if(!ZUe(r)){var o=r.nextElementSibling,a=o?o.offsetTop:r.offsetTop,i=r.getBoundingClientRect().height;a+r.offsetTop>e?this.presetElement.scrollTop=o?a-(e/2+i/2):a:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=eGe(e.target,"."+YMt);switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":ZUe(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":ZUe(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():ZUe(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},t.prototype.documentHandler=function(e){if(!ZUe(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&(ZUe(this.popupObj)||eGe(t,'[id="'+this.popupWrapper.id+'"]'))||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!ZUe(this.targetElement)&&(ZUe(this.targetElement)||t===this.targetElement)||eGe(t,'[id="'+this.popupWrapper.id+'"]')||eGe(t,"."+kMt)===this.inputWrapper.container||eGe(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},t.prototype.createInput=function(){var e=this.cssClass;ZUe(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=rSt.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),GKe(this.inputElement,{"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),rSt.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),ZUe(this.placeholder)||""===this.placeholder.trim()||rSt.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),ZKe([this.inputWrapper.container],"e-date-range-wrapper"),ZUe(this.inputElement.getAttribute("name"))&&GKe(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},t.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?qUe(this.width):"100%"},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&ZKe([this.popupWrapper],"e-daterange-day-header-lg")},t.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),ZUe(this.endValue)||ZUe(this.startValue)||e||this.disabledDateRender(),this.errorClass(),this.previousStartValue=ZUe(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=ZUe(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!ZUe(this.endValue)&&!ZUe(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),n=this.globalize.formatDate(this.endValue,e);rSt.setValue(t+" "+this.separator+" "+n,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&ZUe(this.value)&&this.invalidValueString&&rSt.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!ZUe(e)){var t=!1,n=void 0,r=void 0,o=null,a=null,i=null,l=!1,s=!1,c=!1;if("string"==typeof e){var u=e.split(" "+this.separator+" ");2===u.length?(o=u[0],a=u[1]):(t=!0,i=e)}else e.length>0?(n=e[0],r=e[1]):(n=e.start,r=e.end),n instanceof Date||"object"==typeof n?n instanceof Date?l=!0:ZUe(n)||(c=!0):o=this.getstringvalue(n),r instanceof Date||"object"==typeof r?r instanceof Date?s=!0:ZUe(r)||(c=!0):a=this.getstringvalue(r);(ZUe(o)&&!l&&!ZUe(a)||!ZUe(o)&&!s&&ZUe(a))&&(t=!0),c&&(o=a=i=null,t=!0),o&&(t=t||this.checkInvalidValue(o)),a&&(t=t||this.checkInvalidValue(a)),t&&(l&&!c&&(o=n.toLocaleDateString()),s&&!c&&(a=r.toLocaleDateString()),ZUe(o)||ZUe(a)?ZUe(o)?ZUe(a)||(i=a):i=o:i=o+" "+this.separator+" "+a,this.invalidValueString=i,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},t.prototype.getstringvalue=function(e){var t=null;return ZUe(e)||"number"!=typeof e?ZUe(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t,n=e,r=!1;if(t={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof n)r=!0;else{var o=new kKe(this.locale);if(!this.checkDateValue(o.parseDate(n,t))){var a=null;a=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(n)&&!a.test(n)||/^[a-zA-Z0-9- ]*$/.test(n)||isNaN(+new Date(this.checkValue(n))))&&(r=!0)}}return r},t.prototype.isDateDisabled=function(e){if(ZUe(e))return!1;var t=new Date(+e);if(+t<+this.min||+t>+this.max)return!0;this.virtualRenderCellArgs={date:t,isDisabled:!1};var n=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(n),!!n.isDisabled},t.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue&&+this.endValue<=+this.max;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var n=this.virtualRenderCellArgs;this.virtualRenderCellEvent(n),n.isDisabled&&(this.disabledDays.push(new Date(+n.date)),+e>+this.startValue&&+e<+this.endValue&&t++),this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},t.prototype.virtualRenderCellEvent=function(e){$Ue(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return ZUe(this.endValue)||ZUe(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},t.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&this.value.length>0||this.valueType&&this.valueType.length>0?(+this.startDate==+this.value[0]&&+this.endDate==+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},t.prototype.dispatchEvent=function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!1,!0),e.dispatchEvent(n),this.firstHiddenChild.dispatchEvent(n)},t.prototype.changeTrigger=function(e){+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},t.prototype.navigateTo=function(t,n){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,n):(n<this.min?n=new Date(+this.min):n>=this.max&&(n=new Date(+this.max)),"Month"===t&&this.isSameMonth(n,this.max)?n=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(n,this.max)?n=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(n,this.max)&&(n=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=n,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),n="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=n,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},t.prototype.navigate=function(t,n,r){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,r,n)},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(ZKe([this.inputWrapper.container],[PMt]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(VKe([this.inputWrapper.container],[PMt]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},t.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var t={"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(VKe([this.inputElement],[_Mt]),RKe.remove(this.inputElement,"blur",this.inputBlurHandler),rSt.removeAttributes(t,this.inputElement),ZUe(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),ZUe(this.inputWrapper)||(RKe.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),UKe(this.inputWrapper.container))),ZUe(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&RKe.remove(this.formElement,"reset",this.formResetHandler),ZUe(this.firstHiddenChild)||ZUe(this.secondHiddenChild)||(UKe(this.firstHiddenChild),UKe(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name"))},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)ZUe(this.cloneElement.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])))},t.prototype.getModuleName=function(){return"daterangepicker"},t.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},t.prototype.getSelectedRange=function(){var e;return ZUe(this.startValue)||ZUe(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,this.disabledDateRender(),ZUe(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,n){var r=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){t&&(this.targetElement=t),this.createPopup(),(this.isMobile||zKe.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:n||null,appendTo:this.isMobile||zKe.isDevice?this.mobileRangePopupWrap:document.body};var o=this.openEventArgs;this.trigger("open",o,(function(o){if(r.openEventArgs=o,!r.openEventArgs.cancel){r.openEventArgs.appendTo.appendChild(r.popupWrapper),r.showPopup(t,n);var a=!r.isCustomRange||r.isMobile&&r.isCustomRange;!VUe(r.presets[0].start&&r.presets[0].end&&r.presets[0].label)&&a&&r.setScrollPosition(),r.checkMinMaxDays(),r.isMobile&&!ZUe(r.startDate)&&ZUe(r.endDate)&&(r.endButton.element.classList.add(AMt),r.startButton.element.classList.remove(AMt),r.endButton.element.removeAttribute("disabled"),r.selectableDates()),e.prototype.setOverlayIndex.call(r,r.mobileRangePopupWrap,r.popupObj.element,r.modal,r.isMobile||zKe.isDevice)}}))}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if(ZUe(this.previousEndValue)&&ZUe(this.previousStartValue)?this.clearRange():(ZUe(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),ZUe(this.previousEndValue)?(this.endValue=null,this.setValue()):(this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue())),this.isPopupOpen()){this.closeEventArgs={cancel:!1,popup:this.popupObj,date:this.inputElement.value,model:this,event:e||null};var n=this.closeEventArgs;this.trigger("close",n,(function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?VKe([t.inputWrapper.buttons[0]],AMt):(t.isMobile&&(ZUe(t.startButton)||ZUe(t.endButton)||(RKe.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),RKe.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),ZKe([t.inputWrapper.container],[PMt]))),t.isMobile||(ZUe(t.leftKeyboardModule)||ZUe(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),ZUe(t.presetElement)||t.presetKeyboardModule.destroy(),ZUe(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,VKe([document.body],a_t),RKe.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||zKe.isDevice)&&(ZUe(t.mobileRangePopupWrap)||(t.mobileRangePopupWrap.remove(),t.mobileRangePopupWrap=null)),t.isKeyPopup=t.dateDisabled=!1),t.updateClearIconState(),t.updateHiddenInput(),t.isMobile&&t.allowEdit&&!t.readonly&&t.inputElement.removeAttribute("readonly")}))}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.setLocale=function(){this.globalize=new kKe(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),rSt.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},t.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},t.prototype.setDate=function(){rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),rSt.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},t.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):(t.value&&t.value.start||t.value&&!t.value.start)&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){ZUe(this.firstHiddenChild)&&ZUe(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),ZUe(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),GKe(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:c_t}),GKe(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:c_t});var e={type:"datetime",skeleton:"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},t.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&ZUe(this.startValue)&&ZUe(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},t.prototype.onPropertyChanged=function(e,t){for(var n={format:this.formatString,type:"date",skeleton:"yMd"},r=0,o=Object.keys(e);r<o.length;r++){var a=o[r];switch(["maxDays","minDays","value"].indexOf(a)<0&&this.hide(null),a){case"width":this.setEleWidth(this.width);break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":rSt.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":rSt.setReadonly(this.readonly,this.inputElement),this.inputElement.setAttribute("aria-readonly",""+this.readonly),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),rSt.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),rSt.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"locale":this.globalize=new kKe(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),rSt.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":rSt.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,n)),+this.initStartDate!=+e.startDate&&(this.startValue=this.checkDateValue(new Date(this.checkValue(e.startDate))),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(e.endDate,n)),+this.initEndDate!=+e.endDate&&(this.endValue=this.checkDateValue(new Date(this.checkValue(e.endDate))),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var i=e.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[1])],this.updateValue(),this.setDate()}else!ZUe(e.value)&&e.value.length>0||!ZUe(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1===e.value.length||e.value.start?this.clearModelvalue(e,t):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,t):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||((1===e.value.length||e.value.start)&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(ZUe(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t));if(this.isPopupOpen()){if(ZUe(this.startValue)&&ZUe(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,rSt.removeFloating(this.inputWrapper),rSt.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}}},EMt([vGe(null)],t.prototype,"value",void 0),EMt([vGe(!1)],t.prototype,"enablePersistence",void 0),EMt([vGe(new Date(1900,0,1))],t.prototype,"min",void 0),EMt([vGe(new Date(2099,11,31))],t.prototype,"max",void 0),EMt([vGe(null)],t.prototype,"locale",void 0),EMt([vGe(null)],t.prototype,"firstDayOfWeek",void 0),EMt([vGe(!1)],t.prototype,"weekNumber",void 0),EMt([vGe("Gregorian")],t.prototype,"calendarMode",void 0),EMt([vGe(!1)],t.prototype,"openOnFocus",void 0),EMt([yGe()],t.prototype,"created",void 0),EMt([yGe()],t.prototype,"destroyed",void 0),EMt([yGe()],t.prototype,"change",void 0),EMt([yGe()],t.prototype,"cleared",void 0),EMt([yGe()],t.prototype,"navigated",void 0),EMt([yGe()],t.prototype,"renderDayCell",void 0),EMt([vGe(null)],t.prototype,"startDate",void 0),EMt([vGe(null)],t.prototype,"endDate",void 0),EMt([bGe([{}],d_t)],t.prototype,"presets",void 0),EMt([vGe("")],t.prototype,"width",void 0),EMt([vGe(1e3)],t.prototype,"zIndex",void 0),EMt([vGe(!0)],t.prototype,"showClearButton",void 0),EMt([vGe(!0)],t.prototype,"showTodayButton",void 0),EMt([vGe("Month")],t.prototype,"start",void 0),EMt([vGe("Month")],t.prototype,"depth",void 0),EMt([vGe("")],t.prototype,"cssClass",void 0),EMt([vGe("-")],t.prototype,"separator",void 0),EMt([vGe(null)],t.prototype,"minDays",void 0),EMt([vGe(null)],t.prototype,"maxDays",void 0),EMt([vGe(!1)],t.prototype,"strictMode",void 0),EMt([vGe(null)],t.prototype,"keyConfigs",void 0),EMt([vGe(null)],t.prototype,"format",void 0),EMt([vGe(!0)],t.prototype,"enabled",void 0),EMt([vGe(!1)],t.prototype,"readonly",void 0),EMt([vGe(!0)],t.prototype,"allowEdit",void 0),EMt([vGe("Never")],t.prototype,"floatLabelType",void 0),EMt([vGe(null)],t.prototype,"placeholder",void 0),EMt([vGe({})],t.prototype,"htmlAttributes",void 0),EMt([yGe()],t.prototype,"open",void 0),EMt([yGe()],t.prototype,"close",void 0),EMt([yGe()],t.prototype,"select",void 0),EMt([yGe()],t.prototype,"focus",void 0),EMt([yGe()],t.prototype,"blur",void 0),t=EMt([wGe],t)}(wMt),p_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f_t=function(e){function t(t){var n=e.call(this,t)||this;return n.initRenderCalled=!1,n.checkInjectedModules=!1,n.directivekeys={presets:"preset"},n.immediateRender=!1,n.portals=[],n}return p_t(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return E.createElement(E.Fragment,null,[].concat(E.createElement("input",this.getDefaultAttributes()),this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(h_t);i0e(f_t,[a0e,E.Component]);exports.ExternalInterface=$Et,exports.ExternalInterfaceExtend=function(t){var n=t.toolbarTemplate,r=t.paramToolbar,o=t.currentPageDefault,a=t.queryOrderDefault,i=t.rowsPerPageDefault,l=t.queryKeyDataView,s=t.isSelectMulti,c=t.canContextMenuItems,u=t.handleContextMenuClick,d=t.rowSelected,h=t.dataSourceFilter,p=t.listContextHide,f=t.querySelectDefault,m=t.api,v=t.t,g=t.contextMenuOpen,b=t.stateId,y=t.viewIdTable,w=t.height,E=t.hasIndex,k=t.dataSelected,S=t.showColumnChoose,C=t.typeCheckbox,M=t.format,_=t.rowSelection,N=t.dataSource,A=t.columns,O=t.totalCount,I=t.breakText,D=t.allowPaging,P=t.allowResizing,T=t.handleDoubleContextMenuClick,H=t.stateChildId,L=t.titleChild,z=t.loading,R=t.checkInit1,B=t.checkInit2,$=t.checkInit,Z=t.hasWorkflow,V=t.apiWorkflow,j=t.rowClassName,W=null!=w?w:500,F=[W,0],q=[W-400+180,400],Y=e.useState(F),U=Y[0],K=Y[1],G=e.useState(0),X=G[0],Q=G[1],ee=e.useState({}),te=ee[0],ne=ee[1],re=function(){K(q)},oe=function(){Q(0),K(F)};return x.default.createElement(lkt,{className:0===U[1]?"hidden-split":"",split:"horizontal",sizes:U,onChange:K,allowResize:U[1]>0,sashRender:function(){return x.default.createElement(x.default.Fragment,null)}},x.default.createElement(ZEt,{minSize:250,maxSize:"100%",style:{marginBottom:10}},x.default.createElement($Et,{showColumnChoose:S,isSelectMulti:s,dataSourceFilter:h,totalCount:O,dataSource:N,columns:A,rowSelection:_,format:M,stateId:b,height:0===U[1]?U[0]:U[0]-160,viewIdTable:y,currentPageDefault:o,rowsPerPageDefault:i,queryOrderDefault:a,queryKeyDataView:l,handleContextMenuClick:u,rowSelected:function(e){d(e),function(e){Q(0);var t=e.rowData;t&&!e.rightClick&&H&&(null==H?void 0:H.length)>0&&(ne(e.rowData),re()),(!t&&!e.rightClick||e.rightClick)&&(ne({}),oe())}(e)},allowPaging:D,allowResizing:P,listContextHide:p,querySelectDefault:f,contextMenuOpen:g,canContextMenuItems:c,typeCheckbox:C,t:v,api:m,toolbarTemplate:n,paramToolbar:r,hasIndex:E,breakText:I,dataSelected:k,handleDoubleContextMenuClick:T,loading:z,checkInit:$,checkInit1:B,checkInit2:R,hasWorkflow:Z,apiWorkflow:V,rowClassName:j})),x.default.createElement(ZEt,{minSize:1,maxSize:"90%",style:{maxHeight:U[1]}},x.default.createElement("div",{className:"bg-white p-25",style:{border:"1px solid #e0e0e0"}},x.default.createElement("div",{style:{marginTop:"2px",marginBottom:"0px"},className:"d-flex justify-content-between align-items-center bb-1"},x.default.createElement("h5",{className:"m-0"},L),x.default.createElement("span",null,x.default.createElement($n,{style:{marginRight:5},fontSize:20,onClick:oe,className:"cursor-pointer"}))),x.default.createElement(UCt,{overflowMode:"Popup",heightAdjustMode:"Auto",className:"m-0",animation:{next:{effect:"None"},previous:{effect:"None"}},selected:function(e){Q(e.selectedIndex)}},x.default.createElement(qCt,null,null==H?void 0:H.map((function(e,t){return"AttachFile"!==e.stateId?x.default.createElement(FCt,{key:t,headerText:v(e.stateName)}):x.default.createElement(FCt,{key:t,headerText:v("File attached")})})))),x.default.createElement("div",{className:"box form-box__border d-flex flex-column p-0"},x.default.createElement(On,{activeTab:X},null==H?void 0:H.map((function(e,t){var n,r,a,l;return"AttachFile"!==e.stateId?x.default.createElement(Hn,{key:t,tabId:t},x.default.createElement($Et,{showColumnChoose:!0,showToolbar:!1,format:M,maxHeight:U[1]-130,height:U[1]-130,stateId:null!==(n=e.stateId)&&void 0!==n?n:"",viewIdTable:null!==(r=e.stateId)&&void 0!==r?r:"",dataSource:null!==(a=null==e?void 0:e.dataSource)&&void 0!==a?a:(null==te?void 0:te.id)?void 0:[],columns:null!==(l=null==e?void 0:e.columns)&&void 0!==l?l:void 0,totalCount:null==e?void 0:e.totalCount,summary:!0,currentPageDefault:o,rowsPerPageDefault:i,rowSelected:d,querySelectDefault:e.querySelectDefault,queryKeyDataView:[null==te?void 0:te.id],allowPaging:e.allowPaging,allowResizing:e.allowResizing,t:v,api:m,hasIndex:!0,breakText:I,loading:z,rowClassName:j})):x.default.createElement(Hn,{tabId:t,key:t},x.default.createElement(KCt,{height:U[1]-240,listFile:J(null==te?void 0:te.file)?"[]":null==te?void 0:te.file}))})))))))},exports.HeaderExternalInterface=function(e){var t=e.buttons,n=e.breadCrumb,r=e.CanPer,o=e.t;return x.default.createElement("div",{className:"table-toolbar"},x.default.createElement(nn,{className:"table-bar bar__action"},x.default.createElement(sn,null,x.default.createElement("div",{className:"d-flex justify-content-between align-items-center w-100"},x.default.createElement("div",{className:"bar__action-left"},x.default.createElement(GCt,{breadCrumbTitle:n.breadCrumbTitle,breadCrumbActive:o(n.breadCrumbActive),breadCrumbParent:n.breadCrumbParent})),x.default.createElement("div",{className:"bar__action-right d-flex"},t&&t.length>0&&t.map((function(e,t){var n,a,i,l=Zn[null!==(n=e.icon)&&void 0!==n?n:"Plus"];return x.default.createElement(r,{I:e.userAction,a:e.userSubject,key:t},x.default.createElement(jt,{color:e.color||"primary",onClick:e.actionClick,disabled:e.disabled,className:"me-1 d-flex"},x.default.createElement(l,{fontSize:null!==(a=e.fontSize)&&void 0!==a?a:14,className:"me-50"}),String(o(null!==(i=e.title)&&void 0!==i?i:""))))})))))))},exports.ToolbarTemplate=function(e){var t=window.localStorage.getItem("i18nextLng"),n=t||"vi";return aXe.load({vi:{daterangepicker:{placeholder:"Chọn ngày",startLabel:"Ngày bắt đầu",endLabel:"Ngày kết thúc",applyText:"Chọn",cancelText:"Hủy",selectedDays:"Chọn ngày",days:"Ngày",customRange:"Tùy chỉnh"}}}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var o=r[n];$Ue(yKe,o,{},!0)}}(require("@src/assets/cldr-data/main/".concat(n,"/ca-gregorian.json")),require("@src/assets/cldr-data/main/".concat(n,"/numbers.json")),require("@src/assets/cldr-data/main/".concat(n,"/timeZoneNames.json")),require("@src/assets/supplemental/numberingSystems.json")),wKe=n,bKe.notify("notifyExternalChange",{locale:wKe}),e.map((function(e,t){var r,o,a,i,l,s,c,u,d,h,p,f,m,v,g,b,y=null!==(r=e.option)&&void 0!==r?r:[],w=function(e,t){for(var n,r=0;r<e.length;r++){var o=e[r];if(o[o.fieldValue?o.fieldValue:"value"]===t)return z({},o);if((null===(n=o.children)||void 0===n?void 0:n.length)>0){var a=w(o.children,t);if(a)return a}}};return{template:x.default.createElement("div",{key:t,className:"me-50",style:{width:null!==(o=e.width)&&void 0!==o?o:200}},"daterange"===e.type&&x.default.createElement(f_t,{id:"daterangepicker",placeholder:e.t(null!==(a=e.placeholder)&&void 0!==a?a:""),startDate:!Q(e.data)&&(null===(i=e.data)||void 0===i?void 0:i.length)>0?e.data[0]:void 0,endDate:!Q(e.data)&&(null===(l=e.data)||void 0===l?void 0:l.length)>0?e.data[1]:void 0,format:U.dateFormat,onChange:function(t){var n,r;Q(null===(n=t.target)||void 0===n?void 0:n.value)?e.setData([]):e.setData(null===(r=t.target)||void 0===r?void 0:r.value)},openOnFocus:!0,locale:n}),"select"===e.type&&x.default.createElement(JIe,{value:(e.isMulti?Array.isArray(e.data)&&e.data.length>0:null!==e.data&&void 0!==e.data)?e.isMulti?y.filter((function(t){return Array.isArray(e.data)&&e.data.some((function(n){var r;return t[null!==(r=e.fieldValue)&&void 0!==r?r:"value"]===n}))})):null!==(s=y.find((function(t){var n;return t[null!==(n=e.fieldValue)&&void 0!==n?n:"value"]===e.data})))&&void 0!==s?s:"":e.isMulti?[]:void 0,onChange:function(t){var n,r;(e.isMulti||(e.fieldValue&&t?t[e.fieldValue]:null==t?void 0:t.value)!==e.data)&&(e.isMulti?e.setData((null!==(n=null==t?void 0:t.length)&&void 0!==n?n:0)>0?t.map((function(e){var t;return e[null!==(t=e.fieldValue)&&void 0!==t?t:"value"]})):[]):e.setData(Q(t)?void 0:t[null!==(r=e.fieldValue)&&void 0!==r?r:"value"]))},fieldValue:null!==(c=e.fieldValue)&&void 0!==c?c:"value",fieldLabel:null!==(u=e.fieldLabel)&&void 0!==u?u:"label",placeholder:e.t(null!==(d=e.placeholder)&&void 0!==d?d:""),isMulti:null!==(h=e.isMulti)&&void 0!==h&&h,options:y,isClearable:null===(p=e.isClearable)||void 0===p||p,columns:e.columns}),"selecttree"===e.type&&x.default.createElement(Y$e,{value:(e.isMulti?(null===(f=e.data)||void 0===f?void 0:f.length)>0:!Q(e.data))?e.isMulti?e.data:w(y,e.data):e.isMulti?[]:void 0,onChange:function(t){var n;(e.isMulti||(e.fieldValue&&t?t[e.fieldValue]:null==t?void 0:t.value)!==e.data)&&(e.isMulti?e.setData(Q(t)?[]:t):e.setData(Q(t)?void 0:t[null!==(n=e.fieldValue)&&void 0!==n?n:"value"]))},columns:null!==(m=e.columns)&&void 0!==m?m:ve,placeholder:e.t(null!==(v=e.placeholder)&&void 0!==v?v:""),options:null!=y?y:[],isMulti:null!==(g=e.isMulti)&&void 0!==g&&g,isClearable:!0})),position:null!==(b=e.position)&&void 0!==b?b:"left"}}))},exports.renderColumnTable=function(e,t,n){var r,o,a,i,l,s,c,u=JSON.parse(null!==(o=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.dataJson)&&void 0!==o?o:"[]"),d=JSON.parse(null===(a=null==u?void 0:u[0])||void 0===a?void 0:a.Data),h={Data:null==d?void 0:d.filter((function(e){return!0===(null==e?void 0:e.IsActive)}))},p=[];n&&p.push({width:60,type:"number",freeze:"Left",field:"STT",textAlign:"center",headerText:"STT",allowFiltering:!1,allowSorting:!1});for(var f=function(e){var n=h.Data[e],r={field:n.ColVirtual,headerText:n.Title,visible:!n.IsHidden,width:n.Width,maxWidth:null!==(i=n.MaxWidth)&&void 0!==i?i:n.Width,minWidth:null!==(l=n.MinWidth)&&void 0!==l?l:n.Width,allowSorting:!0,clipMode:"EllipsisWithTooltip",freeze:n.Freeze,textAlign:n.TextAlign};switch(n.Type){case"datetime":r.typeFilter="DateRange",r.template=te,r.type="datetime",r.hideOperator=!0;break;case"date":r.hideOperator=!0,r.typeFilter="DateRange",r.template=te,r.type="date";break;case"checkbox":r.hideOperator=!0,r.typeFilter="Checkbox";break;case"number":r.typeFilter="Number",r.type="number",J(n.TypeDecimal)||"quantity"===n.TypeDecimal?r.template=le:"allocationRatio"===n.TypeDecimal?r.template=fe:"exchangeMoney"===n.TypeDecimal?r.template=ce:"overseaMoney"===n.TypeDecimal?r.template=se:"rate"===n.TypeDecimal?r.template=he:"ratio"===n.TypeDecimal?r.template=pe:"so_cong"===n.TypeDecimal?r.template=me:"unitPriceExchange"===n.TypeDecimal?r.template=ue:"unitPriceOversea"===n.TypeDecimal?r.template=de:r.template="";break;default:r.type="string"}!J(n.ColTemplate)&&J(n.OptionTemplate)&&(r.template=function(e){var r;return t(null==e?void 0:e[null!==(r=n.ColTemplate)&&void 0!==r?r:""])}),J(n.ColTemplate)||J(n.OptionTemplate)||(r.source=null===(c=JSON.parse(null!==(s=n.OptionTemplate)&&void 0!==s?s:"[]"))||void 0===c?void 0:c.map((function(e){var n,r;return z(z({},e),{value:null!==(n=null==e?void 0:e.value)&&void 0!==n?n:null==e?void 0:e.id,label:t(null!==(r=e.label)&&void 0!==r?r:null==e?void 0:e.name)})})),r.template=function(e){var t,o;return null===(o=null===(t=r.source)||void 0===t?void 0:t.find((function(t){var r;return(null==t?void 0:t.value)===(null==e?void 0:e[null!==(r=n.ColTemplate)&&void 0!==r?r:""])})))||void 0===o?void 0:o.label}),0===e&&"checkbox"===n.Type?p.unshift({width:40,type:"checkbox",freeze:"Left"}):("id"===n.ColVirtual&&(r.isPrimaryKey=!0),p.push(r))},m=0;m<h.Data.length;m++)f(m);return p},exports.renderColumnTableBe=function(e,t,n,r){var o,a,i,l,s=JSON.parse(null!==(a=null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.dataJson)&&void 0!==a?a:"[]"),c=JSON.parse(null!==(l=null===(i=null==s?void 0:s[0])||void 0===i?void 0:i.Data)&&void 0!==l?l:"[]"),u={Data:null==c?void 0:c.filter((function(e){return!0===(null==e?void 0:e.IsActive)}))},d={};return n.forEach((function(e){for(var n,o,a,i,l,s,c,h=u.Data.filter((function(t){return t.ViewId===e})),p=[],f=function(e){var u=h[e],d={field:null!==(n=u.ColVirtual)&&void 0!==n?n:"",headerText:u.Title,visible:!u.IsHidden,width:u.Width,maxWidth:null!==(o=u.MaxWidth)&&void 0!==o?o:u.Width,minWidth:null!==(a=u.MinWidth)&&void 0!==a?a:u.Width,allowFiltering:!0,allowSorting:!0,textAlign:null!==(i=u.TextAlign)&&void 0!==i?i:"left",fixedType:J(u.Freeze)?void 0:(null!==(l=u.Freeze)&&void 0!==l?l:"").toLowerCase()};switch(u.Type){case"datetime":d.typeFilter="DateRange",d.type="datetime";break;case"date":d.typeFilter="DateRange",d.type="date";break;case"checkbox":d.typeFilter="Checkbox",d.type="checkbox",d.hideOperator=!0;break;case"number":d.typeFilter="Number",d.type="number",J(u.TypeDecimal)||"quantity"===u.TypeDecimal?d.format={decimalScale:oe("quantity")}:d.format={decimalScale:oe(J(u.TypeDecimal)?"quantity":u.TypeDecimal)};break;default:d.type="string"}!J(u.ColTemplate)&&J(u.OptionTemplate)&&(d.template=function(e){var n;return t(null==e?void 0:e[null!==(n=u.ColTemplate)&&void 0!==n?n:""])}),J(u.ColTemplate)||J(u.OptionTemplate)||(d.source=null===(c=JSON.parse(null!==(s=u.OptionTemplate)&&void 0!==s?s:"[]"))||void 0===c?void 0:c.map((function(e){var n,r;return z(z({},e),{value:null!==(n=null==e?void 0:e.value)&&void 0!==n?n:null==e?void 0:e.id,label:t(null!==(r=e.label)&&void 0!==r?r:null==e?void 0:e.name)})})),d.template=function(e){var t,n;return null===(n=null===(t=d.source)||void 0===t?void 0:t.find((function(t){var n;return(null==t?void 0:t.value)===(null==e?void 0:e[null!==(n=u.ColTemplate)&&void 0!==n?n:""])})))||void 0===n?void 0:n.label}),0===e&&"checkbox"===u.Type?(p.push({width:40,field:"checkbox",fixedType:"left"}),p.push({field:"",headerText:"STT",textAlign:"center",headerTextAlign:"center",template:function(e){return e.indexRow+1},fixedType:"left",visible:r,width:50,minWidth:50,maxWidth:50})):(0===e&&p.push({field:"",headerText:"STT",textAlign:"center",headerTextAlign:"center",template:function(e){return e.indexRow+1},fixedType:"left",visible:r,width:50,minWidth:50,maxWidth:50}),p.push(d))},m=0;m<h.length;m++)f(m);d[e]=p})),d},exports.renderColumnTableGrid=io;
294
+ r.version="2.30.1",function(e){t=e}(Lt),r.fn=Dn,r.min=function(){return Bt("isBefore",[].slice.call(arguments,0))},r.max=function(){return Bt("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return Lt(1e3*e)},r.months=function(e,t){return Ln(e,t,"months")},r.isDate=u,r.locale=mt,r.invalid=v,r.duration=Jt,r.isMoment=x,r.weekdays=function(e,t,n){return zn(e,t,n,"weekdays")},r.parseZone=function(){return Lt.apply(null,arguments).parseZone()},r.localeData=gt,r.isDuration=jt,r.monthsShort=function(e,t){return Ln(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return zn(e,t,n,"weekdaysMin")},r.defineLocale=vt,r.updateLocale=function(e,t){if(null!=t){var n,r,o=ct;null!=ut[e]&&null!=ut[e].parentLocale?ut[e].set(N(ut[e]._config,t)):(null!=(r=ft(e))&&(o=r._config),t=N(o,t),null==r&&(t.abbr=e),(n=new A(t)).parentLocale=ut[e],ut[e]=n),mt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?(ut[e]=ut[e].parentLocale,e===mt()&&mt(e)):null!=ut[e]&&delete ut[e]);return ut[e]},r.locales=function(){return S(ut)},r.weekdaysShort=function(e,t,n){return zn(e,t,n,"weekdaysShort")},r.normalizeUnits=$,r.relativeTimeRounding=function(e){return void 0===e?sr:"function"==typeof e&&(sr=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==cr[e]&&(void 0===t?cr[e]:(cr[e]=t,"s"===e&&(cr.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=Dn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}(Vnt);var jnt=Vnt.exports,Wnt=function(e){return jnt(e).isValid()&&e?jnt(e).format("DD/MM/yyyy HH:mm"):void 0},Fnt=function(e){return null==e},qnt=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Array.isArray(e[n])||(t[n]=e[n]));return t},Ynt=function(t){var n,r=t.control,o=t.id,a=t.name,i=t.type,l=t.label,s=t.labelSize,c=t.required,u=t.widthInput,d=t.errors,h=t.height,p=t.disabled,f=t.alignRight,m=t.row,v=t.isLabel,g=t.placeholder,b=t.autoFocus,y=t.inLine,w=t.callback,E=t.readOnly,k=t.classes,S=t.onBlur,C=g0e(t,["control","id","name","type","label","labelSize","required","widthInput","errors","height","disabled","alignRight","row","isLabel","placeholder","autoFocus","inLine","callback","readOnly","classes","onBlur"]);return x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:w1e(" align",(n={},n[s||""]=s,n[k||""]=k,n["form-row-inline-error"]=d,n),!1===y?"form-group ":"form-row-inline d-flex")},x.default.createElement(e.Fragment,null,!1===v?"":x.default.createElement(X5e,{className:"form-label",for:a},l||""," ",c?x.default.createElement("span",{className:"text-danger"},"*"):""," ")),x.default.createElement("div",{className:w1e("form-input-content",{"hidden-label":!1===v}),style:{}},x.default.createElement(e.Fragment,null,x.default.createElement(O4e,{name:a,control:r,render:function(e){var t=e.field,n=t.value,r=t.onChange;return x.default.createElement(V5e,v0e({id:o,value:Fnt(n)?"":n,onChange:function(e){r(e.target.value),w&&w(e)},onBlur:S,style:{width:"number"==typeof u||"string"==typeof u?u:"",height:"".concat(h,"px"),textAlign:f?"right":"left"},autoFocus:b,disabled:p,placeholder:g,type:i||"text",invalid:d&&!0,rows:m},C,{readOnly:E,checked:n}))}}),d&&x.default.createElement(P5e,null,null==d?void 0:d.message)))))},Unt=function(t){var n,r=t.isMulti,o=t.isLabel,a=t.confirmHandle,i=t.fieldValue,l=t.fieldLabel,s=t.labelComponent,c=t.options,u=t.loadOptions,d=t.control,h=t.placeholder,p=t.disabled,f=t.allowCreate,m=t.onPaste,v=t.onOpenMenu,g=t.onCloseMenu,b=t.name,y=t.label,w=t.labelSize,E=t.required,k=t.errors,S=t.inLine,C=t.callback,M=t.isClearable,_=t.defaultValue,N=t.handleAddNew,A=t.columns,O=t.showFooter,I=t.footerComponent,D=t.maxHeight,P=g0e(t,["isMulti","isLabel","confirmHandle","fieldValue","fieldLabel","labelComponent","options","loadOptions","control","placeholder","disabled","allowCreate","onPaste","onOpenMenu","onCloseMenu","name","label","labelSize","required","errors","inLine","callback","isClearable","defaultValue","handleAddNew","columns","showFooter","footerComponent","maxHeight"]),T=function(e){var t,n=e.onChange,o=e.val;n(r?(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0?o.map((function(e){return e[null!=i?i:"value"]})):[]:Fnt(o)?void 0:o[null!=i?i:"value"]),C&&C(o)};return x.default.createElement(e.Fragment,null,x.default.createElement("div",{className:w1e(!1===S?"form-group ":"form-row-inline d-flex","align",(n={},n[w||""]=w,n["form-row-inline-error"]=k,n))},!1===o?"":x.default.createElement(X5e,{className:"form-label",for:b},y||""," ",E?x.default.createElement("span",{className:"text-danger"},"*"):""," "),x.default.createElement("div",{className:w1e("form-input-content",{"hidden-label":!1===o})},x.default.createElement(O4e,{name:b,control:d,render:function(e){var t,n=e.field,o=n.value,d=n.onChange;return x.default.createElement(JIe,v0e({},P,{value:(r?Array.isArray(o)&&o.length>0:null!=o)?r?c.filter((function(e){return Array.isArray(o)&&o.some((function(t){return e[null!=i?i:"value"]===t}))})):null!==(t=c.find((function(e){return e[null!=i?i:"value"]===o})))&&void 0!==t?t:null!=_?_:"":r?[]:void 0,onChange:function(e){var t;(r||(i&&e?e[i]:null==e?void 0:e.value)!==o)&&(a?a(T,d,e):(d(r?(null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)>0?e.map((function(e){return e[null!=i?i:"value"]})):[]:Fnt(e)?void 0:e[null!=i?i:"value"]),e&&u&&(r?e.forEach((function(e){c.some((function(t){return t[null!=i?i:"value"]===e[null!=i?i:"value"]}))||c.unshift(e)})):_||c.some((function(t){return t[null!=i?i:"value"]===e[null!=i?i:"value"]}))||c.unshift(e)),C&&C(e)))},isClearable:M,isMulti:r,placeholder:h,invalid:k,loadOptions:u,options:c,isDisabled:p,columns:A,fieldValue:i,fieldLabel:l,showFooter:O,handleAdd:N,footerComponent:I,allowCreate:f,formatOptionLabel:s,onCloseMenu:g,onOpenMenu:v,onPaste:m,maxHeight:D}))}}),k&&x.default.createElement(P5e,null,null==k?void 0:k.message))))},Knt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Gnt=function(t){var n=t.data,r=t.listData,o=t.type,a=t.setType,i=t.t,l=t.checkInitProcess,s=t.getProcessApi,c=t.approveProcessApi,u=t.approveMultiProcessApi,d=t.pagingUserApi,h=t.CDN_URL_VIEW,p=t.token,f=t.saveUrl,m=t.approverId,v=t.approverName,g=t.onApproveCompleted,b=e.useState([]),y=b[0],w=b[1],E=e.useState([]),k=E[0],S=E[1],C=e.useState([]),M=C[0],_=C[1],N=e.useState({}),A=N[0],O=N[1],I="approve"===o||"multiApprove"===o,D=function(){a("")},P=function(){return{innerWidth:window.innerWidth,innerHeight:window.innerHeight}},T=e.useState(P()),H=T[0],L=T[1];e.useEffect((function(){var e=function(){L(P())};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var z,R,B=function(e={}){const t=x.default.useRef(),[n,r]=x.default.useState({isDirty:!1,isValidating:!1,isLoading:R4e(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:R4e(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...h7e(e,(()=>r((e=>({...e}))))),formState:n});const o=t.current.control;return o._options=e,S4e({subject:o._subjects.state,next:e=>{x4e(e,o._proxyFormState,o._updateFormState,!0)&&r({...o._formState})}}),x.default.useEffect((()=>{e.values&&!e7e(e.values,o._defaultValues)?o._reset(e.values,o._options.resetOptions):o._resetDefaultValues()}),[e.values,o]),x.default.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),t.current.formState=y4e(n,o),t.current}({defaultValues:{ticketId:null==n?void 0:n.id,userId:[],userName:[],watcher:[]},mode:"onChange"}),$=B.control,Z=B.clearErrors,V=B.reset,j=B.setValue,W=B.handleSubmit;return B.formState,e.useEffect((function(){l&&("approve"===o&&(s?s({ticketId:null==n?void 0:n.id,status:0}).unwrap().then((function(e){var t=null==e?void 0:e.find((function(e){return 0===e.status}));if(O(t),t)if("Handle"===(null==t?void 0:t.workflowStateCode))_([{Id:void 0,Name:i("TransferProcessing")}]);else{var n=JSON.parse((null==t?void 0:t.logWorkflow)||"{}"),r=JSON.parse(n.WorkflowAction||"[]");r&&_(r.sort((function(e,t){return e.Name&&t.Name?e.Name.localeCompare(t.Name):0})))}})).catch((function(){return knt(i("getDataError"))})):knt(i("getProcessApi không hợp lệ!"))),d&&d({$filter:"status==1",$order:"firstName;asc",$pageIndex:1,$pageSize:500}).unwrap().then((function(e){var t,n=null===(t=e.items)||void 0===t?void 0:t.map((function(e){return v0e(v0e({},e),{value:e.loginID,label:e.fullName})}));S(n)})).catch((function(){return knt(i("getDataError"))})))}),[o]),x.default.createElement(h5e,{isOpen:I,backdrop:"static",keyboard:!1,toggle:D,className:"modal-dialog-centered modal-lg",contentClassName:"p-0",onOpened:function(){return b0e(void 0,void 0,void 0,(function(){return y0e(this,(function(e){return j("ticketId",null==n?void 0:n.id),j("ticketInfo",JSON.stringify(qnt(n))),j("userId",m?[m]:[]),j("userName",v?[v]:[]),[2]}))}))},onClosed:function(){Z(),V(),O({}),_([]),w([])}},x.default.createElement(A5e,{id:"form-modal-globalzone",className:"todo-modal modal-form-content",onSubmit:W((function(e){var t,n,a;e.files=JSON.stringify(y),e.userId=null===(t=null==e?void 0:e.userId)||void 0===t?void 0:t.join(","),e.userName=null===(n=null==e?void 0:e.userName)||void 0===n?void 0:n.join(","),e.watcher=null===(a=null==e?void 0:e.watcher)||void 0===a?void 0:a.join(","),"approve"===o?c?c(e).unwrap().then((function(t){g&&g(t),t.isValid?(D(),Ent("".concat(i(null==e?void 0:e.action)," ").concat(i("success")))):Snt(t,i)})).catch((function(){knt("".concat(i(null==e?void 0:e.action)," ").concat(i("fail")))})):knt(i("approveProcessApi không hợp lệ!")):"multiApprove"===o&&(u?r?(e.listTicket=r.filter((function(e){return e.hasPermissionApprove})).map((function(e){return{id:e.id,data:JSON.stringify(qnt(e))}})),u(e).unwrap().then((function(t){g&&g(t),t.isValid?(D(),Ent("".concat(i(null==e?void 0:e.action)," ").concat(i("success")))):Snt(t,i)})).catch((function(){knt("".concat(i(null==e?void 0:e.action)," ").concat(i("fail")))}))):knt(i("listData không hợp lệ!")):knt(i("approveMultiProcessApi không hợp lệ!")))}))},x.default.createElement(Znt,{handleModal:D,typeModal:"Process",title:i("HandleProcess")}),x.default.createElement(d3e.Scrollbars,{autoHide:!0,autoHeight:!0,autoHeightMax:H.innerHeight-180},x.default.createElement(v5e,null,x.default.createElement("section",null,x.default.createElement(W1e,{className:"mb-1 gy-50"},x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Ynt,{control:$,type:"textarea",name:"comment",label:i("Comment"),inLine:!1,required:!1,placeholder:i("Comment")})),(!0===(null==A?void 0:A.isAssignedApprover)||m)&&x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Unt,{options:k,control:$,name:"userId",isMulti:!0,placeholder:i("Select"),label:i("AssignApprovers"),inLine:!1,allowCreate:!1,maxHeight:350,callback:function(e){j("userName",e.map((function(e){return e.fullName})))},columns:[{headerText:"Approver",field:"fullName",width:300,template:function(e){return x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(h,"/").concat(null==e?void 0:e.photo):Knt,alt:"avatar",height:26,width:26,style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}}),x.default.createElement("span",{className:"ms-50"}," ",e.fullName," "))}},{headerText:"Email",field:"email",width:250}],labelSize:"label-small"})),x.default.createElement(J1e,{lg:12,md:12,xs:12},x.default.createElement(Unt,{options:k,control:$,name:"watcher",isMulti:!0,placeholder:i("Select"),label:i("Watcher"),inLine:!1,allowCreate:!1,maxHeight:350,columns:[{headerText:"Watcher",field:"fullName",width:300,template:function(e){return x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(h,"/").concat(null==e?void 0:e.photo):Knt,alt:"avatar",height:26,width:26,style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}}),x.default.createElement("span",{className:"ms-50"}," ",e.fullName," "))}},{headerText:"Email",field:"email",width:250}],labelSize:"label-small"}))),x.default.createElement("div",{style:{marginTop:"10px"}},x.default.createElement("h5",null,i("Attached")),x.default.createElement(Ant,{t:i,CDN_URL_VIEW:h,token:p,saveUrl:f,listFile:y,setListFile:w}))))),x.default.createElement("div",{className:"d-flex justify-content-end p-1",style:{boxShadow:"0 4px 24px 0 rgb(34 41 47 / 10%)"}},(z="multiApprove"===o,R=null==r?void 0:r.every((function(e){return"Handle"===e.currentProcessCode})),x.default.createElement(x.default.Fragment,null,z?R?x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!0),j("action",i("TransferProcessing"))},className:"d-flex btn btn-primary"},i("TransferProcessing"))):x.default.createElement(x.default.Fragment,null,x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!0),j("action",i("Approve"))},className:"d-flex btn btn-primary"},i("Approve"))),x.default.createElement(M2e,{className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("isProceed",!1),j("action",i("Refuse"))},className:"d-flex btn btn-primary"},i("Return")))):null==M?void 0:M.map((function(e,t){return x.default.createElement(M2e,{key:t,className:"btn add-todo-item p-0 me-1",disabled:!l,color:"primary"},x.default.createElement("div",{onClick:function(){j("workflowTransitionId",null==e?void 0:e.Id),j("action",null==e?void 0:e.Name)},className:"d-flex btn btn-primary"},e.Name))})),x.default.createElement(M2e,{color:"secondary",onClick:D,outline:!0,className:"me-1"},i("Close")))))))};const Xnt=e.createContext(null);var Qnt=Object.freeze({__proto__:null,LexicalComposerContext:Xnt,createLexicalComposerContext:function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},useLexicalComposerContext:function(){const t=e.useContext(Xnt);if(null==t)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return t}}),Jnt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const ert=e.createContext(null);var trt=Object.freeze({__proto__:null,LexicalComposerContext:ert,createLexicalComposerContext:function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},useLexicalComposerContext:function(){const t=e.useContext(ert);return null==t&&Jnt(8),t}});const nrt="development"===process.env.NODE_ENV?Qnt:trt,rrt=nrt.LexicalComposerContext,ort=nrt.createLexicalComposerContext,art=nrt.useLexicalComposerContext;function irt(e){return{type:e}}const lrt=irt("SELECTION_CHANGE_COMMAND"),srt=irt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),crt=irt("CLICK_COMMAND"),urt=irt("DELETE_CHARACTER_COMMAND"),drt=irt("INSERT_LINE_BREAK_COMMAND"),hrt=irt("INSERT_PARAGRAPH_COMMAND"),prt=irt("CONTROLLED_TEXT_INSERTION_COMMAND"),frt=irt("PASTE_COMMAND"),mrt=irt("REMOVE_TEXT_COMMAND"),vrt=irt("DELETE_WORD_COMMAND"),grt=irt("DELETE_LINE_COMMAND"),brt=irt("FORMAT_TEXT_COMMAND"),yrt=irt("UNDO_COMMAND"),wrt=irt("REDO_COMMAND"),xrt=irt("KEYDOWN_COMMAND"),Ert=irt("KEY_ARROW_RIGHT_COMMAND"),krt=irt("MOVE_TO_END"),Srt=irt("KEY_ARROW_LEFT_COMMAND"),Crt=irt("MOVE_TO_START"),Mrt=irt("KEY_ARROW_UP_COMMAND"),_rt=irt("KEY_ARROW_DOWN_COMMAND"),Nrt=irt("KEY_ENTER_COMMAND"),Art=irt("KEY_SPACE_COMMAND"),Ort=irt("KEY_BACKSPACE_COMMAND"),Irt=irt("KEY_ESCAPE_COMMAND"),Drt=irt("KEY_DELETE_COMMAND"),Prt=irt("KEY_TAB_COMMAND"),Trt=irt("INSERT_TAB_COMMAND"),Hrt=irt("INDENT_CONTENT_COMMAND"),Lrt=irt("OUTDENT_CONTENT_COMMAND"),zrt=irt("DROP_COMMAND"),Rrt=irt("FORMAT_ELEMENT_COMMAND"),Brt=irt("DRAGSTART_COMMAND"),$rt=irt("DRAGOVER_COMMAND"),Zrt=irt("DRAGEND_COMMAND"),Vrt=irt("COPY_COMMAND"),jrt=irt("CUT_COMMAND"),Wrt=irt("SELECT_ALL_COMMAND"),Frt=irt("CLEAR_EDITOR_COMMAND"),qrt=irt("CLEAR_HISTORY_COMMAND"),Yrt=irt("CAN_REDO_COMMAND"),Urt=irt("CAN_UNDO_COMMAND"),Krt=irt("FOCUS_COMMAND"),Grt=irt("BLUR_COMMAND"),Xrt=irt("KEY_MODIFIER_COMMAND"),Qrt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jrt=Qrt&&"documentMode"in document?document.documentMode:null,eot=Qrt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),tot=Qrt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),not=!(!Qrt||!("InputEvent"in window)||Jrt)&&"getTargetRanges"in new window.InputEvent("input"),rot=Qrt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),oot=Qrt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,aot=Qrt&&/Android/.test(navigator.userAgent),iot=Qrt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lot=Qrt&&aot&&iot,sot=Qrt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!iot,cot=0,uot=1,dot=2,hot=1,pot=2,fot=3,mot=4,vot=5,got=6,bot=rot||oot||sot?" ":"​",yot="\n\n",wot=tot?" ":bot,xot="֑-߿יִ-﷽ﹰ-ﻼ",Eot="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",kot=new RegExp("^[^"+Eot+"]*["+xot+"]"),Sot=new RegExp("^[^"+xot+"]*["+Eot+"]"),Cot={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Mot={directionless:1,unmergeable:2},_ot={center:2,end:6,justify:4,left:1,right:3,start:5},Not={[pot]:"center",[got]:"end",[mot]:"justify",[hot]:"left",[fot]:"right",[vot]:"start"},Aot={normal:0,segmented:2,token:1},Oot={[cot]:"normal",[dot]:"segmented",[uot]:"token"};function Iot(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let Dot=!1,Pot=0;function Tot(e){Pot=e.timeStamp}function Hot(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function Lot(e,t,n){const r=Yat(n._window);let o=null,a=null;null!==r&&r.anchorNode===e&&(o=r.anchorOffset,a=r.focusOffset);const i=e.nodeValue;null!==i&&xat(t,i,o,a,!1)}function zot(e,t,n){if(Plt(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return 3===t.nodeType&&n.isAttached()}function Rot(e,t,n){Dot=!0;const r=performance.now()-Pot>100;try{xst(e,(()=>{const o=qlt()||function(e){return e.getEditorState().read((()=>{const e=qlt();return null!==e?e.clone():null}))}(e),a=new Map,i=e.getRootElement(),l=e._editorState,s=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=sat(p,l);if(!(null===f&&p!==i||kst(f)))if("characterData"===h)r&&klt(f)&&zot(o,p,f)&&Lot(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],o=lat(r),a=r.parentNode;if(null!=a&&r!==s&&null===o&&("BR"!==r.nodeName||!Hot(r,a,e))){if(tot){const e=r.innerText||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let o=0;o<r;o++){const r=n[o];("BR"===r.nodeName&&Hot(r,p,e)||s===r)&&(p.appendChild(r),t++)}r!==t&&(p===i&&(f=hat(l)),a.set(p,f))}}}if(a.size>0)for(const[t,n]of a)if(Cst(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n<r.length;n++){const a=r[n],i=e.getElementByKey(a);null!==i&&(null==o?(t.appendChild(i),o=i):o!==i&&t.replaceChild(i,o),o=o.nextSibling)}}else klt(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,o=n.target;for(let t=0;t<r.length;t++){const n=r[t],a=n.parentNode;null==a||"BR"!==n.nodeName||Hot(n,o,e)||a.removeChild(n)}}n.takeRecords()}null!==o&&(c&&(o.dirty=!0,pat(o)),tot&&Pat(e)&&o.insertRawText(u))}))}finally{Dot=!1}}function Bot(e){const t=e._observer;null!==t&&Rot(e,t.takeRecords(),t)}function $ot(e){!function(e){0===Pot&&Bat(e).addEventListener("textInput",Tot,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Rot(e,t,n)}))}function Zot(e,t){const n=e.__mode,r=e.__format,o=e.__style,a=t.__mode,i=t.__format,l=t.__style;return!(null!==n&&n!==a||null!==r&&r!==i||null!==o&&o!==l)}function Vot(e,t){const n=e.mergeWithSibling(t),r=ust()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function jot(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&klt(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Zot(t,r)){r=Vot(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&klt(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Zot(r,n)){r=Vot(r,n);break}break}n.remove()}}else r.remove()}function Wot(e){return Fot(e.anchor),Fot(e.focus),e}function Fot(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),klt(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Cst(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let qot=1;const Yot="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Uot(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return kst(sat(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function Kot(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Uot(t)&&Got(t)===e}catch(e){return!1}}function Got(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=zat(t)}return null}function Xot(e){return e.isToken()||e.isSegmented()}function Qot(e){return 3===e.nodeType}function Jot(e){let t=e;for(;null!=t;){if(Qot(t))return t;t=t.firstChild}return null}function eat(e,t,n){const r=Cot[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Cot.superscript:"superscript"===t&&(o&=~Cot.subscript),o}function tat(e,t){if(null!=t)return void(e.__key=t);lst(),sst();const n=ust(),r=cst(),o=""+qot++;r._nodeMap.set(o,e),Cst(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}function nat(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),a=e.getNextSibling();if(null===o)if(null!==a){const e=a.getWritable();r.__first=a.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==a){const t=a.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===a)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=a.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function rat(e){sst();const t=e.getLatest(),n=t.__parent,r=cst(),o=ust(),a=r._nodeMap,i=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,a,i);const l=t.__key;o._dirtyType=1,Cst(e)?i.set(l,!0):o._dirtyLeaves.add(l)}function oat(e){lst();const t=ust(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=iat(n);null!==e&&e.getWritable()}if(null!==e){const t=iat(e);null!==t&&t.getWritable()}}}function aat(){return ist()?null:ust()._compositionKey}function iat(e,t){const n=(t||cst())._nodeMap.get(e);return void 0===n?null:n}function lat(e,t){const n=e[`__lexicalKey_${ust()._key}`];return void 0!==n?iat(n,t):null}function sat(e,t){let n=e;for(;null!=n;){const e=lat(n,t);if(null!==e)return e;n=zat(n)}return null}function cat(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function uat(e){return e.read((()=>dat().getTextContent()))}function dat(){return hat(cst())}function hat(e){return e._nodeMap.get("root")}function pat(e){lst();const t=cst();if(null!==e){if(Object.isFrozen(e))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");e.dirty=!0,e.setCachedNodes(null)}t._selection=e}function fat(e){const t=ust(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=zat(n)}return null}(e,t);return null===n?e===t.getRootElement()?iat("root"):null:iat(n)}function mat(e,t){return t?e.getTextContentSize():0}function vat(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function gat(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function bat(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function yat(e){return 3===e.nodeType?e.nodeValue:null}function wat(e,t,n){const r=Yat(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:a,focusOffset:i}=r;if(null!==o){let t=yat(o);const r=sat(o);if(null!==t&&klt(r)){if(t===bot&&n){const e=n.length;t=n,a=e,i=e}null!==t&&xat(r,t,a,i,e)}}}function xat(e,t,n,r,o){let a=e;if(a.isAttached()&&(o||!a.isDirty())){const i=a.isComposing();let l=t;(i||o)&&t[t.length-1]===bot&&(l=t.slice(0,-1));const s=a.getTextContent();if(o||l!==s){if(""===l){if(oat(null),rot||oot||sot)a.remove();else{const e=ust();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}const t=a.getParent(),o=Ylt(),s=a.getTextContentSize(),c=aat(),u=a.getKey();if(a.isToken()||null!==c&&u===c&&!i||Plt(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!a.canInsertTextBefore()&&!i||o.focus.key===e.__key&&o.focus.offset===s&&!a.canInsertTextAfter()&&!i))return void a.markDirty();const d=qlt();if(!Plt(d)||null===n||null===r)return void a.setTextContent(l);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){const e=Elt(a.getTextContent());a.replace(e),a=e}a.setTextContent(l)}}}function Eat(e){return"ArrowLeft"===e}function kat(e){return"ArrowRight"===e}function Sat(e,t){return eot?e:t}function Cat(e){return"Enter"===e}function Mat(e){return"Backspace"===e}function _at(e){return"Delete"===e}function Nat(e,t,n){return"KeyA"===e&&Sat(t,n)}function Aat(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=Iot(o);return n[t]=e,e}return o}function Oat(e,t,n,r,o){if(0===n.size)return;const a=r.__type,i=r.__key,l=t.get(a);if(void 0===l)throw Error(`Type ${a} not in registeredNodes`);const s=l.klass;let c=e.get(s);void 0===c&&(c=new Map,e.set(s,c));const u=c.get(i),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(i,d?"updated":o)}function Iat(e,t,n){const r=e.getParent();let o=n,a=e;return null!==r&&(t&&0===n?(o=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(o=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?o-1:o)}function Dat(e,t){const n=e.offset;if("element"===e.type)return Iat(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Iat(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Pat(e){const t=Bat(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Tat(e,t,n){return bst(e,t,n)}function Hat(e){return!Nst(e)&&!e.isLastChild()&&!e.isInline()}function Lat(e,t){const n=e._keyToDOMMap.get(t);if(void 0===n)throw Error(`Reconciliation: could not find DOM element for node key ${t}`);return n}function zat(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Rat(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Bat(e){const t=e._window;if(null===t)throw Error("window object not found");return t}function $at(e){let t=e.getParentOrThrow();for(;null!==t;){if(Zat(t))return t;t=t.getParentOrThrow()}return t}function Zat(e){return Nst(e)||Cst(e)&&e.isShadowRoot()}function Vat(e){const t=e.constructor.clone(e);return tat(t,null),t}function jat(e){const t=ust(),n=e.constructor.getType(),r=t._nodes.get(n);if(void 0===r)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const o=r.replace;if(null!==o){const t=o(e);if(!(t instanceof e.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return t}return e}function Wat(e,t){if(Nst(e.getParent())&&!Cst(t)&&!kst(t))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Fat(e){return(kst(e)||Cst(e)&&!e.canBeEmpty())&&!e.isInline()}function qat(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Yat(e){return Qrt?(e||window).getSelection():null}function Uat(e){return 1===e.nodeType}function Kat(e){const t=new RegExp(/^(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|#text)$/,"i");return null!==e.nodeName.match(t)}function Gat(e){if(Nst(e)||kst(e)&&!e.isInline())return!0;if(!Cst(e)||Zat(e))return!1;const t=e.getFirstChild(),n=null===t||alt(t)||klt(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Xat(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function Qat(e,t,n,r,o,a){let i=e.getFirstChild();for(;null!==i;){const e=i.__key;i.__parent===t&&(Cst(i)&&Qat(i,e,n,r,o,a),n.has(e)||a.delete(e),o.push(e)),i=i.getNextSibling()}}let Jat,eit,tit,nit,rit,oit,ait,iit,lit,sit,cit="",uit="",dit=null,hit="",pit=!1,fit=!1,mit=null;function vit(e,t){const n=ait.get(e);if(null!==t){const n=Iit(e);n.parentNode===t&&t.removeChild(n)}if(iit.has(e)||eit._keyToDOMMap.delete(e),Cst(n)){const e=_it(n,ait);git(e,0,e.length-1,null)}void 0!==n&&Oat(sit,tit,nit,n,"destroyed")}function git(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&vit(t,r)}}function bit(e,t){e.setProperty("text-align",t)}const yit="40px";function wit(e,t){const n=Jat.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||yit;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function xit(e,t){const n=e.style;0===t?bit(n,""):1===t?bit(n,"left"):2===t?bit(n,"center"):3===t?bit(n,"right"):4===t?bit(n,"justify"):5===t?bit(n,"start"):6===t&&bit(n,"end")}function Eit(e,t,n){const r=iit.get(e);if(void 0===r)throw Error("createNode: node does not exist in nodeMap");const o=r.createDOM(Jat,eit);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,eit),klt(r)?o.setAttribute("data-lexical-text","true"):kst(r)&&o.setAttribute("data-lexical-decorator","true"),Cst(r)){const e=r.__indent,t=r.__size;if(0!==e&&wit(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=uit;uit="",kit(e,n,0,t,r,null),Mit(n,r),uit=o}(_it(r,iit),e,r,o)}const n=r.__format;0!==n&&xit(o,n),r.isInline()||Cit(null,r,o),Hat(r)&&(cit+=yot,hit+=yot)}else{const t=r.getTextContent();if(kst(r)){const t=r.decorate(eit,Jat);null!==t&&Ait(e,t),o.contentEditable="false"}else klt(r)&&(r.isDirectionless()||(uit+=t));cit+=t,hit+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return Object.freeze(r),Oat(sit,tit,nit,r,"created"),o}function kit(e,t,n,r,o,a){const i=cit;cit="";let l=n;for(;l<=r;++l){Eit(e[l],o,a);const t=iit.get(e[l]);null!==t&&null===dit&&klt(t)&&(dit=t.getFormat())}Hat(t)&&(cit+=yot),o.__lexicalTextContent=cit,cit=i+cit}function Sit(e,t){const n=t.get(e);return alt(n)||kst(n)&&n.isInline()}function Cit(e,t,n){const r=null!==e&&(0===e.__size||Sit(e.__last,ait)),o=0===t.__size||Sit(t.__last,iit);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Mit(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==uit||r!==mit){const n=""===uit,a=n?mit:(o=uit,kot.test(o)?"rtl":Sot.test(o)?"ltr":null);if(a!==r){const o=t.classList,i=Jat.theme;let l=null!==r?i[r]:void 0,s=null!==a?i[a]:void 0;if(void 0!==l){if("string"==typeof l){const e=Iot(l);l=i[r]=e}o.remove(...l)}if(null===a||n&&"ltr"===a)t.removeAttribute("dir");else{if(void 0!==s){if("string"==typeof s){const e=Iot(s);s=i[a]=e}void 0!==s&&o.add(...s)}t.dir=a}fit||(e.getWritable().__dir=a)}mit=a,t.__lexicalDirTextContent=uit,t.__lexicalDir=a}var o}function _it(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);if(void 0===e)throw Error("createChildrenArray: node does not exist in nodeMap");n.push(r),r=e.__next}return n}function Nit(e,t){const n=ait.get(e);let r=iit.get(e);if(void 0===n||void 0===r)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const o=pit||oit.has(e)||rit.has(e),a=Lat(eit,e);if(n===r&&!o){if(Cst(n)){const e=a.__lexicalTextContent;void 0!==e&&(cit+=e,hit+=e);const t=a.__lexicalDirTextContent;void 0!==t&&(uit+=t)}else{const e=n.getTextContent();klt(n)&&!n.isDirectionless()&&(uit+=e),hit+=e,cit+=e}return a}if(n!==r&&o&&Oat(sit,tit,nit,r,"updated"),r.updateDOM(n,a,Jat)){const n=Eit(e,null,null);if(null===t)throw Error("reconcileNode: parentDOM is null");return t.replaceChild(n,a),vit(e,null),n}if(Cst(n)&&Cst(r)){const e=r.__indent;e!==n.__indent&&wit(a,e);const t=r.__format;t!==n.__format&&xit(a,t),o&&(function(e,t,n){const r=uit;var o;uit="",dit=null,function(e,t,n){const r=cit,o=e.__size,a=t.__size;if(cit="",1===o&&1===a){const r=e.__first,o=t.__first;if(r===o)Nit(r,n);else{const e=Iit(r),t=Eit(o,null,null);n.replaceChild(t,e),vit(r,null)}const a=iit.get(o);null===dit&&klt(a)&&(dit=a.getFormat())}else{const r=_it(e,ait),i=_it(t,iit);if(0===o)0!==a&&kit(i,t,0,a-1,n,null);else if(0===a){if(0!==o){const e=null==n.__lexicalLineBreak;git(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,a){const i=r-1,l=o-1;let s,c,u=a.firstChild,d=0,h=0;for(;d<=i&&h<=l;){const e=t[d],r=n[h];if(e===r)u=Oit(Nit(r,a)),d++,h++;else{void 0===s&&(s=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),i=s.has(r);if(o)if(i){const e=Lat(eit,r);e===u?u=Oit(Nit(r,a)):(null!=u?a.insertBefore(e,u):a.appendChild(e),Nit(r,a)),d++,h++}else Eit(r,a,u),h++;else u=Oit(Iit(e)),vit(e,a),d++}const o=iit.get(r);null!==o&&null===dit&&klt(o)&&(dit=o.getFormat())}const p=d>i,f=h>l;if(p&&!f){const t=n[l+1];kit(n,e,h,l,a,void 0===t?null:eit.getElementByKey(t))}else f&&!p&&git(t,d,i,a)}(t,r,i,o,a,n)}Hat(t)&&(cit+=yot),n.__lexicalTextContent=cit,cit=r+cit}(e,t,n),Mit(t,n),Lst(o=t)&&null!=dit&&dit!==o.__textFormat&&o.setTextFormat(dit),uit=r,dit=null}(n,r,a),Nst(r)||r.isInline()||Cit(n,r,a)),Hat(r)&&(cit+=yot,hit+=yot)}else{const t=r.getTextContent();if(kst(r)){const t=r.decorate(eit,Jat);null!==t&&Ait(e,t)}else klt(r)&&!r.isDirectionless()&&(uit+=t);cit+=t,hit+=t}if(!fit&&Nst(r)&&r.__cachedText!==hit){const e=r.getWritable();e.__cachedText=hit,r=e}return Object.freeze(r),a}function Ait(e,t){let n=eit._pendingDecorators;const r=eit._decorators;if(null===n){if(r[e]===t)return;n=cat(eit)}n[e]=t}function Oit(e){let t=e.nextSibling;return null!==t&&t===eit._blockCursorElement&&(t=t.nextSibling),t}function Iit(e){const t=lit.get(e);if(void 0===t)throw Error(`Reconciliation: could not find DOM element for node key ${e}`);return t}const Dit=Object.freeze({}),Pit=[["keydown",function(e,t){if(Tit=e.timeStamp,Hit=e.code,t.isComposing())return;const{code:n,shiftKey:r,ctrlKey:o,metaKey:a,altKey:i}=e;Tat(t,xrt,e)||(!function(e,t,n,r){return kat(e)&&!t&&!r&&!n}(n,o,i,a)?!function(e,t,n,r,o){return kat(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?!function(e,t,n,r){return Eat(e)&&!t&&!r&&!n}(n,o,i,a)?!function(e,t,n,r,o){return Eat(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?!function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,a)?!function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,a)?!function(e,t){return Cat(e)&&t}(n,r)?!function(e){return"Space"===e}(n)?!function(e,t){return eot&&t&&"KeyO"===e}(n,o)?!function(e,t){return Cat(e)&&!t}(n,r)?!function(e,t,n,r){return eot?!t&&!n&&(Mat(e)||"KeyH"===e&&r):!(r||t||n)&&Mat(e)}(n,i,a,o)?!function(e){return"Escape"===e}(n)?!function(e,t,n,r,o){return eot?!(n||r||o)&&(_at(e)||"KeyD"===e&&t):!(t||r||o)&&_at(e)}(n,o,r,i,a)?!function(e,t,n){return Mat(e)&&(eot?t:n)}(n,i,o)?!function(e,t,n){return _at(e)&&(eot?t:n)}(n,i,o)?!function(e,t){return eot&&t&&Mat(e)}(n,a)?!function(e,t){return eot&&t&&_at(e)}(n,a)?!function(e,t,n,r){return"KeyB"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"KeyU"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"KeyI"===e&&!t&&Sat(n,r)}(n,i,a,o)?!function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,i,o,a)?!function(e,t,n,r){return"KeyZ"===e&&!t&&Sat(n,r)}(n,r,a,o)?!function(e,t,n,r){return eot?"KeyZ"===e&&n&&t:"KeyY"===e&&r||"KeyZ"===e&&r&&t}(n,r,a,o)?Hlt(t._editorState._selection)?function(e,t,n,r){return!t&&"KeyC"===e&&(eot?n:r)}(n,r,a,o)?(e.preventDefault(),Tat(t,Vrt,e)):function(e,t,n,r){return!t&&"KeyX"===e&&(eot?n:r)}(n,r,a,o)?(e.preventDefault(),Tat(t,jrt,e)):Nat(n,a,o)&&(e.preventDefault(),Tat(t,Wrt,e)):!tot&&Nat(n,a,o)&&(e.preventDefault(),Tat(t,Wrt,e)):(e.preventDefault(),Tat(t,wrt,void 0)):(e.preventDefault(),Tat(t,yrt,void 0)):Tat(t,Prt,e):(e.preventDefault(),Tat(t,brt,"italic")):(e.preventDefault(),Tat(t,brt,"underline")):(e.preventDefault(),Tat(t,brt,"bold")):(e.preventDefault(),Tat(t,grt,!1)):(e.preventDefault(),Tat(t,grt,!0)):(e.preventDefault(),Tat(t,vrt,!1)):(e.preventDefault(),Tat(t,vrt,!0)):_at(n)?Tat(t,Drt,e):(e.preventDefault(),Tat(t,urt,!1)):Tat(t,Irt,e):Mat(n)?Tat(t,Ort,e):(e.preventDefault(),Tat(t,urt,!0)):(Zit=!1,Tat(t,Nrt,e)):(e.preventDefault(),Zit=!0,Tat(t,drt,!0)):Tat(t,Art,e):(Zit=!0,Tat(t,Nrt,e)):Tat(t,_rt,e):Tat(t,Mrt,e):Tat(t,Crt,e):Tat(t,Srt,e):Tat(t,krt,e):Tat(t,Ert,e),function(e,t,n,r){return e||t||n||r}(o,r,i,a)&&Tat(t,Xrt,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&xst(t,(()=>{(function(e){return kst(sat(e))})(n)||($it=!0)}))}],["compositionstart",function(e,t){xst(t,(()=>{const n=qlt();if(Plt(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();oat(r.key),(e.timeStamp<Tit+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||klt(o)&&o.getStyle()!==n.style)&&Tat(t,prt,wot)}}))}],["compositionend",function(e,t){tot?Vit=!0:xst(t,(()=>{Uit(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),xst(t,(()=>{const n=qlt(),r=e.data,o=Yit(e);if(null!=r&&Plt(n)&&Wit(n,o,r,e.timeStamp,!1)){Vit&&(Uit(t,r),Vit=!1);const o=n.anchor.getNode(),a=Yat(t._window);if(null===a)return;const i=n.isBackward(),l=i?n.anchor.offset:n.focus.offset,s=i?n.focus.offset:n.anchor.offset;not&&!n.isCollapsed()&&klt(o)&&null!==a.anchorNode&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+s)===yat(a.anchorNode)||Tat(t,prt,r);const c=r.length;tot&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),rot||oot||sot||!t.isComposing()||(Tit=0,oat(null))}else wat(!1,t,null!==r?r:void 0),Vit&&(Uit(t,r||void 0),Vit=!1);lst(),Bot(ust())})),zit=null}],["click",function(e,t){xst(t,(()=>{const n=qlt(),r=Yat(t._window),o=Ylt();if(r)if(Plt(n)){const t=n.anchor,a=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Nst(a)&&1===dat().getChildrenSize()&&a.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||a!==n.focus.getNode()&&(Cst(a)?a.select(0):a.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const a=n.nodeType;1!==a&&3!==a||pat(Flt(o,r,t,e))}}Tat(t,crt,e)}))}],["cut",Dit],["copy",Dit],["dragstart",Dit],["dragover",Dit],["dragend",Dit],["paste",Dit],["focus",Dit],["blur",Dit],["drop",Dit]];not&&Pit.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Yit(e);"deleteCompositionText"===n||tot&&Pat(t)||"insertCompositionText"!==n&&xst(t,(()=>{const o=qlt();if("deleteContentBackward"===n){if(null===o){const e=Ylt();if(!Plt(e))return;pat(e.clone())}if(Plt(o)){const n=o.anchor.key===o.focus.key;if(a=e.timeStamp,"Delete"===Hit&&a<Tit+30&&t.isComposing()&&n){if(oat(null),Tit=0,setTimeout((()=>{xst(t,(()=>{oat(null)}))}),30),Plt(o)){const e=o.anchor.getNode();if(e.markDirty(),o.format=e.getFormat(),!klt(e))throw Error("Anchor node must be a TextNode");o.style=e.getStyle()}}else{oat(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),a=0===o.anchor.offset&&o.focus.offset===r.length;lot&&n&&!a||Tat(t,urt,!0)}return}}var a;if(!Plt(o))return;const i=e.data;null!==zit&&wat(!1,t,zit),o.dirty&&null===zit||!o.isCollapsed()||Nst(o.anchor.getNode())||null===r||o.applyDOMRange(r),zit=null;const l=o.anchor,s=o.focus,c=l.getNode(),u=s.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Tat(t,prt,e);break;case"insertFromComposition":oat(null),Tat(t,prt,e);break;case"insertLineBreak":oat(null),Tat(t,drt,!1);break;case"insertParagraph":oat(null),Zit&&!oot?(Zit=!1,Tat(t,drt,!1)):Tat(t,hrt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Tat(t,frt,e);break;case"deleteByComposition":(function(e,t){return e!==t||Cst(e)||Cst(t)||!e.isToken()||!t.isToken()})(c,u)&&Tat(t,mrt,e);break;case"deleteByDrag":case"deleteByCut":Tat(t,mrt,e);break;case"deleteContent":Tat(t,urt,!1);break;case"deleteWordBackward":Tat(t,vrt,!0);break;case"deleteWordForward":Tat(t,vrt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Tat(t,grt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Tat(t,grt,!1);break;case"formatStrikeThrough":Tat(t,brt,"strikethrough");break;case"formatBold":Tat(t,brt,"bold");break;case"formatItalic":Tat(t,brt,"italic");break;case"formatUnderline":Tat(t,brt,"underline");break;case"historyUndo":Tat(t,yrt,void 0);break;case"historyRedo":Tat(t,wrt,void 0)}else{if("\n"===i)e.preventDefault(),Tat(t,drt,!1);else if(i===yot)e.preventDefault(),Tat(t,hrt,void 0);else if(null==i&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=i&&Wit(o,r,i,e.timeStamp,!0)?(e.preventDefault(),Tat(t,prt,i)):zit=i;Lit=e.timeStamp}}))}(e,t)]);let Tit=0,Hit=null,Lit=0,zit=null;const Rit=new WeakMap;let Bit=!1,$it=!1,Zit=!1,Vit=!1,jit=[0,"",0,"root",0];function Wit(e,t,n,r,o){const a=e.anchor,i=e.focus,l=a.getNode(),s=ust(),c=Yat(s._window),u=null!==c?c.anchorNode:null,d=a.key,h=s.getElementByKey(d),p=n.length;return d!==i.key||!klt(l)||(!o&&(!not||Lit<r+50)||l.isDirty()&&p<2||vat(n))&&a.offset!==i.offset&&!l.isComposing()||Xot(l)||l.isDirty()&&p>1||(o||!not)&&null!==h&&!l.isComposing()&&u!==Jot(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||l.getFormat()!==e.format||l.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(klt(t)||Cst(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,l)}function Fit(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function qit(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:a,focusOffset:i}=e;Bit&&(Bit=!1,Fit(r,o)&&Fit(a,i))||xst(t,(()=>{if(!n)return void pat(null);if(!Kot(t,r,a))return;const l=qlt();if(Plt(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const o=Bat(t).event,a=o?o.timeStamp:performance.now(),[i,s,c,u,d]=jit,h=dat(),p=!1===t.isComposing()&&""===h.getTextContent();if(a<d+200&&n.offset===c&&n.key===u)l.format=i,l.style=s;else if("text"===n.type){if(!klt(r))throw Error("Point.getNode() must return TextNode when type is text");l.format=r.getFormat(),l.style=r.getStyle()}else if("element"===n.type&&!p){const e=n.getNode();e instanceof Pst&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),a=r.length,s=l.isBackward(),c=s?i:o,u=s?o:i,d=s?t:e,h=s?e:t;let p=255,f=!1;for(let e=0;e<a;e++){const t=r[e],n=t.getTextContentSize();if(klt(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===a-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}Tat(t,lrt,void 0)}))}function Yit(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function Uit(e,t){const n=e._compositionKey;if(oat(null),null!==n&&null!=t){if(""===t){const t=iat(n),r=Jot(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&klt(t)&&xat(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=qlt();if(Plt(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void Tat(e,Nrt,null)}}}wat(!0,e,t)}function Kit(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const Git=new Map;function Xit(e){const t=e.target,n=Yat(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=Got(n.anchorNode);if(null===r)return;$it&&($it=!1,xst(r,(()=>{const t=Ylt(),o=n.anchorNode;if(null===o)return;const a=o.nodeType;1!==a&&3!==a||pat(Flt(t,n,r,e))})));const o=gat(r),a=o[o.length-1],i=a._key,l=Git.get(i),s=l||a;s!==r&&qit(n,s,!1),qit(n,r,!0),r!==a?Git.set(i,r):l&&Git.delete(i)}function Qit(e){e._lexicalHandled=!0}function Jit(e){return!0===e._lexicalHandled}function elt(e,t,n){lst();const r=e.__key,o=e.getParent();if(null===o)return;const a=function(e){const t=qlt();if(!Plt(t)||!Cst(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),a=r.getNode();return Rat(o,e)&&n.set(e.__key,0,"element"),Rat(a,e)&&r.set(e.__key,0,"element"),t}(e);let i=!1;if(Plt(a)&&t){const t=a.anchor,n=a.focus;t.key===r&&(Glt(t,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0),n.key===r&&(Glt(n,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else Hlt(a)&&t&&e.isSelected()&&e.selectPrevious();if(Plt(a)&&t&&!i){const t=e.getIndexWithinParent();nat(e),Ult(a,o,t,-1)}else nat(e);n||Zat(o)||o.canBeEmpty()||!o.isEmpty()||elt(o,t),t&&Nst(o)&&o.isEmpty()&&o.selectEnd()}class tlt{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(e){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,tat(this,e),"root"!==this.__type&&(lst(),function(e,t){const n=ust()._nodes.get(e);if(void 0===n)throw Error(`Create node: Attempted to create node ${t.name} that was not configured to be used on the editor.`);const r=n.klass;if(r!==t)throw Error(`Create node: Type ${e} in node ${t.name} does not match registered node ${r.name} with the same type`)}(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=iat(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||qlt();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(klt(this)||!Plt(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:iat(e)}getParentOrThrow(){const e=this.getParent();if(null===e)throw Error(`Expected node ${this.__key} to have a parent.`);return e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Zat(t)){if(!Cst(e))throw Error("Children of root nodes must be elements");return e}e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();if(null===e)throw Error(`Expected node ${this.__key} to have a top parent element.`);return e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:iat(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:iat(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Cst(this)&&t.unshift(this),Cst(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const a=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(a.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,o=this;for(;;){const e=o.getParentOrThrow();if(e===t){n=o.getIndexWithinParent();break}o=e}for(o=e;;){const e=o.getParentOrThrow();if(e===t){r=o.getIndexWithinParent();break}o=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let o=this;for(;null!==o;){const a=o.__key;if(r.has(a)||(r.add(a),n.push(o)),o===e)break;const i=Cst(o)?t?o.getFirstChild():o.getLastChild():null;if(null!==i){o=i;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(null!==l){o=l;continue}const s=o.getParentOrThrow();if(r.has(s.__key)||n.push(s),s===e)break;let c=null,u=s;do{if(null===u)throw Error("getNodesBetween: ancestor is null");if(c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);o=c}return t||n.reverse(),n}isDirty(){const e=ust()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=iat(this.__key);if(null===e)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return e}getWritable(){lst();const e=cst(),t=ust(),n=e._nodeMap,r=this.__key,o=this.getLatest(),a=o.__parent,i=t._cloneNotNeeded,l=qlt();if(null!==l&&l.setCachedNodes(null),i.has(r))return rat(o),o;const s=o.constructor.clone(o);return s.__parent=a,s.__next=o.__next,s.__prev=o.__prev,Cst(o)&&Cst(s)?(Lst(o)&&Lst(s)&&(s.__textFormat=o.__textFormat),s.__first=o.__first,s.__last=o.__last,s.__size=o.__size,s.__indent=o.__indent,s.__format=o.__format,s.__dir=o.__dir):klt(o)&&klt(s)&&(s.__format=o.__format,s.__style=o.__style,s.__mode=o.__mode,s.__detail=o.__detail),i.add(r),s.__key=r,rat(s),n.set(r,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){throw Error("createDOM: base method not extended")}updateDOM(e,t,n){throw Error("updateDOM: base method not extended")}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(e){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(e){elt(this,!0,e)}replace(e,t){lst();let n=qlt();null!==n&&(n=n.clone()),Wat(this,e);const r=this.getLatest(),o=this.__key,a=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),s=l.__size;nat(i);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(elt(r,!1,!0),null===c?l.__first=a:c.getWritable().__next=a,i.__prev=d,null===u?l.__last=a:u.getWritable().__prev=a,i.__next=h,i.__parent=p,l.__size=s,t){if(!Cst(this)||!Cst(i))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach((e=>{i.append(e)}))}if(Plt(n)){pat(n);const e=n.anchor,t=n.focus;e.key===o&&Olt(e,i),t.key===o&&Olt(t,i)}return aat()===o&&oat(a),i}insertAfter(e,t=!0){lst(),Wat(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),a=qlt();let i=!1,l=!1;if(null!==o){const t=e.getIndexWithinParent();if(nat(r),Plt(a)){const e=o.__key,n=a.anchor,r=a.focus;i="element"===n.type&&n.key===e&&n.offset===t+1,l="element"===r.type&&r.key===e&&r.offset===t+1}}const s=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===s?c.__last=u:s.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Plt(a)){const e=this.getIndexWithinParent();Ult(a,c,e+1);const t=c.__key;i&&a.anchor.set(t,e+2,"element"),l&&a.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){lst(),Wat(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;nat(r);const a=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),l=n.__prev,s=this.getIndexWithinParent();null===a?i.__first=o:a.getWritable().__next=o,i.__size++,n.__prev=o,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const c=qlt();return t&&Plt(c)&&Ult(c,this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return Hst()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){lst();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Cst(n))return n.select();if(!klt(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){lst();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Cst(n))return n.select(0,0);if(!klt(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class nlt extends tlt{static getType(){return"linebreak"}static clone(e){return new nlt(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&ilt(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&ilt(n))return!0}}return!1}(e)?null:{conversion:rlt,priority:0}}}static importJSON(e){return olt()}exportJSON(){return{type:"linebreak",version:1}}}function rlt(e){return{node:olt()}}function olt(){return jat(new nlt)}function alt(e){return e instanceof nlt}function ilt(e){return 3===e.nodeType&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function llt(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function slt(e,t){return 1&t?"strong":2&t?"em":"span"}function clt(e,t,n,r,o){const a=r.classList;let i=Aat(o,"base");void 0!==i&&a.add(...i),i=Aat(o,"underlineStrikethrough");let l=!1;const s=8&t&&4&t;void 0!==i&&(8&n&&4&n?(l=!0,s||a.add(...i)):s&&a.remove(...i));for(const e in Cot){const r=Cot[e];if(i=Aat(o,e),void 0!==i)if(n&r){if(l&&("underline"===e||"strikethrough"===e)){t&r&&a.remove(...i);continue}t&r&&(!s||"underline"!==e)&&"strikethrough"!==e||a.add(...i)}else t&r&&a.remove(...i)}}function ult(e,t,n){const r=t.firstChild,o=n.isComposing(),a=e+(o?bot:"");if(null==r)t.textContent=a;else{const e=r.nodeValue;if(e!==a)if(o||tot){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,a=0;for(;o<n&&o<r&&e[o]===t[o];)o++;for(;a+o<n&&a+o<r&&e[n-a-1]===t[r-a-1];)a++;return[o,n-o-a,t.slice(o,r-a)]}(e,a);0!==n&&r.deleteData(t,n),r.insertData(t,o)}else r.nodeValue=a}}function dlt(e,t,n,r,o,a){ult(o,e,t);const i=a.theme.text;void 0!==i&&clt(0,0,r,e,i)}function hlt(e,t){const n=document.createElement(t);return n.appendChild(e),n}class plt extends tlt{static getType(){return"text"}static clone(e){return new plt(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Oot[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===aat()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Cot[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return eat(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=llt(0,n),o=slt(0,n),a=null===r?o:r,i=document.createElement(a);let l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(o),i.appendChild(l)),dlt(l,this,0,n,this.__text,e);const s=this.__style;return""!==s&&(i.style.cssText=s),i}updateDOM(e,t,n){const r=this.__text,o=e.__format,a=this.__format,i=llt(0,o),l=llt(0,a),s=slt(0,o),c=slt(0,a);if((null===i?s:i)!==(null===l?c:l))return!0;if(i===l&&s!==c){const e=t.firstChild;if(null==e)throw Error("updateDOM: prevInnerDOM is null or undefined");const o=document.createElement(c);return dlt(o,this,0,a,r,n),t.replaceChild(o,e),!1}let u=t;if(null!==l&&null!==i&&(u=t.firstChild,null==u))throw Error("updateDOM: innerDOM is null or undefined");ult(r,u,this);const d=n.theme.text;void 0!==d&&o!==a&&clt(0,o,a,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:blt,priority:0}),b:()=>({conversion:mlt,priority:0}),code:()=>({conversion:xlt,priority:0}),em:()=>({conversion:xlt,priority:0}),i:()=>({conversion:xlt,priority:0}),s:()=>({conversion:xlt,priority:0}),span:()=>({conversion:flt,priority:0}),strong:()=>({conversion:xlt,priority:0}),sub:()=>({conversion:xlt,priority:0}),sup:()=>({conversion:xlt,priority:0}),u:()=>({conversion:xlt,priority:0})}}static importJSON(e){const t=Elt(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);if(null===t||!Uat(t))throw Error("Expected TextNode createDOM to always return a HTMLElement");return t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=hlt(t,"b")),this.hasFormat("italic")&&(t=hlt(t,"i")),this.hasFormat("strikethrough")&&(t=hlt(t,"s")),this.hasFormat("underline")&&(t=hlt(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Cot[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Mot[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=eat(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Aot[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){lst();let n=e,r=t;const o=qlt(),a=this.getTextContent(),i=this.__key;if("string"==typeof a){const e=a.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Plt(o))return jlt(i,n,i,r,"text","text");{const e=aat();e!==o.anchor.key&&e!==o.focus.key||oat(i),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),a=o.__text,i=n.length;let l=e;l<0&&(l=i+l,l<0&&(l=0));const s=qlt();if(r&&Plt(s)){const t=e+i;s.setTextNodeRange(o,t,o,t)}const c=a.slice(0,l)+n+a.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){lst();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=aat(),a=new Set(e),i=[],l=n.length;let s="";for(let e=0;e<l;e++)""!==s&&a.has(e)&&(i.push(s),s=""),s+=n[e];""!==s&&i.push(s);const c=i.length;if(0===c)return[];if(i[0]===n)return[t];const u=i[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),m=t.__detail;let v=!1;t.isSegmented()?(h=Elt(u),h.__format=p,h.__style=f,h.__detail=m,v=!0):(h=t.getWritable(),h.__text=u);const g=qlt(),b=[h];let y=u.length;for(let e=1;e<c;e++){const t=i[e],n=t.length,a=Elt(t).getWritable();a.__format=p,a.__style=f,a.__detail=m;const l=a.__key,s=y+n;if(Plt(g)){const e=g.anchor,t=g.focus;e.key===r&&"text"===e.type&&e.offset>y&&e.offset<=s&&(e.key=l,e.offset-=y,g.dirty=!0),t.key===r&&"text"===t.type&&t.offset>y&&t.offset<=s&&(t.key=l,t.offset-=y,g.dirty=!0)}o===r&&oat(l),y=s,b.push(a)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&rat(t),null!==n&&rat(n)}(this);const w=d.getWritable(),x=this.getIndexWithinParent();return v?(w.splice(x,0,b),this.remove()):w.splice(x,1,b),Plt(g)&&Ult(g,d,x,c-1),b}mergeWithSibling(e){const t=e===this.getPreviousSibling();if(!t&&e!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const n=this.__key,r=e.__key,o=this.__text,a=o.length;aat()===r&&oat(n);const i=qlt();if(Plt(i)){const o=i.anchor,l=i.focus;null!==o&&o.key===r&&(Xlt(o,t,n,e,a),i.dirty=!0),null!==l&&l.key===r&&(Xlt(l,t,n,e,a),i.dirty=!0)}const l=e.__text,s=t?l+o:o+l;this.setTextContent(s);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function flt(e){const t=e.style,n=t.fontWeight,r=t.textDecoration.split(" "),o="700"===n||"bold"===n,a=r.includes("line-through"),i="italic"===t.fontStyle,l=r.includes("underline"),s=t.verticalAlign;return{forChild:e=>klt(e)?(o&&e.toggleFormat("bold"),a&&e.toggleFormat("strikethrough"),i&&e.toggleFormat("italic"),l&&e.toggleFormat("underline"),"sub"===s&&e.toggleFormat("subscript"),"super"===s&&e.toggleFormat("superscript"),e):e,node:null}}function mlt(e){const t="normal"===e.style.fontWeight;return{forChild:e=>(klt(e)&&!t&&e.toggleFormat("bold"),e),node:null}}const vlt=new WeakMap;function glt(e){return"PRE"===e.nodeName||1===e.nodeType&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function blt(e){const t=e;if(null===e.parentElement)throw Error("Expected parentElement of Text not to be null");let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=vlt.get(n))&&!glt(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e<r.length;e++)vlt.set(r[e],o);return o}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(olt()):"\t"===r?t.push(Clt()):""!==r&&t.push(Elt(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=ylt(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=ylt(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Elt(n)}}function ylt(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,1===n.nodeType){const e=n.style.display;if(""===e&&!Kat(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(3===n.nodeType)return n;if("BR"===n.nodeName)return null}}const wlt={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function xlt(e){const t=wlt[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(klt(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function Elt(e=""){return jat(new plt(e))}function klt(e){return e instanceof plt}class Slt extends plt{static getType(){return"tab"}static clone(e){const t=new Slt(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Clt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){throw Error("TabNode does not support setTextContent")}setDetail(e){throw Error("TabNode does not support setDetail")}setMode(e){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Clt(){return jat(new Slt)}function Mlt(e){return e instanceof Slt}class _lt{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Cst(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Cst(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?r<o:t.isBefore(n)}getNode(){const e=iat(this.key);if(null===e)throw Error("Point.getNode: node not found");return e}set(e,t,n){const r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,ist()||(aat()===o&&oat(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Nlt(e,t,n){return new _lt(e,t,n)}function Alt(e,t){let n=t.__key,r=e.offset,o="element";if(klt(t)){o="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Cst(t)){const e=t.getNextSibling();if(klt(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Olt(e,t){if(Cst(t)){const n=t.getLastDescendant();Cst(n)||klt(n)?Alt(e,n):Alt(e,t)}else Alt(e,t)}function Ilt(e,t,n,r){e.key=t,e.offset=n,e.type=r}class Dlt{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Hlt(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Dlt(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(klt(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=iat(e);null!==t&&n.push(t)}return ist()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function Plt(e){return e instanceof Tlt}class Tlt{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Plt(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),o=r?t:n,a=r?n:t;let i=o.getNode(),l=a.getNode();const s=o.offset,c=a.offset;if(Cst(i)){const e=i.getDescendantByIndex(s);i=null!=e?e:i}if(Cst(l)){let e=l.getDescendantByIndex(c);null!==e&&e!==i&&l.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),l=null!=e?e:l}let u;return u=i.is(l)?Cst(i)&&i.getChildrenSize()>0?[]:[i]:i.getNodesBetween(l),ist()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Ilt(this.anchor,e.__key,t,"text"),Ilt(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,a=r.isBefore(o),[i,l]=zlt(this);let s="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Cst(d)&&!d.isInline())c||(s+="\n"),c=!d.isEmpty();else if(c=!1,klt(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=i<l?e.slice(i,l):e.slice(l,i)):e=a?e.slice(i):e.slice(l):d===n&&(e=a?e.slice(0,l):e.slice(0,i)),s+=e}else!kst(d)&&!alt(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){const t=ust(),n=t.getEditorState()._selection,r=Vlt(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[o,a]=r;Ilt(this.anchor,o.key,o.offset,o.type),Ilt(this.focus,a.key,a.offset,a.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Tlt(Nlt(e.key,e.offset,e.type),Nlt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=eat(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Cot[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(olt()):"\t"===r?n.push(Clt()):n.push(Elt(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,o=this.style;let a=t,i=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,i=t),"element"===a.type&&function(e,t,n,r){const o=e.getNode(),a=o.getChildAtIndex(e.offset),i=Elt(),l=Nst(o)?Hst().append(i):i;i.setFormat(n),i.setStyle(r),null===a?o.append(l):a.insertBefore(l),e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}(a,i,r,o);const l=a.offset;let s=i.offset;const c=this.getNodes(),u=c.length;let d=c[0];if(!klt(d))throw Error("insertText: first node is not a text node");const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===i.type&&(s=h,i.set(a.key,s,"text")),this.isCollapsed()&&l===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(klt(t)&&t.canInsertTextBefore()&&!Xot(t)||(t=Elt(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===l&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(klt(t)&&!Xot(t)||(t=Elt(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const e=Elt(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Cst(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Zlt(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Elt(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(l!==s||t===r&&n===o){if(Mlt(d)){const t=Elt(e);return t.setFormat(r),t.setStyle(o),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Elt(e);if(t.setFormat(r),t.setStyle(o),t.select(),0===l)d.insertBefore(t,!1);else{const[e]=d.splitText(l);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(o)}const a=s-l;d=d.spliceText(l,a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Cst(d)?d:d.getParentOrThrow();let r=Cst(f)?f:f.getParentOrThrow(),o=f;if(!n.is(r)&&r.isInline())do{o=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===i.type&&(0!==s||""===f.getTextContent())||"element"===i.type&&f.getIndexWithinParent()<s)if(klt(f)&&!f.isToken()&&s!==f.getTextContentSize()){if(f.isSegmented()){const e=Elt(f.getTextContent());f.replace(e),f=e}Nst(i.getNode())||"text"!==i.type||(f=f.spliceText(0,s,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const a=r.getChildren(),p=new Set(c),m=n.is(r),v=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=a.length-1;e>=0;e--){const t=a[e];if(t.is(d)||Cst(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(o)?m||v.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(l===h)d.select();else{const t=Elt(e);t.select(),d.replace(t)}else d=d.spliceText(l,h-l,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void oat(null);const t=this.getNodes(),n=[];for(const e of t)klt(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void oat(null);const o=this.anchor,a=this.focus,i=this.isBackward(),l=i?a:o,s=i?o:a;let c=0,u=n[0],d="element"===l.type?0:l.offset;if("text"===l.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const m="text"===s.type?s.offset:f.getTextContentSize();if(u.is(f)){if(d===m)return;if(0===d&&m===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,m),t=0===d?e[0]:e[1];t.setFormat(h),"text"===l.type&&l.set(t.__key,0,"text"),"text"===s.type&&s.set(t.__key,m-d,"text")}return void(this.format=h)}0!==d&&([,u]=u.splitText(d),d=0),u.setFormat(h);const v=f.getFormatFlags(e,h);m>0&&(m!==f.getTextContentSize()&&([f]=f.splitText(m)),f.setFormat(v));for(let t=c+1;t<p;t++){const r=n[t];if(!r.isToken()){const t=r.getFormatFlags(e,v);r.setFormat(t)}}"text"===l.type&&l.set(u.__key,d,"text"),"text"===s.type&&s.set(f.__key,m,"text"),this.format=h|v}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=qlt();if(!Plt(t))throw Error("Expected RangeSelection after insertParagraph");return t.insertNodes(e)}const t=Xat((this.isBackward()?this.focus:this.anchor).getNode(),Gat),n=e[e.length-1];if("__language"in t&&Cst(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=Qlt(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Cst(e)||kst(e))&&!e.isInline()))){if(!Cst(t))throw Error("Expected 'firstBlock' to be an ElementNode");const r=Qlt(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Hst();let n=null;for(let r=0;r<e.length;r++){const o=e[r],a=alt(o);if(a||kst(o)&&o.isInline()||Cst(o)&&o.isInline()||klt(o)||o.isParentRequired()){if(null===n&&(n=o.createParentElementNode(),t.append(n),a))continue;null!==n&&n.append(o)}else t.append(o),n=null}return t}(e),o=r.getLastDescendant(),a=r.getChildren(),i=e=>"__value"in e&&"__checked"in e,l=Cst(t)&&t.isEmpty()?null:this.insertParagraph(),s=a[a.length-1];let c=a[0];if((e=>Cst(e)&&Gat(e)&&!e.isEmpty()&&Cst(t)&&(!t.isEmpty()||i(t)))(c)){if(!Cst(t))throw Error("Expected 'firstBlock' to be an ElementNode");t.append(...c.getChildren()),c=a[1]}c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;){if(!r.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");r=r.getNextSibling(),o.push(r)}let a=e;for(const e of o)a=a.insertAfter(e)}(t,c);const u=Xat(o,Gat);l&&Cst(u)&&(i(l)||Gat(s))&&(u.append(...l.getChildren()),l.remove()),Cst(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=Cst(t)?t.getLastChild():null;alt(d)&&u!==t&&d.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Hst();return dat().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Qlt(this),t=Xat(this.anchor.getNode(),Gat);if(!Cst(t))throw Error("Expected ancestor to be an ElementNode");const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=olt();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let a=e[0],i=e[n];const[l,s]=zlt(this);if(0===t)return[];if(1===t){if(klt(a)&&!this.isCollapsed()){const e=l>s?s:l,t=l>s?l:s,n=a.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[a]}const c=r.isBefore(o);if(klt(a)){const t=c?l:s;t===a.getTextContentSize()?e.shift():0!==t&&([,a]=a.splitText(t),e[0]=a)}if(klt(i)){const t=i.getTextContent().length,r=c?s:l;0===r?e.pop():r!==t&&([i]=i.splitText(r),e[n]=i)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,a="move"===e,i=Dat(r,t);if(kst(i)&&!i.isIsolated()){if(a&&i.isKeyboardSelectable()){const e=Wlt();return e.add(i.__key),void pat(e)}const e=t?i.getPreviousSibling():i.getNextSibling();if(klt(e)){const n=e.__key,i=t?e.getTextContent().length:0;return r.set(n,i,"text"),void(a&&o.set(n,i,"text"))}{const n=i.getParentOrThrow();let l,s;return Cst(e)?(s=e.__key,l=t?e.getChildrenSize():0):(l=i.getIndexWithinParent(),s=n.__key,t||l++),r.set(s,l,"element"),void(a&&o.set(s,l,"element"))}}const l=ust(),s=Yat(l._window);if(!s)return;const c=l._blockCursorElement,u=l._rootElement;if(null===u||null===c||!Cst(i)||i.isInline()||i.canBeEmpty()||qat(c,l,u),function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),r=Nst(n)?n:$at(n);if(this.applyDOMRange(e),this.dirty=!0,!a){const n=this.getNodes(),o=[];let a=!1;for(let e=0;e<n.length;e++){const t=n[e];Rat(t,r)?o.push(t):a=!0}if(a&&o.length>0)if(t){const e=o[0];Cst(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Cst(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,a=n.type;Ilt(n,t.key,t.offset,t.type),Ilt(t,r,o,a),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Cst(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Cst(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Dat(r,e);if(kst(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Cst(n)&&0===n.getChildrenSize()){n.remove();const e=Wlt();e.add(o.__key),pat(e)}else o.remove(),ust().dispatchCommand(lrt,void 0);return}if(!e&&Cst(o)&&Cst(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,a=o.getTextContentSize();if(o.is(n)||e&&t!==a||!e&&0!==t)return void Rlt(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,a=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==a)return void Rlt(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,a=r.offset,i=e<a,l=i?e:a,s=i?a:e,c=s-1;l!==c&&(vat(o.getTextContent().slice(l,s))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Nst(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Hlt(e){return e instanceof Dlt}function Llt(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zlt(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Llt(n),Llt(r)]}function Rlt(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),a=o.length;let i=0,l=0;for(let e=0;e<a;e++){const r=e===a-1;if(l=i,i+=o[e].length,t&&i===n||i>n||r){o.splice(e,1),r&&(l=void 0);break}}const s=o.join("").trim();""===s?r.remove():(r.setTextContent(s),r.select(l,l))}function Blt(e,t,n,r){let o,a=t;if(1===e.nodeType){let i=!1;const l=e.childNodes,s=l.length,c=r._blockCursorElement;a===s&&(i=!0,a=s-1);let u=l[a],d=!1;if(u===c)u=l[a+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&a--}if(o=fat(u),klt(o))a=mat(o,i);else{let r=fat(e);if(null===r)return null;if(Cst(r)){a=Math.min(r.getChildrenSize(),a);let e=r.getChildAtIndex(a);if(Cst(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=i?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Cst(e)?e:e.getParentOrThrow()),a=0}klt(e)?(o=e,r=null,a=mat(e,i)):e!==r&&i&&!d&&a++}else{const n=r.getIndexWithinParent();a=0===t&&kst(r)&&fat(e)===r?n:n+1,r=r.getParentOrThrow()}if(Cst(r))return Nlt(r.__key,a,"element")}}else o=fat(e);return klt(o)?Nlt(o.__key,a,"text"):null}function $lt(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),a=o.getParent();if(t){if((n||!t)&&null===r&&Cst(a)&&a.isInline()){const t=a.getPreviousSibling();klt(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Cst(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):klt(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),a=o.getParent();if(t&&Cst(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Cst(a)&&a.isInline()&&!a.canInsertTextAfter()){const t=a.getNextSibling();klt(t)&&(e.key=t.__key,e.offset=0)}}}function Zlt(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);$lt(e,r,o),$lt(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const a=ust();if(a.isComposing()&&a._compositionKey!==e.key&&Plt(n)){const r=n.anchor,o=n.focus;Ilt(e,r.key,r.offset,r.type),Ilt(t,o.key,o.offset,o.type)}}}function Vlt(e,t,n,r,o,a){if(null===e||null===n||!Kot(o,e,n))return null;const i=Blt(e,t,Plt(a)?a.anchor:null,o);if(null===i)return null;const l=Blt(n,r,Plt(a)?a.focus:null,o);if(null===l)return null;if("element"===i.type&&"element"===l.type){const t=fat(e),r=fat(n);if(kst(t)&&kst(r))return null}return Zlt(i,l,a),[i,l]}function jlt(e,t,n,r,o,a){const i=cst(),l=new Tlt(Nlt(e,t,o),Nlt(n,r,a),0,"");return l.dirty=!0,i._selection=l,l}function Wlt(){return new Dlt(new Set)}function Flt(e,t,n,r){const o=n._window;if(null===o)return null;const a=r||o.event,i=a?a.type:void 0,l="selectionchange"===i,s=!Dot&&(l||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&a&&3===a.detail||"drop"===i||void 0===i);let c,u,d,h;if(Plt(e)&&!s)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,l&&Plt(e)&&!Kot(n,c,u))return e.clone();const p=Vlt(c,d,u,h,n,e);if(null===p)return null;const[f,m]=p;return new Tlt(f,m,Plt(e)?e.format:0,Plt(e)?e.style:"")}function qlt(){return cst()._selection}function Ylt(){return ust()._editorState._selection}function Ult(e,t,n,r=1){const o=e.anchor,a=e.focus,i=o.getNode(),l=a.getNode();if(!t.is(i)&&!t.is(l))return;const s=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);o.set(s,n,"element"),a.set(s,n,"element"),Klt(e)}}else{const i=e.isBackward(),l=i?a:o,c=l.getNode(),u=i?o:a,d=u.getNode();if(t.is(c)){const e=l.offset;(n<=e&&r>0||n<e&&r<0)&&l.set(s,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(s,Math.max(0,e+r),"element")}}Klt(e)}function Klt(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,a=t.getNode(),i=r.getNode();if(e.isCollapsed()){if(!Cst(a))return;const e=a.getChildrenSize(),o=n>=e,i=o?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(klt(i)){let e=0;o&&(e=i.getTextContentSize()),t.set(i.__key,e,"text"),r.set(i.__key,e,"text")}}else{if(Cst(a)){const e=a.getChildrenSize(),r=n>=e,o=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(klt(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Cst(i)){const e=i.getChildrenSize(),t=o>=e,n=t?i.getChildAtIndex(e-1):i.getChildAtIndex(o);if(klt(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Glt(e,t,n,r,o){let a=null,i=0,l=null;null!==r?(a=r.__key,klt(r)?(i=r.getTextContentSize(),l="text"):Cst(r)&&(i=r.getChildrenSize(),l="element")):null!==o&&(a=o.__key,klt(o)?l="text":Cst(o)&&(l="element")),null!==a&&null!==l?e.set(a,i,l):(i=t.getIndexWithinParent(),-1===i&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function Xlt(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function Qlt(e){let t=e;e.isCollapsed()||t.removeText();const n=qlt();if(Plt(n)&&(t=n),!Plt(t))throw Error("Unexpected dirty selection to be null");const r=t.anchor;let o=r.getNode(),a=r.offset;for(;!Gat(o);)[o,a]=Jlt(o,a);return a}function Jlt(e,t){const n=e.getParent();if(!n){const e=Hst();return dat().append(e),e.select(),[dat(),0]}if(klt(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Cst(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Tlt(Nlt(e.__key,t,"element"),Nlt(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let est=null,tst=null,nst=!1,rst=!1,ost=0;const ast={characterData:!0,childList:!0,subtree:!0};function ist(){return nst||null!==est&&est._readOnly}function lst(){if(nst)throw Error("Cannot use method in read-only mode.")}function sst(){if(ost>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function cst(){if(null===est)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return est}function ust(){if(null===tst)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return tst}function dst(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);if(void 0===n)throw Error(`registeredNode: Type ${t} not found`);return n}(e,r);let a=n.get(r);void 0===a&&(a=Array.from(o.transforms),n.set(r,a));const i=a.length;for(let e=0;e<i&&(a[e](t),t.isAttached());e++);}function hst(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function pst(e,t){const n=e.type,r=t.get(n);if(void 0===r)throw Error(`parseEditorState: type "${n}" + not found`);const o=r.klass;if(e.type!==o.getType())throw Error(`LexicalNode: Node ${o.name} does not implement .importJSON().`);const a=o.importJSON(e),i=e.children;if(Cst(a)&&Array.isArray(i))for(let e=0;e<i.length;e++){const n=pst(i[e],t);a.append(n)}return a}function fst(e,t){const n=est,r=nst,o=tst;est=e,nst=!0,tst=null;try{return t()}finally{est=n,nst=r,tst=o}}function mst(e){const t=e._nodeMap;t.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},t.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},t.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function vst(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const a=e._editorState,i=a._selection,l=n._selection,s=0!==e._dirtyType,c=est,u=nst,d=tst,h=e._updating,p=e._observer;let f=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==p){tst=e,est=n,nst=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;p.disconnect(),f=function(e,t,n,r,o,a){cit="",hit="",uit="",pit=2===r,mit=null,eit=n,Jat=n._config,tit=n._nodes,nit=eit._listeners.mutation,rit=o,oit=a,ait=e._nodeMap,iit=t._nodeMap,fit=t._readOnly,lit=new Map(n._keyToDOMMap);const i=new Map;return sit=i,Nit("root",null),eit=void 0,tit=void 0,rit=void 0,oit=void 0,ait=void 0,iit=void 0,Jat=void 0,lit=void 0,sit=void 0,i}(a,n,e,t,r,o)}catch(t){if(t instanceof Error&&e._onError(t),rst)throw t;return zst(e,null,r,n),$ot(e),e._dirtyType=2,rst=!0,vst(e,a),void(rst=!1)}finally{p.observe(r,ast),e._updating=h,est=c,nst=u,tst=d}}n._readOnly||(n._readOnly=!0,mst(n),Plt(l)&&(Object.freeze(l.anchor),Object.freeze(l.focus)),Object.freeze(l));const m=e._dirtyLeaves,v=e._dirtyElements,g=e._normalizedNodes,b=e._updateTags,y=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const o=t._nodeMap;let a;for(a in r)o.has(a)||(r===n&&(r=cat(e)),delete r[a])}(e,n);const w=o?null:Yat(e._window);if(e._editable&&null!==w&&(s||null===l||l.dirty)){tst=e,est=n;try{if(null!==p&&p.disconnect(),s||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&qat(t,e,r),function(e,t,n,r,o,a){const i=r.anchorNode,l=r.focusNode,s=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(o.has("collaboration")&&u!==a||null!==u&&Uot(u))return;if(!Plt(t))return void(null!==e&&Kot(n,i,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,p=d.key,f=h.key,m=Lat(n,p),v=Lat(n,f),g=d.offset,b=h.offset,y=t.format,w=t.style,x=t.isCollapsed();let E=m,k=v,S=!1;if("text"===d.type){E=Jot(m);const e=d.getNode();S=e.getFormat()!==y||e.getStyle()!==w}else Plt(e)&&"text"===e.anchor.type&&(S=!0);if("text"===h.type&&(k=Jot(v)),null!==E&&null!==k&&(x&&(null===e||S||Plt(e)&&(e.format!==y||e.style!==w))&&function(e,t,n,r,o){jit=[e,t,n,r,o]}(y,w,g,p,performance.now()),s!==g||c!==b||i!==E||l!==k||"Range"===r.type&&x||(null!==u&&a.contains(u)||a.focus({preventScroll:!0}),"element"===d.type))){try{r.setBaseAndExtent(E,g,k,b)}catch(e){console.warn(e)}if(!o.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==a&&a===document.activeElement){const e=t instanceof Tlt&&"element"===t.anchor.type?E.childNodes[g]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:a,bottom:i}=t,l=0,s=0,c=n;for(;null!==c;){const t=c===r.body;if(t)l=0,s=Bat(e).innerHeight;else{const e=c.getBoundingClientRect();l=e.top,s=e.bottom}let n=0;if(a<l?n=-(l-a):i>s&&(n=i-s),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;a-=t,i-=t}if(t)break;c=zat(c)}}(n,t,a)}}Bit=!0}}(i,l,e,w,b,r)}(function(e,t,n){let r=e._blockCursorElement;if(Plt(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,a=o.getNode(),i=o.offset;let l=!1,s=null;if(i===a.getChildrenSize())Fat(a.getChildAtIndex(i-1))&&(l=!0);else{const t=a.getChildAtIndex(i);if(Fat(t)){const n=t.getPreviousSibling();(null===n||Fat(n))&&(l=!0,s=e.getElementByKey(t.__key))}}if(l){const n=e.getElementByKey(a.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Iot(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===s?n.appendChild(r):n.insertBefore(r,s))}}null!==r&&qat(r,e,t)})(e,r,l),null!==p&&p.observe(r,ast)}finally{tst=d,est=c}}null!==f&&function(e,t,n,r,o){const a=Array.from(e._listeners.mutation),i=a.length;for(let e=0;e<i;e++){const[i,l]=a[e],s=t.get(l);void 0!==s&&i(s,{dirtyLeaves:r,prevEditorState:o,updateTags:n})}}(e,f,b,m,a),Plt(l)||null===l||null!==i&&i.is(l)||e.dispatchCommand(lrt,void 0);const x=e._pendingDecorators;null!==x&&(e._decorators=x,e._pendingDecorators=null,gst("decorator",e,!0,x)),function(e,t,n){const r=uat(t),o=uat(n);r!==o&&gst("textcontent",e,!0,o)}(e,t||a,n),gst("update",e,!0,{dirtyElements:v,dirtyLeaves:m,editorState:n,normalizedNodes:g,prevEditorState:t||a,tags:b}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;wst(e,t,r)}}}(e)}function gst(e,t,n,...r){const o=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function bst(e,t,n){if(!1===e._updating||tst!==e){let r=!1;return e.update((()=>{r=bst(e,t,n)})),r}const r=gat(e);for(let o=4;o>=0;o--)for(let a=0;a<r.length;a++){const i=r[a]._commands.get(t);if(void 0!==i){const t=i[o];if(void 0!==t){const r=Array.from(t),o=r.length;for(let t=0;t<o;t++)if(!0===r[t](n,e))return!0}}}return!1}function yst(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,o]=t;let a,i;void 0!==o&&(a=o.onUpdate,i=o.tag,o.skipTransforms&&(r=!0),a&&e._deferred.push(a),i&&e._updateTags.add(i)),n()}}return r}function wst(e,t,n){const r=e._updateTags;let o,a,i=!1,l=!1;void 0!==n&&(o=n.onUpdate,a=n.tag,null!=a&&r.add(a),i=n.skipTransforms||!1,l=n.discrete||!1),o&&e._deferred.push(o);const s=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new Ist(new Map((c||s)._nodeMap)),u=!0),c._flushSync=l;const d=est,h=nst,p=tst,f=e._updating;est=c,nst=!1,e._updating=!0,tst=e;try{u&&(e._headless?null!==s._selection&&(c._selection=s._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=Yat(e._window);return Plt(t)||null==t?Flt(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),i=yst(e,i),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Plt(r)){const e=r.anchor,t=r.focus;let o;if("text"===e.type&&(o=e.getNode(),o.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();o!==e&&e.selectionTransform(n,r)}}}(c,e),0!==e._dirtyType&&(i?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);klt(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&jot(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,o=e._nodeMap,a=aat(),i=new Map;let l=n,s=l.size,c=r,u=c.size;for(;s>0||u>0;){if(s>0){t._dirtyLeaves=new Set;for(const e of l){const r=o.get(e);klt(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&jot(r),void 0!==r&&hst(r,a)&&dst(t,r,i),n.add(e)}if(l=t._dirtyLeaves,s=l.size,s>0){ost++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],l=e[1];if("root"!==n&&!l)continue;const s=o.get(n);void 0!==s&&hst(s,a)&&dst(t,s,i),r.set(n,l)}l=t._dirtyLeaves,s=l.size,c=t._dirtyElements,u=c.size,ost++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),yst(e),function(e,t,n,r){const o=e._nodeMap,a=t._nodeMap,i=[];for(const[e]of r){const t=a.get(e);void 0!==t&&(t.isAttached()||(Cst(t)&&Qat(t,e,o,a,i,r),o.has(e)||r.delete(e),i.push(e)))}for(const e of i)a.delete(e);for(const e of n){const t=a.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Plt(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;if(void 0===e.get(t)||void 0===e.get(n))throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Hlt(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void vst(e)}finally{est=d,nst=h,tst=p,e._updating=f,ost=0}const m=0!==e._dirtyType||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,vst(e)):u&&Yot((()=>{vst(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function xst(e,t,n){e._updating?e._updates.push([t,n]):wst(e,t,n)}class Est extends tlt{constructor(e){super(e)}decorate(e,t){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function kst(e){return e instanceof Est}class Sst extends tlt{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Not[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=ust()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(klt(t)&&e.push(t),Cst(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Cst(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Cst(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Cst(e)&&e.getLastDescendant()||e||null}const r=t[e];return Cst(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:iat(e)}getFirstChildOrThrow(){const e=this.getFirstChild();if(null===e)throw Error(`Expected node ${this.__key} to have a first child.`);return e}getLastChild(){const e=this.getLatest().__last;return null===e?null:iat(e)}getLastChildOrThrow(){const e=this.getLastChild();if(null===e)throw Error(`Expected node ${this.__key} to have a last child.`);return e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContent(),Cst(o)&&r!==n-1&&!o.isInline()&&(e+=yot)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContentSize(),Cst(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=_ot[e];return!!(this.getFormat()&t)}return!1}select(e,t){lst();const n=qlt();let r=e,o=t;const a=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(klt(e)||Cst(e))return e.select(0,0)}else if(!(void 0!==e&&e!==a||void 0!==t&&t!==a)){const e=this.getLastChild();if(klt(e)||Cst(e))return e.select()}void 0===r&&(r=a),void 0===o&&(o=a);const i=this.__key;return Plt(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):jlt(i,r,i,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?_ot[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),a=this.getWritable(),i=a.__key,l=[],s=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){if(null===e)throw Error("splice: sibling not found");const t=e.getNextSibling(),n=e.__key;nat(e.getWritable()),s.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===i&&d--,nat(r);const o=t.__key;if(null===h)a.__first=o,r.__prev=null;else{const e=h.getWritable();e.__next=o,r.__prev=e.__key}if(t.__key===i)throw Error("append: attempting to append self");r.__parent=i,l.push(o),h=t}if(e+t===o)null!==h&&(h.getWritable().__next=null,a.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(a.__size=d,s.length){const e=qlt();if(Plt(e)){const t=new Set(s),n=new Set(l),{anchor:r,focus:o}=e;Mst(r,t,n)&&Glt(r,r.getNode(),this,u,c),Mst(o,t,n)&&Glt(o,o.getNode(),this,u,c),0!==d||this.canBeEmpty()||Zat(this)||this.remove()}}return a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Cst(e){return e instanceof Sst}function Mst(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class _st extends Sst{static getType(){return"root"}static clone(){return new _st}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const e=this.__cachedText;return!ist()&&0!==ust()._dirtyType||null===e?super.getTextContent():e}remove(){throw Error("remove: cannot be called on root nodes")}replace(e){throw Error("replace: cannot be called on root nodes")}insertBefore(e){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(e){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(!Cst(n)&&!kst(n))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...e)}static importJSON(e){const t=dat();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Nst(e){return e instanceof _st}function Ast(){return new Ist(new Map([["root",new _st]]))}function Ost(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(Cst(e)){const r=t.children;if(!Array.isArray(r))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`);const o=e.getChildren();for(let e=0;e<o.length;e++){const t=Ost(o[e]);r.push(t)}}return t}class Ist{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return fst(this,e)}clone(e){const t=new Ist(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return fst(this,(()=>({root:Ost(dat())})))}}class Dst extends Sst{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Pst extends Sst{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Cot[e];return!!(this.getTextFormat()&t)}static clone(e){return new Pst(e.__key)}createDOM(e){const t=document.createElement("p"),n=Aat(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Tst,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Uat(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Hst();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Hst();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||klt(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Tst(e){const t=Hst();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Hst(){return jat(new Pst)}function Lst(e){return e instanceof Pst}function zst(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Ast(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const a=e._observer;null!==a&&(a.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Rst{constructor(e,t,n,r,o,a,i){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=bat(),this._onError=o,this._htmlConversions=a,this._editable=i,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){if(void 0===n)throw Error('Listener for type "command" requires a "priority".');const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);if(void 0===o)throw Error(`registerCommand: Command ${String(e)} not found in command map`);const a=o[n];return a.add(t),()=>{a.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){if(void 0===this._nodes.get(e.getType()))throw Error(`Node ${e.name} has not been registered. Ensure node has been passed to createEditor.`);const n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);if(void 0===r)throw Error(`Node ${e.name} has not been registered. Ensure node has been passed to createEditor.`);return r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var a;return a=e.getType(),xst(this,(()=>{const e=cst();if(e.isEmpty())return;if("root"===a)return void dat().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Tat(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Aat(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,zst(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Rit.get(t);if(void 0===n)throw Error("Root element not registered");const r=n-1;if(!(r>=0))throw Error("Root element count less than 0");Rit.set(t,r),0===r&&t.removeEventListener("selectionchange",Xit);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=gat(e),n=t[t.length-1]._key;Git.get(n)===e&&Git.delete(n)}else Git.delete(e._key)}(o),e.__lexicalEditor=null);const a=Kit(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,$ot(this),this._updateTags.add("history-merge"),vst(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=Rit.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Xit),Rit.set(n,(r||0)+1),e.__lexicalEditor=t;const o=Kit(e);for(let n=0;n<Pit.length;n++){const[r,a]=Pit[n],i="function"==typeof a?e=>{Jit(e)||(Qit(e),(t.isEditable()||"click"===r)&&a(e,t))}:e=>{if(!Jit(e)&&(Qit(e),t.isEditable()))switch(r){case"cut":return Tat(t,jrt,e);case"copy":return Tat(t,Vrt,e);case"paste":return Tat(t,frt,e);case"dragstart":return Tat(t,Brt,e);case"dragover":return Tat(t,$rt,e);case"dragend":return Tat(t,Zrt,e);case"focus":return Tat(t,Krt,e);case"blur":return Tat(t,Grt,e);case"drop":return Tat(t,zrt,e)}};e.addEventListener(r,i),o.push((()=>{e.removeEventListener(r,i)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;gst("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){if(e.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");Bot(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),vst(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),vst(this)}parseEditorState(e,t){return function(e,t,n){const r=Ast(),o=est,a=nst,i=tst,l=t._dirtyElements,s=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,est=r,nst=!1,tst=t;try{const o=t._nodes;pst(e.root,o),n&&n(),r._readOnly=!0,mst(r)}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=l,t._dirtyLeaves=s,t._cloneNotNeeded=c,t._dirtyType=u,est=o,nst=a,tst=i}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){xst(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),xst(this,(()=>{const e=qlt(),n=dat();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Yat(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,gst("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}var Bst=Object.freeze({__proto__:null,$addUpdateTag:function(e){lst(),ust()._updateTags.add(e)},$applyNodeReplacement:jat,$copyNode:Vat,$createLineBreakNode:olt,$createNodeSelection:Wlt,$createParagraphNode:Hst,$createPoint:Nlt,$createRangeSelection:function(){const e=Nlt("root",0,"element"),t=Nlt("root",0,"element");return new Tlt(e,t,0,"")},$createRangeSelectionFromDom:function(e,t){return Flt(null,e,t,null)},$createTabNode:Clt,$createTextNode:Elt,$getAdjacentNode:Dat,$getCharacterOffsets:zlt,$getEditor:function(){return ust()},$getNearestNodeFromDOMNode:sat,$getNearestRootOrShadowRoot:$at,$getNodeByKey:iat,$getPreviousSelection:Ylt,$getRoot:dat,$getSelection:qlt,$getTextContent:function(){const e=qlt();return null===e?"":e.getTextContent()},$hasAncestor:Rat,$hasUpdateTag:function(e){return ust()._updateTags.has(e)},$insertNodes:function(e){let t=qlt()||Ylt();null===t&&(t=dat().selectEnd()),t.insertNodes(e)},$isBlockElementNode:function(e){return Cst(e)&&!e.isInline()},$isDecoratorNode:kst,$isElementNode:Cst,$isInlineElementOrDecoratorNode:function(e){return Cst(e)&&e.isInline()||kst(e)&&e.isInline()},$isLeafNode:function(e){return klt(e)||alt(e)||kst(e)},$isLineBreakNode:alt,$isNodeSelection:Hlt,$isParagraphNode:Lst,$isRangeSelection:Plt,$isRootNode:Nst,$isRootOrShadowRoot:Zat,$isTabNode:Mlt,$isTextNode:klt,$nodesOfType:function(e){const t=cst(),n=t._readOnly,r=e.getType(),o=t._nodeMap,a=[];for(const[,t]of o)t instanceof e&&t.__type===r&&(n||t.isAttached())&&a.push(t);return a},$normalizeSelection__EXPERIMENTAL:Wot,$parseSerializedNode:function(e){return pst(e,ust()._nodes)},$selectAll:function(){const e=dat();pat(Wot(e.select(0,e.getChildrenSize())))},$setCompositionKey:oat,$setSelection:pat,$splitNode:function(e,t){let n=e.getChildAtIndex(t);if(null==n&&(n=e),Zat(e))throw Error("Can not call $splitNode() on root element");const r=e=>{const t=e.getParentOrThrow(),o=Zat(t),a=e!==n||o?Vat(e):e;if(o){if(!Cst(e)||!Cst(a))throw Error("Children of a root must be ElementNode");return e.insertAfter(a),[e,a,a]}{const[n,o,i]=r(t),l=e.getNextSiblings();return i.append(a,...l),[n,o,a]}},[o,a]=r(n);return[o,a]},ArtificialNode__DO_NOT_USE:Dst,BLUR_COMMAND:Grt,CAN_REDO_COMMAND:Yrt,CAN_UNDO_COMMAND:Urt,CLEAR_EDITOR_COMMAND:Frt,CLEAR_HISTORY_COMMAND:qrt,CLICK_COMMAND:crt,COMMAND_PRIORITY_CRITICAL:4,COMMAND_PRIORITY_EDITOR:0,COMMAND_PRIORITY_HIGH:3,COMMAND_PRIORITY_LOW:1,COMMAND_PRIORITY_NORMAL:2,CONTROLLED_TEXT_INSERTION_COMMAND:prt,COPY_COMMAND:Vrt,CUT_COMMAND:jrt,DELETE_CHARACTER_COMMAND:urt,DELETE_LINE_COMMAND:grt,DELETE_WORD_COMMAND:vrt,DRAGEND_COMMAND:Zrt,DRAGOVER_COMMAND:$rt,DRAGSTART_COMMAND:Brt,DROP_COMMAND:zrt,DecoratorNode:Est,ElementNode:Sst,FOCUS_COMMAND:Krt,FORMAT_ELEMENT_COMMAND:Rrt,FORMAT_TEXT_COMMAND:brt,INDENT_CONTENT_COMMAND:Hrt,INSERT_LINE_BREAK_COMMAND:drt,INSERT_PARAGRAPH_COMMAND:hrt,INSERT_TAB_COMMAND:Trt,KEY_ARROW_DOWN_COMMAND:_rt,KEY_ARROW_LEFT_COMMAND:Srt,KEY_ARROW_RIGHT_COMMAND:Ert,KEY_ARROW_UP_COMMAND:Mrt,KEY_BACKSPACE_COMMAND:Ort,KEY_DELETE_COMMAND:Drt,KEY_DOWN_COMMAND:xrt,KEY_ENTER_COMMAND:Nrt,KEY_ESCAPE_COMMAND:Irt,KEY_MODIFIER_COMMAND:Xrt,KEY_SPACE_COMMAND:Art,KEY_TAB_COMMAND:Prt,LineBreakNode:nlt,MOVE_TO_END:krt,MOVE_TO_START:Crt,OUTDENT_CONTENT_COMMAND:Lrt,PASTE_COMMAND:frt,ParagraphNode:Pst,REDO_COMMAND:wrt,REMOVE_TEXT_COMMAND:mrt,RootNode:_st,SELECTION_CHANGE_COMMAND:lrt,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:srt,SELECT_ALL_COMMAND:Wrt,TabNode:Slt,TextNode:plt,UNDO_COMMAND:yrt,createCommand:irt,createEditor:function(e){const t=e||{},n=tst,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,a=t.disableEvents||!1,i=Ast(),l=t.namespace||(null!==o?o._config.namespace:bat()),s=t.editorState,c=[_st,plt,nlt,Slt,Pst,Dst,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}{const e=t.name;if("RootNode"!==e){const n=t.prototype;["getType","clone"].forEach((n=>{t.hasOwnProperty(n)||console.warn(`${e} must implement static "${n}" method`)})),!t.hasOwnProperty("importDOM")&&t.hasOwnProperty("exportDOM")&&console.warn(`${e} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),n instanceof Est&&(n.hasOwnProperty("decorate")||console.warn(`${n.constructor.name} must implement "decorate" method`)),t.hasOwnProperty("importJSON")||console.warn(`${e} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),n.hasOwnProperty("exportJSON")||console.warn(`${e} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const o=t.getType(),a=t.transform(),i=new Set;null!==a&&i.add(a),p.set(o,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:i})}}const f=new Rst(i,o,p,{disableEvents:a,namespace:l,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,o=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(p,d?d.import:void 0),h);return void 0!==s&&(f._pendingEditorState=s,f._dirtyType=2),f},getNearestEditorFromDOMNode:Got,isBlockDomNode:function(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)},isCurrentlyReadOnlyMode:ist,isHTMLAnchorElement:function(e){return Uat(e)&&"A"===e.tagName},isHTMLElement:Uat,isInlineDomNode:Kat,isSelectionCapturedInDecoratorInput:Uot,isSelectionWithinEditor:Kot});const $st={},Zst={},Vst={},jst={},Wst={},Fst={},qst={},Yst={},Ust={},Kst={},Gst={},Xst={},Qst={},Jst={},ect={},tct={},nct={},rct={},oct={},act={},ict={},lct={},sct={},cct={},uct={},dct={},hct={},pct={},fct={},mct={},vct={},gct={},bct={},yct={},wct={},xct={};var Ect=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const kct="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Sct=kct&&"documentMode"in document?document.documentMode:null,Cct=kct&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Mct=kct&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_ct=!(!kct||!("InputEvent"in window)||Sct)&&"getTargetRanges"in new window.InputEvent("input"),Nct=kct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Act=kct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Oct=kct&&/Android/.test(navigator.userAgent),Ict=kct&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dct=kct&&Oct&&Ict,Pct=kct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ict,Tct=0,Hct=1,Lct=2,zct=1,Rct=2,Bct=3,$ct=4,Zct=5,Vct=6,jct=Nct||Act||Pct?" ":"​",Wct="\n\n",Fct=Mct?" ":jct,qct="֑-߿יִ-﷽ﹰ-ﻼ",Yct="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Uct=new RegExp("^[^"+Yct+"]*["+qct+"]"),Kct=new RegExp("^[^"+qct+"]*["+Yct+"]"),Gct={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},Xct={directionless:1,unmergeable:2},Qct={center:2,end:6,justify:4,left:1,right:3,start:5},Jct={[Rct]:"center",[Vct]:"end",[$ct]:"justify",[zct]:"left",[Bct]:"right",[Zct]:"start"},eut={normal:0,segmented:2,token:1},tut={[Tct]:"normal",[Lct]:"segmented",[Hct]:"token"};function nut(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let rut=!1,out=0;function aut(e){out=e.timeStamp}function iut(e,t,n){return t.__lexicalLineBreak===e||void 0!==e[`__lexicalKey_${n._key}`]}function lut(e,t,n){const r=bdt(n._window);let o=null,a=null;null!==r&&r.anchorNode===e&&(o=r.anchorOffset,a=r.focusOffset);const i=e.nodeValue;null!==i&&qut(t,i,o,a,!1)}function sut(e,t,n){if(opt(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return 3===t.nodeType&&n.isAttached()}function cut(e,t,n){rut=!0;const r=performance.now()-out>100;try{Fpt(e,(()=>{const o=gpt()||function(e){return e.getEditorState().read((()=>{const e=gpt();return null!==e?e.clone():null}))}(e),a=new Map,i=e.getRootElement(),l=e._editorState,s=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,p=d.target;let f=Put(p,l);if(!(null===f&&p!==i||Ypt(f)))if("characterData"===h)r&&Uht(f)&&sut(o,p,f)&&lut(p,f,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],o=Dut(r),a=r.parentNode;if(null!=a&&r!==s&&null===o&&("BR"!==r.nodeName||!iut(r,a,e))){if(Mct){const e=r.innerText||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let o=0;o<r;o++){const r=n[o];("BR"===r.nodeName&&iut(r,p,e)||s===r)&&(p.appendChild(r),t++)}r!==t&&(p===i&&(f=zut(l)),a.set(p,f))}}}if(a.size>0)for(const[t,n]of a)if(Kpt(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n<r.length;n++){const a=r[n],i=e.getElementByKey(a);null!==i&&(null==o?(t.appendChild(i),o=i):o!==i&&t.replaceChild(i,o),o=o.nextSibling)}}else Uht(n)&&n.markDirty();const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,o=n.target;for(let t=0;t<r.length;t++){const n=r[t],a=n.parentNode;null==a||"BR"!==n.nodeName||iut(n,o,e)||a.removeChild(n)}}n.takeRecords()}null!==o&&(c&&(o.dirty=!0,Rut(o)),Mct&&odt(e)&&o.insertRawText(u))}))}finally{rut=!1}}function uut(e){const t=e._observer;null!==t&&cut(e,t.takeRecords(),t)}function dut(e){!function(e){0===out&&udt(e).addEventListener("textInput",aut,!0)}(e),e._observer=new MutationObserver(((t,n)=>{cut(e,t,n)}))}function hut(e,t){const n=e.__mode,r=e.__format,o=e.__style,a=t.__mode,i=t.__format,l=t.__style;return!(null!==n&&n!==a||null!==r&&r!==i||null!==o&&o!==l)}function put(e,t){const n=e.mergeWithSibling(t),r=Hpt()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function fut(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Uht(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(hut(t,r)){r=put(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Uht(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(hut(r,n)){r=put(r,n);break}break}n.remove()}}else r.remove()}function mut(e){return vut(e.anchor),vut(e.focus),e}function vut(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),Uht(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Kpt(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let gut=1;const but="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function yut(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Ypt(Put(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function wut(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!yut(t)&&xut(t)===e}catch(e){return!1}}function xut(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=sdt(t)}return null}function Eut(e){return e.isToken()||e.isSegmented()}function kut(e){return 3===e.nodeType}function Sut(e){let t=e;for(;null!=t;){if(kut(t))return t;t=t.firstChild}return null}function Cut(e,t,n){const r=Gct[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Gct.superscript:"superscript"===t&&(o&=~Gct.subscript),o}function Mut(e,t){if(null!=t)return void(e.__key=t);Dpt(),Ppt();const n=Hpt(),r=Tpt(),o=""+gut++;r._nodeMap.set(o,e),Kpt(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}function _ut(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),a=e.getNextSibling();if(null===o)if(null!==a){const e=a.getWritable();r.__first=a.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==a){const t=a.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===a)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=a.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function Nut(e){Ppt();const t=e.getLatest(),n=t.__parent,r=Tpt(),o=Hpt(),a=r._nodeMap,i=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,a,i);const l=t.__key;o._dirtyType=1,Kpt(e)?i.set(l,!0):o._dirtyLeaves.add(l)}function Aut(e){Dpt();const t=Hpt(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Iut(n);null!==e&&e.getWritable()}if(null!==e){const t=Iut(e);null!==t&&t.getWritable()}}}function Out(){return Ipt()?null:Hpt()._compositionKey}function Iut(e,t){const n=(t||Tpt())._nodeMap.get(e);return void 0===n?null:n}function Dut(e,t){const n=e[`__lexicalKey_${Hpt()._key}`];return void 0!==n?Iut(n,t):null}function Put(e,t){let n=e;for(;null!=n;){const e=Dut(n,t);if(null!==e)return e;n=sdt(n)}return null}function Tut(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Hut(e){return e.read((()=>Lut().getTextContent()))}function Lut(){return zut(Tpt())}function zut(e){return e._nodeMap.get("root")}function Rut(e){Dpt();const t=Tpt();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function But(e){const t=Hpt(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=sdt(n)}return null}(e,t);return null===n?e===t.getRootElement()?Iut("root"):null:Iut(n)}function $ut(e,t){return t?e.getTextContentSize():0}function Zut(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Vut(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function jut(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Wut(e){return 3===e.nodeType?e.nodeValue:null}function Fut(e,t,n){const r=bdt(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:a,focusOffset:i}=r;if(null!==o){let t=Wut(o);const r=Put(o);if(null!==t&&Uht(r)){if(t===jct&&n){const e=n.length;t=n,a=e,i=e}null!==t&&qut(r,t,a,i,e)}}}function qut(e,t,n,r,o){let a=e;if(a.isAttached()&&(o||!a.isDirty())){const i=a.isComposing();let l=t;(i||o)&&t[t.length-1]===jct&&(l=t.slice(0,-1));const s=a.getTextContent();if(o||l!==s){if(""===l){if(Aut(null),Nct||Act||Pct)a.remove();else{const e=Hpt();setTimeout((()=>{e.update((()=>{a.isAttached()&&a.remove()}))}),20)}return}const t=a.getParent(),o=bpt(),s=a.getTextContentSize(),c=Out(),u=a.getKey();if(a.isToken()||null!==c&&u===c&&!i||opt(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!a.canInsertTextBefore()&&!i||o.focus.key===e.__key&&o.focus.offset===s&&!a.canInsertTextAfter()&&!i))return void a.markDirty();const d=gpt();if(!opt(d)||null===n||null===r)return void a.setTextContent(l);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){const e=Yht(a.getTextContent());a.replace(e),a=e}a.setTextContent(l)}}}function Yut(e){return"ArrowLeft"===e}function Uut(e){return"ArrowRight"===e}function Kut(e,t){return Cct?e:t}function Gut(e){return"Enter"===e}function Xut(e){return"Backspace"===e}function Qut(e){return"Delete"===e}function Jut(e,t,n){return"KeyA"===e&&Kut(t,n)}function edt(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=nut(o);return n[t]=e,e}return o}function tdt(e,t,n,r,o){if(0===n.size)return;const a=r.__type,i=r.__key,l=t.get(a);void 0===l&&Ect(33,a);const s=l.klass;let c=e.get(s);void 0===c&&(c=new Map,e.set(s,c));const u=c.get(i),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(i,d?"updated":o)}function ndt(e,t,n){const r=e.getParent();let o=n,a=e;return null!==r&&(t&&0===n?(o=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(o=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?o-1:o)}function rdt(e,t){const n=e.offset;if("element"===e.type)return ndt(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?ndt(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function odt(e){const t=udt(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function adt(e,t,n){return Vpt(e,t,n)}function idt(e){return!Qpt(e)&&!e.isLastChild()&&!e.isInline()}function ldt(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Ect(75,t),n}function sdt(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function cdt(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function udt(e){const t=e._window;return null===t&&Ect(78),t}function ddt(e){let t=e.getParentOrThrow();for(;null!==t;){if(hdt(t))return t;t=t.getParentOrThrow()}return t}function hdt(e){return Qpt(e)||Kpt(e)&&e.isShadowRoot()}function pdt(e){const t=e.constructor.clone(e);return Mut(t,null),t}function fdt(e){const t=Hpt(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Ect(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Ect(98),t}return e}function mdt(e,t){!Qpt(e.getParent())||Kpt(t)||Ypt(t)||Ect(99)}function vdt(e){return(Ypt(e)||Kpt(e)&&!e.canBeEmpty())&&!e.isInline()}function gdt(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function bdt(e){return kct?(e||window).getSelection():null}function ydt(e){return 1===e.nodeType}function wdt(e){const t=new RegExp(/^(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|#text)$/,"i");return null!==e.nodeName.match(t)}function xdt(e){if(Qpt(e)||Ypt(e)&&!e.isInline())return!0;if(!Kpt(e)||hdt(e))return!1;const t=e.getFirstChild(),n=null===t||Oht(t)||Uht(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Edt(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function kdt(e,t,n,r,o,a){let i=e.getFirstChild();for(;null!==i;){const e=i.__key;i.__parent===t&&(Kpt(i)&&kdt(i,e,n,r,o,a),n.has(e)||a.delete(e),o.push(e)),i=i.getNextSibling()}}let Sdt,Cdt,Mdt,_dt,Ndt,Adt,Odt,Idt,Ddt,Pdt,Tdt="",Hdt="",Ldt=null,zdt="",Rdt=!1,Bdt=!1,$dt=null;function Zdt(e,t){const n=Odt.get(e);if(null!==t){const n=nht(e);n.parentNode===t&&t.removeChild(n)}if(Idt.has(e)||Cdt._keyToDOMMap.delete(e),Kpt(n)){const e=Qdt(n,Odt);Vdt(e,0,e.length-1,null)}void 0!==n&&tdt(Pdt,Mdt,_dt,n,"destroyed")}function Vdt(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&Zdt(t,r)}}function jdt(e,t){e.setProperty("text-align",t)}const Wdt="40px";function Fdt(e,t){const n=Sdt.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Wdt;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function qdt(e,t){const n=e.style;0===t?jdt(n,""):1===t?jdt(n,"left"):2===t?jdt(n,"center"):3===t?jdt(n,"right"):4===t?jdt(n,"justify"):5===t?jdt(n,"start"):6===t&&jdt(n,"end")}function Ydt(e,t,n){const r=Idt.get(e);void 0===r&&Ect(60);const o=r.createDOM(Sdt,Cdt);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,Cdt),Uht(r)?o.setAttribute("data-lexical-text","true"):Ypt(r)&&o.setAttribute("data-lexical-decorator","true"),Kpt(r)){const e=r.__indent,t=r.__size;if(0!==e&&Fdt(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=Hdt;Hdt="",Udt(e,n,0,t,r,null),Xdt(n,r),Hdt=o}(Qdt(r,Idt),e,r,o)}const n=r.__format;0!==n&&qdt(o,n),r.isInline()||Gdt(null,r,o),idt(r)&&(Tdt+=Wct,zdt+=Wct)}else{const t=r.getTextContent();if(Ypt(r)){const t=r.decorate(Cdt,Sdt);null!==t&&eht(e,t),o.contentEditable="false"}else Uht(r)&&(r.isDirectionless()||(Hdt+=t));Tdt+=t,zdt+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return tdt(Pdt,Mdt,_dt,r,"created"),o}function Udt(e,t,n,r,o,a){const i=Tdt;Tdt="";let l=n;for(;l<=r;++l){Ydt(e[l],o,a);const t=Idt.get(e[l]);null!==t&&null===Ldt&&Uht(t)&&(Ldt=t.getFormat())}idt(t)&&(Tdt+=Wct),o.__lexicalTextContent=Tdt,Tdt=i+Tdt}function Kdt(e,t){const n=t.get(e);return Oht(n)||Ypt(n)&&n.isInline()}function Gdt(e,t,n){const r=null!==e&&(0===e.__size||Kdt(e.__last,Odt)),o=0===t.__size||Kdt(t.__last,Idt);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Xdt(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==Hdt||r!==$dt){const n=""===Hdt,a=n?$dt:(o=Hdt,Uct.test(o)?"rtl":Kct.test(o)?"ltr":null);if(a!==r){const o=t.classList,i=Sdt.theme;let l=null!==r?i[r]:void 0,s=null!==a?i[a]:void 0;if(void 0!==l){if("string"==typeof l){const e=nut(l);l=i[r]=e}o.remove(...l)}if(null===a||n&&"ltr"===a)t.removeAttribute("dir");else{if(void 0!==s){if("string"==typeof s){const e=nut(s);s=i[a]=e}void 0!==s&&o.add(...s)}t.dir=a}Bdt||(e.getWritable().__dir=a)}$dt=a,t.__lexicalDirTextContent=Hdt,t.__lexicalDir=a}var o}function Qdt(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Ect(101),n.push(r),r=e.__next}return n}function Jdt(e,t){const n=Odt.get(e);let r=Idt.get(e);void 0!==n&&void 0!==r||Ect(61);const o=Rdt||Adt.has(e)||Ndt.has(e),a=ldt(Cdt,e);if(n===r&&!o){if(Kpt(n)){const e=a.__lexicalTextContent;void 0!==e&&(Tdt+=e,zdt+=e);const t=a.__lexicalDirTextContent;void 0!==t&&(Hdt+=t)}else{const e=n.getTextContent();Uht(n)&&!n.isDirectionless()&&(Hdt+=e),zdt+=e,Tdt+=e}return a}if(n!==r&&o&&tdt(Pdt,Mdt,_dt,r,"updated"),r.updateDOM(n,a,Sdt)){const n=Ydt(e,null,null);return null===t&&Ect(62),t.replaceChild(n,a),Zdt(e,null),n}if(Kpt(n)&&Kpt(r)){const e=r.__indent;e!==n.__indent&&Fdt(a,e);const t=r.__format;t!==n.__format&&qdt(a,t),o&&(function(e,t,n){const r=Hdt;var o;Hdt="",Ldt=null,function(e,t,n){const r=Tdt,o=e.__size,a=t.__size;if(Tdt="",1===o&&1===a){const r=e.__first,o=t.__first;if(r===o)Jdt(r,n);else{const e=nht(r),t=Ydt(o,null,null);n.replaceChild(t,e),Zdt(r,null)}const a=Idt.get(o);null===Ldt&&Uht(a)&&(Ldt=a.getFormat())}else{const r=Qdt(e,Odt),i=Qdt(t,Idt);if(0===o)0!==a&&Udt(i,t,0,a-1,n,null);else if(0===a){if(0!==o){const e=null==n.__lexicalLineBreak;Vdt(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,a){const i=r-1,l=o-1;let s,c,u=a.firstChild,d=0,h=0;for(;d<=i&&h<=l;){const e=t[d],r=n[h];if(e===r)u=tht(Jdt(r,a)),d++,h++;else{void 0===s&&(s=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),i=s.has(r);if(o)if(i){const e=ldt(Cdt,r);e===u?u=tht(Jdt(r,a)):(null!=u?a.insertBefore(e,u):a.appendChild(e),Jdt(r,a)),d++,h++}else Ydt(r,a,u),h++;else u=tht(nht(e)),Zdt(e,a),d++}const o=Idt.get(r);null!==o&&null===Ldt&&Uht(o)&&(Ldt=o.getFormat())}const p=d>i,f=h>l;if(p&&!f){const t=n[l+1];Udt(n,e,h,l,a,void 0===t?null:Cdt.getElementByKey(t))}else f&&!p&&Vdt(t,d,i,a)}(t,r,i,o,a,n)}idt(t)&&(Tdt+=Wct),n.__lexicalTextContent=Tdt,Tdt=r+Tdt}(e,t,n),Xdt(t,n),ift(o=t)&&null!=Ldt&&Ldt!==o.__textFormat&&o.setTextFormat(Ldt),Hdt=r,Ldt=null}(n,r,a),Qpt(r)||r.isInline()||Gdt(n,r,a)),idt(r)&&(Tdt+=Wct,zdt+=Wct)}else{const t=r.getTextContent();if(Ypt(r)){const t=r.decorate(Cdt,Sdt);null!==t&&eht(e,t)}else Uht(r)&&!r.isDirectionless()&&(Hdt+=t);Tdt+=t,zdt+=t}if(!Bdt&&Qpt(r)&&r.__cachedText!==zdt){const e=r.getWritable();e.__cachedText=zdt,r=e}return a}function eht(e,t){let n=Cdt._pendingDecorators;const r=Cdt._decorators;if(null===n){if(r[e]===t)return;n=Tut(Cdt)}n[e]=t}function tht(e){let t=e.nextSibling;return null!==t&&t===Cdt._blockCursorElement&&(t=t.nextSibling),t}function nht(e){const t=Ddt.get(e);return void 0===t&&Ect(75,e),t}const rht=Object.freeze({}),oht=[["keydown",function(e,t){if(aht=e.timeStamp,iht=e.code,t.isComposing())return;const{code:n,shiftKey:r,ctrlKey:o,metaKey:a,altKey:i}=e;adt(t,Jst,e)||(function(e,t,n,r){return Uut(e)&&!t&&!r&&!n}(n,o,i,a)?adt(t,ect,e):function(e,t,n,r,o){return Uut(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?adt(t,tct,e):function(e,t,n,r){return Yut(e)&&!t&&!r&&!n}(n,o,i,a)?adt(t,nct,e):function(e,t,n,r,o){return Yut(e)&&!r&&!n&&(t||o)}(n,o,r,i,a)?adt(t,rct,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,a)?adt(t,oct,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,a)?adt(t,act,e):function(e,t){return Gut(e)&&t}(n,r)?(hht=!0,adt(t,ict,e)):function(e){return"Space"===e}(n)?adt(t,lct,e):function(e,t){return Cct&&t&&"KeyO"===e}(n,o)?(e.preventDefault(),hht=!0,adt(t,jst,!0)):function(e,t){return Gut(e)&&!t}(n,r)?(hht=!1,adt(t,ict,e)):function(e,t,n,r){return Cct?!t&&!n&&(Xut(e)||"KeyH"===e&&r):!(r||t||n)&&Xut(e)}(n,i,a,o)?Xut(n)?adt(t,sct,e):(e.preventDefault(),adt(t,Vst,!0)):function(e){return"Escape"===e}(n)?adt(t,cct,e):function(e,t,n,r,o){return Cct?!(n||r||o)&&(Qut(e)||"KeyD"===e&&t):!(t||r||o)&&Qut(e)}(n,o,r,i,a)?Qut(n)?adt(t,uct,e):(e.preventDefault(),adt(t,Vst,!1)):function(e,t,n){return Xut(e)&&(Cct?t:n)}(n,i,o)?(e.preventDefault(),adt(t,Ust,!0)):function(e,t,n){return Qut(e)&&(Cct?t:n)}(n,i,o)?(e.preventDefault(),adt(t,Ust,!1)):function(e,t){return Cct&&t&&Xut(e)}(n,a)?(e.preventDefault(),adt(t,Kst,!0)):function(e,t){return Cct&&t&&Qut(e)}(n,a)?(e.preventDefault(),adt(t,Kst,!1)):function(e,t,n,r){return"KeyB"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"bold")):function(e,t,n,r){return"KeyU"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"underline")):function(e,t,n,r){return"KeyI"===e&&!t&&Kut(n,r)}(n,i,a,o)?(e.preventDefault(),adt(t,Gst,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,i,o,a)?adt(t,dct,e):function(e,t,n,r){return"KeyZ"===e&&!t&&Kut(n,r)}(n,r,a,o)?(e.preventDefault(),adt(t,Xst,void 0)):function(e,t,n,r){return Cct?"KeyZ"===e&&n&&t:"KeyY"===e&&r||"KeyZ"===e&&r&&t}(n,r,a,o)?(e.preventDefault(),adt(t,Qst,void 0)):ipt(t._editorState._selection)?function(e,t,n,r){return!t&&"KeyC"===e&&(Cct?n:r)}(n,r,a,o)?(e.preventDefault(),adt(t,vct,e)):function(e,t,n,r){return!t&&"KeyX"===e&&(Cct?n:r)}(n,r,a,o)?(e.preventDefault(),adt(t,gct,e)):Jut(n,a,o)&&(e.preventDefault(),adt(t,bct,e)):!Mct&&Jut(n,a,o)&&(e.preventDefault(),adt(t,bct,e)),function(e,t,n,r){return e||t||n||r}(o,r,i,a)&&adt(t,xct,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Fpt(t,(()=>{Ypt(Put(n))||(dht=!0)}))}],["compositionstart",function(e,t){Fpt(t,(()=>{const n=gpt();if(opt(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Aut(r.key),(e.timeStamp<aht+30||"element"===r.type||!n.isCollapsed()||o.getFormat()!==n.format||Uht(o)&&o.getStyle()!==n.style)&&adt(t,Fst,Fct)}}))}],["compositionend",function(e,t){Mct?pht=!0:Fpt(t,(()=>{yht(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Fpt(t,(()=>{const n=gpt(),r=e.data,o=bht(e);if(null!=r&&opt(n)&&mht(n,o,r,e.timeStamp,!1)){pht&&(yht(t,r),pht=!1);const o=n.anchor.getNode(),a=bdt(t._window);if(null===a)return;const i=n.isBackward(),l=i?n.anchor.offset:n.focus.offset,s=i?n.focus.offset:n.anchor.offset;_ct&&!n.isCollapsed()&&Uht(o)&&null!==a.anchorNode&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+s)===Wut(a.anchorNode)||adt(t,Fst,r);const c=r.length;Mct&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Nct||Act||Pct||!t.isComposing()||(aht=0,Aut(null))}else Fut(!1,t,null!==r?r:void 0),pht&&(yht(t,r||void 0),pht=!1);Dpt(),uut(Hpt())})),sht=null}],["click",function(e,t){Fpt(t,(()=>{const n=gpt(),r=bdt(t._window),o=bpt();if(r)if(opt(n)){const t=n.anchor,a=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Qpt(a)&&1===Lut().getChildrenSize()&&a.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||a!==n.focus.getNode()&&(Kpt(a)?a.select(0):a.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const a=n.nodeType;1!==a&&3!==a||Rut(vpt(o,r,t,e))}}adt(t,Zst,e)}))}],["cut",rht],["copy",rht],["dragstart",rht],["dragover",rht],["dragend",rht],["paste",rht],["focus",rht],["blur",rht],["drop",rht]];_ct&&oht.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=bht(e);"deleteCompositionText"===n||Mct&&odt(t)||"insertCompositionText"!==n&&Fpt(t,(()=>{const o=gpt();if("deleteContentBackward"===n){if(null===o){const e=bpt();if(!opt(e))return;Rut(e.clone())}if(opt(o)){const n=o.anchor.key===o.focus.key;if(a=e.timeStamp,"Delete"===iht&&a<aht+30&&t.isComposing()&&n){if(Aut(null),aht=0,setTimeout((()=>{Fpt(t,(()=>{Aut(null)}))}),30),opt(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Uht(e)||Ect(142),o.style=e.getStyle()}}else{Aut(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),a=0===o.anchor.offset&&o.focus.offset===r.length;Dct&&n&&!a||adt(t,Vst,!0)}return}}var a;if(!opt(o))return;const i=e.data;null!==sht&&Fut(!1,t,sht),o.dirty&&null===sht||!o.isCollapsed()||Qpt(o.anchor.getNode())||null===r||o.applyDOMRange(r),sht=null;const l=o.anchor,s=o.focus,c=l.getNode(),u=s.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":adt(t,Fst,e);break;case"insertFromComposition":Aut(null),adt(t,Fst,e);break;case"insertLineBreak":Aut(null),adt(t,jst,!1);break;case"insertParagraph":Aut(null),hht&&!Act?(hht=!1,adt(t,jst,!1)):adt(t,Wst,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":adt(t,qst,e);break;case"deleteByComposition":(function(e,t){return e!==t||Kpt(e)||Kpt(t)||!e.isToken()||!t.isToken()})(c,u)&&adt(t,Yst,e);break;case"deleteByDrag":case"deleteByCut":adt(t,Yst,e);break;case"deleteContent":adt(t,Vst,!1);break;case"deleteWordBackward":adt(t,Ust,!0);break;case"deleteWordForward":adt(t,Ust,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":adt(t,Kst,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":adt(t,Kst,!1);break;case"formatStrikeThrough":adt(t,Gst,"strikethrough");break;case"formatBold":adt(t,Gst,"bold");break;case"formatItalic":adt(t,Gst,"italic");break;case"formatUnderline":adt(t,Gst,"underline");break;case"historyUndo":adt(t,Xst,void 0);break;case"historyRedo":adt(t,Qst,void 0)}else{if("\n"===i)e.preventDefault(),adt(t,jst,!1);else if(i===Wct)e.preventDefault(),adt(t,Wst,void 0);else if(null==i&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=i&&mht(o,r,i,e.timeStamp,!0)?(e.preventDefault(),adt(t,Fst,i)):sht=i;lht=e.timeStamp}}))}(e,t)]);let aht=0,iht=null,lht=0,sht=null;const cht=new WeakMap;let uht=!1,dht=!1,hht=!1,pht=!1,fht=[0,"",0,"root",0];function mht(e,t,n,r,o){const a=e.anchor,i=e.focus,l=a.getNode(),s=Hpt(),c=bdt(s._window),u=null!==c?c.anchorNode:null,d=a.key,h=s.getElementByKey(d),p=n.length;return d!==i.key||!Uht(l)||(!o&&(!_ct||lht<r+50)||l.isDirty()&&p<2||Zut(n))&&a.offset!==i.offset&&!l.isComposing()||Eut(l)||l.isDirty()&&p>1||(o||!_ct)&&null!==h&&!l.isComposing()&&u!==Sut(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||l.getFormat()!==e.format||l.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Uht(t)||Kpt(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,l)}function vht(e,t){return null!==e&&null!==e.nodeValue&&3===e.nodeType&&0!==t&&t!==e.nodeValue.length}function ght(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:a,focusOffset:i}=e;uht&&(uht=!1,vht(r,o)&&vht(a,i))||Fpt(t,(()=>{if(!n)return void Rut(null);if(!wut(t,r,a))return;const l=gpt();if(opt(l)){const n=l.anchor,r=n.getNode();if(l.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(l.dirty=!0);const o=udt(t).event,a=o?o.timeStamp:performance.now(),[i,s,c,u,d]=fht,h=Lut(),p=!1===t.isComposing()&&""===h.getTextContent();if(a<d+200&&n.offset===c&&n.key===u)l.format=i,l.style=s;else if("text"===n.type)Uht(r)||Ect(141),l.format=r.getFormat(),l.style=r.getStyle();else if("element"===n.type&&!p){const e=n.getNode();e instanceof rft&&0===e.getChildrenSize()?l.format=e.getTextFormat():l.format=0,l.style=""}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),a=r.length,s=l.isBackward(),c=s?i:o,u=s?o:i,d=s?t:e,h=s?e:t;let p=255,f=!1;for(let e=0;e<a;e++){const t=r[e],n=t.getTextContentSize();if(Uht(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===a-1&&t.__key===h&&0===u)&&(f=!0,p&=t.getFormat(),0===p))break}l.format=f?p:0}}adt(t,$st,void 0)}))}function bht(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function yht(e,t){const n=e._compositionKey;if(Aut(null),null!==n&&null!=t){if(""===t){const t=Iut(n),r=Sut(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Uht(t)&&qut(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=gpt();if(opt(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void adt(e,ict,null)}}}Fut(!0,e,t)}function wht(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const xht=new Map;function Eht(e){const t=e.target,n=bdt(null==t?null:9===t.nodeType?t.defaultView:t.ownerDocument.defaultView);if(null===n)return;const r=xut(n.anchorNode);if(null===r)return;dht&&(dht=!1,Fpt(r,(()=>{const t=bpt(),o=n.anchorNode;if(null===o)return;const a=o.nodeType;1!==a&&3!==a||Rut(vpt(t,n,r,e))})));const o=Vut(r),a=o[o.length-1],i=a._key,l=xht.get(i),s=l||a;s!==r&&ght(n,s,!1),ght(n,r,!0),r!==a?xht.set(i,r):l&&xht.delete(i)}function kht(e){e._lexicalHandled=!0}function Sht(e){return!0===e._lexicalHandled}function Cht(e,t,n){Dpt();const r=e.__key,o=e.getParent();if(null===o)return;const a=function(e){const t=gpt();if(!opt(t)||!Kpt(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),a=r.getNode();return cdt(o,e)&&n.set(e.__key,0,"element"),cdt(a,e)&&r.set(e.__key,0,"element"),t}(e);let i=!1;if(opt(a)&&t){const t=a.anchor,n=a.focus;t.key===r&&(xpt(t,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0),n.key===r&&(xpt(n,e,o,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else ipt(a)&&t&&e.isSelected()&&e.selectPrevious();if(opt(a)&&t&&!i){const t=e.getIndexWithinParent();_ut(e),ypt(a,o,t,-1)}else _ut(e);n||hdt(o)||o.canBeEmpty()||!o.isEmpty()||Cht(o,t),t&&Qpt(o)&&o.isEmpty()&&o.selectEnd()}class Mht{static getType(){Ect(64,this.name)}static clone(e){Ect(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Mut(this,e)}getType(){return this.__type}isInline(){Ect(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Iut(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||gpt();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));return(Uht(this)||!opt(t)||"element"!==t.anchor.type||"element"!==t.focus.type||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Iut(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Ect(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(hdt(t))return Kpt(e)||Ect(138),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Ect(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Iut(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Iut(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Kpt(this)&&t.unshift(this),Kpt(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const a=new Set(n);for(let e=0;e<r;e++){const n=t[e];if(a.has(n))return n}return null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,r=0,o=this;for(;;){const e=o.getParentOrThrow();if(e===t){n=o.getIndexWithinParent();break}o=e}for(o=e;;){const e=o.getParentOrThrow();if(e===t){r=o.getIndexWithinParent();break}o=e}return n<r}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;null!==n;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let o=this;for(;null!==o;){const a=o.__key;if(r.has(a)||(r.add(a),n.push(o)),o===e)break;const i=Kpt(o)?t?o.getFirstChild():o.getLastChild():null;if(null!==i){o=i;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(null!==l){o=l;continue}const s=o.getParentOrThrow();if(r.has(s.__key)||n.push(s),s===e)break;let c=null,u=s;do{if(null===u&&Ect(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);o=c}return t||n.reverse(),n}isDirty(){const e=Hpt()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=Iut(this.__key);return null===e&&Ect(113),e}getWritable(){Dpt();const e=Tpt(),t=Hpt(),n=e._nodeMap,r=this.__key,o=this.getLatest(),a=o.__parent,i=t._cloneNotNeeded,l=gpt();if(null!==l&&l.setCachedNodes(null),i.has(r))return Nut(o),o;const s=o.constructor.clone(o);return s.__parent=a,s.__next=o.__next,s.__prev=o.__prev,Kpt(o)&&Kpt(s)?(ift(o)&&ift(s)&&(s.__textFormat=o.__textFormat),s.__first=o.__first,s.__last=o.__last,s.__size=o.__size,s.__indent=o.__indent,s.__format=o.__format,s.__dir=o.__dir):Uht(o)&&Uht(s)&&(s.__format=o.__format,s.__style=o.__style,s.__mode=o.__mode,s.__detail=o.__detail),i.add(r),s.__key=r,Nut(s),n.set(r,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Ect(70)}updateDOM(e,t,n){Ect(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){Ect(72)}static importJSON(e){Ect(18,this.name)}static transform(){return null}remove(e){Cht(this,!0,e)}replace(e,t){Dpt();let n=gpt();null!==n&&(n=n.clone()),mdt(this,e);const r=this.getLatest(),o=this.__key,a=e.__key,i=e.getWritable(),l=this.getParentOrThrow().getWritable(),s=l.__size;_ut(i);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,p=r.__parent;if(Cht(r,!1,!0),null===c?l.__first=a:c.getWritable().__next=a,i.__prev=d,null===u?l.__last=a:u.getWritable().__prev=a,i.__next=h,i.__parent=p,l.__size=s,t&&(Kpt(this)&&Kpt(i)||Ect(139),this.getChildren().forEach((e=>{i.append(e)}))),opt(n)){Rut(n);const e=n.anchor,t=n.focus;e.key===o&&tpt(e,i),t.key===o&&tpt(t,i)}return Out()===o&&Aut(a),i}insertAfter(e,t=!0){Dpt(),mdt(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),a=gpt();let i=!1,l=!1;if(null!==o){const t=e.getIndexWithinParent();if(_ut(r),opt(a)){const e=o.__key,n=a.anchor,r=a.focus;i="element"===n.type&&n.key===e&&n.offset===t+1,l="element"===r.type&&r.key===e&&r.offset===t+1}}const s=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===s?c.__last=u:s.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&opt(a)){const e=this.getIndexWithinParent();ypt(a,c,e+1);const t=c.__key;i&&a.anchor.set(t,e+2,"element"),l&&a.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){Dpt(),mdt(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;_ut(r);const a=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),l=n.__prev,s=this.getIndexWithinParent();null===a?i.__first=o:a.getWritable().__next=o,i.__size++,n.__prev=o,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const c=gpt();return t&&opt(c)&&ypt(c,this.getParentOrThrow(),s),e}isParentRequired(){return!1}createParentElementNode(){return aft()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Dpt();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Kpt(n))return n.select();if(!Uht(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Dpt();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Kpt(n))return n.select(0,0);if(!Uht(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class _ht extends Mht{static getType(){return"linebreak"}static clone(e){return new _ht(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t){const n=t.firstChild;if(n===e||n.nextSibling===e&&Iht(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Iht(n))return!0}}return!1}(e)?null:{conversion:Nht,priority:0}}}static importJSON(e){return Aht()}exportJSON(){return{type:"linebreak",version:1}}}function Nht(e){return{node:Aht()}}function Aht(){return fdt(new _ht)}function Oht(e){return e instanceof _ht}function Iht(e){return 3===e.nodeType&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Dht(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Pht(e,t){return 1&t?"strong":2&t?"em":"span"}function Tht(e,t,n,r,o){const a=r.classList;let i=edt(o,"base");void 0!==i&&a.add(...i),i=edt(o,"underlineStrikethrough");let l=!1;const s=8&t&&4&t;void 0!==i&&(8&n&&4&n?(l=!0,s||a.add(...i)):s&&a.remove(...i));for(const e in Gct){const r=Gct[e];if(i=edt(o,e),void 0!==i)if(n&r){if(l&&("underline"===e||"strikethrough"===e)){t&r&&a.remove(...i);continue}t&r&&(!s||"underline"!==e)&&"strikethrough"!==e||a.add(...i)}else t&r&&a.remove(...i)}}function Hht(e,t,n){const r=t.firstChild,o=n.isComposing(),a=e+(o?jct:"");if(null==r)t.textContent=a;else{const e=r.nodeValue;if(e!==a)if(o||Mct){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,a=0;for(;o<n&&o<r&&e[o]===t[o];)o++;for(;a+o<n&&a+o<r&&e[n-a-1]===t[r-a-1];)a++;return[o,n-o-a,t.slice(o,r-a)]}(e,a);0!==n&&r.deleteData(t,n),r.insertData(t,o)}else r.nodeValue=a}}function Lht(e,t,n,r,o,a){Hht(o,e,t);const i=a.theme.text;void 0!==i&&Tht(0,0,r,e,i)}function zht(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Rht extends Mht{static getType(){return"text"}static clone(e){return new Rht(e.__text,e.__key)}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return tut[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Out()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Gct[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Cut(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,r=Dht(0,n),o=Pht(0,n),a=null===r?o:r,i=document.createElement(a);let l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(o),i.appendChild(l)),Lht(l,this,0,n,this.__text,e);const s=this.__style;return""!==s&&(i.style.cssText=s),i}updateDOM(e,t,n){const r=this.__text,o=e.__format,a=this.__format,i=Dht(0,o),l=Dht(0,a),s=Pht(0,o),c=Pht(0,a);if((null===i?s:i)!==(null===l?c:l))return!0;if(i===l&&s!==c){const e=t.firstChild;null==e&&Ect(48);const o=document.createElement(c);return Lht(o,this,0,a,r,n),t.replaceChild(o,e),!1}let u=t;null!==l&&null!==i&&(u=t.firstChild,null==u&&Ect(49)),Hht(r,u,this);const d=n.theme.text;void 0!==d&&o!==a&&Tht(0,o,a,u,d);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:jht,priority:0}),b:()=>({conversion:$ht,priority:0}),code:()=>({conversion:qht,priority:0}),em:()=>({conversion:qht,priority:0}),i:()=>({conversion:qht,priority:0}),s:()=>({conversion:qht,priority:0}),span:()=>({conversion:Bht,priority:0}),strong:()=>({conversion:qht,priority:0}),sub:()=>({conversion:qht,priority:0}),sup:()=>({conversion:qht,priority:0}),u:()=>({conversion:qht,priority:0})}}static importJSON(e){const t=Yht(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&ydt(t)||Ect(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=zht(t,"b")),this.hasFormat("italic")&&(t=zht(t,"i")),this.hasFormat("strikethrough")&&(t=zht(t,"s")),this.hasFormat("underline")&&(t=zht(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Gct[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Xct[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Cut(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=eut[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Dpt();let n=e,r=t;const o=gpt(),a=this.getTextContent(),i=this.__key;if("string"==typeof a){const e=a.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!opt(o))return fpt(i,n,i,r,"text","text");{const e=Out();e!==o.anchor.key&&e!==o.focus.key||Aut(i),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),a=o.__text,i=n.length;let l=e;l<0&&(l=i+l,l<0&&(l=0));const s=gpt();if(r&&opt(s)){const t=e+i;s.setTextNodeRange(o,t,o,t)}const c=a.slice(0,l)+n+a.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Dpt();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=Out(),a=new Set(e),i=[],l=n.length;let s="";for(let e=0;e<l;e++)""!==s&&a.has(e)&&(i.push(s),s=""),s+=n[e];""!==s&&i.push(s);const c=i.length;if(0===c)return[];if(i[0]===n)return[t];const u=i[0],d=t.getParentOrThrow();let h;const p=t.getFormat(),f=t.getStyle(),m=t.__detail;let v=!1;t.isSegmented()?(h=Yht(u),h.__format=p,h.__style=f,h.__detail=m,v=!0):(h=t.getWritable(),h.__text=u);const g=gpt(),b=[h];let y=u.length;for(let e=1;e<c;e++){const t=i[e],n=t.length,a=Yht(t).getWritable();a.__format=p,a.__style=f,a.__detail=m;const l=a.__key,s=y+n;if(opt(g)){const e=g.anchor,t=g.focus;e.key===r&&"text"===e.type&&e.offset>y&&e.offset<=s&&(e.key=l,e.offset-=y,g.dirty=!0),t.key===r&&"text"===t.type&&t.offset>y&&t.offset<=s&&(t.key=l,t.offset-=y,g.dirty=!0)}o===r&&Aut(l),y=s,b.push(a)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Nut(t),null!==n&&Nut(n)}(this);const w=d.getWritable(),x=this.getIndexWithinParent();return v?(w.splice(x,0,b),this.remove()):w.splice(x,1,b),opt(g)&&ypt(g,d,x,c-1),b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Ect(50);const n=this.__key,r=e.__key,o=this.__text,a=o.length;Out()===r&&Aut(n);const i=gpt();if(opt(i)){const o=i.anchor,l=i.focus;null!==o&&o.key===r&&(Ept(o,t,n,e,a),i.dirty=!0),null!==l&&l.key===r&&(Ept(l,t,n,e,a),i.dirty=!0)}const l=e.__text,s=t?l+o:o+l;this.setTextContent(s);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function Bht(e){const t=e.style,n=t.fontWeight,r=t.textDecoration.split(" "),o="700"===n||"bold"===n,a=r.includes("line-through"),i="italic"===t.fontStyle,l=r.includes("underline"),s=t.verticalAlign;return{forChild:e=>Uht(e)?(o&&e.toggleFormat("bold"),a&&e.toggleFormat("strikethrough"),i&&e.toggleFormat("italic"),l&&e.toggleFormat("underline"),"sub"===s&&e.toggleFormat("subscript"),"super"===s&&e.toggleFormat("superscript"),e):e,node:null}}function $ht(e){const t="normal"===e.style.fontWeight;return{forChild:e=>(Uht(e)&&!t&&e.toggleFormat("bold"),e),node:null}}const Zht=new WeakMap;function Vht(e){return"PRE"===e.nodeName||1===e.nodeType&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function jht(e){const t=e;null===e.parentElement&&Ect(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Zht.get(n))&&!Vht(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e<r.length;e++)Zht.set(r[e],o);return o}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(Aht()):"\t"===r?t.push(Ght()):""!==r&&t.push(Yht(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=Wht(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Wht(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Yht(n)}}function Wht(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,1===n.nodeType){const e=n.style.display;if(""===e&&!wdt(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(3===n.nodeType)return n;if("BR"===n.nodeName)return null}}const Fht={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qht(e){const t=Fht[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:e=>(Uht(e)&&!e.hasFormat(t)&&e.toggleFormat(t),e),node:null}}function Yht(e=""){return fdt(new Rht(e))}function Uht(e){return e instanceof Rht}class Kht extends Rht{static getType(){return"tab"}static clone(e){const t=new Kht(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Ght();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Ect(126)}setDetail(e){Ect(127)}setMode(e){Ect(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Ght(){return fdt(new Kht)}function Xht(e){return e instanceof Kht}class Qht{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Kpt(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Kpt(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?r<o:t.isBefore(n)}getNode(){const e=Iut(this.key);return null===e&&Ect(20),e}set(e,t,n){const r=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,Ipt()||(Out()===o&&Aut(e),null!==r&&(r.setCachedNodes(null),r.dirty=!0))}}function Jht(e,t,n){return new Qht(e,t,n)}function ept(e,t){let n=t.__key,r=e.offset,o="element";if(Uht(t)){o="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Kpt(t)){const e=t.getNextSibling();if(Uht(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function tpt(e,t){if(Kpt(t)){const n=t.getLastDescendant();Kpt(n)||Uht(n)?ept(e,n):ept(e,t)}else ept(e,t)}function npt(e,t,n,r){e.key=t,e.offset=n,e.type=r}class rpt{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ipt(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new rpt(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Uht(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=Iut(e);null!==t&&n.push(t)}return Ipt()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function opt(e){return e instanceof apt}class apt{constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!opt(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this.anchor,n=this.focus,r=t.isBefore(n),o=r?t:n,a=r?n:t;let i=o.getNode(),l=a.getNode();const s=o.offset,c=a.offset;if(Kpt(i)){const e=i.getDescendantByIndex(s);i=null!=e?e:i}if(Kpt(l)){let e=l.getDescendantByIndex(c);null!==e&&e!==i&&l.getChildAtIndex(c)===e&&(e=e.getPreviousSibling()),l=null!=e?e:l}let u;return u=i.is(l)?Kpt(i)&&i.getChildrenSize()>0?[]:[i]:i.getNodesBetween(l),Ipt()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){npt(this.anchor,e.__key,t,"text"),npt(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,a=r.isBefore(o),[i,l]=spt(this);let s="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Kpt(d)&&!d.isInline())c||(s+="\n"),c=!d.isEmpty();else if(c=!1,Uht(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===o.type&&o.offset!==r.offset||(e=i<l?e.slice(i,l):e.slice(l,i)):e=a?e.slice(i):e.slice(l):d===n&&(e=a?e.slice(0,l):e.slice(0,i)),s+=e}else!Ypt(d)&&!Oht(d)||d===n&&this.isCollapsed()||(s+=d.getTextContent())}return s}applyDOMRange(e){const t=Hpt(),n=t.getEditorState()._selection,r=ppt(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[o,a]=r;npt(this.anchor,o.key,o.offset,o.type),npt(this.focus,a.key,a.offset,a.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new apt(Jht(e.key,e.offset,e.type),Jht(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Cut(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Gct[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(Aht()):"\t"===r?n.push(Ght()):n.push(Yht(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,o=this.style;let a=t,i=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,i=t),"element"===a.type&&function(e,t,n,r){const o=e.getNode(),a=o.getChildAtIndex(e.offset),i=Yht(),l=Qpt(o)?aft().append(i):i;i.setFormat(n),i.setStyle(r),null===a?o.append(l):a.insertBefore(l),e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}(a,i,r,o);const l=a.offset;let s=i.offset;const c=this.getNodes(),u=c.length;let d=c[0];Uht(d)||Ect(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===i.type&&(s=h,i.set(a.key,s,"text")),this.isCollapsed()&&l===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Uht(t)&&t.canInsertTextBefore()&&!Eut(t)||(t=Yht(),t.setFormat(r),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===l&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Uht(t)&&!Eut(t)||(t=Yht(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const e=Yht(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Kpt(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),hpt(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(d.isToken()){const t=Yht(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(l!==s||t===r&&n===o){if(Xht(d)){const t=Yht(e);return t.setFormat(r),t.setStyle(o),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Yht(e);if(t.setFormat(r),t.setStyle(o),t.select(),0===l)d.insertBefore(t,!1);else{const[e]=d.splitText(l);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(o)}const a=s-l;d=d.spliceText(l,a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...f.getParentKeys()]),n=Kpt(d)?d:d.getParentOrThrow();let r=Kpt(f)?f:f.getParentOrThrow(),o=f;if(!n.is(r)&&r.isInline())do{o=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===i.type&&(0!==s||""===f.getTextContent())||"element"===i.type&&f.getIndexWithinParent()<s)if(Uht(f)&&!f.isToken()&&s!==f.getTextContentSize()){if(f.isSegmented()){const e=Yht(f.getTextContent());f.replace(e),f=e}Qpt(i.getNode())||"text"!==i.type||(f=f.spliceText(0,s,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const a=r.getChildren(),p=new Set(c),m=n.is(r),v=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=a.length-1;e>=0;e--){const t=a[e];if(t.is(d)||Kpt(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(o)?m||v.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(l===h)d.select();else{const t=Yht(e);t.select(),d.replace(t)}else d=d.spliceText(l,h-l,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void Aut(null);const t=this.getNodes(),n=[];for(const e of t)Uht(e)&&n.push(e);const r=n.length;if(0===r)return this.toggleFormat(e),void Aut(null);const o=this.anchor,a=this.focus,i=this.isBackward(),l=i?a:o,s=i?o:a;let c=0,u=n[0],d="element"===l.type?0:l.offset;if("text"===l.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const h=u.getFormatFlags(e,null),p=r-1;let f=n[p];const m="text"===s.type?s.offset:f.getTextContentSize();if(u.is(f)){if(d===m)return;if(0===d&&m===u.getTextContentSize())u.setFormat(h);else{const e=u.splitText(d,m),t=0===d?e[0]:e[1];t.setFormat(h),"text"===l.type&&l.set(t.__key,0,"text"),"text"===s.type&&s.set(t.__key,m-d,"text")}return void(this.format=h)}0!==d&&([,u]=u.splitText(d),d=0),u.setFormat(h);const v=f.getFormatFlags(e,h);m>0&&(m!==f.getTextContentSize()&&([f]=f.splitText(m)),f.setFormat(v));for(let t=c+1;t<p;t++){const r=n[t];if(!r.isToken()){const t=r.getFormatFlags(e,v);r.setFormat(t)}}"text"===l.type&&l.set(u.__key,d,"text"),"text"===s.type&&s.set(f.__key,m,"text"),this.format=h|v}insertNodes(e){if(0===e.length)return;if("root"===this.anchor.key){this.insertParagraph();const t=gpt();return opt(t)||Ect(134),t.insertNodes(e)}const t=Edt((this.isBackward()?this.focus:this.anchor).getNode(),xdt),n=e[e.length-1];if("__language"in t&&Kpt(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const r=kpt(this);t.splice(r,0,e),n.selectEnd()}return}if(!e.some((e=>(Kpt(e)||Ypt(e))&&!e.isInline()))){Kpt(t)||Ect(135);const r=kpt(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=aft();let n=null;for(let r=0;r<e.length;r++){const o=e[r],a=Oht(o);if(a||Ypt(o)&&o.isInline()||Kpt(o)&&o.isInline()||Uht(o)||o.isParentRequired()){if(null===n&&(n=o.createParentElementNode(),t.append(n),a))continue;null!==n&&n.append(o)}else t.append(o),n=null}return t}(e),o=r.getLastDescendant(),a=r.getChildren(),i=e=>"__value"in e&&"__checked"in e,l=Kpt(t)&&t.isEmpty()?null:this.insertParagraph(),s=a[a.length-1];let c=a[0];var u;Kpt(u=c)&&xdt(u)&&!u.isEmpty()&&Kpt(t)&&(!t.isEmpty()||i(t))&&(Kpt(t)||Ect(135),t.append(...c.getChildren()),c=a[1]),c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;)r.getNextSibling()||Ect(140),r=r.getNextSibling(),o.push(r);let a=e;for(const e of o)a=a.insertAfter(e)}(t,c);const d=Edt(o,xdt);l&&Kpt(d)&&(i(l)||xdt(s))&&(d.append(...l.getChildren()),l.remove()),Kpt(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const h=Kpt(t)?t.getLastChild():null;Oht(h)&&d!==t&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=aft();return Lut().splice(this.anchor.offset,0,[e]),e.select(),e}const e=kpt(this),t=Edt(this.anchor.getNode(),xdt);Kpt(t)||Ect(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=Aht();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let a=e[0],i=e[n];const[l,s]=spt(this);if(0===t)return[];if(1===t){if(Uht(a)&&!this.isCollapsed()){const e=l>s?s:l,t=l>s?l:s,n=a.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[a]}const c=r.isBefore(o);if(Uht(a)){const t=c?l:s;t===a.getTextContentSize()?e.shift():0!==t&&([,a]=a.splitText(t),e[0]=a)}if(Uht(i)){const t=i.getTextContent().length,r=c?s:l;0===r?e.pop():r!==t&&([i]=i.splitText(r),e[n]=i)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,a="move"===e,i=rdt(r,t);if(Ypt(i)&&!i.isIsolated()){if(a&&i.isKeyboardSelectable()){const e=mpt();return e.add(i.__key),void Rut(e)}const e=t?i.getPreviousSibling():i.getNextSibling();if(Uht(e)){const n=e.__key,i=t?e.getTextContent().length:0;return r.set(n,i,"text"),void(a&&o.set(n,i,"text"))}{const n=i.getParentOrThrow();let l,s;return Kpt(e)?(s=e.__key,l=t?e.getChildrenSize():0):(l=i.getIndexWithinParent(),s=n.__key,t||l++),r.set(s,l,"element"),void(a&&o.set(s,l,"element"))}}const l=Hpt(),s=bdt(l._window);if(!s)return;const c=l._blockCursorElement,u=l._rootElement;if(null===u||null===c||!Kpt(i)||i.isInline()||i.canBeEmpty()||gdt(c,l,u),function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),r=Qpt(n)?n:ddt(n);if(this.applyDOMRange(e),this.dirty=!0,!a){const n=this.getNodes(),o=[];let a=!1;for(let e=0;e<n.length;e++){const t=n[e];cdt(t,r)?o.push(t):a=!0}if(a&&o.length>0)if(t){const e=o[0];Kpt(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Kpt(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,a=n.type;npt(n,t.key,t.offset,t.type),npt(t,r,o,a),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Kpt(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Kpt(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=rdt(r,e);if(Ypt(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Kpt(n)&&0===n.getChildrenSize()){n.remove();const e=mpt();e.add(o.__key),Rut(e)}else o.remove(),Hpt().dispatchCommand($st,void 0);return}if(!e&&Kpt(o)&&Kpt(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,a=o.getTextContentSize();if(o.is(n)||e&&t!==a||!e&&0!==t)return void cpt(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,a=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==a)return void cpt(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,a=r.offset,i=e<a,l=i?e:a,s=i?a:e,c=s-1;l!==c&&(Zut(o.getTextContent().slice(l,s))||(t?r.offset=c:n.offset=c))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Qpt(e.getParent())&&0===e.getIndexWithinParent()&&e.collapseAtStart(this)}}deleteLine(e){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",e,"lineboundary"),0===(e?this.focus:this.anchor).offset&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ipt(e){return e instanceof rpt}function lpt(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function spt(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[lpt(n),lpt(r)]}function cpt(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),a=o.length;let i=0,l=0;for(let e=0;e<a;e++){const r=e===a-1;if(l=i,i+=o[e].length,t&&i===n||i>n||r){o.splice(e,1),r&&(l=void 0);break}}const s=o.join("").trim();""===s?r.remove():(r.setTextContent(s),r.select(l,l))}function upt(e,t,n,r){let o,a=t;if(1===e.nodeType){let i=!1;const l=e.childNodes,s=l.length,c=r._blockCursorElement;a===s&&(i=!0,a=s-1);let u=l[a],d=!1;if(u===c)u=l[a+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&a--}if(o=But(u),Uht(o))a=$ut(o,i);else{let r=But(e);if(null===r)return null;if(Kpt(r)){a=Math.min(r.getChildrenSize(),a);let e=r.getChildAtIndex(a);if(Kpt(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=i?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Kpt(e)?e:e.getParentOrThrow()),a=0}Uht(e)?(o=e,r=null,a=$ut(e,i)):e!==r&&i&&!d&&a++}else{const n=r.getIndexWithinParent();a=0===t&&Ypt(r)&&But(e)===r?n:n+1,r=r.getParentOrThrow()}if(Kpt(r))return Jht(r.__key,a,"element")}}else o=But(e);return Uht(o)?Jht(o.__key,a,"text"):null}function dpt(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),a=o.getParent();if(t){if((n||!t)&&null===r&&Kpt(a)&&a.isInline()){const t=a.getPreviousSibling();Uht(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Kpt(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Uht(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),a=o.getParent();if(t&&Kpt(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Kpt(a)&&a.isInline()&&!a.canInsertTextAfter()){const t=a.getNextSibling();Uht(t)&&(e.key=t.__key,e.offset=0)}}}function hpt(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);dpt(e,r,o),dpt(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const a=Hpt();if(a.isComposing()&&a._compositionKey!==e.key&&opt(n)){const r=n.anchor,o=n.focus;npt(e,r.key,r.offset,r.type),npt(t,o.key,o.offset,o.type)}}}function ppt(e,t,n,r,o,a){if(null===e||null===n||!wut(o,e,n))return null;const i=upt(e,t,opt(a)?a.anchor:null,o);if(null===i)return null;const l=upt(n,r,opt(a)?a.focus:null,o);if(null===l)return null;if("element"===i.type&&"element"===l.type){const t=But(e),r=But(n);if(Ypt(t)&&Ypt(r))return null}return hpt(i,l,a),[i,l]}function fpt(e,t,n,r,o,a){const i=Tpt(),l=new apt(Jht(e,t,o),Jht(n,r,a),0,"");return l.dirty=!0,i._selection=l,l}function mpt(){return new rpt(new Set)}function vpt(e,t,n,r){const o=n._window;if(null===o)return null;const a=r||o.event,i=a?a.type:void 0,l="selectionchange"===i,s=!rut&&(l||"beforeinput"===i||"compositionstart"===i||"compositionend"===i||"click"===i&&a&&3===a.detail||"drop"===i||void 0===i);let c,u,d,h;if(opt(e)&&!s)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,l&&opt(e)&&!wut(n,c,u))return e.clone();const p=ppt(c,d,u,h,n,e);if(null===p)return null;const[f,m]=p;return new apt(f,m,opt(e)?e.format:0,opt(e)?e.style:"")}function gpt(){return Tpt()._selection}function bpt(){return Hpt()._editorState._selection}function ypt(e,t,n,r=1){const o=e.anchor,a=e.focus,i=o.getNode(),l=a.getNode();if(!t.is(i)&&!t.is(l))return;const s=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);o.set(s,n,"element"),a.set(s,n,"element"),wpt(e)}}else{const i=e.isBackward(),l=i?a:o,c=l.getNode(),u=i?o:a,d=u.getNode();if(t.is(c)){const e=l.offset;(n<=e&&r>0||n<e&&r<0)&&l.set(s,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(s,Math.max(0,e+r),"element")}}wpt(e)}function wpt(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,a=t.getNode(),i=r.getNode();if(e.isCollapsed()){if(!Kpt(a))return;const e=a.getChildrenSize(),o=n>=e,i=o?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(Uht(i)){let e=0;o&&(e=i.getTextContentSize()),t.set(i.__key,e,"text"),r.set(i.__key,e,"text")}}else{if(Kpt(a)){const e=a.getChildrenSize(),r=n>=e,o=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(Uht(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Kpt(i)){const e=i.getChildrenSize(),t=o>=e,n=t?i.getChildAtIndex(e-1):i.getChildAtIndex(o);if(Uht(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function xpt(e,t,n,r,o){let a=null,i=0,l=null;null!==r?(a=r.__key,Uht(r)?(i=r.getTextContentSize(),l="text"):Kpt(r)&&(i=r.getChildrenSize(),l="element")):null!==o&&(a=o.__key,Uht(o)?l="text":Kpt(o)&&(l="element")),null!==a&&null!==l?e.set(a,i,l):(i=t.getIndexWithinParent(),-1===i&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function Ept(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function kpt(e){let t=e;e.isCollapsed()||t.removeText();const n=gpt();opt(n)&&(t=n),opt(t)||Ect(161);const r=t.anchor;let o=r.getNode(),a=r.offset;for(;!xdt(o);)[o,a]=Spt(o,a);return a}function Spt(e,t){const n=e.getParent();if(!n){const e=aft();return Lut().append(e),e.select(),[Lut(),0]}if(Uht(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Kpt(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new apt(Jht(e.__key,t,"element"),Jht(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Cpt=null,Mpt=null,_pt=!1,Npt=!1,Apt=0;const Opt={characterData:!0,childList:!0,subtree:!0};function Ipt(){return _pt||null!==Cpt&&Cpt._readOnly}function Dpt(){_pt&&Ect(13)}function Ppt(){Apt>99&&Ect(14)}function Tpt(){return null===Cpt&&Ect(15),Cpt}function Hpt(){return null===Mpt&&Ect(16),Mpt}function Lpt(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Ect(30,t),n}(e,r);let a=n.get(r);void 0===a&&(a=Array.from(o.transforms),n.set(r,a));const i=a.length;for(let e=0;e<i&&(a[e](t),t.isAttached());e++);}function zpt(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Rpt(e,t){const n=e.type,r=t.get(n);void 0===r&&Ect(17,n);const o=r.klass;e.type!==o.getType()&&Ect(18,o.name);const a=o.importJSON(e),i=e.children;if(Kpt(a)&&Array.isArray(i))for(let e=0;e<i.length;e++){const n=Rpt(i[e],t);a.append(n)}return a}function Bpt(e,t){const n=Cpt,r=_pt,o=Mpt;Cpt=e,_pt=!0,Mpt=null;try{return t()}finally{Cpt=n,_pt=r,Mpt=o}}function $pt(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||null===r;if(null===n)return;const a=e._editorState,i=a._selection,l=n._selection,s=0!==e._dirtyType,c=Cpt,u=_pt,d=Mpt,h=e._updating,p=e._observer;let f=null;if(e._pendingEditorState=null,e._editorState=n,!o&&s&&null!==p){Mpt=e,Cpt=n,_pt=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,o=e._dirtyLeaves;p.disconnect(),f=function(e,t,n,r,o,a){Tdt="",zdt="",Hdt="",Rdt=2===r,$dt=null,Cdt=n,Sdt=n._config,Mdt=n._nodes,_dt=Cdt._listeners.mutation,Ndt=o,Adt=a,Odt=e._nodeMap,Idt=t._nodeMap,Bdt=t._readOnly,Ddt=new Map(n._keyToDOMMap);const i=new Map;return Pdt=i,Jdt("root",null),Cdt=void 0,Mdt=void 0,Ndt=void 0,Adt=void 0,Odt=void 0,Idt=void 0,Sdt=void 0,Ddt=void 0,Pdt=void 0,i}(a,n,e,t,r,o)}catch(t){if(t instanceof Error&&e._onError(t),Npt)throw t;return lft(e,null,r,n),dut(e),e._dirtyType=2,Npt=!0,$pt(e,a),void(Npt=!1)}finally{p.observe(r,Opt),e._updating=h,Cpt=c,_pt=u,Mpt=d}}n._readOnly||(n._readOnly=!0);const m=e._dirtyLeaves,v=e._dirtyElements,g=e._normalizedNodes,b=e._updateTags,y=e._deferred;s&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const o=t._nodeMap;let a;for(a in r)o.has(a)||(r===n&&(r=Tut(e)),delete r[a])}(e,n);const w=o?null:bdt(e._window);if(e._editable&&null!==w&&(s||null===l||l.dirty)){Mpt=e,Cpt=n;try{if(null!==p&&p.disconnect(),s||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&gdt(t,e,r),function(e,t,n,r,o,a){const i=r.anchorNode,l=r.focusNode,s=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(o.has("collaboration")&&u!==a||null!==u&&yut(u))return;if(!opt(t))return void(null!==e&&wut(n,i,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,p=d.key,f=h.key,m=ldt(n,p),v=ldt(n,f),g=d.offset,b=h.offset,y=t.format,w=t.style,x=t.isCollapsed();let E=m,k=v,S=!1;if("text"===d.type){E=Sut(m);const e=d.getNode();S=e.getFormat()!==y||e.getStyle()!==w}else opt(e)&&"text"===e.anchor.type&&(S=!0);var C,M,_,N,A;if("text"===h.type&&(k=Sut(v)),null!==E&&null!==k&&(x&&(null===e||S||opt(e)&&(e.format!==y||e.style!==w))&&(C=y,M=w,_=g,N=p,A=performance.now(),fht=[C,M,_,N,A]),s!==g||c!==b||i!==E||l!==k||"Range"===r.type&&x||(null!==u&&a.contains(u)||a.focus({preventScroll:!0}),"element"===d.type))){try{r.setBaseAndExtent(E,g,k,b)}catch(e){}if(!o.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==a&&a===document.activeElement){const e=t instanceof apt&&"element"===t.anchor.type?E.childNodes[g]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:a,bottom:i}=t,l=0,s=0,c=n;for(;null!==c;){const t=c===r.body;if(t)l=0,s=udt(e).innerHeight;else{const e=c.getBoundingClientRect();l=e.top,s=e.bottom}let n=0;if(a<l?n=-(l-a):i>s&&(n=i-s),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;a-=t,i-=t}if(t)break;c=sdt(c)}}(n,t,a)}}uht=!0}}(i,l,e,w,b,r)}(function(e,t,n){let r=e._blockCursorElement;if(opt(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,a=o.getNode(),i=o.offset;let l=!1,s=null;if(i===a.getChildrenSize())vdt(a.getChildAtIndex(i-1))&&(l=!0);else{const t=a.getChildAtIndex(i);if(vdt(t)){const n=t.getPreviousSibling();(null===n||vdt(n))&&(l=!0,s=e.getElementByKey(t.__key))}}if(l){const n=e.getElementByKey(a.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=nut(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===s?n.appendChild(r):n.insertBefore(r,s))}}null!==r&&gdt(r,e,t)})(e,r,l),null!==p&&p.observe(r,Opt)}finally{Mpt=d,Cpt=c}}null!==f&&function(e,t,n,r,o){const a=Array.from(e._listeners.mutation),i=a.length;for(let e=0;e<i;e++){const[i,l]=a[e],s=t.get(l);void 0!==s&&i(s,{dirtyLeaves:r,prevEditorState:o,updateTags:n})}}(e,f,b,m,a),opt(l)||null===l||null!==i&&i.is(l)||e.dispatchCommand($st,void 0);const x=e._pendingDecorators;null!==x&&(e._decorators=x,e._pendingDecorators=null,Zpt("decorator",e,!0,x)),function(e,t,n){const r=Hut(t),o=Hut(n);r!==o&&Zpt("textcontent",e,!0,o)}(e,t||a,n),Zpt("update",e,!0,{dirtyElements:v,dirtyLeaves:m,editorState:n,normalizedNodes:g,prevEditorState:t||a,tags:b}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;Wpt(e,t,r)}}}(e)}function Zpt(e,t,n,...r){const o=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=o}}function Vpt(e,t,n){if(!1===e._updating||Mpt!==e){let r=!1;return e.update((()=>{r=Vpt(e,t,n)})),r}const r=Vut(e);for(let o=4;o>=0;o--)for(let a=0;a<r.length;a++){const i=r[a]._commands.get(t);if(void 0!==i){const t=i[o];if(void 0!==t){const r=Array.from(t),o=r.length;for(let t=0;t<o;t++)if(!0===r[t](n,e))return!0}}}return!1}function jpt(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,o]=t;let a,i;void 0!==o&&(a=o.onUpdate,i=o.tag,o.skipTransforms&&(r=!0),a&&e._deferred.push(a),i&&e._updateTags.add(i)),n()}}return r}function Wpt(e,t,n){const r=e._updateTags;let o,a,i=!1,l=!1;void 0!==n&&(o=n.onUpdate,a=n.tag,null!=a&&r.add(a),i=n.skipTransforms||!1,l=n.discrete||!1),o&&e._deferred.push(o);const s=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=new tft(new Map((c||s)._nodeMap)),u=!0),c._flushSync=l;const d=Cpt,h=_pt,p=Mpt,f=e._updating;Cpt=c,_pt=!1,e._updating=!0,Mpt=e;try{u&&(e._headless?null!==s._selection&&(c._selection=s._selection.clone()):c._selection=function(e){const t=e.getEditorState()._selection,n=bdt(e._window);return opt(t)||null==t?vpt(t,n,e,null):t.clone()}(e));const n=e._compositionKey;t(),i=jpt(e,i),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(opt(r)){const e=r.anchor,t=r.focus;let o;if("text"===e.type&&(o=e.getNode(),o.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();o!==e&&e.selectionTransform(n,r)}}}(c,e),0!==e._dirtyType&&(i?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Uht(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&fut(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,o=e._nodeMap,a=Out(),i=new Map;let l=n,s=l.size,c=r,u=c.size;for(;s>0||u>0;){if(s>0){t._dirtyLeaves=new Set;for(const e of l){const r=o.get(e);Uht(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&fut(r),void 0!==r&&zpt(r,a)&&Lpt(t,r,i),n.add(e)}if(l=t._dirtyLeaves,s=l.size,s>0){Apt++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],l=e[1];if("root"!==n&&!l)continue;const s=o.get(n);void 0!==s&&zpt(s,a)&&Lpt(t,s,i),r.set(n,l)}l=t._dirtyLeaves,s=l.size,c=t._dirtyElements,u=c.size,Apt++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),jpt(e),function(e,t,n,r){const o=e._nodeMap,a=t._nodeMap,i=[];for(const[e]of r){const t=a.get(e);void 0!==t&&(t.isAttached()||(Kpt(t)&&kdt(t,e,o,a,i,r),o.has(e)||r.delete(e),i.push(e)))}for(const e of i)a.delete(e);for(const e of n){const t=a.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(opt(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Ect(19)}else ipt(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void $pt(e)}finally{Cpt=d,_pt=h,Mpt=p,e._updating=f,Apt=0}const m=0!==e._dirtyType||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,$pt(e)):u&&but((()=>{$pt(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Fpt(e,t,n){e._updating?e._updates.push([t,n]):Wpt(e,t,n)}class qpt extends Mht{constructor(e){super(e)}decorate(e,t){Ect(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ypt(e){return e instanceof qpt}class Upt extends Mht{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Jct[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Hpt()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Uht(t)&&e.push(t),Kpt(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Kpt(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Kpt(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Kpt(e)&&e.getLastDescendant()||e||null}const r=t[e];return Kpt(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Iut(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Ect(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Iut(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Ect(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContent(),Kpt(o)&&r!==n-1&&!o.isInline()&&(e+=Wct)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const o=t[r];e+=o.getTextContentSize(),Kpt(o)&&r!==n-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(""!==e){const t=Qct[e];return!!(this.getFormat()&t)}return!1}select(e,t){Dpt();const n=gpt();let r=e,o=t;const a=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Uht(e)||Kpt(e))return e.select(0,0)}else if(!(void 0!==e&&e!==a||void 0!==t&&t!==a)){const e=this.getLastChild();if(Uht(e)||Kpt(e))return e.select()}void 0===r&&(r=a),void 0===o&&(o=a);const i=this.__key;return opt(n)?(n.anchor.set(i,r,"element"),n.focus.set(i,o,"element"),n.dirty=!0,n):fpt(i,r,i,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Qct[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),a=this.getWritable(),i=a.__key,l=[],s=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&Ect(100);const t=e.getNextSibling(),n=e.__key;_ut(e.getWritable()),s.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===i&&d--,_ut(r);const o=t.__key;if(null===h)a.__first=o,r.__prev=null;else{const e=h.getWritable();e.__next=o,r.__prev=e.__key}t.__key===i&&Ect(76),r.__parent=i,l.push(o),h=t}if(e+t===o)null!==h&&(h.getWritable().__next=null,a.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(a.__size=d,s.length){const e=gpt();if(opt(e)){const t=new Set(s),n=new Set(l),{anchor:r,focus:o}=e;Gpt(r,t,n)&&xpt(r,r.getNode(),this,u,c),Gpt(o,t,n)&&xpt(o,o.getNode(),this,u,c),0!==d||this.canBeEmpty()||hdt(this)||this.remove()}}return a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}}function Kpt(e){return e instanceof Upt}function Gpt(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class Xpt extends Upt{static getType(){return"root"}static clone(){return new Xpt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Ect(51)}getTextContent(){const e=this.__cachedText;return!Ipt()&&0!==Hpt()._dirtyType||null===e?super.getTextContent():e}remove(){Ect(52)}replace(e){Ect(53)}insertBefore(e){Ect(54)}insertAfter(e){Ect(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];Kpt(n)||Ypt(n)||Ect(56)}return super.append(...e)}static importJSON(e){const t=Lut();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Qpt(e){return e instanceof Xpt}function Jpt(){return new tft(new Map([["root",new Xpt]]))}function eft(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Ect(130,n.name),Kpt(e)){const r=t.children;Array.isArray(r)||Ect(59,n.name);const o=e.getChildren();for(let e=0;e<o.length;e++){const t=eft(o[e]);r.push(t)}}return t}class tft{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e){return Bpt(this,e)}clone(e){const t=new tft(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Bpt(this,(()=>({root:eft(Lut())})))}}class nft extends Upt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rft extends Upt{constructor(e){super(e),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Gct[e];return!!(this.getTextFormat()&t)}static clone(e){return new rft(e.__key)}createDOM(e){const t=document.createElement("p"),n=edt(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:oft,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&ydt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=aft();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=aft();n.setTextFormat(e.format);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Uht(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function oft(e){const t=aft();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function aft(){return fdt(new rft)}function ift(e){return e instanceof rft}function lft(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Jpt(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const a=e._observer;null!==a&&(a.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class sft{constructor(e,t,n,r,o,a,i){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=jut(),this._onError=o,this._htmlConversions=a,this._editable=i,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Ect(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Ect(36,String(e));const a=o[n];return a.add(t),()=>{a.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t){void 0===this._nodes.get(e.getType())&&Ect(37,e.name);const n=this._listeners.mutation;return n.set(t,e),()=>{n.delete(t)}}registerNodeTransformToKlass(e,t){const n=e.getType(),r=this._nodes.get(n);return void 0===r&&Ect(37,e.name),r.transforms.add(t),r}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var a;return a=e.getType(),Fpt(this,(()=>{const e=Tpt();if(e.isEmpty())return;if("root"===a)return void Lut().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return adt(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=edt(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,lft(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=cht.get(t);void 0===n&&Ect(162);const r=n-1;r>=0||Ect(164),cht.set(t,r),0===r&&t.removeEventListener("selectionchange",Eht);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=Vut(e),n=t[t.length-1]._key;xht.get(n)===e&&xht.delete(n)}else xht.delete(e._key)}(o),e.__lexicalEditor=null);const a=wht(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){const t=function(e){const t=e.ownerDocument;return t&&t.defaultView||null}(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,dut(this),this._updateTags.add("history-merge"),$pt(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=cht.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Eht),cht.set(n,(r||0)+1),e.__lexicalEditor=t;const o=wht(e);for(let n=0;n<oht.length;n++){const[r,a]=oht[n],i="function"==typeof a?e=>{Sht(e)||(kht(e),(t.isEditable()||"click"===r)&&a(e,t))}:e=>{if(!Sht(e)&&(kht(e),t.isEditable()))switch(r){case"cut":return adt(t,gct,e);case"copy":return adt(t,vct,e);case"paste":return adt(t,qst,e);case"dragstart":return adt(t,pct,e);case"dragover":return adt(t,fct,e);case"dragend":return adt(t,mct,e);case"focus":return adt(t,yct,e);case"blur":return adt(t,wct,e);case"drop":return adt(t,hct,e)}};e.addEventListener(r,i),o.push((()=>{e.removeEventListener(r,i)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;Zpt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Ect(38),uut(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),$pt(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),$pt(this)}parseEditorState(e,t){return function(e,t,n){const r=Jpt(),o=Cpt,a=_pt,i=Mpt,l=t._dirtyElements,s=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Cpt=r,_pt=!1,Mpt=t;try{const o=t._nodes;Rpt(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=l,t._dirtyLeaves=s,t._cloneNotNeeded=c,t._dirtyType=u,Cpt=o,_pt=a,Mpt=i}return r}("string"==typeof e?JSON.parse(e):e,this,t)}update(e,t){Fpt(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Fpt(this,(()=>{const e=gpt(),n=Lut();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=bdt(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Zpt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}var cft=Object.freeze({__proto__:null,$addUpdateTag:function(e){Dpt(),Hpt()._updateTags.add(e)},$applyNodeReplacement:fdt,$copyNode:pdt,$createLineBreakNode:Aht,$createNodeSelection:mpt,$createParagraphNode:aft,$createPoint:Jht,$createRangeSelection:function(){const e=Jht("root",0,"element"),t=Jht("root",0,"element");return new apt(e,t,0,"")},$createRangeSelectionFromDom:function(e,t){return vpt(null,e,t,null)},$createTabNode:Ght,$createTextNode:Yht,$getAdjacentNode:rdt,$getCharacterOffsets:spt,$getEditor:function(){return Hpt()},$getNearestNodeFromDOMNode:Put,$getNearestRootOrShadowRoot:ddt,$getNodeByKey:Iut,$getPreviousSelection:bpt,$getRoot:Lut,$getSelection:gpt,$getTextContent:function(){const e=gpt();return null===e?"":e.getTextContent()},$hasAncestor:cdt,$hasUpdateTag:function(e){return Hpt()._updateTags.has(e)},$insertNodes:function(e){let t=gpt()||bpt();null===t&&(t=Lut().selectEnd()),t.insertNodes(e)},$isBlockElementNode:function(e){return Kpt(e)&&!e.isInline()},$isDecoratorNode:Ypt,$isElementNode:Kpt,$isInlineElementOrDecoratorNode:function(e){return Kpt(e)&&e.isInline()||Ypt(e)&&e.isInline()},$isLeafNode:function(e){return Uht(e)||Oht(e)||Ypt(e)},$isLineBreakNode:Oht,$isNodeSelection:ipt,$isParagraphNode:ift,$isRangeSelection:opt,$isRootNode:Qpt,$isRootOrShadowRoot:hdt,$isTabNode:Xht,$isTextNode:Uht,$nodesOfType:function(e){const t=Tpt(),n=t._readOnly,r=e.getType(),o=t._nodeMap,a=[];for(const[,t]of o)t instanceof e&&t.__type===r&&(n||t.isAttached())&&a.push(t);return a},$normalizeSelection__EXPERIMENTAL:mut,$parseSerializedNode:function(e){return Rpt(e,Hpt()._nodes)},$selectAll:function(){const e=Lut();Rut(mut(e.select(0,e.getChildrenSize())))},$setCompositionKey:Aut,$setSelection:Rut,$splitNode:function(e,t){let n=e.getChildAtIndex(t);null==n&&(n=e),hdt(e)&&Ect(102);const r=e=>{const t=e.getParentOrThrow(),o=hdt(t),a=e!==n||o?pdt(e):e;if(o)return Kpt(e)&&Kpt(a)||Ect(133),e.insertAfter(a),[e,a,a];{const[n,o,i]=r(t),l=e.getNextSiblings();return i.append(a,...l),[n,o,a]}},[o,a]=r(n);return[o,a]},ArtificialNode__DO_NOT_USE:nft,BLUR_COMMAND:wct,CAN_REDO_COMMAND:{},CAN_UNDO_COMMAND:{},CLEAR_EDITOR_COMMAND:{},CLEAR_HISTORY_COMMAND:{},CLICK_COMMAND:Zst,COMMAND_PRIORITY_CRITICAL:4,COMMAND_PRIORITY_EDITOR:0,COMMAND_PRIORITY_HIGH:3,COMMAND_PRIORITY_LOW:1,COMMAND_PRIORITY_NORMAL:2,CONTROLLED_TEXT_INSERTION_COMMAND:Fst,COPY_COMMAND:vct,CUT_COMMAND:gct,DELETE_CHARACTER_COMMAND:Vst,DELETE_LINE_COMMAND:Kst,DELETE_WORD_COMMAND:Ust,DRAGEND_COMMAND:mct,DRAGOVER_COMMAND:fct,DRAGSTART_COMMAND:pct,DROP_COMMAND:hct,DecoratorNode:qpt,ElementNode:Upt,FOCUS_COMMAND:yct,FORMAT_ELEMENT_COMMAND:{},FORMAT_TEXT_COMMAND:Gst,INDENT_CONTENT_COMMAND:{},INSERT_LINE_BREAK_COMMAND:jst,INSERT_PARAGRAPH_COMMAND:Wst,INSERT_TAB_COMMAND:{},KEY_ARROW_DOWN_COMMAND:act,KEY_ARROW_LEFT_COMMAND:nct,KEY_ARROW_RIGHT_COMMAND:ect,KEY_ARROW_UP_COMMAND:oct,KEY_BACKSPACE_COMMAND:sct,KEY_DELETE_COMMAND:uct,KEY_DOWN_COMMAND:Jst,KEY_ENTER_COMMAND:ict,KEY_ESCAPE_COMMAND:cct,KEY_MODIFIER_COMMAND:xct,KEY_SPACE_COMMAND:lct,KEY_TAB_COMMAND:dct,LineBreakNode:_ht,MOVE_TO_END:tct,MOVE_TO_START:rct,OUTDENT_CONTENT_COMMAND:{},PASTE_COMMAND:qst,ParagraphNode:rft,REDO_COMMAND:Qst,REMOVE_TEXT_COMMAND:Yst,RootNode:Xpt,SELECTION_CHANGE_COMMAND:$st,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:{},SELECT_ALL_COMMAND:bct,TabNode:Kht,TextNode:Rht,UNDO_COMMAND:Xst,createCommand:function(e){return{}},createEditor:function(e){const t=e||{},n=Mpt,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,a=t.disableEvents||!1,i=Jpt(),l=t.namespace||(null!==o?o._config.namespace:jut()),s=t.editorState,c=[Xpt,Rht,_ht,Kht,rft,nft,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}const o=t.getType(),a=t.transform(),i=new Set;null!==a&&i.add(a),p.set(o,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:i})}}const f=new sft(i,o,p,{disableEvents:a,namespace:l,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,o=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(p,d?d.import:void 0),h);return void 0!==s&&(f._pendingEditorState=s,f._dirtyType=2),f},getNearestEditorFromDOMNode:xut,isBlockDomNode:function(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)},isCurrentlyReadOnlyMode:Ipt,isHTMLAnchorElement:function(e){return ydt(e)&&"A"===e.tagName},isHTMLElement:ydt,isInlineDomNode:wdt,isSelectionCapturedInDecoratorInput:yut,isSelectionWithinEditor:wut});const uft="development"===process.env.NODE_ENV?Bst:cft;uft.$addUpdateTag;const dft=uft.$applyNodeReplacement;uft.$copyNode;const hft=uft.$createLineBreakNode,pft=uft.$createNodeSelection,fft=uft.$createParagraphNode;uft.$createPoint;const mft=uft.$createRangeSelection;uft.$createRangeSelectionFromDom;const vft=uft.$createTabNode,gft=uft.$createTextNode,bft=uft.$getAdjacentNode,yft=uft.$getCharacterOffsets;uft.$getEditor;const wft=uft.$getNearestNodeFromDOMNode;uft.$getNearestRootOrShadowRoot;const xft=uft.$getNodeByKey,Eft=uft.$getPreviousSelection,kft=uft.$getRoot,Sft=uft.$getSelection;uft.$getTextContent;const Cft=uft.$hasAncestor;uft.$hasUpdateTag;const Mft=uft.$insertNodes,_ft=uft.$isBlockElementNode,Nft=uft.$isDecoratorNode,Aft=uft.$isElementNode;uft.$isInlineElementOrDecoratorNode;const Oft=uft.$isLeafNode,Ift=uft.$isLineBreakNode,Dft=uft.$isNodeSelection,Pft=uft.$isParagraphNode,Tft=uft.$isRangeSelection,Hft=uft.$isRootNode,Lft=uft.$isRootOrShadowRoot;uft.$isTabNode;const zft=uft.$isTextNode;uft.$nodesOfType;const Rft=uft.$normalizeSelection__EXPERIMENTAL,Bft=uft.$parseSerializedNode,$ft=uft.$selectAll;uft.$setCompositionKey;const Zft=uft.$setSelection,Vft=uft.$splitNode,jft=uft.ArtificialNode__DO_NOT_USE,Wft=uft.BLUR_COMMAND,Fft=uft.CAN_REDO_COMMAND,qft=uft.CAN_UNDO_COMMAND,Yft=uft.CLEAR_EDITOR_COMMAND,Uft=uft.CLEAR_HISTORY_COMMAND,Kft=uft.CLICK_COMMAND,Gft=uft.COMMAND_PRIORITY_CRITICAL,Xft=uft.COMMAND_PRIORITY_EDITOR;uft.COMMAND_PRIORITY_HIGH;const Qft=uft.COMMAND_PRIORITY_LOW,Jft=uft.COMMAND_PRIORITY_NORMAL,emt=uft.CONTROLLED_TEXT_INSERTION_COMMAND,tmt=uft.COPY_COMMAND,nmt=uft.CUT_COMMAND,rmt=uft.DELETE_CHARACTER_COMMAND,omt=uft.DELETE_LINE_COMMAND,amt=uft.DELETE_WORD_COMMAND;uft.DRAGEND_COMMAND;const imt=uft.DRAGOVER_COMMAND,lmt=uft.DRAGSTART_COMMAND,smt=uft.DROP_COMMAND,cmt=uft.DecoratorNode,umt=uft.ElementNode,dmt=uft.FOCUS_COMMAND,hmt=uft.FORMAT_ELEMENT_COMMAND,pmt=uft.FORMAT_TEXT_COMMAND,fmt=uft.INDENT_CONTENT_COMMAND,mmt=uft.INSERT_LINE_BREAK_COMMAND,vmt=uft.INSERT_PARAGRAPH_COMMAND,gmt=uft.INSERT_TAB_COMMAND,bmt=uft.KEY_ARROW_DOWN_COMMAND,ymt=uft.KEY_ARROW_LEFT_COMMAND,wmt=uft.KEY_ARROW_RIGHT_COMMAND,xmt=uft.KEY_ARROW_UP_COMMAND,Emt=uft.KEY_BACKSPACE_COMMAND,kmt=uft.KEY_DELETE_COMMAND,Smt=uft.KEY_DOWN_COMMAND,Cmt=uft.KEY_ENTER_COMMAND,Mmt=uft.KEY_ESCAPE_COMMAND;uft.KEY_MODIFIER_COMMAND,uft.KEY_SPACE_COMMAND;const _mt=uft.KEY_TAB_COMMAND;uft.LineBreakNode,uft.MOVE_TO_END,uft.MOVE_TO_START;const Nmt=uft.OUTDENT_CONTENT_COMMAND,Amt=uft.PASTE_COMMAND;uft.ParagraphNode;const Omt=uft.REDO_COMMAND,Imt=uft.REMOVE_TEXT_COMMAND;uft.RootNode;const Dmt=uft.SELECTION_CHANGE_COMMAND,Pmt=uft.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Tmt=uft.SELECT_ALL_COMMAND;uft.TabNode;const Hmt=uft.TextNode,Lmt=uft.UNDO_COMMAND,zmt=uft.createCommand,Rmt=uft.createEditor;uft.getNearestEditorFromDOMNode;const Bmt=uft.isBlockDomNode;uft.isCurrentlyReadOnlyMode;const $mt=uft.isHTMLAnchorElement,Zmt=uft.isHTMLElement,Vmt=uft.isInlineDomNode,jmt=uft.isSelectionCapturedInDecoratorInput,Wmt=uft.isSelectionWithinEditor,Fmt=new Map;function qmt(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function Ymt(e){const t=e.parentNode;if(null==t)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function Umt(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Kmt(e){let t=Fmt.get(e);return void 0===t&&(t=Umt(e),Fmt.set(e,t)),Object.freeze(t),t}function Gmt(e,t,n){let r=t.getNode(),o=n;if(Aft(r)){const e=r.getDescendantByIndex(t.offset);null!==e&&(r=e)}for(;o>0&&null!==r;){if(Aft(r)){const e=r.getLastDescendant();null!==e&&(r=e)}let n=r.getPreviousSibling(),a=0;if(null===n){let e=r.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){n=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,n=t)}let i=r.getTextContent();""===i&&Aft(r)&&!r.isInline()&&(i="\n\n");const l=i.length;if(!zft(r)||o>=l){const e=r.getParent();r.remove(),null==e||0!==e.getChildrenSize()||Hft(e)||e.remove(),o-=l+a,r=n}else{const n=r.getKey(),a=e.getEditorState().read((()=>{const e=xft(n);return zft(e)&&e.isSimpleText()?e.getTextContent():null})),s=l-o,c=i.slice(0,s);if(null!==a&&a!==i){const e=Eft();let t=r;if(r.isSimpleText())r.setTextContent(a);else{const e=gft(a);r.replace(e),t=e}if(Tft(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(r.isSimpleText()){const e=t.key===n;let a=t.offset;a<o&&(a=l);const i=e?a-o:0,c=e?a:s;if(e&&0===i){const[e]=r.splitText(i,c);e.remove()}else{const[,e]=r.splitText(i,c);e.remove()}}else{const e=gft(c);r.replace(e)}o=0}}}function Xmt(e,t){const n=Kmt("getStyle"in e?e.getStyle():e.style),r=Object.entries(t).reduce(((e,[t,r])=>(r instanceof Function?e[t]=r(n[t]):null===r?delete e[t]:e[t]=r,e)),{...n}||{}),o=function(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}(r);e.setStyle(o),Fmt.set(o,r)}function Qmt(e){return e.getNode().isAttached()}function Jmt(e){let t=e;for(;null!==t&&!Lft(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function evt(e,t,n,r,o=null){if(0===t.length)return;const a=t[0],i=new Map,l=[];let s=Aft(a)?a:a.getParentOrThrow();s.isInline()&&(s=s.getParentOrThrow());let c=!1;for(;null!==s;){const e=s.getPreviousSibling();if(null!==e){s=e,c=!0;break}if(s=s.getParentOrThrow(),Lft(s))break}const u=new Set;for(let e=0;e<n;e++){const n=t[e];Aft(n)&&0===n.getChildrenSize()&&u.add(n.getKey())}const d=new Set;for(let e=0;e<n;e++){const n=t[e];let o=n.getParent();if(null!==o&&o.isInline()&&(o=o.getParent()),null!==o&&Oft(n)&&!d.has(n.getKey())){const e=o.getKey();if(void 0===i.get(e)){const t=r();t.setFormat(o.getFormatType()),t.setIndent(o.getIndent()),l.push(t),i.set(e,t),o.getChildren().forEach((e=>{t.append(e),d.add(e.getKey()),Aft(e)&&e.getChildrenKeys().forEach((e=>d.add(e)))})),Jmt(o)}}else if(u.has(n.getKey())){if(!Aft(n))throw Error("Expected node in emptyElements to be an ElementNode");const e=r();e.setFormat(n.getFormatType()),e.setIndent(n.getIndent()),l.push(e),n.remove(!0)}}if(null!==o)for(let e=0;e<l.length;e++){const t=l[e];o.append(t)}let h=null;if(Lft(s))if(c)if(null!==o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t)}else{const e=s.getFirstChild();if(Aft(e)&&(s=e),null===e)if(o)s.append(o);else for(let e=0;e<l.length;e++){const t=l[e];s.append(t),h=t}else if(null!==o)e.insertBefore(o);else for(let t=0;t<l.length;t++){const n=l[t];e.insertBefore(n),h=n}}else if(o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t),h=t}const p=Eft();Tft(p)&&Qmt(p.anchor)&&Qmt(p.focus)?Zft(p.clone()):null!==h?h.selectEnd():e.dirty=!0}function tvt(e,t,n,r){e.modify(t?"extend":"move",n,r)}function nvt(e){const t=e.anchor.getNode();return"rtl"===(Hft(t)?t:t.getParentOrThrow()).getDirection()}function rvt(e,t,n){const r=Kmt(e.getStyle());return null!==r&&r[t]||n}function ovt(e){if(Nft(e))return!1;if(!Aft(e)||Lft(e))return!1;const t=e.getFirstChild(),n=null===t||Ift(t)||zft(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}const avt=Gmt;var ivt=Object.freeze({__proto__:null,$addNodeStyle:function(e){const t=e.getStyle(),n=Umt(t);Fmt.set(t,n)},$cloneWithProperties:function(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Aft(e)&&Aft(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):zft(e)&&zft(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):Pft(e)&&Pft(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r},$getSelectionStyleValueForProperty:function(e,t,n=""){let r=null;const o=e.getNodes(),a=e.anchor,i=e.focus,l=e.isBackward(),s=l?i.offset:a.offset,c=l?i.getNode():a.getNode();if(Tft(e)&&e.isCollapsed()&&""!==e.style){const n=Kmt(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e<o.length;e++){const a=o[e];if((0===e||0!==s||!a.is(c))&&zft(a)){const e=rvt(a,t,n);if(null===r)r=e;else if(r!==e){r="";break}}}return null===r?n:r},$isAtNodeEnd:function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();if(!Aft(t))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return e.offset===t.getChildrenSize()},$isParentElementRTL:nvt,$moveCaretSelection:tvt,$moveCharacter:function(e,t,n){const r=nvt(e);tvt(e,t,n?!r:r,"character")},$patchStyleText:function(e,t){const n=e.getNodes(),r=n.length,o=e.getStartEndPoints();if(null===o)return;const[a,i]=o,l=r-1;let s=n[0],c=n[l];if(e.isCollapsed()&&Tft(e))return void Xmt(e,t);const u=s.getTextContent().length,d=i.offset;let h=a.offset;const p=a.isBefore(i);let f=p?h:d,m=p?d:h;const v=p?a.type:i.type,g=p?i.type:a.type,b=p?i.key:a.key;if(zft(s)&&f===u){const e=s.getNextSibling();zft(e)&&(h=0,f=0,s=e)}if(1===n.length){if(zft(s)&&s.canHaveFormat()){if(f="element"===v?0:h>d?d:h,m="element"===g?u:h>d?h:d,f===m)return;if(0===f&&m===u)Xmt(s,t),s.select(f,m);else{const e=s.splitText(f,m),n=0===f?e[0]:e[1];Xmt(n,t),n.select(0,m-f)}}}else{if(zft(s)&&f<s.getTextContentSize()&&s.canHaveFormat()&&(0!==f&&(s=s.splitText(f)[1],f=0,a.set(s.getKey(),f,"text")),Xmt(s,t)),zft(c)&&c.canHaveFormat()){const e=c.getTextContent().length;c.__key!==b&&0!==m&&(m=e),m!==e&&([c]=c.splitText(m)),0===m&&"element"!==g||Xmt(c,t)}for(let e=1;e<l;e++){const r=n[e],o=r.getKey();zft(r)&&r.canHaveFormat()&&o!==s.getKey()&&o!==c.getKey()&&!r.isToken()&&Xmt(r,t)}}},$selectAll:function(e){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),a=r.getLastDescendant(),i="element",l="element",s=0;zft(o)?i="text":Aft(o)||null===o||(o=o.getParentOrThrow()),zft(a)?(l="text",s=a.getTextContentSize()):Aft(a)||null===a||(a=a.getParentOrThrow()),o&&a&&(t.set(o.getKey(),0,i),n.set(a.getKey(),s,l))},$setBlocksType:function(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=kft(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const o=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),ovt);a&&-1===o.indexOf(a)&&o.push(a);for(let e=0;e<o.length;e++){const n=o[e];if(!ovt(n))continue;if(!Aft(n))throw Error("Expected block node to be an ElementNode");const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}},$shouldOverrideDefaultCharacterSelection:function(e,t){const n=bft(e.focus,t);return Nft(n)&&!n.isIsolated()||Aft(n)&&!n.isInline()&&!n.canBeEmpty()},$sliceSelectedTextNodeContent:function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,a=e.isBackward(),i=r.getNode(),l=o.getNode(),s=t.is(i),c=t.is(l);if(s||c){const[n,r]=yft(e),o=i.is(l),s=t.is(a?l:i),c=t.is(a?i:l);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):s?(d=a?r:n,u=void 0):c&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u),t}}return t},$trimTextContentFromAnchor:Gmt,$wrapNodes:function(e,t,n=null){const r=e.getStartEndPoints(),o=r?r[0]:null,a=e.getNodes(),i=a.length;if(null!==o&&(0===i||1===i&&"element"===o.type&&0===o.getNode().getChildrenSize())){const e="text"===o.type?o.getNode().getParentOrThrow():o.getNode(),r=e.getChildren();let a=t();return a.setFormat(e.getFormatType()),a.setIndent(e.getIndent()),r.forEach((e=>a.append(e))),n&&(a=n.append(a)),void e.replace(a)}let l=null,s=[];for(let r=0;r<i;r++){const o=a[r];Lft(o)?(evt(e,s,s.length,t,n),s=[],l=o):null===l||null!==l&&Cft(o,l)?s.push(o):(evt(e,s,s.length,t,n),s=[o])}evt(e,s,s.length,t,n)},createDOMRange:function(e,t,n,r,o){const a=t.getKey(),i=r.getKey(),l=document.createRange();let s=e.getElementByKey(a),c=e.getElementByKey(i),u=n,d=o;if(zft(t)&&(s=qmt(s)),zft(r)&&(c=qmt(c)),void 0===t||void 0===r||null===s||null===c)return null;"BR"===s.nodeName&&([s,u]=Ymt(s)),"BR"===c.nodeName&&([c,d]=Ymt(c));const h=s.firstChild;s===c&&null!=h&&"BR"===h.nodeName&&0===u&&0===d&&(d=1);try{l.setStart(s,u),l.setEnd(c,d)}catch(e){return null}return!l.collapsed||u===d&&a===i||(l.setStart(c,d),l.setEnd(s,u)),l},createRectsFromDOMRange:function(e,t){const n=e.getRootElement();if(null===n)return[];const r=n.getBoundingClientRect(),o=getComputedStyle(n),a=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(t.getClientRects());let l,s=i.length;i.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<s;e++){const t=i[e],n=l&&l.top<=t.top&&l.top+l.height>t.top&&l.left+l.width>t.left,o=t.width+a===r.width;n||o?(i.splice(e--,1),s--):l=t}return i},getStyleObjectFromCSS:Kmt,trimTextContentFromAnchor:avt}),lvt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const svt=new Map;function cvt(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function uvt(e){const t=e.parentNode;if(null==t)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function dvt(e){const t={},n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function hvt(e){let t=svt.get(e);return void 0===t&&(t=dvt(e),svt.set(e,t)),t}function pvt(e,t,n){let r=t.getNode(),o=n;if(Aft(r)){const e=r.getDescendantByIndex(t.offset);null!==e&&(r=e)}for(;o>0&&null!==r;){if(Aft(r)){const e=r.getLastDescendant();null!==e&&(r=e)}let n=r.getPreviousSibling(),a=0;if(null===n){let e=r.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){n=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,n=t)}let i=r.getTextContent();""===i&&Aft(r)&&!r.isInline()&&(i="\n\n");const l=i.length;if(!zft(r)||o>=l){const e=r.getParent();r.remove(),null==e||0!==e.getChildrenSize()||Hft(e)||e.remove(),o-=l+a,r=n}else{const n=r.getKey(),a=e.getEditorState().read((()=>{const e=xft(n);return zft(e)&&e.isSimpleText()?e.getTextContent():null})),s=l-o,c=i.slice(0,s);if(null!==a&&a!==i){const e=Eft();let t=r;if(r.isSimpleText())r.setTextContent(a);else{const e=gft(a);r.replace(e),t=e}if(Tft(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(r.isSimpleText()){const e=t.key===n;let a=t.offset;a<o&&(a=l);const i=e?a-o:0,c=e?a:s;if(e&&0===i){const[e]=r.splitText(i,c);e.remove()}else{const[,e]=r.splitText(i,c);e.remove()}}else{const e=gft(c);r.replace(e)}o=0}}}function fvt(e,t){const n=hvt("getStyle"in e?e.getStyle():e.style),r=Object.entries(t).reduce(((e,[t,r])=>(r instanceof Function?e[t]=r(n[t]):null===r?delete e[t]:e[t]=r,e)),{...n}||{}),o=function(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}(r);e.setStyle(o),svt.set(o,r)}function mvt(e){return e.getNode().isAttached()}function vvt(e){let t=e;for(;null!==t&&!Lft(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function gvt(e,t,n,r,o=null){if(0===t.length)return;const a=t[0],i=new Map,l=[];let s=Aft(a)?a:a.getParentOrThrow();s.isInline()&&(s=s.getParentOrThrow());let c=!1;for(;null!==s;){const e=s.getPreviousSibling();if(null!==e){s=e,c=!0;break}if(s=s.getParentOrThrow(),Lft(s))break}const u=new Set;for(let e=0;e<n;e++){const n=t[e];Aft(n)&&0===n.getChildrenSize()&&u.add(n.getKey())}const d=new Set;for(let e=0;e<n;e++){const n=t[e];let o=n.getParent();if(null!==o&&o.isInline()&&(o=o.getParent()),null!==o&&Oft(n)&&!d.has(n.getKey())){const e=o.getKey();if(void 0===i.get(e)){const t=r();t.setFormat(o.getFormatType()),t.setIndent(o.getIndent()),l.push(t),i.set(e,t),o.getChildren().forEach((e=>{t.append(e),d.add(e.getKey()),Aft(e)&&e.getChildrenKeys().forEach((e=>d.add(e)))})),vvt(o)}}else if(u.has(n.getKey())){Aft(n)||lvt(179);const e=r();e.setFormat(n.getFormatType()),e.setIndent(n.getIndent()),l.push(e),n.remove(!0)}}if(null!==o)for(let e=0;e<l.length;e++){const t=l[e];o.append(t)}let h=null;if(Lft(s))if(c)if(null!==o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t)}else{const e=s.getFirstChild();if(Aft(e)&&(s=e),null===e)if(o)s.append(o);else for(let e=0;e<l.length;e++){const t=l[e];s.append(t),h=t}else if(null!==o)e.insertBefore(o);else for(let t=0;t<l.length;t++){const n=l[t];e.insertBefore(n),h=n}}else if(o)s.insertAfter(o);else for(let e=l.length-1;e>=0;e--){const t=l[e];s.insertAfter(t),h=t}const p=Eft();Tft(p)&&mvt(p.anchor)&&mvt(p.focus)?Zft(p.clone()):null!==h?h.selectEnd():e.dirty=!0}function bvt(e,t,n,r){e.modify(t?"extend":"move",n,r)}function yvt(e){const t=e.anchor.getNode();return"rtl"===(Hft(t)?t:t.getParentOrThrow()).getDirection()}function wvt(e,t,n){const r=hvt(e.getStyle());return null!==r&&r[t]||n}function xvt(e){if(Nft(e))return!1;if(!Aft(e)||Lft(e))return!1;const t=e.getFirstChild(),n=null===t||Ift(t)||zft(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}const Evt=pvt;var kvt=Object.freeze({__proto__:null,$addNodeStyle:function(e){const t=e.getStyle(),n=dvt(t);svt.set(t,n)},$cloneWithProperties:function(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,Aft(e)&&Aft(t)?(r=e,(n=t).__first=r.__first,n.__last=r.__last,n.__size=r.__size,n.__format=r.__format,n.__indent=r.__indent,n.__dir=r.__dir,n):zft(e)&&zft(t)?function(e,t){return e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail,e}(t,e):Pft(e)&&Pft(t)?function(e,t){return e.__textFormat=t.__textFormat,e}(t,e):t;var n,r},$getSelectionStyleValueForProperty:function(e,t,n=""){let r=null;const o=e.getNodes(),a=e.anchor,i=e.focus,l=e.isBackward(),s=l?i.offset:a.offset,c=l?i.getNode():a.getNode();if(Tft(e)&&e.isCollapsed()&&""!==e.style){const n=hvt(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e<o.length;e++){const a=o[e];if((0===e||0!==s||!a.is(c))&&zft(a)){const e=wvt(a,t,n);if(null===r)r=e;else if(r!==e){r="";break}}}return null===r?n:r},$isAtNodeEnd:function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return Aft(t)||lvt(177),e.offset===t.getChildrenSize()},$isParentElementRTL:yvt,$moveCaretSelection:bvt,$moveCharacter:function(e,t,n){const r=yvt(e);bvt(e,t,n?!r:r,"character")},$patchStyleText:function(e,t){const n=e.getNodes(),r=n.length,o=e.getStartEndPoints();if(null===o)return;const[a,i]=o,l=r-1;let s=n[0],c=n[l];if(e.isCollapsed()&&Tft(e))return void fvt(e,t);const u=s.getTextContent().length,d=i.offset;let h=a.offset;const p=a.isBefore(i);let f=p?h:d,m=p?d:h;const v=p?a.type:i.type,g=p?i.type:a.type,b=p?i.key:a.key;if(zft(s)&&f===u){const e=s.getNextSibling();zft(e)&&(h=0,f=0,s=e)}if(1===n.length){if(zft(s)&&s.canHaveFormat()){if(f="element"===v?0:h>d?d:h,m="element"===g?u:h>d?h:d,f===m)return;if(0===f&&m===u)fvt(s,t),s.select(f,m);else{const e=s.splitText(f,m),n=0===f?e[0]:e[1];fvt(n,t),n.select(0,m-f)}}}else{if(zft(s)&&f<s.getTextContentSize()&&s.canHaveFormat()&&(0!==f&&(s=s.splitText(f)[1],f=0,a.set(s.getKey(),f,"text")),fvt(s,t)),zft(c)&&c.canHaveFormat()){const e=c.getTextContent().length;c.__key!==b&&0!==m&&(m=e),m!==e&&([c]=c.splitText(m)),0===m&&"element"!==g||fvt(c,t)}for(let e=1;e<l;e++){const r=n[e],o=r.getKey();zft(r)&&r.canHaveFormat()&&o!==s.getKey()&&o!==c.getKey()&&!r.isToken()&&fvt(r,t)}}},$selectAll:function(e){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),a=r.getLastDescendant(),i="element",l="element",s=0;zft(o)?i="text":Aft(o)||null===o||(o=o.getParentOrThrow()),zft(a)?(l="text",s=a.getTextContentSize()):Aft(a)||null===a||(a=a.getParentOrThrow()),o&&a&&(t.set(o.getKey(),0,i),n.set(a.getKey(),s,l))},$setBlocksType:function(e,t){if(null===e)return;const n=e.getStartEndPoints(),r=n?n[0]:null;if(null!==r&&"root"===r.key){const e=t(),n=kft(),r=n.getFirstChild();return void(r?r.replace(e,!0):n.append(e))}const o=e.getNodes(),a=null!==r&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(r.getNode(),xvt);a&&-1===o.indexOf(a)&&o.push(a);for(let e=0;e<o.length;e++){const n=o[e];if(!xvt(n))continue;Aft(n)||lvt(178);const r=t();r.setFormat(n.getFormatType()),r.setIndent(n.getIndent()),n.replace(r,!0)}},$shouldOverrideDefaultCharacterSelection:function(e,t){const n=bft(e.focus,t);return Nft(n)&&!n.isIsolated()||Aft(n)&&!n.isInline()&&!n.canBeEmpty()},$sliceSelectedTextNodeContent:function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,a=e.isBackward(),i=r.getNode(),l=o.getNode(),s=t.is(i),c=t.is(l);if(s||c){const[n,r]=yft(e),o=i.is(l),s=t.is(a?l:i),c=t.is(a?i:l);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):s?(d=a?r:n,u=void 0):c&&(d=0,u=a?n:r),t.__text=t.__text.slice(d,u),t}}return t},$trimTextContentFromAnchor:pvt,$wrapNodes:function(e,t,n=null){const r=e.getStartEndPoints(),o=r?r[0]:null,a=e.getNodes(),i=a.length;if(null!==o&&(0===i||1===i&&"element"===o.type&&0===o.getNode().getChildrenSize())){const e="text"===o.type?o.getNode().getParentOrThrow():o.getNode(),r=e.getChildren();let a=t();return a.setFormat(e.getFormatType()),a.setIndent(e.getIndent()),r.forEach((e=>a.append(e))),n&&(a=n.append(a)),void e.replace(a)}let l=null,s=[];for(let r=0;r<i;r++){const o=a[r];Lft(o)?(gvt(e,s,s.length,t,n),s=[],l=o):null===l||null!==l&&Cft(o,l)?s.push(o):(gvt(e,s,s.length,t,n),s=[o])}gvt(e,s,s.length,t,n)},createDOMRange:function(e,t,n,r,o){const a=t.getKey(),i=r.getKey(),l=document.createRange();let s=e.getElementByKey(a),c=e.getElementByKey(i),u=n,d=o;if(zft(t)&&(s=cvt(s)),zft(r)&&(c=cvt(c)),void 0===t||void 0===r||null===s||null===c)return null;"BR"===s.nodeName&&([s,u]=uvt(s)),"BR"===c.nodeName&&([c,d]=uvt(c));const h=s.firstChild;s===c&&null!=h&&"BR"===h.nodeName&&0===u&&0===d&&(d=1);try{l.setStart(s,u),l.setEnd(c,d)}catch(e){return null}return!l.collapsed||u===d&&a===i||(l.setStart(c,d),l.setEnd(s,u)),l},createRectsFromDOMRange:function(e,t){const n=e.getRootElement();if(null===n)return[];const r=n.getBoundingClientRect(),o=getComputedStyle(n),a=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(t.getClientRects());let l,s=i.length;i.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<s;e++){const t=i[e],n=l&&l.top<=t.top&&l.top+l.height>t.top&&l.left+l.width>t.left,o=t.width+a===r.width;n||o?(i.splice(e--,1),s--):l=t}return i},getStyleObjectFromCSS:hvt,trimTextContentFromAnchor:Evt});const Svt="development"===process.env.NODE_ENV?ivt:kvt,Cvt=Svt.$addNodeStyle,Mvt=Svt.$cloneWithProperties;Svt.$getSelectionStyleValueForProperty,Svt.$isAtNodeEnd,Svt.$isParentElementRTL,Svt.$moveCaretSelection;const _vt=Svt.$moveCharacter;Svt.$patchStyleText,Svt.$selectAll,Svt.$setBlocksType;const Nvt=Svt.$shouldOverrideDefaultCharacterSelection,Avt=Svt.$sliceSelectedTextNodeContent;Svt.$trimTextContentFromAnchor,Svt.$wrapNodes,Svt.createDOMRange;const Ovt=Svt.createRectsFromDOMRange;Svt.getStyleObjectFromCSS,Svt.trimTextContentFromAnchor;const Ivt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dvt=Ivt&&"documentMode"in document?document.documentMode:null,Pvt=Ivt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Tvt=Ivt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Hvt=!(!Ivt||!("InputEvent"in window)||Dvt)&&"getTargetRanges"in new window.InputEvent("input"),Lvt=Ivt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zvt=Ivt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Rvt=Ivt&&/Android/.test(navigator.userAgent),Bvt=Ivt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),$vt=Ivt&&Rvt&&Bvt,Zvt=Ivt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Bvt;function Vvt(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function jvt(...e){return()=>{e.forEach((e=>e()))}}function Wvt(e){return`${e}px`}const Fvt={attributes:!0,characterData:!0,childList:!0,subtree:!0};function qvt(e,t,n){let r=null,o=null,a=null,i=[];const l=document.createElement("div");function s(){if(null===r)throw Error("Unexpected null rootDOMNode");if(null===o)throw Error("Unexpected null parentDOMNode");const{left:a,top:s}=r.getBoundingClientRect(),c=o,u=Ovt(e,t);l.isConnected||c.append(l);let d=!1;for(let e=0;e<u.length;e++){const t=u[e],n=i[e]||document.createElement("div"),r=n.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const o=Wvt(t.left-a);r.left!==o&&(r.left=o,d=!0);const c=Wvt(t.top-s);r.top!==c&&(n.style.top=c,d=!0);const h=Wvt(t.width);r.width!==h&&(n.style.width=h,d=!0);const p=Wvt(t.height);r.height!==p&&(n.style.height=p,d=!0),n.parentNode!==l&&(l.append(n),d=!0),i[e]=n}for(;i.length>u.length;)i.pop();d&&n(i)}function c(){o=null,r=null,null!==a&&a.disconnect(),a=null,l.remove();for(const e of i)e.remove();i=[]}const u=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),r=n,o=i,a=new MutationObserver((n=>{const a=e.getRootElement(),i=a&&a.parentElement;if(a!==r||i!==o)return t();for(const e of n)if(!l.contains(e.target))return s()})),a.observe(i,Fvt),s()}));return()=>{u(),c()}}const Yvt=Hvt,Uvt=Ivt,Kvt=Rvt,Gvt=$vt,Xvt=Pvt,Qvt=Zvt,Jvt=Bvt,egt=Tvt,tgt=zvt,ngt=Lvt;function rgt(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}const ogt=(e,t)=>{let n=e;for(;n!==kft()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};var agt=Object.freeze({__proto__:null,$dfs:function(e,t){const n=[],r=(e||kft()).getLatest(),o=t||Aft(r)&&r.getLastDescendant()||r;let a=r,i=function(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}(a);for(;null!==a&&!a.is(o);)if(n.push({depth:i,node:a}),Aft(a)&&a.getChildrenSize()>0)a=a.getFirstChild(),i++;else{let e=null;for(;null===e&&null!==a;)e=a.getNextSibling(),null===e?(a=a.getParent(),i--):a=e}return null!==a&&a.is(o)&&n.push({depth:i,node:a}),n},$filter:function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=t(e[r]);null!==o&&n.push(o)}return n},$findMatchingParent:ogt,$getNearestBlockElementAncestorOrThrow:function(e){const t=ogt(e,(e=>Aft(e)&&!e.isInline()));if(!Aft(t))throw Error(`Expected node ${e.__key} to have closest block element node.`);return t},$getNearestNodeOfType:function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null},$getNextRightPreorderNode:function(e){let t=e;if(Aft(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t},$insertFirst:function(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)},$insertNodeToNearestRoot:function(e){const t=Sft()||Eft();if(Tft(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if(Lft(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;zft(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,a]=Vft(t,n);a.insertBefore(e),a.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else kft().append(e);const n=fft();e.insertAfter(n),n.select()}return e.getLatest()},$restoreEditorState:function(e,t){const n=new Map,r=e._pendingEditorState;for(const[e,r]of t._nodeMap){const t=Mvt(r);if(zft(t)){if(!zft(r))throw Error("Expected node be a TextNode");t.__text=r.__text}n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2;const o=t._selection;Zft(null===o?null:o.clone())},$wrapNodeInElement:function(e,t){const n=t();return e.replace(n),n.append(e),n},CAN_USE_BEFORE_INPUT:Yvt,CAN_USE_DOM:Uvt,IS_ANDROID:Kvt,IS_ANDROID_CHROME:Gvt,IS_APPLE:Xvt,IS_APPLE_WEBKIT:Qvt,IS_CHROME:Jvt,IS_FIREFOX:egt,IS_IOS:tgt,IS_SAFARI:ngt,addClassNamesToElement:function(e,...t){const n=Vvt(...t);n.length>0&&e.classList.add(...n)},calculateZoomLevel:function(e){if(egt)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t},isMimeType:rgt,markSelection:function(e,t){let n=null,r=null,o=null,a=null,i=()=>{};function l(l){l.read((()=>{const l=Sft();if(!Tft(l))return n=null,r=null,o=null,a=null,i(),void(i=()=>{});const{anchor:s,focus:c}=l,u=s.getNode(),d=u.getKey(),h=s.offset,p=c.getNode(),f=p.getKey(),m=c.offset,v=e.getElementByKey(d),g=e.getElementByKey(f),b=null===n||null===v||h!==r||d!==n.getKey()||u!==n&&(!(n instanceof Hmt)||u.updateDOM(n,v,e._config)),y=null===o||null===g||m!==a||f!==o.getKey()||p!==o&&(!(o instanceof Hmt)||p.updateDOM(o,g,e._config));if(b||y){const n=e.getElementByKey(s.getNode().getKey()),r=e.getElementByKey(c.getNode().getKey());if(null!==n&&null!==r&&"SPAN"===n.tagName&&"SPAN"===r.tagName){const o=document.createRange();let a,l,u,d;c.isBefore(s)?(a=r,l=c.offset,u=n,d=s.offset):(a=n,l=s.offset,u=r,d=c.offset);const h=a.firstChild;if(null===h)throw Error("Expected text node to be first child of span");const p=u.firstChild;if(null===p)throw Error("Expected text node to be first child of span");o.setStart(h,l),o.setEnd(p,d),i(),i=qvt(e,o,(e=>{for(const t of e){const e=t.style;"Highlight"!==e.background&&(e.background="Highlight"),"HighlightText"!==e.color&&(e.color="HighlightText"),"-1"!==e.zIndex&&(e.zIndex="-1"),"none"!==e.pointerEvents&&(e.pointerEvents="none"),e.marginTop!==Wvt(-1.5)&&(e.marginTop=Wvt(-1.5)),e.paddingTop!==Wvt(4)&&(e.paddingTop=Wvt(4)),e.paddingBottom!==Wvt(0)&&(e.paddingBottom=Wvt(0))}void 0!==t&&t(e)}))}}n=u,r=h,o=p,a=m}))}return l(e.getEditorState()),jvt(e.registerUpdateListener((({editorState:e})=>l(e))),i,(()=>{i()}))},mediaFileReader:function(e,t){const n=e[Symbol.iterator]();return new Promise(((e,r)=>{const o=[],a=()=>{const{done:i,value:l}=n.next();if(i)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:l,result:e}),a()})),rgt(l,t)?s.readAsDataURL(l):a()};a()}))},mergeRegister:jvt,objectKlassEquals:function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},positionNodeOnRange:qvt,registerNestedElementResolver:function(e,t,n,r){const o=e=>e instanceof t;return e.registerNodeTransform(t,(e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(o(n))return null}let n=e,r=e;for(;null!==n;)if(r=n,n=n.getParent(),o(n))return{child:r,parent:n};return null})(e);if(null!==t){const{child:o,parent:a}=t;if(o.is(e)){r(a,e);const t=o.getNextSiblings(),i=t.length;if(a.insertAfter(o),0!==i){const e=n(a);o.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}a.canBeEmpty()||0!==a.getChildrenSize()||a.remove()}}}))},removeClassNamesFromElement:function(e,...t){const n=Vvt(...t);n.length>0&&e.classList.remove(...n)},$splitNode:Vft,isBlockDomNode:Bmt,isHTMLAnchorElement:$mt,isHTMLElement:Zmt,isInlineDomNode:Vmt}),igt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const lgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,sgt=lgt&&"documentMode"in document?document.documentMode:null,cgt=lgt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ugt=lgt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),dgt=!(!lgt||!("InputEvent"in window)||sgt)&&"getTargetRanges"in new window.InputEvent("input"),hgt=lgt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pgt=lgt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fgt=lgt&&/Android/.test(navigator.userAgent),mgt=lgt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vgt=lgt&&fgt&&mgt,ggt=lgt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mgt;function bgt(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function ygt(...e){return()=>{e.forEach((e=>e()))}}function wgt(e){return`${e}px`}const xgt={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Egt(e,t,n){let r=null,o=null,a=null,i=[];const l=document.createElement("div");function s(){null===r&&igt(182),null===o&&igt(183);const{left:a,top:s}=r.getBoundingClientRect(),c=o,u=Ovt(e,t);l.isConnected||c.append(l);let d=!1;for(let e=0;e<u.length;e++){const t=u[e],n=i[e]||document.createElement("div"),r=n.style;"absolute"!==r.position&&(r.position="absolute",d=!0);const o=wgt(t.left-a);r.left!==o&&(r.left=o,d=!0);const c=wgt(t.top-s);r.top!==c&&(n.style.top=c,d=!0);const h=wgt(t.width);r.width!==h&&(n.style.width=h,d=!0);const p=wgt(t.height);r.height!==p&&(n.style.height=p,d=!0),n.parentNode!==l&&(l.append(n),d=!0),i[e]=n}for(;i.length>u.length;)i.pop();d&&n(i)}function c(){o=null,r=null,null!==a&&a.disconnect(),a=null,l.remove();for(const e of i)e.remove();i=[]}const u=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),r=n,o=i,a=new MutationObserver((n=>{const a=e.getRootElement(),i=a&&a.parentElement;if(a!==r||i!==o)return t();for(const e of n)if(!l.contains(e.target))return s()})),a.observe(i,xgt),s()}));return()=>{u(),c()}}const kgt=dgt,Sgt=lgt,Cgt=fgt,Mgt=vgt,_gt=cgt,Ngt=ggt,Agt=mgt,Ogt=ugt,Igt=pgt,Dgt=hgt;function Pgt(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}const Tgt=(e,t)=>{let n=e;for(;n!==kft()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};var Hgt=Object.freeze({__proto__:null,$dfs:function(e,t){const n=[],r=(e||kft()).getLatest(),o=t||Aft(r)&&r.getLastDescendant()||r;let a=r,i=function(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}(a);for(;null!==a&&!a.is(o);)if(n.push({depth:i,node:a}),Aft(a)&&a.getChildrenSize()>0)a=a.getFirstChild(),i++;else{let e=null;for(;null===e&&null!==a;)e=a.getNextSibling(),null===e?(a=a.getParent(),i--):a=e}return null!==a&&a.is(o)&&n.push({depth:i,node:a}),n},$filter:function(e,t){const n=[];for(let r=0;r<e.length;r++){const o=t(e[r]);null!==o&&n.push(o)}return n},$findMatchingParent:Tgt,$getNearestBlockElementAncestorOrThrow:function(e){const t=Tgt(e,(e=>Aft(e)&&!e.isInline()));return Aft(t)||igt(4,e.__key),t},$getNearestNodeOfType:function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null},$getNextRightPreorderNode:function(e){let t=e;if(Aft(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t},$insertFirst:function(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)},$insertNodeToNearestRoot:function(e){const t=Sft()||Eft();if(Tft(t)){const{focus:n}=t,r=n.getNode(),o=n.offset;if(Lft(r)){const t=r.getChildAtIndex(o);null==t?r.append(e):t.insertBefore(e),e.selectNext()}else{let t,n;zft(r)?(t=r.getParentOrThrow(),n=r.getIndexWithinParent(),o>0&&(n+=1,r.splitText(o))):(t=r,n=o);const[,a]=Vft(t,n);a.insertBefore(e),a.selectStart()}}else{if(null!=t){const n=t.getNodes();n[n.length-1].getTopLevelElementOrThrow().insertAfter(e)}else kft().append(e);const n=fft();e.insertAfter(n),n.select()}return e.getLatest()},$restoreEditorState:function(e,t){const n=new Map,r=e._pendingEditorState;for(const[e,r]of t._nodeMap){const t=Mvt(r);zft(t)&&(zft(r)||igt(180),t.__text=r.__text),n.set(e,t)}r&&(r._nodeMap=n),e._dirtyType=2;const o=t._selection;Zft(null===o?null:o.clone())},$wrapNodeInElement:function(e,t){const n=t();return e.replace(n),n.append(e),n},CAN_USE_BEFORE_INPUT:kgt,CAN_USE_DOM:Sgt,IS_ANDROID:Cgt,IS_ANDROID_CHROME:Mgt,IS_APPLE:_gt,IS_APPLE_WEBKIT:Ngt,IS_CHROME:Agt,IS_FIREFOX:Ogt,IS_IOS:Igt,IS_SAFARI:Dgt,addClassNamesToElement:function(e,...t){const n=bgt(...t);n.length>0&&e.classList.add(...n)},calculateZoomLevel:function(e){if(Ogt)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t},isMimeType:Pgt,markSelection:function(e,t){let n=null,r=null,o=null,a=null,i=()=>{};function l(l){l.read((()=>{const l=Sft();if(!Tft(l))return n=null,r=null,o=null,a=null,i(),void(i=()=>{});const{anchor:s,focus:c}=l,u=s.getNode(),d=u.getKey(),h=s.offset,p=c.getNode(),f=p.getKey(),m=c.offset,v=e.getElementByKey(d),g=e.getElementByKey(f),b=null===n||null===v||h!==r||d!==n.getKey()||u!==n&&(!(n instanceof Hmt)||u.updateDOM(n,v,e._config)),y=null===o||null===g||m!==a||f!==o.getKey()||p!==o&&(!(o instanceof Hmt)||p.updateDOM(o,g,e._config));if(b||y){const n=e.getElementByKey(s.getNode().getKey()),r=e.getElementByKey(c.getNode().getKey());if(null!==n&&null!==r&&"SPAN"===n.tagName&&"SPAN"===r.tagName){const o=document.createRange();let a,l,u,d;c.isBefore(s)?(a=r,l=c.offset,u=n,d=s.offset):(a=n,l=s.offset,u=r,d=c.offset);const h=a.firstChild;null===h&&igt(181);const p=u.firstChild;null===p&&igt(181),o.setStart(h,l),o.setEnd(p,d),i(),i=Egt(e,o,(e=>{for(const t of e){const e=t.style;"Highlight"!==e.background&&(e.background="Highlight"),"HighlightText"!==e.color&&(e.color="HighlightText"),"-1"!==e.zIndex&&(e.zIndex="-1"),"none"!==e.pointerEvents&&(e.pointerEvents="none"),e.marginTop!==wgt(-1.5)&&(e.marginTop=wgt(-1.5)),e.paddingTop!==wgt(4)&&(e.paddingTop=wgt(4)),e.paddingBottom!==wgt(0)&&(e.paddingBottom=wgt(0))}void 0!==t&&t(e)}))}}n=u,r=h,o=p,a=m}))}return l(e.getEditorState()),ygt(e.registerUpdateListener((({editorState:e})=>l(e))),i,(()=>{i()}))},mediaFileReader:function(e,t){const n=e[Symbol.iterator]();return new Promise(((e,r)=>{const o=[],a=()=>{const{done:i,value:l}=n.next();if(i)return e(o);const s=new FileReader;s.addEventListener("error",r),s.addEventListener("load",(()=>{const e=s.result;"string"==typeof e&&o.push({file:l,result:e}),a()})),Pgt(l,t)?s.readAsDataURL(l):a()};a()}))},mergeRegister:ygt,objectKlassEquals:function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name},positionNodeOnRange:Egt,registerNestedElementResolver:function(e,t,n,r){const o=e=>e instanceof t;return e.registerNodeTransform(t,(e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(o(n))return null}let n=e,r=e;for(;null!==n;)if(r=n,n=n.getParent(),o(n))return{child:r,parent:n};return null})(e);if(null!==t){const{child:o,parent:a}=t;if(o.is(e)){r(a,e);const t=o.getNextSiblings(),i=t.length;if(a.insertAfter(o),0!==i){const e=n(a);o.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}a.canBeEmpty()||0!==a.getChildrenSize()||a.remove()}}}))},removeClassNamesFromElement:function(e,...t){const n=bgt(...t);n.length>0&&e.classList.remove(...n)},$splitNode:Vft,isBlockDomNode:Bmt,isHTMLAnchorElement:$mt,isHTMLElement:Zmt,isInlineDomNode:Vmt});const Lgt="development"===process.env.NODE_ENV?agt:Hgt;Lgt.$dfs,Lgt.$filter;const zgt=Lgt.$findMatchingParent,Rgt=Lgt.$getNearestBlockElementAncestorOrThrow;Lgt.$getNearestNodeOfType,Lgt.$getNextRightPreorderNode,Lgt.$insertFirst,Lgt.$insertNodeToNearestRoot,Lgt.$restoreEditorState,Lgt.$splitNode,Lgt.$wrapNodeInElement,Lgt.CAN_USE_BEFORE_INPUT,Lgt.CAN_USE_DOM,Lgt.IS_ANDROID,Lgt.IS_ANDROID_CHROME,Lgt.IS_APPLE,Lgt.IS_APPLE_WEBKIT,Lgt.IS_CHROME,Lgt.IS_FIREFOX,Lgt.IS_IOS,Lgt.IS_SAFARI;const Bgt=Lgt.addClassNamesToElement;Lgt.calculateZoomLevel;const $gt=Lgt.isBlockDomNode;Lgt.isHTMLAnchorElement;const Zgt=Lgt.isHTMLElement;Lgt.isInlineDomNode,Lgt.isMimeType,Lgt.markSelection,Lgt.mediaFileReader;const Vgt=Lgt.mergeRegister,jgt=Lgt.objectKlassEquals;Lgt.positionNodeOnRange,Lgt.registerNestedElementResolver,Lgt.removeClassNamesFromElement;const Wgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,Fgt=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function qgt(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function Ygt(t,n,r,o){const[a]=art();e.useEffect((()=>{if(null!=n&&null!=t){const e=a.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let i=!1,l=qgt(n,t);const s=function(){i||(window.requestAnimationFrame((function(){r(),i=!1})),i=!0);const e=qgt(n,t);e!==l&&(l=e,null!=o&&o(e))},c=new ResizeObserver(r);return window.addEventListener("resize",r),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",r),document.removeEventListener("scroll",s,!0)}}}),[n,a,o,r,t])}const Ugt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function Kgt({close:t,editor:n,anchorElementRef:r,resolution:o,options:a,menuRenderFn:i,onSelectOption:l,shouldSplitNodeWithQuery:s=!1,commandPriority:c=Qft}){const[u,d]=e.useState(null),h=o.match&&o.match.matchingString;e.useEffect((()=>{d(0)}),[h]);const p=e.useCallback((e=>{n.update((()=>{const n=null!=o.match&&s?function(e){const t=Sft();if(!Tft(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,a=r.getTextContent().slice(0,o),i=e.replaceableString.length,l=function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(a,e.matchingString,i),s=o-l;if(s<0)return null;let c;return 0===s?[c]=r.splitText(o):[,c]=r.splitText(s,o),c}(o.match):null;l(e,n,t,o.match?o.match.matchingString:"")}))}),[n,s,o.match,l,t]),f=e.useCallback((e=>{const t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[n]);return e.useEffect((()=>()=>{const e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[n]),Wgt((()=>{null===a?d(null):null===u&&f(0)}),[a,u,f]),e.useEffect((()=>Vgt(n.registerCommand(Ugt,(({option:e})=>!(!e.ref||null==e.ref.current||(Fgt(e.ref.current),0))),c))),[n,f,c]),e.useEffect((()=>Vgt(n.registerCommand(bmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=u!==a.length-1?u+1:0;f(e);const r=a[e];null!=r.ref&&r.ref.current&&n.dispatchCommand(Ugt,{index:e,option:r}),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(xmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=0!==u?u-1:a.length-1;f(e);const n=a[e];null!=n.ref&&n.ref.current&&Fgt(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(Mmt,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),c),n.registerCommand(_mt,(e=>{const t=e;return null!==a&&null!==u&&null!=a[u]&&(t.preventDefault(),t.stopImmediatePropagation(),p(a[u]),!0)}),c),n.registerCommand(Cmt,(e=>null!==a&&null!==u&&null!=a[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),p(a[u]),!0)),c))),[p,t,n,a,u,f,c]),i(r,e.useMemo((()=>({options:a,selectOptionAndCleanUp:p,selectedIndex:u,setHighlightedIndex:d})),[p,u,a]),o.match?o.match.matchingString:"")}const Ggt="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",Xgt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");var Qgt=Object.freeze({__proto__:null,LexicalTypeaheadMenuPlugin:function({options:t,onQueryChange:n,onSelectOption:r,onOpen:o,onClose:a,menuRenderFn:i,triggerFn:l,anchorClassName:s,commandPriority:c=Qft,parent:u}){const[d]=art(),[h,p]=e.useState(null),f=function(t,n,r,o=document.body){const[a]=art(),i=e.useRef(document.createElement("div")),l=e.useCallback((()=>{i.current.style.top=i.current.style.bottom;const e=a.getRootElement(),n=i.current,l=n.firstChild;if(null!==e&&null!==t){const{left:a,top:s,width:c,height:u}=t.getRect(),d=i.current.offsetHeight;if(n.style.top=`${s+window.pageYOffset+d+3}px`,n.style.left=`${a+window.pageXOffset}px`,n.style.height=`${u}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),r=t.height,o=t.width,i=e.getBoundingClientRect();a+o>i.right&&(n.style.left=`${i.right-o+window.pageXOffset}px`),(s+r>window.innerHeight||s+r>i.bottom)&&s-i.top>r+u&&(n.style.top=s-r+window.pageYOffset-u+"px")}n.isConnected||(null!=r&&(n.className=r),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",o.append(n)),i.current=n,e.setAttribute("aria-controls","typeahead-menu")}}),[a,t,r,o]);e.useEffect((()=>{const e=a.getRootElement();if(null!==t)return l(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=i.current;null!==t&&t.isConnected&&t.remove()}}),[a,l,t]);const s=e.useCallback((e=>{null!==t&&(e||n(null))}),[t,n]);return Ygt(t,i.current,l,s),i}(h,p,s,u),m=e.useCallback((()=>{p(null),null!=a&&null!==h&&a()}),[a,h]),v=e.useCallback((e=>{p(e),null!=o&&null===h&&o(e)}),[o,h]);return e.useEffect((()=>{const e=d.registerUpdateListener((()=>{d.getEditorState().read((()=>{const e=d._window||window,t=e.document.createRange(),r=Sft(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Sft();Tft(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(d);if(!Tft(r)||!r.isCollapsed()||null===o||null===t)return void m();const a=l(o,d);if(n(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Sft();if(Tft(e)){const t=e.anchor.getNode().getPreviousSibling();return zft(t)&&t.isTextEntity()}return!1}))}(d,a.leadOffset)){const n=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,a=e,i=r.anchorOffset;if(null==o||null==i)return!1;try{t.setStart(o,a),t.setEnd(o,i)}catch(e){return!1}return!0}(a.leadOffset,t,e);if(null!==n)return i=()=>v({getRect:()=>t.getBoundingClientRect(),match:a}),void(E.startTransition?E.startTransition(i):i())}var i;m()}))}));return()=>{e()}}),[d,l,n,h,m,v]),null===h||null===d?null:E.createElement(Kgt,{close:m,resolution:h,editor:d,anchorElementRef:f,options:t,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:r,commandPriority:c})},MenuOption:class{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}},PUNCTUATION:Ggt,SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND:Xgt,getScrollParent:function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body},useBasicTypeaheadTriggerMatch:function(t,{minLength:n=1,maxLength:r=75}){return e.useCallback((e=>{const o=new RegExp("(^|\\s|\\()(["+t+"]((?:[^"+t+Ggt+"\\s]){0,"+r+"}))$").exec(e);if(null!==o){const e=o[1],t=o[3];if(t.length>=n)return{leadOffset:o.index+e.length,matchingString:t,replaceableString:o[2]}}return null}),[r,n,t])},useDynamicPositioning:Ygt});const Jgt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect,ebt=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function tbt(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function nbt(t,n,r,o){const[a]=art();e.useEffect((()=>{if(null!=n&&null!=t){const e=a.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let i=!1,l=tbt(n,t);const s=function(){i||(window.requestAnimationFrame((function(){r(),i=!1})),i=!0);const e=tbt(n,t);e!==l&&(l=e,null!=o&&o(e))},c=new ResizeObserver(r);return window.addEventListener("resize",r),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",r),document.removeEventListener("scroll",s,!0)}}}),[n,a,o,r,t])}const rbt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function obt({close:t,editor:n,anchorElementRef:r,resolution:o,options:a,menuRenderFn:i,onSelectOption:l,shouldSplitNodeWithQuery:s=!1,commandPriority:c=Qft}){const[u,d]=e.useState(null),h=o.match&&o.match.matchingString;e.useEffect((()=>{d(0)}),[h]);const p=e.useCallback((e=>{n.update((()=>{const n=null!=o.match&&s?function(e){const t=Sft();if(!Tft(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,a=r.getTextContent().slice(0,o),i=e.replaceableString.length,l=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(a,e.matchingString,i);if(l<0)return null;let s;return 0===l?[s]=r.splitText(o):[,s]=r.splitText(l,o),s}(o.match):null;l(e,n,t,o.match?o.match.matchingString:"")}))}),[n,s,o.match,l,t]),f=e.useCallback((e=>{const t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[n]);return e.useEffect((()=>()=>{const e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[n]),Jgt((()=>{null===a?d(null):null===u&&f(0)}),[a,u,f]),e.useEffect((()=>Vgt(n.registerCommand(rbt,(({option:e})=>!(!e.ref||null==e.ref.current||(ebt(e.ref.current),0))),c))),[n,f,c]),e.useEffect((()=>Vgt(n.registerCommand(bmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=u!==a.length-1?u+1:0;f(e);const r=a[e];null!=r.ref&&r.ref.current&&n.dispatchCommand(rbt,{index:e,option:r}),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(xmt,(e=>{const t=e;if(null!==a&&a.length&&null!==u){const e=0!==u?u-1:a.length-1;f(e);const n=a[e];null!=n.ref&&n.ref.current&&ebt(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),n.registerCommand(Mmt,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),c),n.registerCommand(_mt,(e=>{const t=e;return null!==a&&null!==u&&null!=a[u]&&(t.preventDefault(),t.stopImmediatePropagation(),p(a[u]),!0)}),c),n.registerCommand(Cmt,(e=>null!==a&&null!==u&&null!=a[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),p(a[u]),!0)),c))),[p,t,n,a,u,f,c]),i(r,e.useMemo((()=>({options:a,selectOptionAndCleanUp:p,selectedIndex:u,setHighlightedIndex:d})),[p,u,a]),o.match?o.match.matchingString:"")}const abt="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;",ibt=zmt("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");var lbt=Object.freeze({__proto__:null,LexicalTypeaheadMenuPlugin:function({options:t,onQueryChange:n,onSelectOption:r,onOpen:o,onClose:a,menuRenderFn:i,triggerFn:l,anchorClassName:s,commandPriority:c=Qft,parent:u}){const[d]=art(),[h,p]=e.useState(null),f=function(t,n,r,o=document.body){const[a]=art(),i=e.useRef(document.createElement("div")),l=e.useCallback((()=>{i.current.style.top=i.current.style.bottom;const e=a.getRootElement(),n=i.current,l=n.firstChild;if(null!==e&&null!==t){const{left:a,top:s,width:c,height:u}=t.getRect(),d=i.current.offsetHeight;if(n.style.top=`${s+window.pageYOffset+d+3}px`,n.style.left=`${a+window.pageXOffset}px`,n.style.height=`${u}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),r=t.height,o=t.width,i=e.getBoundingClientRect();a+o>i.right&&(n.style.left=`${i.right-o+window.pageXOffset}px`),(s+r>window.innerHeight||s+r>i.bottom)&&s-i.top>r+u&&(n.style.top=s-r+window.pageYOffset-u+"px")}n.isConnected||(null!=r&&(n.className=r),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",o.append(n)),i.current=n,e.setAttribute("aria-controls","typeahead-menu")}}),[a,t,r,o]);e.useEffect((()=>{const e=a.getRootElement();if(null!==t)return l(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=i.current;null!==t&&t.isConnected&&t.remove()}}),[a,l,t]);const s=e.useCallback((e=>{null!==t&&(e||n(null))}),[t,n]);return nbt(t,i.current,l,s),i}(h,p,s,u),m=e.useCallback((()=>{p(null),null!=a&&null!==h&&a()}),[a,h]),v=e.useCallback((e=>{p(e),null!=o&&null===h&&o(e)}),[o,h]);return e.useEffect((()=>{const e=d.registerUpdateListener((()=>{d.getEditorState().read((()=>{const e=d._window||window,t=e.document.createRange(),r=Sft(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Sft();Tft(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(d);if(!Tft(r)||!r.isCollapsed()||null===o||null===t)return void m();const a=l(o,d);if(n(a?a.matchingString:null),null!==a&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Sft();if(Tft(e)){const t=e.anchor.getNode().getPreviousSibling();return zft(t)&&t.isTextEntity()}return!1}))}(d,a.leadOffset)){const n=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,a=e,i=r.anchorOffset;if(null==o||null==i)return!1;try{t.setStart(o,a),t.setEnd(o,i)}catch(e){return!1}return!0}(a.leadOffset,t,e);if(null!==n)return i=()=>v({getRect:()=>t.getBoundingClientRect(),match:a}),void(E.startTransition?E.startTransition(i):i())}var i;m()}))}));return()=>{e()}}),[d,l,n,h,m,v]),null===h||null===d?null:E.createElement(obt,{close:m,resolution:h,editor:d,anchorElementRef:f,options:t,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:r,commandPriority:c})},MenuOption:class{constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}},PUNCTUATION:abt,SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND:ibt,getScrollParent:function(e,t){let n=getComputedStyle(e);const r="absolute"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body},useBasicTypeaheadTriggerMatch:function(t,{minLength:n=1,maxLength:r=75}){return e.useCallback((e=>{const o=new RegExp("(^|\\s|\\()(["+t+"]((?:[^"+t+abt+"\\s]){0,"+r+"}))$").exec(e);if(null!==o){const e=o[1],t=o[3];if(t.length>=n)return{leadOffset:o.index+e.length,matchingString:t,replaceableString:o[2]}}return null}),[r,n,t])},useDynamicPositioning:nbt});const sbt="development"===process.env.NODE_ENV?Qgt:lbt,cbt=sbt.LexicalTypeaheadMenuPlugin,ubt=sbt.MenuOption;sbt.PUNCTUATION,sbt.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,sbt.getScrollParent;const dbt=sbt.useBasicTypeaheadTriggerMatch;sbt.useDynamicPositioning;var hbt=function(e){function t(t,n){var r=e.call(this,"​",n)||this;return r.__textContent=t,r}return m0e(t,e),t.getType=function(){return"zeroWidth"},t.clone=function(e){return new t(e.__textContent,e.__key)},t.importJSON=function(e){return function(e){void 0===e&&(e="");var t=new hbt(e);return t.setMode("segmented"),dft(t)}()},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{text:"",type:"zeroWidth"})},t.prototype.updateDOM=function(){return!1},t.importDOM=function(){return null},t.prototype.exportDOM=function(e){return{element:null}},t.prototype.isTextEntity=function(){return!0},t.prototype.getTextContent=function(){return this.__textContent},t}(Hmt);function pbt(e){return e instanceof hbt}var fbt="\\.,\\*\\?\\$\\|#{}\\(\\)\\^\\[\\]\\\\/!%'\"~=<>_:;",mbt=function(e){return"(?:".concat(e.join("|"),")")},vbt=function(e,t){var n=0===e.length?"":"(?!".concat(e.join("|"),")");return"".concat(n,"[^\\s").concat(t,"]")};function gbt(e,t,n){return new RegExp(vbt(t,n)).test(e)}function bbt(e){for(var t=e.getNextSibling();null!==t&&pbt(t);)t=t.getNextSibling();return t}function ybt(e){for(var t=e.getPreviousSibling();null!==t&&pbt(t);)t=t.getPreviousSibling();return t}var wbt=function(){function e(e,t,n){this.value=e,this.displayValue=t,this.data=n,this.key=n?JSON.stringify(v0e(v0e({},n),{value:e})):e,this.displayValue=null!=t?t:e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}return e.prototype.setRefElement=function(e){this.ref={current:e}},e}(),xbt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ebt=xbt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;function kbt(e,t){return e.getEditorState().read((()=>{const e=xft(t);return null!==e&&e.isSelected()}))}xbt&&window.matchMedia("(pointer: coarse)").matches;var Sbt=Object.freeze({__proto__:null,useLexicalNodeSelection:function(t){const[n]=art(),[r,o]=e.useState((()=>kbt(n,t)));return e.useEffect((()=>{let e=!0;const r=n.registerUpdateListener((()=>{e&&o(kbt(n,t))}));return()=>{e=!1,r()}}),[n,t]),[r,e.useCallback((e=>{n.update((()=>{let n=Sft();Dft(n)||(n=pft(),Zft(n)),Dft(n)&&(e?n.add(t):n.delete(t))}))}),[n,t]),e.useCallback((()=>{n.update((()=>{const e=Sft();Dft(e)&&e.clear()}))}),[n])]}});function Cbt(e,t){return e.getEditorState().read((()=>{const e=xft(t);return null!==e&&e.isSelected()}))}var Mbt=Object.freeze({__proto__:null,useLexicalNodeSelection:function(t){const[n]=art(),[r,o]=e.useState((()=>Cbt(n,t)));return e.useEffect((()=>{let e=!0;const r=n.registerUpdateListener((()=>{e&&o(Cbt(n,t))}));return()=>{e=!1,r()}}),[n,t]),[r,e.useCallback((e=>{n.update((()=>{let n=Sft();Dft(n)||(n=pft(),Zft(n)),Dft(n)&&(e?n.add(t):n.delete(t))}))}),[n,t]),e.useCallback((()=>{n.update((()=>{const e=Sft();Dft(e)&&e.clear()}))}),[n])]}});const _bt=("development"===process.env.NODE_ENV?Sbt:Mbt).useLexicalNodeSelection;var Nbt=xbt?e.useLayoutEffect:e.useEffect;function Abt(t){var n=t.value,r=t.trigger,o=t.data,a=t.className,i=t.classNameFocused,l=t.classNames,s=t.nodeKey,c=t.component,u=art()[0],d=function(){var t=art()[0],n=e.useState((function(){return!!xbt&&t.getRootElement()===document.activeElement})),r=n[0],o=n[1];return Nbt((function(){return Vgt(t.registerCommand(dmt,(function(){return o(!0),!1}),Jft),t.registerCommand(Wft,(function(){return o(!1),!1}),Jft))}),[t]),r}(),h=_bt(s),p=h[0],f=h[1],m=h[2],v=e.useRef(null),g=r+n,b=e.useMemo((function(){if(a){var e=[a];return p&&d&&i&&e.push(i),e.join(" ").trim()||void 0}return""}),[p,a,i,d]),y=e.useCallback((function(e){if(p&&Dft(Sft())){e.preventDefault();var t=xft(s);Tbt(t)&&t.remove()}return!1}),[p,s]),w=e.useCallback((function(e){var t=xft(s);if(!t||!t.isSelected())return!1;var n=!1,r=ybt(t);return Aft(r)&&(r.selectEnd(),n=!0),zft(r)&&(r.select(),n=!0),Nft(r)&&(r.selectNext(),n=!0),null===r&&(t.selectPrevious(),n=!0),n&&e.preventDefault(),n}),[s]),E=e.useCallback((function(e){var t=xft(s);if(!t||!t.isSelected())return!1;var n=!1,r=bbt(t);return Aft(r)&&(r.selectStart(),n=!0),zft(r)&&(r.select(0,0),n=!0),Nft(r)&&(r.selectPrevious(),n=!0),null===r&&(t.selectNext(),n=!0),n&&e.preventDefault(),n}),[s]),k=e.useCallback((function(e){var t;return!(e.target!==v.current&&!(null===(t=v.current)||void 0===t?void 0:t.contains(e.target))||(e.shiftKey||m(),f(!0),0))}),[m,f]),S=e.useCallback((function(){var e=xft(s);if(!e||!e.isSelected())return!1;var t=Sft();return!!Dft(t)&&(Zft(null),!1)}),[s]),C=e.useCallback((function(){return!(!Ebt||!p||(f(!1),0))}),[p,f]);return e.useEffect((function(){var e=Vgt(u.registerCommand(Kft,k,Qft),u.registerCommand(kmt,y,Qft),u.registerCommand(Emt,y,Qft),u.registerCommand(ymt,w,Qft),u.registerCommand(wmt,E,Qft),u.registerCommand(Wft,S,Qft),u.registerCommand(Dmt,C,Qft));return function(){e()}}),[u,w,E,k,y,S,C]),c?x.default.createElement(c,{ref:v,trigger:r,value:n,data:o,className:b,"data-beautiful-mention":g},g):l?x.default.createElement("span",{ref:v,className:p&&l.containerFocused?l.containerFocused:l.container,"data-beautiful-mention":g},x.default.createElement("span",{className:l.trigger},r),x.default.createElement("span",{className:l.value},n)):x.default.createElement("span",{ref:v,className:b,"data-beautiful-mention":g},g)}function Obt(e){var t=e.getAttribute("data-lexical-beautiful-mention-trigger"),n=e.getAttribute("data-lexical-beautiful-mention-value"),r=void 0,o=e.getAttribute("data-lexical-beautiful-mention-data");if(o)try{r=JSON.parse(o)}catch(e){console.warn("Failed to parse data attribute of beautiful mention node",e)}return null!==t&&null!==n?{node:Pbt(t,n,r)}:null}var Ibt,Dbt=function(e){function t(t,n,r,o){var a=e.call(this,o)||this;return a.__trigger=t,a.__value=n,a.__data=r,a}return m0e(t,e),t.getType=function(){return"beautifulMention"},t.clone=function(e){return new t(e.__trigger,e.__value,e.__data,e.__key)},t.prototype.createDOM=function(){return document.createElement("span")},t.prototype.updateDOM=function(){return!1},t.prototype.exportDOM=function(){var e=document.createElement("span");return e.setAttribute("data-lexical-beautiful-mention","true"),e.setAttribute("data-lexical-beautiful-mention-trigger",this.__trigger),e.setAttribute("data-lexical-beautiful-mention-value",this.__value),this.__data&&e.setAttribute("data-lexical-beautiful-mention-data",JSON.stringify(this.__data)),e.textContent=this.getTextContent(),{element:e}},t.importDOM=function(){return{span:function(e){return e.hasAttribute("data-lexical-beautiful-mention")?{conversion:Obt,priority:1}:null}}},t.importJSON=function(e){return Pbt(e.trigger,e.value,e.data)},t.prototype.exportJSON=function(){var e=this.__data;return v0e(v0e({trigger:this.__trigger,value:this.__value},e?{data:e}:{}),{type:"beautifulMention",version:1})},t.prototype.getTextContent=function(){var e=this.getLatest();return e.__trigger+e.__value},t.prototype.getTrigger=function(){return this.getLatest().__trigger},t.prototype.getValue=function(){return this.getLatest().__value},t.prototype.setValue=function(e){this.getWritable().__value=e},t.prototype.getData=function(){return this.getLatest().__data},t.prototype.setData=function(e){this.getWritable().__data=e},t.prototype.component=function(){return null},t.prototype.decorate=function(e,t){var n=this.getCssClassesFromTheme(t),r=n.className,o=n.classNameFocused,a=n.classNames;return x.default.createElement(Abt,{nodeKey:this.getKey(),trigger:this.getTrigger(),value:this.getValue(),data:this.getData(),className:r,classNameFocused:o,classNames:a,component:this.component()})},t.prototype.getCssClassesFromTheme=function(e){var t=this,n=e.theme.beautifulMentions||{},r=Object.entries(n).find((function(e){var n=e[0];return new RegExp(n).test(t.__trigger)})),o=r&&r[0],a=r&&r[1],i="string"==typeof a?a:void 0;return{className:i,classNameFocused:i&&"string"==typeof n["".concat(o,"Focused")]?n["".concat(o,"Focused")]:void 0,classNames:r&&"string"!=typeof a?a:void 0}},t}(cmt);function Pbt(e,t,n){var r=new Dbt(e,t,n);return dft(r)}function Tbt(e){return e instanceof Dbt}function Hbt(e){var t=e.textContent;return null!==t?{node:zbt(t)}:null}zmt("INSERT_MENTION_COMMAND"),zmt("REMOVE_MENTIONS_COMMAND"),zmt("RENAME_MENTIONS_COMMAND"),zmt("OPEN_MENTION_MENU_COMMAND"),function(e){m0e((function(t,n,r,o){void 0===o&&(o={});var a=e.call(this,n,r,o)||this;return a.itemType=t,a.comboboxItem={itemType:t,value:n,displayValue:r,data:o},a.menuOption=new wbt(n,r,o),a}),e)}(wbt),function(e){m0e((function(t,n,r,o){var a=e.call(this,n,r,o)||this;return a.trigger=t,a.menuItem={trigger:t,value:n,displayValue:r,data:o},a}),e)}(wbt);var Lbt=function(e){function t(t,n,r){var o=e.call(this,null!=n?n:t,r)||this;return o.__mention=t,o}return m0e(t,e),t.getType=function(){return"mention"},t.clone=function(e){return new t(e.__mention,e.__text,e.__key)},t.importJSON=function(e){var t=zbt(e.mentionName);return t.setTextContent(e.text),t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{mentionName:this.__mention,type:"mention",version:1})},t.prototype.createDOM=function(t){var n=e.prototype.createDOM.call(this,t);return n.style.cssText="color: #0068ff; font-weight: 500",n.className="mention",n},t.prototype.exportDOM=function(){var e=document.createElement("span");return e.setAttribute("data-lexical-mention","true"),e.textContent=this.__text,{element:e}},t.importDOM=function(){return{span:function(e){return e.hasAttribute("data-lexical-mention")?{conversion:Hbt,priority:1}:null}}},t.prototype.isTextEntity=function(){return!0},t.prototype.canInsertTextBefore=function(){return!1},t.prototype.canInsertTextAfter=function(){return!1},t}(Hmt);function zbt(e){var t=new Lbt(e);return t.setMode("segmented").toggleDirectionless(),dft(t)}function Rbt(e){var t="";if(Aft(e))for(var n=0,r=e.getChildren();n<r.length;n++)t+=Rbt(r[n]);else Tbt(e)?t+="[".concat(e.getTextContent(),"]"):pbt(e)||(t+=e.getTextContent());return t}var Bbt=function(t){var n=t.onClick,r=t.children,o=art()[0],a=e.useCallback((function(){o.update((function(){var e=kft(),t=Rbt(e);n(t),e.clear()}))}),[o,n]);return x.default.createElement(M2e,{className:"send",outline:!0,style:{background:"none",border:0},onClick:function(){return a()}},r)},$bt=new Map,Zbt=function(e){function t(t,n){var r=e.call(this,t)||this;return r.name=t,r.picture=n,r}return m0e(t,e),t}(ubt);function Vbt(e){var t=e.index,n=e.isSelected,r=e.onClick,o=e.onMouseEnter,a=e.option,i="item";return n&&(i+=" selected"),E.createElement("li",{key:a.key,tabIndex:-1,className:i,ref:a.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-".concat(t),onMouseEnter:o,onClick:r},a.picture,E.createElement("span",{className:"text"},a.name))}var jbt=function(t){var n=art()[0],r=t.items,o=t.targetContainer,a=fbt,i=!0,l=e.useState(null),s=l[0],c=l[1],u=function(t,n){var r=e.useState([]),o=r[0],a=r[1],i=function(e,t){setTimeout((function(){var r=n.filter((function(t){return t.name.toLowerCase().includes(e.toLowerCase())}));t(r)}),500)};return e.useEffect((function(){var e=$bt.get(t);null!==t?null!==e&&(void 0===e?($bt.set(t,null),i(t,(function(e){$bt.set(t,e),a(e)}))):a(e)):a([])}),[t]),o}(s,r),d=["@"],h=e.useMemo((function(){return u.map((function(e){return new Zbt(e.name,E.createElement("i",{className:"icon user"}))}))}),[u]),p=e.useCallback((function(e,t,r){n.update((function(){var n=zbt("@".concat(e.name));t&&t.replace(n),n.select(),r()}))}),[n]),f=e.useCallback((function(e){var t=function(e,t){var n=Sft();if(n&&Tft(n)){var r=n.anchor,o=n.focus,a=n.getNodes();if(r.key===o.key&&r.offset===o.offset&&0!==a.length){var i=a[0],l=pbt(i)?i.getPreviousSibling():i;if(l){var s=zft(l)&&l.isSimpleText(),c="text"===r.type?r.offset:0,u=function(e){return pbt(e)?"":e.getTextContent()}(l),d=0===c,h=u.length===c,p=u.charAt(c-1),f=u.charAt(c),m=gbt(p,e,t),v=gbt(f,e,t),g=/\s/.test(p),b=/\s/.test(f),y={node:l,offset:c,isTextNode:s,textContent:u,selection:n,prevNode:ybt(l),nextNode:bbt(l),cursorAtStartOfNode:d,cursorAtEndOfNode:h,wordCharBeforeCursor:m,wordCharAfterCursor:v,spaceBeforeCursor:g,spaceAfterCursor:b};return v0e(v0e({},y),s?{isTextNode:!0,node:l}:{isTextNode:!1,node:l})}}}}(d,a);if((null==t?void 0:t.isTextNode)&&t.wordCharAfterCursor)return null;var n=function(e,t,n,r,o){var a=function(e,t,n,r){return new RegExp("".concat((t?"(^|\\s|".concat(t,")("):"(^|\\s)(")+mbt(e),"((?:").concat(vbt(e,n)).concat(r?function(e){return"(?:\\.[ |$]|\\s|"+"[".concat(e,"]|")+")"}(n):"","){0,").concat(75,"})")+")$")}(t,n,r,o).exec(e);if(null!==a){var i=a[1],l=a[2],s=a[3];if(l.length>=1)return{leadOffset:a.index+i.length,matchingString:s,replaceableString:l}}return null}(e,d,"\\(",a,i);return n&&n.replaceableString?n:null}),["\\(",i,a,d]);return E.createElement(cbt,{anchorClassName:"mentions-class",onQueryChange:c,onSelectOption:p,triggerFn:f,options:h,menuRenderFn:function(e,t){var n=t.selectedIndex,r=t.selectOptionAndCleanUp,a=t.setHighlightedIndex;return e.current&&u.length?k.default.createPortal(E.createElement("div",{className:"typeahead-popover mentions-menu "},E.createElement("ul",null,h.map((function(e,t){return E.createElement(Vbt,{index:t,isSelected:n===t,onClick:function(){a(t),r(e)},onMouseEnter:function(){a(t)},key:e.key,option:e})})))),o.current):null}})},Wbt=function(t){var n=t.ignoreHistoryMergeTagChange,r=void 0===n||n,o=t.ignoreSelectionChange,a=void 0!==o&&o,i=t.onKeyDown,l=t.onEnter,s=art()[0];return e.useLayoutEffect((function(){var e=s.registerCommand(Smt,(function(e){return function(e){if(i){var t=Rbt(n=kft());i(e,t,s)}var n;!e.shiftKey&&"Enter"===e.code&&l&&(t=Rbt(n=kft()),l(t,s),n.clear())}(e),!1}),1);return function(){e()}}),[s,r,a,l,i]),null},Fbt=Object.freeze({__proto__:null,AutoFocusPlugin:function({defaultSelection:t}){const[n]=art();return e.useEffect((()=>{n.focus((()=>{const e=document.activeElement,t=n.getRootElement();null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,n]),null}}),qbt=Object.freeze({__proto__:null,AutoFocusPlugin:function({defaultSelection:t}){const[n]=art();return e.useEffect((()=>{n.focus((()=>{const e=document.activeElement,t=n.getRootElement();null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})}),{defaultSelection:t})}),[t,n]),null}});const Ybt=("development"===process.env.NODE_ENV?Fbt:qbt).AutoFocusPlugin;var Ubt=function(e){function t(t,n,r){var o=e.call(this,n,r)||this;return o.__className=t,o}return m0e(t,e),t.getType=function(){return"emoji"},t.clone=function(e){return new t(e.__className,e.__text,e.__key)},t.prototype.createDOM=function(t){var n=document.createElement("span"),r=e.prototype.createDOM.call(this,t);return n.className=this.__className,r.className="emoji-inner",n.appendChild(r),n},t.prototype.updateDOM=function(t,n,r){var o=n.firstChild;return null===o||(e.prototype.updateDOM.call(this,t,o,r),!1)},t.importJSON=function(e){var t=Kbt(e.className,e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t},t.prototype.exportJSON=function(){return v0e(v0e({},e.prototype.exportJSON.call(this)),{className:this.getClassName(),type:"emoji"})},t.prototype.getClassName=function(){return this.getLatest().__className},t}(Hmt);function Kbt(e,t){var n=new Ubt(e,t).setMode("token");return dft(n)}var Gbt=new Map([[":)",["emoji happysmile","🙂"]],[":D",["emoji veryhappysmile","😀"]],[":(",["emoji unhappysmile","🙁"]],["<3",["emoji heart","❤"]]]);function Xbt(e){for(var t=e.getTextContent(),n=0;n<t.length;n++){var r=Gbt.get(t[n])||Gbt.get(t.slice(n,n+2));if(void 0!==r){var o=r[0],a=r[1],i=void 0;i=0===n?e.splitText(n+2)[0]:e.splitText(n,n+2)[1];var l=Kbt(o,a);return i.replace(l),l}}return null}function Qbt(e){for(var t=e;null!==t;){if(!t.isSimpleText())return;t=Xbt(t)}}function Jbt(){return function(t){e.useEffect((function(){if(!t.hasNodes([Ubt]))throw new Error("EmojisPlugin: EmojiNode not registered on editor");return t.registerNodeTransform(Hmt,Qbt)}),[t])}(art()[0]),null}var eyt=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.title=t,o.emoji=n,o.keywords=r.keywords||[],o}return m0e(t,e),t}(ubt);function tyt(e){var t=e.index,n=e.isSelected,r=e.onClick,o=e.onMouseEnter,a=e.option,i="item";return n&&(i+=" selected"),E.createElement("li",{key:a.key,tabIndex:-1,className:i,ref:a.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-".concat(t),onMouseEnter:o,onClick:r},E.createElement("span",{className:"text"},a.emoji," ",a.title))}function nyt(){var t=art()[0],n=e.useState(null),r=n[0],o=n[1],a=e.useState([])[0],i=e.useMemo((function(){return null!==a?a.map((function(e){var t=e.emoji,n=e.aliases,r=e.tags;return new eyt(n[0],t,{keywords:w0e(w0e([],n,!0),r,!0)})})):[]}),[a]),l=dbt(":",{minLength:0}),s=e.useMemo((function(){return i.filter((function(e){return null!==r?!(!new RegExp(r,"gi").exec(e.title)&&null===e.keywords)&&e.keywords.some((function(e){return new RegExp(r,"gi").exec(e)})):i})).slice(0,10)}),[i,r]),c=e.useCallback((function(e,n,r){t.update((function(){var t=Sft();Tft(t)&&null!==e&&(n&&n.remove(),t.insertNodes([gft(e.emoji)]),r())}))}),[t]);return E.createElement(cbt,{onQueryChange:o,onSelectOption:c,triggerFn:l,options:s,menuRenderFn:function(e,t){var n=t.selectedIndex,r=t.selectOptionAndCleanUp,o=t.setHighlightedIndex;return null===e.current||0===s.length?null:e.current&&s.length?S.createPortal(E.createElement("div",{className:"typeahead-popover emoji-menu"},E.createElement("ul",null,s.map((function(e,t){return E.createElement(tyt,{key:e.key,index:t,isSelected:n===t,onClick:function(){o(t),r(e)},onMouseEnter:function(){o(t)},option:e})})))),e.current):null}})}const ryt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var oyt=Object.freeze({__proto__:null,OnChangePlugin:function({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=art();return ryt((()=>{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:a,dirtyLeaves:i,prevEditorState:l,tags:s})=>{t&&0===a.size&&0===i.size||e&&s.has("history-merge")||l.isEmpty()||n(o,r,s)}))}),[r,e,t,n]),null}});const ayt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var iyt=Object.freeze({__proto__:null,OnChangePlugin:function({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=art();return ayt((()=>{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:a,dirtyLeaves:i,prevEditorState:l,tags:s})=>{t&&0===a.size&&0===i.size||e&&s.has("history-merge")||l.isEmpty()||n(o,r,s)}))}),[r,e,t,n]),null}});const lyt=("development"===process.env.NODE_ENV?oyt:iyt).OnChangePlugin,syt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function cyt(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}var uyt=Object.freeze({__proto__:null,default:function(){return function(t){const[n]=art(),r=e.useMemo((()=>t(n)),[n,t]),o=e.useRef(r.initialValueFn()),[a,i]=e.useState(o.current);return syt((()=>{const{initialValueFn:e,subscribe:t}=r,n=e();return o.current!==n&&(o.current=n,i(n)),t((e=>{o.current=e,i(e)}))}),[r,t]),a}(cyt)}});const dyt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function hyt(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}var pyt=Object.freeze({__proto__:null,default:function(){return function(t){const[n]=art(),r=e.useMemo((()=>t(n)),[n,t]),o=e.useRef(r.initialValueFn()),[a,i]=e.useState(o.current);return dyt((()=>{const{initialValueFn:e,subscribe:t}=r,n=e();return o.current!==n&&(o.current=n,i(n)),t((e=>{o.current=e,i(e)}))}),[r,t]),a}(hyt)}}),fyt=("development"===process.env.NODE_ENV?uyt:pyt).default;function myt(){return kft().getTextContent()}function vyt(e,t=!0){if(e)return!1;let n=myt();return t&&(n=n.trim()),""===n}function gyt(e){if(!vyt(e,!1))return!1;const t=kft().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(Nft(n))return!1;if(Aft(n)){if(!Pft(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!zft(n))return!1}}}return!0}var byt=Object.freeze({__proto__:null,$canShowPlaceholder:gyt,$canShowPlaceholderCurry:function(e){return()=>gyt(e)},$findTextIntersectionFromCharacters:function(e,t){let n=e.getFirstChild(),r=0;e:for(;null!==n;){if(Aft(n)){const e=n.getFirstChild();if(null!==e){n=e;continue}}else if(zft(n)){const e=n.getTextContentSize();if(r+e>t)return{node:n,offset:t-r};r+=e}const e=n.getNextSibling();if(null!==e){n=e;continue}let o=n.getParent();for(;null!==o;){const e=o.getNextSibling();if(null!==e){n=e;continue e}o=o.getParent()}break}return null},$isRootTextContentEmpty:vyt,$isRootTextContentEmptyCurry:function(e,t){return()=>vyt(e,t)},$rootTextContent:myt,registerLexicalTextEntity:function(e,t,n,r){const o=e=>e instanceof n,a=e=>{const t=gft(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)},i=e.registerNodeTransform(Hmt,(e=>{if(!e.isSimpleText())return;let n,i=e.getPreviousSibling(),l=e.getTextContent(),s=e;if(zft(i)){const n=i.getTextContent(),r=t(n+l);if(o(i)){if(null===r||0!==(e=>e.getLatest().__mode)(i))return void a(i);{const t=r.end-n.length;if(t>0){const r=n+l.slice(0,t);if(i.select(),i.setTextContent(r),t===l.length)e.remove();else{const n=l.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=t(l);let e,u=null===n?"":l.slice(n.end);if(l=u,""===u){const e=s.getNextSibling();if(zft(e)){u=s.getTextContent()+e.getTextContent();const n=t(u);if(null===n)return void(o(e)?a(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&zft(i)&&i.isTextEntity()){c+=n.end;continue}if(0===n.start?[e,s]=s.splitText(n.end):[,e,s]=s.splitText(n.start+c,n.end+c),void 0===e)throw Error("nodeToReplace should not be undefined. You may want to check splitOffsets passed to the splitText.");const d=r(e);if(d.setFormat(e.getFormat()),e.replace(d),null==s)return;c=0,i=d}})),l=e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void a(e);if(n.length>r.end)return void e.splitText(r.end);const i=e.getPreviousSibling();zft(i)&&i.isTextEntity()&&(a(i),a(e));const l=e.getNextSibling();zft(l)&&l.isTextEntity()&&(a(l),o(e)&&a(e))}));return[i,l]}});function yyt(){return kft().getTextContent()}function wyt(e,t=!0){if(e)return!1;let n=yyt();return t&&(n=n.trim()),""===n}function xyt(e){if(!wyt(e,!1))return!1;const t=kft().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(Nft(n))return!1;if(Aft(n)){if(!Pft(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){const n=t[e];if(!zft(n))return!1}}}return!0}var Eyt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})),kyt=Object.freeze({__proto__:null,$canShowPlaceholder:xyt,$canShowPlaceholderCurry:function(e){return()=>xyt(e)},$findTextIntersectionFromCharacters:function(e,t){let n=e.getFirstChild(),r=0;e:for(;null!==n;){if(Aft(n)){const e=n.getFirstChild();if(null!==e){n=e;continue}}else if(zft(n)){const e=n.getTextContentSize();if(r+e>t)return{node:n,offset:t-r};r+=e}const e=n.getNextSibling();if(null!==e){n=e;continue}let o=n.getParent();for(;null!==o;){const e=o.getNextSibling();if(null!==e){n=e;continue e}o=o.getParent()}break}return null},$isRootTextContentEmpty:wyt,$isRootTextContentEmptyCurry:function(e,t){return()=>wyt(e,t)},$rootTextContent:yyt,registerLexicalTextEntity:function(e,t,n,r){const o=e=>e instanceof n,a=e=>{const t=gft(e.getTextContent());t.setFormat(e.getFormat()),e.replace(t)};return[e.registerNodeTransform(Hmt,(e=>{if(!e.isSimpleText())return;let n,i=e.getPreviousSibling(),l=e.getTextContent(),s=e;if(zft(i)){const n=i.getTextContent(),r=t(n+l);if(o(i)){if(null===r||0!==(e=>e.getLatest().__mode)(i))return void a(i);{const t=r.end-n.length;if(t>0){const r=n+l.slice(0,t);if(i.select(),i.setTextContent(r),t===l.length)e.remove();else{const n=l.slice(t);e.setTextContent(n)}return}}}else if(null===r||r.start<n.length)return}let c=0;for(;;){n=t(l);let e,u=null===n?"":l.slice(n.end);if(l=u,""===u){const e=s.getNextSibling();if(zft(e)){u=s.getTextContent()+e.getTextContent();const n=t(u);if(null===n)return void(o(e)?a(e):e.markDirty());if(0!==n.start)return}}if(null===n)return;if(0===n.start&&zft(i)&&i.isTextEntity()){c+=n.end;continue}0===n.start?[e,s]=s.splitText(n.end):[,e,s]=s.splitText(n.start+c,n.end+c),void 0===e&&Eyt(165,"nodeToReplace");const d=r(e);if(d.setFormat(e.getFormat()),e.replace(d),null==s)return;c=0,i=d}})),e.registerNodeTransform(n,(e=>{const n=e.getTextContent(),r=t(n);if(null===r||0!==r.start)return void a(e);if(n.length>r.end)return void e.splitText(r.end);const i=e.getPreviousSibling();zft(i)&&i.isTextEntity()&&(a(i),a(e));const l=e.getNextSibling();zft(l)&&l.isTextEntity()&&(a(l),o(e)&&a(e))}))]}});const Syt="development"===process.env.NODE_ENV?byt:kyt;Syt.$canShowPlaceholder;const Cyt=Syt.$canShowPlaceholderCurry;Syt.$findTextIntersectionFromCharacters,Syt.$isRootTextContentEmpty,Syt.$isRootTextContentEmptyCurry,Syt.$rootTextContent,Syt.registerLexicalTextEntity;var Myt=Object.freeze({__proto__:null,registerDragonSupport:function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,a,i,l,s]=t;e.update((()=>{const e=Sft();if(Tft(e)){const t=e.anchor;let s=t.getNode(),c=0,u=0;if(zft(s)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(s,c,s,u)),c===u&&""===a||(e.insertRawText(a),s=t.getNode()),zft(s)){c=i,u=i+l;const t=s.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(s,c,s,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}}),_yt=Object.freeze({__proto__:null,registerDragonSupport:function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,a,i,l,s]=t;e.update((()=>{const e=Sft();if(Tft(e)){const t=e.anchor;let s=t.getNode(),c=0,u=0;if(zft(s)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(s,c,s,u)),c===u&&""===a||(e.insertRawText(a),s=t.getNode()),zft(s)){c=i,u=i+l;const t=s.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(s,c,s,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}});const Nyt=("development"===process.env.NODE_ENV?Myt:_yt).registerDragonSupport;function Ayt(e,t,n,r=null){let o=null===r||t.isSelected(r);const a=Aft(t)&&t.excludeFromCopy("html");let i=t;if(null!==r){let e=Mvt(t);e=zft(e)&&null!==r?Avt(r,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=e._nodes.get(i.getType());let c;c=s&&void 0!==s.exportDOM?s.exportDOM(e,i):i.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<l.length;n++){const a=l[n],i=Ayt(e,a,h,r);!o&&Aft(t)&&i&&t.extractWithChild(a,r,"html")&&(o=!0)}if(o&&!a){if(Zgt(u)&&u.append(h),n.append(u),d){const e=d.call(i,u);e&&u.replaceWith(e)}}else n.append(h);return o}const Oyt=new Set(["STYLE","SCRIPT"]);function Iyt(e,t,n,r,o=new Map,a){let i=[];if(Oyt.has(e.nodeName))return i;let l=null;const s=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=s?s(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(l=Array.isArray(t)?t[t.length-1]:t,null!==l){for(const[,e]of o)if(l=e(l,a),!l)break;l&&i.push(...Array.isArray(t)?t:[l])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==l||!Lft(l))&&(null!=l&&_ft(l)||r);for(let e=0;e<d.length;e++)h.push(...Iyt(d[e],t,n,p,new Map(o),l));return null!=u&&(h=u(h)),$gt(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let a=[];for(let e=0;e<t.length;e++){const i=t[e];if(_ft(i))i.setFormat(r),o.push(i);else if(a.push(i),e===t.length-1||e<t.length-1&&_ft(t[e+1])){const e=n();e.setFormat(r),e.append(...a),o.push(e),a=[]}}return o}(e,h,p?()=>{const e=new jft;return n.push(e),e}:fft)),null==l?i=i.concat(h):Aft(l)&&l.append(...h),i}var Dyt=Object.freeze({__proto__:null,$generateHtmlFromNodes:function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=kft().getChildren();for(let o=0;o<r.length;o++)Ayt(e,r[o],n,t);return n.innerHTML},$generateNodesFromDOM:function(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const a=n[t];if(!Oyt.has(a.nodeName)){const t=Iyt(a,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof jft&&t.insertAfter(hft());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}});function Pyt(e,t,n,r=null){let o=null===r||t.isSelected(r);const a=Aft(t)&&t.excludeFromCopy("html");let i=t;if(null!==r){let e=Mvt(t);e=zft(e)&&null!==r?Avt(r,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=e._nodes.get(i.getType());let c;c=s&&void 0!==s.exportDOM?s.exportDOM(e,i):i.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<l.length;n++){const a=l[n],i=Pyt(e,a,h,r);!o&&Aft(t)&&i&&t.extractWithChild(a,r,"html")&&(o=!0)}if(o&&!a){if(Zgt(u)&&u.append(h),n.append(u),d){const e=d.call(i,u);e&&u.replaceWith(e)}}else n.append(h);return o}const Tyt=new Set(["STYLE","SCRIPT"]);function Hyt(e,t,n,r,o=new Map,a){let i=[];if(Tyt.has(e.nodeName))return i;let l=null;const s=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=s?s(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(l=Array.isArray(t)?t[t.length-1]:t,null!==l){for(const[,e]of o)if(l=e(l,a),!l)break;l&&i.push(...Array.isArray(t)?t:[l])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==l||!Lft(l))&&(null!=l&&_ft(l)||r);for(let e=0;e<d.length;e++)h.push(...Hyt(d[e],t,n,p,new Map(o),l));return null!=u&&(h=u(h)),$gt(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let a=[];for(let e=0;e<t.length;e++){const i=t[e];if(_ft(i))i.setFormat(r),o.push(i);else if(a.push(i),e===t.length-1||e<t.length-1&&_ft(t[e+1])){const e=n();e.setFormat(r),e.append(...a),o.push(e),a=[]}}return o}(e,h,p?()=>{const e=new jft;return n.push(e),e}:fft)),null==l?i=i.concat(h):Aft(l)&&l.append(...h),i}var Lyt=Object.freeze({__proto__:null,$generateHtmlFromNodes:function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=kft().getChildren();for(let o=0;o<r.length;o++)Pyt(e,r[o],n,t);return n.innerHTML},$generateNodesFromDOM:function(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const a=n[t];if(!Tyt.has(a.nodeName)){const t=Hyt(a,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof jft&&t.insertAfter(hft());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}});const zyt="development"===process.env.NODE_ENV?Dyt:Lyt,Ryt=zyt.$generateHtmlFromNodes,Byt=zyt.$generateNodesFromDOM,$yt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Zyt=e=>$yt?(e||window).getSelection():null;function Vyt(e){const t=Sft();if(null==t)throw Error("Expected valid LexicalSelection");return Tft(t)&&t.isCollapsed()||0===t.getNodes().length?"":Ryt(e,t)}function jyt(e){const t=Sft();if(null==t)throw Error("Expected valid LexicalSelection");return Tft(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(qyt(e,t))}function Wyt(e,t,n){e.dispatchCommand(Pmt,{nodes:t,selection:n})||n.insertNodes(t)}function Fyt(e,t,n,r=[]){let o=null===t||n.isSelected(t);const a=Aft(n)&&n.excludeFromCopy("html");let i=n;if(null!==t){let e=Mvt(n);e=zft(e)&&null!==t?Avt(t,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType())throw Error(`LexicalNode: Node ${n.name} does not implement .exportJSON().`);if(Aft(e)){const e=t.children;if(!Array.isArray(e))throw Error(`LexicalNode: Node ${n.name} is an element but .exportJSON() does not have a children array.`)}return t}(i);if(zft(i)){const e=i.__text;e.length>0?s.text=e:o=!1}for(let r=0;r<l.length;r++){const a=l[r],i=Fyt(e,t,a,s.children);!o&&Aft(n)&&i&&n.extractWithChild(a,t,"clone")&&(o=!0)}if(o&&!a)r.push(s);else if(Array.isArray(s.children))for(let e=0;e<s.children.length;e++){const t=s.children[e];r.push(t)}return o}function qyt(e,t){const n=[],r=kft().getChildren();for(let o=0;o<r.length;o++)Fyt(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function Yyt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Bft(r);zft(o)&&Cvt(o),t.push(o)}return t}let Uyt=null;function Kyt(e,t){const n=Zyt(e._window);if(!n)return!1;const r=n.anchorNode,o=n.focusNode;if(null!==r&&null!==o&&!Wmt(e,r,o))return!1;t.preventDefault();const a=t.clipboardData,i=Sft();if(null===a||null===i)return!1;const l=Vyt(e),s=jyt(e);let c="";return null!==i&&(c=i.getTextContent()),null!==l&&a.setData("text/html",l),null!==s&&a.setData("application/x-lexical-editor",s),a.setData("text/plain",c),!0}var Gyt=Object.freeze({__proto__:null,$generateJSONFromSelectedNodes:qyt,$generateNodesFromSerializedNodes:Yyt,$getHtmlContent:Vyt,$getLexicalContent:jyt,$insertDataTransferForPlainText:function(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)},$insertDataTransferForRichText:function(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Wyt(n,Yyt(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return Wyt(n,Byt(n,e),t)}catch(e){}const a=e.getData("text/plain")||e.getData("text/uri-list");if(null!=a)if(Tft(t)){const e=a.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=Sft();if(Tft(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([vft()]):n.insertText(r)}}}else t.insertRawText(a)},$insertGeneratedNodes:Wyt,copyToClipboard:async function(e,t){if(null!==Uyt)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(Kyt(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,o=Zyt(e._window);if(null===n||null===o)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const i=new Range;return i.setStart(a,0),i.setEnd(a,1),o.removeAllRanges(),o.addRange(i),new Promise(((t,n)=>{const o=e.registerCommand(tmt,(n=>(jgt(n,ClipboardEvent)&&(o(),null!==Uyt&&(window.clearTimeout(Uyt),Uyt=null),t(Kyt(e,n))),!0)),Gft);Uyt=window.setTimeout((()=>{o(),Uyt=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}}),Xyt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const Qyt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Jyt=e=>Qyt?(e||window).getSelection():null;function ewt(e){const t=Sft();return null==t&&Xyt(166),Tft(t)&&t.isCollapsed()||0===t.getNodes().length?"":Ryt(e,t)}function twt(e){const t=Sft();return null==t&&Xyt(166),Tft(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(owt(e,t))}function nwt(e,t,n){e.dispatchCommand(Pmt,{nodes:t,selection:n})||n.insertNodes(t)}function rwt(e,t,n,r=[]){let o=null===t||n.isSelected(t);const a=Aft(n)&&n.excludeFromCopy("html");let i=n;if(null!==t){let e=Mvt(n);e=zft(e)&&null!==t?Avt(t,e):e,i=e}const l=Aft(i)?i.getChildren():[],s=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Xyt(58,n.name),Aft(e)){const e=t.children;Array.isArray(e)||Xyt(59,n.name)}return t}(i);if(zft(i)){const e=i.__text;e.length>0?s.text=e:o=!1}for(let r=0;r<l.length;r++){const a=l[r],i=rwt(e,t,a,s.children);!o&&Aft(n)&&i&&n.extractWithChild(a,t,"clone")&&(o=!0)}if(o&&!a)r.push(s);else if(Array.isArray(s.children))for(let e=0;e<s.children.length;e++){const t=s.children[e];r.push(t)}return o}function owt(e,t){const n=[],r=kft().getChildren();for(let o=0;o<r.length;o++)rwt(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function awt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=Bft(r);zft(o)&&Cvt(o),t.push(o)}return t}let iwt=null;function lwt(e,t){const n=Jyt(e._window);if(!n)return!1;const r=n.anchorNode,o=n.focusNode;if(null!==r&&null!==o&&!Wmt(e,r,o))return!1;t.preventDefault();const a=t.clipboardData,i=Sft();if(null===a||null===i)return!1;const l=ewt(e),s=twt(e);let c="";return null!==i&&(c=i.getTextContent()),null!==l&&a.setData("text/html",l),null!==s&&a.setData("application/x-lexical-editor",s),a.setData("text/plain",c),!0}var swt=Object.freeze({__proto__:null,$generateJSONFromSelectedNodes:owt,$generateNodesFromSerializedNodes:awt,$getHtmlContent:ewt,$getLexicalContent:twt,$insertDataTransferForPlainText:function(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)},$insertDataTransferForRichText:function(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return nwt(n,awt(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return nwt(n,Byt(n,e),t)}catch(e){}const a=e.getData("text/plain")||e.getData("text/uri-list");if(null!=a)if(Tft(t)){const e=a.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=Sft();if(Tft(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([vft()]):n.insertText(r)}}}else t.insertRawText(a)},$insertGeneratedNodes:nwt,copyToClipboard:async function(e,t){if(null!==iwt)return!1;if(null!==t)return new Promise(((n,r)=>{e.update((()=>{n(lwt(e,t))}))}));const n=e.getRootElement(),r=null==e._window?window.document:e._window.document,o=Jyt(e._window);if(null===n||null===o)return!1;const a=r.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(r.createTextNode("#")),n.append(a);const i=new Range;return i.setStart(a,0),i.setEnd(a,1),o.removeAllRanges(),o.addRange(i),new Promise(((t,n)=>{const o=e.registerCommand(tmt,(n=>(jgt(n,ClipboardEvent)&&(o(),null!==iwt&&(window.clearTimeout(iwt),iwt=null),t(lwt(e,n))),!0)),Gft);iwt=window.setTimeout((()=>{o(),iwt=null,t(!1)}),50),r.execCommand("copy"),a.remove()}))}});const cwt="development"===process.env.NODE_ENV?Gyt:swt;cwt.$generateJSONFromSelectedNodes,cwt.$generateNodesFromSerializedNodes,cwt.$getHtmlContent,cwt.$getLexicalContent,cwt.$insertDataTransferForPlainText;const uwt=cwt.$insertDataTransferForRichText;cwt.$insertGeneratedNodes;const dwt=cwt.copyToClipboard;function hwt(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const pwt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fwt=pwt&&"documentMode"in document?document.documentMode:null,mwt=!(!pwt||!("InputEvent"in window)||fwt)&&"getTargetRanges"in new window.InputEvent("input"),vwt=pwt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gwt=pwt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,bwt=pwt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ywt=pwt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!bwt,wwt=zmt("DRAG_DROP_PASTE_FILE");class xwt extends umt{static getType(){return"quote"}static clone(e){return new xwt(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return Bgt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Mwt,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Ewt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=fft(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=fft();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function Ewt(){return dft(new xwt)}class kwt extends umt{static getType(){return"heading"}static clone(e){return new kwt(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];Bgt(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:Cwt,priority:0}),h2:e=>({conversion:Cwt,priority:0}),h3:e=>({conversion:Cwt,priority:0}),h4:e=>({conversion:Cwt,priority:0}),h5:e=>({conversion:Cwt,priority:0}),h6:e=>({conversion:Cwt,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Swt(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Swt(e)?{conversion:e=>({node:_wt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=_wt(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?_wt(this.getTag()):fft(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=fft();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?fft():_wt(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function Swt(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Cwt(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=_wt(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function Mwt(e){const t=Ewt();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function _wt(e){return dft(new kwt(e))}function Nwt(e){let t=null;if(jgt(e,DragEvent)?t=e.dataTransfer:jgt(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Awt(e){const t=Sft();if(!Tft(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],a=o.getKey();if(n.has(a))continue;const i=zgt(o,(e=>Aft(e)&&!e.isInline()));if(null===i)continue;const l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function Owt(e){const t=wft(e);return Nft(t)}var Iwt=Object.freeze({__proto__:null,$createHeadingNode:_wt,$createQuoteNode:Ewt,$isHeadingNode:function(e){return e instanceof kwt},$isQuoteNode:function(e){return e instanceof xwt},DRAG_DROP_PASTE:wwt,HeadingNode:kwt,QuoteNode:xwt,eventFiles:Nwt,registerRichText:function(e){const t=Vgt(e.registerCommand(Kft,(e=>{const t=Sft();return!!Dft(t)&&(t.clear(),!0)}),0),e.registerCommand(rmt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteCharacter(e),!0)}),Xft),e.registerCommand(amt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteWord(e),!0)}),Xft),e.registerCommand(omt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteLine(e),!0)}),Xft),e.registerCommand(emt,(t=>{const n=Sft();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)uwt(r,n,e);else if(Tft(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),Xft),e.registerCommand(Imt,(()=>{const e=Sft();return!!Tft(e)&&(e.removeText(),!0)}),Xft),e.registerCommand(pmt,(e=>{const t=Sft();return!!Tft(t)&&(t.formatText(e),!0)}),Xft),e.registerCommand(hmt,(e=>{const t=Sft();if(!Tft(t)&&!Dft(t))return!1;const n=t.getNodes();for(const t of n){const n=zgt(t,(e=>Aft(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),Xft),e.registerCommand(mmt,(e=>{const t=Sft();return!!Tft(t)&&(t.insertLineBreak(e),!0)}),Xft),e.registerCommand(vmt,(()=>{const e=Sft();return!!Tft(e)&&(e.insertParagraph(),!0)}),Xft),e.registerCommand(gmt,(()=>(Mft([vft()]),!0)),Xft),e.registerCommand(fmt,(()=>Awt((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Xft),e.registerCommand(Nmt,(()=>Awt((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),Xft),e.registerCommand(xmt,(e=>{const t=Sft();if(Dft(t)&&!Owt(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(Tft(t)){const n=bft(t.focus,!0);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(bmt,(e=>{const t=Sft();if(Dft(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(Tft(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===kft().getChildrenSize()}(t))return e.preventDefault(),!0;const n=bft(t.focus,!1);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(ymt,(e=>{const t=Sft();if(Dft(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!Tft(t))return!1;if(Nvt(t,!0)){const n=e.shiftKey;return e.preventDefault(),_vt(t,n,!0),!0}return!1}),Xft),e.registerCommand(wmt,(e=>{const t=Sft();if(Dft(t)&&!Owt(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!Tft(t))return!1;const n=e.shiftKey;return!!Nvt(t,!1)&&(e.preventDefault(),_vt(t,n,!1),!0)}),Xft),e.registerCommand(Emt,(t=>{if(Owt(t.target))return!1;const n=Sft();if(!Tft(n))return!1;t.preventDefault();const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!Hft(o)&&Rgt(o).getIndent()>0?e.dispatchCommand(Nmt,void 0):e.dispatchCommand(rmt,!0)}),Xft),e.registerCommand(kmt,(t=>{if(Owt(t.target))return!1;const n=Sft();return!!Tft(n)&&(t.preventDefault(),e.dispatchCommand(rmt,!1))}),Xft),e.registerCommand(Cmt,(t=>{const n=Sft();if(!Tft(n))return!1;if(null!==t){if((gwt||vwt||ywt)&&mwt)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mmt,!1)}return e.dispatchCommand(vmt,void 0)}),Xft),e.registerCommand(Mmt,(()=>{const t=Sft();return!!Tft(t)&&(e.blur(),!0)}),Xft),e.registerCommand(smt,(t=>{const[,n]=Nwt(t);if(n.length>0){const r=hwt(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,a=wft(o);if(null!==a){const e=mft();if(zft(a))e.anchor.set(a.getKey(),t,"text"),e.focus.set(a.getKey(),t,"text");else{const t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Rft(e);Zft(n)}e.dispatchCommand(wwt,n)}return t.preventDefault(),!0}const r=Sft();return!!Tft(r)}),Xft),e.registerCommand(lmt,(e=>{const[t]=Nwt(e),n=Sft();return!(t&&!Tft(n))}),Xft),e.registerCommand(imt,(e=>{const[t]=Nwt(e),n=Sft();if(t&&!Tft(n))return!1;const r=hwt(e.clientX,e.clientY);if(null!==r){const t=wft(r.node);Nft(t)&&e.preventDefault()}return!0}),Xft),e.registerCommand(Tmt,(()=>($ft(),!0)),Xft),e.registerCommand(tmt,(t=>(dwt(e,jgt(t,ClipboardEvent)?t:null),!0)),Xft),e.registerCommand(nmt,(t=>(async function(e,t){await dwt(t,jgt(e,ClipboardEvent)?e:null),t.update((()=>{const e=Sft();Tft(e)?e.removeText():Dft(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Xft),e.registerCommand(Amt,(t=>{const[,n,r]=Nwt(t);return n.length>0&&!r?(e.dispatchCommand(wwt,n),!0):!jmt(t.target)&&(null!==Sft()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=Sft(),r=jgt(e,InputEvent)||jgt(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&uwt(r,n,t)}),{tag:"paste"})}(t,e),!0))}),Xft));return t}});function Dwt(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const Pwt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Twt=Pwt&&"documentMode"in document?document.documentMode:null,Hwt=!(!Pwt||!("InputEvent"in window)||Twt)&&"getTargetRanges"in new window.InputEvent("input"),Lwt=Pwt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zwt=Pwt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Rwt=Pwt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Bwt=Pwt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Rwt,$wt=zmt("DRAG_DROP_PASTE_FILE");class Zwt extends umt{static getType(){return"quote"}static clone(e){return new Zwt(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return Bgt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:qwt,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Vwt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=fft(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=fft();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}}function Vwt(){return dft(new Zwt)}class jwt extends umt{static getType(){return"heading"}static clone(e){return new jwt(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){const e=r[t];Bgt(n,e)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:Fwt,priority:0}),h2:e=>({conversion:Fwt,priority:0}),h3:e=>({conversion:Fwt,priority:0}),h4:e=>({conversion:Fwt,priority:0}),h5:e=>({conversion:Fwt,priority:0}),h6:e=>({conversion:Fwt,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Wwt(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Wwt(e)?{conversion:e=>({node:Ywt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Zgt(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){const t=Ywt(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=n!==this.getTextContentSize()&&e?Ywt(this.getTag()):fft(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){const e=fft();e.select(),this.replace(e,!0)}return r}collapseAtStart(){const e=this.isEmpty()?fft():Ywt(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function Wwt(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Fwt(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=Ywt(t),null!==e.style&&n.setFormat(e.style.textAlign)),{node:n}}function qwt(e){const t=Vwt();return null!==e.style&&t.setFormat(e.style.textAlign),{node:t}}function Ywt(e){return dft(new jwt(e))}function Uwt(e){let t=null;if(jgt(e,DragEvent)?t=e.dataTransfer:jgt(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Kwt(e){const t=Sft();if(!Tft(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],a=o.getKey();if(n.has(a))continue;const i=zgt(o,(e=>Aft(e)&&!e.isInline()));if(null===i)continue;const l=i.getKey();i.canIndent()&&!n.has(l)&&(n.add(l),e(i))}return n.size>0}function Gwt(e){const t=wft(e);return Nft(t)}var Xwt=Object.freeze({__proto__:null,$createHeadingNode:Ywt,$createQuoteNode:Vwt,$isHeadingNode:function(e){return e instanceof jwt},$isQuoteNode:function(e){return e instanceof Zwt},DRAG_DROP_PASTE:$wt,HeadingNode:jwt,QuoteNode:Zwt,eventFiles:Uwt,registerRichText:function(e){return Vgt(e.registerCommand(Kft,(e=>{const t=Sft();return!!Dft(t)&&(t.clear(),!0)}),0),e.registerCommand(rmt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteCharacter(e),!0)}),Xft),e.registerCommand(amt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteWord(e),!0)}),Xft),e.registerCommand(omt,(e=>{const t=Sft();return!!Tft(t)&&(t.deleteLine(e),!0)}),Xft),e.registerCommand(emt,(t=>{const n=Sft();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)uwt(r,n,e);else if(Tft(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),Xft),e.registerCommand(Imt,(()=>{const e=Sft();return!!Tft(e)&&(e.removeText(),!0)}),Xft),e.registerCommand(pmt,(e=>{const t=Sft();return!!Tft(t)&&(t.formatText(e),!0)}),Xft),e.registerCommand(hmt,(e=>{const t=Sft();if(!Tft(t)&&!Dft(t))return!1;const n=t.getNodes();for(const t of n){const n=zgt(t,(e=>Aft(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),Xft),e.registerCommand(mmt,(e=>{const t=Sft();return!!Tft(t)&&(t.insertLineBreak(e),!0)}),Xft),e.registerCommand(vmt,(()=>{const e=Sft();return!!Tft(e)&&(e.insertParagraph(),!0)}),Xft),e.registerCommand(gmt,(()=>(Mft([vft()]),!0)),Xft),e.registerCommand(fmt,(()=>Kwt((e=>{const t=e.getIndent();e.setIndent(t+1)}))),Xft),e.registerCommand(Nmt,(()=>Kwt((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),Xft),e.registerCommand(xmt,(e=>{const t=Sft();if(Dft(t)&&!Gwt(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(Tft(t)){const n=bft(t.focus,!0);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(bmt,(e=>{const t=Sft();if(Dft(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(Tft(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===kft().getChildrenSize()}(t))return e.preventDefault(),!0;const n=bft(t.focus,!1);if(!e.shiftKey&&Nft(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),Xft),e.registerCommand(ymt,(e=>{const t=Sft();if(Dft(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!Tft(t))return!1;if(Nvt(t,!0)){const n=e.shiftKey;return e.preventDefault(),_vt(t,n,!0),!0}return!1}),Xft),e.registerCommand(wmt,(e=>{const t=Sft();if(Dft(t)&&!Gwt(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!Tft(t))return!1;const n=e.shiftKey;return!!Nvt(t,!1)&&(e.preventDefault(),_vt(t,n,!1),!0)}),Xft),e.registerCommand(Emt,(t=>{if(Gwt(t.target))return!1;const n=Sft();if(!Tft(n))return!1;t.preventDefault();const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!Hft(o)&&Rgt(o).getIndent()>0?e.dispatchCommand(Nmt,void 0):e.dispatchCommand(rmt,!0)}),Xft),e.registerCommand(kmt,(t=>{if(Gwt(t.target))return!1;const n=Sft();return!!Tft(n)&&(t.preventDefault(),e.dispatchCommand(rmt,!1))}),Xft),e.registerCommand(Cmt,(t=>{const n=Sft();if(!Tft(n))return!1;if(null!==t){if((zwt||Lwt||Bwt)&&Hwt)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mmt,!1)}return e.dispatchCommand(vmt,void 0)}),Xft),e.registerCommand(Mmt,(()=>{const t=Sft();return!!Tft(t)&&(e.blur(),!0)}),Xft),e.registerCommand(smt,(t=>{const[,n]=Uwt(t);if(n.length>0){const r=Dwt(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,a=wft(o);if(null!==a){const e=mft();if(zft(a))e.anchor.set(a.getKey(),t,"text"),e.focus.set(a.getKey(),t,"text");else{const t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Rft(e);Zft(n)}e.dispatchCommand($wt,n)}return t.preventDefault(),!0}const r=Sft();return!!Tft(r)}),Xft),e.registerCommand(lmt,(e=>{const[t]=Uwt(e),n=Sft();return!(t&&!Tft(n))}),Xft),e.registerCommand(imt,(e=>{const[t]=Uwt(e),n=Sft();if(t&&!Tft(n))return!1;const r=Dwt(e.clientX,e.clientY);if(null!==r){const t=wft(r.node);Nft(t)&&e.preventDefault()}return!0}),Xft),e.registerCommand(Tmt,(()=>($ft(),!0)),Xft),e.registerCommand(tmt,(t=>(dwt(e,jgt(t,ClipboardEvent)?t:null),!0)),Xft),e.registerCommand(nmt,(t=>(async function(e,t){await dwt(t,jgt(e,ClipboardEvent)?e:null),t.update((()=>{const e=Sft();Tft(e)?e.removeText():Dft(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),Xft),e.registerCommand(Amt,(t=>{const[,n,r]=Uwt(t);return n.length>0&&!r?(e.dispatchCommand($wt,n),!0):!jmt(t.target)&&null!==Sft()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=Sft(),r=jgt(e,InputEvent)||jgt(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&uwt(r,n,t)}),{tag:"paste"})}(t,e),!0)}),Xft))}});const Qwt="development"===process.env.NODE_ENV?Iwt:Xwt;Qwt.$createHeadingNode,Qwt.$createQuoteNode,Qwt.$isHeadingNode,Qwt.$isQuoteNode,Qwt.DRAG_DROP_PASTE,Qwt.HeadingNode,Qwt.QuoteNode,Qwt.eventFiles;const Jwt=Qwt.registerRichText,ext="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function txt(e){return e.getEditorState().read(Cyt(e.isComposing()))}function nxt({content:t}){const[n]=art(),r=function(t){const[n,r]=e.useState((()=>txt(t)));return ext((()=>{function e(){const e=txt(t);r(e)}return e(),Vgt(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),n}(n),o=fyt();return r?"function"==typeof t?t(o):t:null}var rxt=Object.freeze({__proto__:null,RichTextPlugin:function({contentEditable:n,placeholder:r,ErrorBoundary:o}){const[a]=art(),i=function(n,r){const[o,a]=e.useState((()=>n.getDecorators()));return ext((()=>n.registerDecoratorListener((e=>{t.flushSync((()=>{a(e)}))}))),[n]),e.useEffect((()=>{a(n.getDecorators())}),[n]),e.useMemo((()=>{const a=[],i=Object.keys(o);for(let l=0;l<i.length;l++){const s=i[l],c=E.createElement(r,{onError:e=>n._onError(e)},E.createElement(e.Suspense,{fallback:null},o[s])),u=n.getElementByKey(s);null!==u&&a.push(t.createPortal(c,u,s))}return a}),[r,o,n])}(a,o);return function(e){ext((()=>Vgt(Jwt(e),Nyt(e))),[e])}(a),E.createElement(E.Fragment,null,n,E.createElement(nxt,{content:r}),i)}});const oxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function axt(e){return e.getEditorState().read(Cyt(e.isComposing()))}function ixt({content:t}){const[n]=art(),r=function(t){const[n,r]=e.useState((()=>axt(t)));return oxt((()=>{function e(){const e=axt(t);r(e)}return e(),Vgt(t.registerUpdateListener((()=>{e()})),t.registerEditableListener((()=>{e()})))}),[t]),n}(n),o=fyt();return r?"function"==typeof t?t(o):t:null}var lxt=Object.freeze({__proto__:null,RichTextPlugin:function({contentEditable:n,placeholder:r,ErrorBoundary:o}){const[a]=art(),i=function(n,r){const[o,a]=e.useState((()=>n.getDecorators()));return oxt((()=>n.registerDecoratorListener((e=>{t.flushSync((()=>{a(e)}))}))),[n]),e.useEffect((()=>{a(n.getDecorators())}),[n]),e.useMemo((()=>{const a=[],i=Object.keys(o);for(let l=0;l<i.length;l++){const s=i[l],c=E.createElement(r,{onError:e=>n._onError(e)},E.createElement(e.Suspense,{fallback:null},o[s])),u=n.getElementByKey(s);null!==u&&a.push(t.createPortal(c,u,s))}return a}),[r,o,n])}(a,o);return function(e){oxt((()=>Vgt(Jwt(e),Nyt(e))),[e])}(a),E.createElement(E.Fragment,null,n,E.createElement(ixt,{content:r}),i)}});const sxt=("development"===process.env.NODE_ENV?rxt:lxt).RichTextPlugin;function cxt(e,t){return cxt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cxt(e,t)}var uxt={error:null},dxt=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=uxt,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,cxt(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(uxt)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,o=this.state.error,a=this.props.resetKeys;null!==o&&null!==t.error&&function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),e.length!==t.length||e.some((function(e,n){return!Object.is(e,t[n])}))}(e.resetKeys,a)&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(a);if(r)return E.createElement(r,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(E.Component),hxt=Object.freeze({__proto__:null,default:function({children:e,onError:t}){return E.createElement(dxt,{fallback:E.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},e)}});function pxt(e,t){return pxt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pxt(e,t)}var fxt={error:null},mxt=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=fxt,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,pxt(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var o=r.prototype;return o.reset=function(){this.setState(fxt)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,o,a,i=this.state.error,l=this.props.resetKeys;null!==i&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(a=l)&&(a=[]),o.length!==a.length||o.some((function(e,t){return!Object.is(e,a[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,l),this.reset())},o.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(a);if(r)return E.createElement(r,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(E.Component),vxt=Object.freeze({__proto__:null,default:function({children:e,onError:t}){return E.createElement(mxt,{fallback:E.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:t},e)}}),gxt=("development"===process.env.NODE_ENV?hxt:vxt).default;function bxt(){return bxt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bxt.apply(this,arguments)}const yxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var wxt=Object.freeze({__proto__:null,ContentEditable:function({ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:a,ariaLabel:i,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:h,id:p,role:f="textbox",spellCheck:m=!0,style:v,tabIndex:g,"data-testid":b,...y}){const[w]=art(),[x,k]=e.useState(!1),S=e.useCallback((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&w.setRootElement(e)}),[w]);return yxt((()=>(k(w.isEditable()),w.registerEditableListener((e=>{k(e)})))),[w]),E.createElement("div",bxt({},y,{"aria-activedescendant":x?t:void 0,"aria-autocomplete":x?n:"none","aria-controls":x?r:void 0,"aria-describedby":o,"aria-expanded":x&&"combobox"===f?!!a:void 0,"aria-label":i,"aria-labelledby":l,"aria-multiline":s,"aria-owns":x?c:void 0,"aria-readonly":!x||void 0,"aria-required":u,autoCapitalize:d,className:h,contentEditable:x,"data-testid":b,id:p,ref:S,role:f,spellCheck:m,style:v,tabIndex:g}))}});function xxt(){return xxt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xxt.apply(this,arguments)}const Ext="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;var kxt=Object.freeze({__proto__:null,ContentEditable:function({ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:a,ariaLabel:i,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:h,id:p,role:f="textbox",spellCheck:m=!0,style:v,tabIndex:g,"data-testid":b,...y}){const[w]=art(),[x,k]=e.useState(!1),S=e.useCallback((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView&&w.setRootElement(e)}),[w]);return Ext((()=>(k(w.isEditable()),w.registerEditableListener((e=>{k(e)})))),[w]),E.createElement("div",xxt({},y,{"aria-activedescendant":x?t:void 0,"aria-autocomplete":x?n:"none","aria-controls":x?r:void 0,"aria-describedby":o,"aria-expanded":x&&"combobox"===f?!!a:void 0,"aria-label":i,"aria-labelledby":l,"aria-multiline":s,"aria-owns":x?c:void 0,"aria-readonly":!x||void 0,"aria-required":u,autoCapitalize:d,className:h,contentEditable:x,"data-testid":b,id:p,ref:S,role:f,spellCheck:m,style:v,tabIndex:g}))}});const Sxt=("development"===process.env.NODE_ENV?wxt:kxt).ContentEditable;var Cxt,Mxt=new URL("./assets/file-icons/icon-photo.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,_xt=new URL("./assets/file-icons/icon-word.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Nxt=new URL("./assets/file-icons/icon-excel.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Axt=new URL("./assets/file-icons/icon-powerpoint.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Oxt=new URL("./assets/file-icons/icon-music.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Ixt=new URL("./assets/file-icons/icon-video.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Dxt=new URL("./assets/file-icons/icon-pdf.svg","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Pxt=function(e){var t,n=e.fileType,r=e.width,o=e.height;switch(n){case".jpg":case".jpeg":case".png":t=Mxt;break;case".mp3":case".wma":case".wma9":case".wav":case".flac":case".aac":case".aac+":case".ogg":case".aiff":case".lossless":case".amr":case".ac3":t=Oxt;break;case".avi":case".mp4":case".mkv":case".wmv":case".vob":case".flv":case".webm":case".3gp":case".mpeg":t=Ixt;break;case".pdf":t=Dxt;break;case".ppt":t=Axt;break;case".xlsx":t=Nxt;break;case".doc":case".docx":t=_xt;break;default:t=""}return x.default.createElement("img",v0e({},e,{src:t,style:v0e({width:r||24,height:o||"auto"},e.style)}))},Txt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,Hxt=G8e.div(Cxt||(Cxt=x0e(["\n font-size: 13px;\n &.comment {\n display: flex;\n width: 100%;\n align-items: flex-start;\n margin-bottom: 15px;\n position: relative; /* Add for child positioning */\n }\n\n .comment-avatar {\n /* width: 40px;\n height: 40px; */\n border-radius: 50%;\n margin-right: 10px;\n }\n\n .comment-body {\n //background-color: #f0f2f5;\n //padding: 10px 15px;\n //border-radius: 10px;\n //max-width: 600px;\n flex: 1;\n }\n \n .comment-content {\n background-color: #f0f2f5;\n padding: 10px 15px;\n border-radius: 10px;\n }\n\n .comment-header {\n font-size: 13px;\n display: flex;\n align-items: center;\n //margin-bottom: 5px;\n }\n\n .comment-username {\n font-weight: bold;\n color: #050505;\n margin-right: 10px;\n }\n\n .comment-timestamp {\n font-size: 12px;\n color: #65676b;\n }\n\n .comment-text {\n margin: 0;\n color: #050505;\n line-height: 1.5;\n }\n\n .replies {\n margin-top: 10px;\n //margin-left: 50px;\n position: relative;\n padding-left: 10px;\n \n }\n\n .replies::before {\n //content: '';\n //position: absolute;\n //top: calc(-50% + 40px - 20px);\n //left: calc(-15px - 10px - 20px); \n //width: 2px;\n //height: 100%;\n //background-color: #d1d1d1;\n }\n \n .replies .comment {\n margin-bottom: 10px;\n position: relative;\n }\n \n .replies .comment::before {\n //content: '';\n //position: absolute;\n //top: 15px;\n //left: -55px;\n //width: 30px;\n //height: 2px;\n //background-color: #d1d1d1;\n }\n\n .reply-toggle {\n background: none;\n border: none;\n color: #65676b;\n cursor: pointer;\n font-size: 13px;\n padding: 0;\n margin-top: 5px;\n }\n\n .reply-toggle:hover {\n text-decoration: underline;\n }\n .comment-toolbar {\n display: flex;\n align-items: end;\n gap: 1rem\n }\n\n .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n }\n\n .comment-link {\n margin: 0;\n color: #1b74e4;\n line-height: 1.5;\n text-decoration: underline;\n word-break: break-all;\n }\n .comment-link:hover {\n color: #135ab2;\n }\n"],["\n font-size: 13px;\n &.comment {\n display: flex;\n width: 100%;\n align-items: flex-start;\n margin-bottom: 15px;\n position: relative; /* Add for child positioning */\n }\n\n .comment-avatar {\n /* width: 40px;\n height: 40px; */\n border-radius: 50%;\n margin-right: 10px;\n }\n\n .comment-body {\n //background-color: #f0f2f5;\n //padding: 10px 15px;\n //border-radius: 10px;\n //max-width: 600px;\n flex: 1;\n }\n \n .comment-content {\n background-color: #f0f2f5;\n padding: 10px 15px;\n border-radius: 10px;\n }\n\n .comment-header {\n font-size: 13px;\n display: flex;\n align-items: center;\n //margin-bottom: 5px;\n }\n\n .comment-username {\n font-weight: bold;\n color: #050505;\n margin-right: 10px;\n }\n\n .comment-timestamp {\n font-size: 12px;\n color: #65676b;\n }\n\n .comment-text {\n margin: 0;\n color: #050505;\n line-height: 1.5;\n }\n\n .replies {\n margin-top: 10px;\n //margin-left: 50px;\n position: relative;\n padding-left: 10px;\n \n }\n\n .replies::before {\n //content: '';\n //position: absolute;\n //top: calc(-50% + 40px - 20px);\n //left: calc(-15px - 10px - 20px); \n //width: 2px;\n //height: 100%;\n //background-color: #d1d1d1;\n }\n \n .replies .comment {\n margin-bottom: 10px;\n position: relative;\n }\n \n .replies .comment::before {\n //content: '';\n //position: absolute;\n //top: 15px;\n //left: -55px;\n //width: 30px;\n //height: 2px;\n //background-color: #d1d1d1;\n }\n\n .reply-toggle {\n background: none;\n border: none;\n color: #65676b;\n cursor: pointer;\n font-size: 13px;\n padding: 0;\n margin-top: 5px;\n }\n\n .reply-toggle:hover {\n text-decoration: underline;\n }\n .comment-toolbar {\n display: flex;\n align-items: end;\n gap: 1rem\n }\n\n .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n }\n\n .comment-link {\n margin: 0;\n color: #1b74e4;\n line-height: 1.5;\n text-decoration: underline;\n word-break: break-all;\n }\n .comment-link:hover {\n color: #135ab2;\n }\n"]))),Lxt=function(t){var n=t.t,r=t.commentData,o=t.setReplyComment,a=t.handlePreviewImage,i=t.CDN_URL_VIEW,l=art()[0],s=[".png",".jpg",".jpeg",".gif",".bmp",".webp"],c=e.useState(!0),u=c[0],d=c[1],h=r.photo,p=r.createdByName,f=r.action,m=r.comment,v=r.createdDate,g=r.files,b=r.children,y=void 0===b?[]:b,w=(new Date).getDate(),E=v?new Date(v).getDate():null,k=E&&w-E==0?"".concat(jnt(v).format("HH:mm")," Hôm nay"):E&&w-E==1?"".concat(jnt(v).format("HH:mm")," Hôm qua"):v?Wnt(v):"",S=function(e){try{return new URL(e),!0}catch(e){return!1}}(m),C=S&&!m.startsWith("http")?"https://".concat(m):m;return x.default.createElement(Hxt,{className:"comment"},x.default.createElement("img",{src:h&&""!==h?h.startsWith("http")?h:"".concat(i,"/").concat(h):Txt,width:40,height:40,alt:"".concat(p,"'s avatar"),className:"comment-avatar"}),x.default.createElement("div",{className:"comment-body"},x.default.createElement("div",{className:"comment-content"},x.default.createElement("div",{className:"comment-header"},x.default.createElement("span",{className:"comment-username"},p),x.default.createElement("span",{className:"comment-text"},f)),S?x.default.createElement("a",{href:C,className:"comment-link",target:"_blank",rel:"noopener noreferrer",title:m},m):x.default.createElement("p",{className:"comment-text"},m),(null==g?void 0:g.length)>0&&x.default.createElement("div",{className:"d-flex "},null==g?void 0:g.map((function(t,n){return x.default.createElement(e.Fragment,{key:n},s.includes(t.type)?x.default.createElement("div",{className:"image-container"},x.default.createElement("img",{style:{maxWidth:"100%",maxHeight:360,cursor:"pointer"},src:"".concat(i,"/").concat(t.path),onClick:a,alt:""})):x.default.createElement(x.default.Fragment,null,x.default.createElement("a",{href:"".concat(i,"/").concat(t.path),key:n,className:"d-flex align-items-center p-1",style:{textDecoration:"none",color:"inherit"}},x.default.createElement("div",{className:"me-1"},x.default.createElement(Pxt,{fileType:null==t?void 0:t.type,width:35})),x.default.createElement("div",{className:"d-flex flex-column justify-content-center"},x.default.createElement("p",{className:"file-name-chat m-0"},t.name),x.default.createElement("p",{className:" m-0"},function(e,t){if(void 0===t&&(t=2),!+e.size)return"0 Bytes";var n=t<0?0:t,r=Math.floor(Math.log(e.size)/Math.log(1024));return"".concat(parseFloat((e.size/Math.pow(1024,r)).toFixed(n))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r])}({size:t.size}))))))}))," ")),x.default.createElement("div",{className:"comment-toolbar"},x.default.createElement("div",null,x.default.createElement("span",{className:"comment-timestamp"},k)),x.default.createElement("button",{className:"reply-toggle",onClick:function(){l.focus(),o(r)}},n("Reply")),y.length>0&&x.default.createElement("button",{className:"reply-toggle",onClick:function(){return d(!u)}},u?n("Hide"):"".concat(n("SeeReplies")," (").concat(y.length,")"))),u&&y.length>0&&x.default.createElement("div",{className:"replies"},y.map((function(e,t){return x.default.createElement(Lxt,{key:t,t:n,commentData:e,handlePreviewImage:a,setReplyComment:o,CDN_URL_VIEW:i})})))))};const zxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Rxt=zxt?e.useLayoutEffect:e.useEffect,Bxt={tag:"history-merge"};var $xt=Object.freeze({__proto__:null,LexicalComposer:function({initialConfig:t,children:n}){const r=e.useMemo((()=>{const{theme:e,namespace:n,editor__DEPRECATED:r,nodes:o,onError:a,editorState:i,html:l}=t,s=ort(null,e);let c=r||null;if(null===c){const r=Rmt({editable:t.editable,html:l,namespace:n,nodes:o,onError:e=>a(e,r),theme:e});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=kft();if(t.isEmpty()){const n=fft();t.append(n);const r=zxt?document.activeElement:null;(null!==Sft()||null!==r&&r===e.getRootElement())&&n.select()}}),Bxt);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Bxt);break}case"object":e.setEditorState(t,Bxt);break;case"function":e.update((()=>{kft().isEmpty()&&t(e)}),Bxt)}}(r,i),c=r}return[c,s]}),[]);return Rxt((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),E.createElement(rrt.Provider,{value:r},n)}});const Zxt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Vxt=Zxt?e.useLayoutEffect:e.useEffect,jxt={tag:"history-merge"};var Wxt=Object.freeze({__proto__:null,LexicalComposer:function({initialConfig:t,children:n}){const r=e.useMemo((()=>{const{theme:e,namespace:n,editor__DEPRECATED:r,nodes:o,onError:a,editorState:i,html:l}=t,s=ort(null,e);let c=r||null;if(null===c){const r=Rmt({editable:t.editable,html:l,namespace:n,nodes:o,onError:e=>a(e,r),theme:e});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=kft();if(t.isEmpty()){const n=fft();t.append(n);const r=Zxt?document.activeElement:null;(null!==Sft()||null!==r&&r===e.getRootElement())&&n.select()}}),jxt);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,jxt);break}case"object":e.setEditorState(t,jxt);break;case"function":e.update((()=>{kft().isEmpty()&&t(e)}),jxt)}}(r,i),c=r}return[c,s]}),[]);return Vxt((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),E.createElement(rrt.Provider,{value:r},n)}});const Fxt=("development"===process.env.NODE_ENV?$xt:Wxt).LexicalComposer;var qxt="px-1 mx-2/3 mx-px align-baseline inline-block rounded break-words cursor-pointer leading-5",Yxt="ring-2 ring-offset-1",Uxt={ltr:"text-left",rtl:"text-right",beautifulMentions:{"@":"".concat(qxt," dark:bg-green-500 bg-green-600 text-accent"),"@Focused":"".concat(Yxt," dark:ring-green-500 ring-green-600 ring-offset-background"),"#":"".concat(qxt," dark:bg-blue-400 bg-blue-600 text-accent"),"#Focused":"".concat(Yxt," dark:ring-blue-400 ring-blue-600 ring-offset-background"),"due:":"".concat(qxt," dark:bg-yellow-400 bg-yellow-600 text-accent"),"due:Focused":"".concat(Yxt," dark:ring-yellow-400 ring-yellow-600 ring-offset-background"),"rec:":{trigger:"text-blue-500",value:"text-orange-500",container:"mx-[2px] px-[4px] rounded border border-muted cursor-pointer",containerFocused:"mx-[2px] px-[4px] rounded border border-muted cursor-pointer"},"\\w+:":"".concat(qxt," dark:bg-gray-400 bg-gray-500 text-accent"),"\\w+:Focused":"".concat(Yxt," dark:ring-gray-400 ring-gray-500 ring-offset-background")}},Kxt=e.forwardRef((function(t,n){var r=t.value,o=g0e(t,["value"]);return x.default.createElement(e.Fragment,null,x.default.createElement("span",v0e({},o,{ref:n}),r))}));function Gxt(e,t,n){return function(){var r=kft();if(null===r.getFirstChild()){var o=fft();o.append.apply(o,function(e,t,n,r){void 0===r&&(r=fbt);for(var o=function(e,t,n){var r=function(e,t,n){var r,o=new RegExp("(?<=\\s|^|\\()".concat(mbt(t),"((?:").concat(vbt(t,n),"){1,").concat(75,"})"),"g"),a=[];for(o.lastIndex=0;null!==(r=o.exec(e));)a.push({value:r[0],index:r.index});return a}(e,t,n),o=[],a=0;if(r.forEach((function(n){var r=n.value,i=n.index;if(i>a){var l=e.substring(a,i);o.push({type:"text",value:l})}var s=t.find((function(e){return new RegExp(e).test(r)})),c=s&&r.match(new RegExp(s));if(!c)throw new Error("No trigger found for mention");var u=c[0];o.push({type:"mention",value:r.substring(u.length),trigger:u}),a=i+r.length})),a<e.length){var i=e.substring(a);o.push({type:"text",value:i})}return o}(e,t,r),a=[],i=function(e){var t=n.find((function(t){return t.name===e.value}));"text"===e.type?a.push(gft(e.value)):t?a.push(zbt("@".concat(e.value))):a.push(gft("@".concat(e.value)))},l=0,s=o;l<s.length;l++)i(s[l]);return a}(e,t,n)),r.append(o)}}}Kxt.displayName="CustomMentionComponent";Ibt=Ibt||function(e){return function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return m0e(n,t),n.getType=function(){return"custom-beautifulMention"},n.clone=function(e){return new n(e.__trigger,e.__value,e.__data,e.__key)},n.importJSON=function(e){return new n(e.trigger,e.value,e.data)},n.prototype.exportJSON=function(){var e=this.__data;return v0e(v0e({trigger:this.__trigger,value:this.__value},e?{data:e}:{}),{type:"custom-beautifulMention",version:1})},n.prototype.component=function(){return e},n.prototype.decorate=function(e,n){return t.prototype.decorate.call(this,e,n)},n}(Dbt)}(Kxt);function Xxt(e,t){let n=Date.now(),r=0;return(o,a,i,l,s,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const a=t._selection,i=e._selection;if(o)return 1;if(!(Tft(a)&&Tft(i)&&i.isCollapsed()&&a.isCollapsed()))return 0;const l=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Hft(n)||o.push(n)}return o}(t,n,r);if(0===l.length)return 0;if(l.length>1){const n=t._nodeMap,r=n.get(a.anchor.key),o=n.get(i.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&zft(r)&&1===r.__text.length&&1===a.anchor.offset?2:0}const s=l[0],c=e._nodeMap.get(s.__key);if(!zft(c)||!zft(s)||c.__mode!==s.__mode)return 0;const u=c.__text,d=s.__text;if(u===d)return 0;const h=a.anchor,p=i.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,v=d.length-u.length;return 1===v&&m===f-1?2:-1===v&&m===f+1?3:-1===v&&m===f?4:0}(o,a,l,s,e.isComposing()),h=(()=>{const h=null===i||i.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=a._selection;return l.size>0||s.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===l.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),a=t._selection,i=n._selection;let l=!1;return Tft(a)&&Tft(i)&&(l="element"===a.anchor.type&&"element"===a.focus.type&&"text"===i.anchor.type&&"text"===i.focus.type),!(l||!zft(r)||!zft(o))&&r.__type===o.__type&&r.__text===o.__text&&r.__mode===o.__mode&&r.__detail===o.__detail&&r.__style===o.__style&&r.__format===o.__format&&r.__parent===o.__parent}(Array.from(l)[0],o,a)?0:1:null!==f?0:2})();return n=u,r=d,h}}function Qxt(e){e.undoStack=[],e.redoStack=[],e.current=null}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chat-app-window .user-chats {\n background-color: #f2f0f7;\n padding: 0;\n position: relative;\n}\n.chat-app-window .user-chats > div:first-child {\n overflow: auto !important;\n margin-bottom: 0 !important;\n}\n.chat-app-window .user-chats .avatar img {\n border: 2px solid #fff;\n}\n.chat-app-window .active-chat {\n height: inherit;\n display: flex;\n flex-direction: column;\n}\n.chat-app-window .active-chat .chat-header {\n display: flex;\n justify-content: space-between;\n height: 65px;\n background-color: #fff;\n padding: 0 1rem;\n border-bottom: 1px solid #ebe9f1;\n}\n.chat-app-window .chats .chat-avatar {\n float: right;\n}\n.chat-app-window .chats .chat {\n margin: 0 17px;\n}\n.chat-app-window .chats .chat-body {\n display: block;\n margin: 10px 0 0 0;\n overflow: hidden;\n}\n.chat-app-window .chats .chat-body .chat-content {\n float: right;\n margin: 0 0 10px 0;\n clear: both;\n min-height: 40px;\n color: #22292f;\n background-color: #FFFFFF;\n border-radius: 0.357rem;\n box-shadow: 0 4px 8px 0 rgba(34, 41, 47, 0.12);\n max-width: 75%;\n}\n.chat-app-window .chats .chat-body .chat-content.chat-content-file {\n padding: 0;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message {\n user-select: text;\n white-space: pre-wrap;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message-text {\n font-size: 1.075rem;\n margin-bottom: 0.5rem;\n}\n.chat-app-window .chats .chat-body .chat-content .chat-message-text .mention {\n color: #0068ff;\n font-weight: 500;\n}\n.chat-app-window .chats .chat-body .chat-content p {\n margin: 0;\n}\n.chat-app-window .chats .chat-body .chat-message-item .message-action {\n visibility: hidden;\n opacity: 0;\n}\n.chat-app-window .chats .chat-body .chat-message-item:hover .message-action {\n opacity: 1;\n visibility: visible;\n}\n.chat-app-window .chat-input-container {\n background-color: #FFFFFF;\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: flex-end;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n}\n.chat-app-window .chat-input-container .editor-container {\n max-height: 150px;\n overflow: auto;\n flex-grow: 1;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar {\n width: 6px;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar-track {\n background: none;\n}\n.chat-app-window .chat-input-container .editor-container::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 10px;\n}\n.chat-app-window .chat-input-container .editor-container .editor-input {\n padding: 10px 12px;\n}\n.chat-app-window .chat-input-container .editor-container .editor-input p {\n margin: 0;\n}\n.chat-app-window .chat-input-container .send {\n background: none;\n border: 0 !important;\n}\n.chat-app-window .chat-app-form {\n min-height: 65px;\n padding: 0 1rem;\n background-color: #fff;\n display: flex;\n align-items: center;\n}\n.chat-app-window .chat-app-form.chat-toolbar {\n min-height: 40px;\n border-bottom: 1px solid #ebe9f1;\n border-top: 1px solid #ebe9f1;\n position: relative;\n}\n.chat-app-window .chat-app-reply {\n width: 100%;\n padding: 14px;\n height: 0;\n display: none;\n}\n.chat-app-window .chat-app-reply.show {\n display: block;\n height: auto;\n transition: all 1s ease-in-out;\n}\n.chat-app-window .chat-app-reply .reply-container {\n display: flex;\n padding: 10px;\n background-color: #eaedf0;\n border-radius: 6px;\n position: relative;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-quote {\n border-left: 2px solid #007bb6;\n margin-right: 5px;\n height: 42px;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-image {\n margin-right: 4px;\n width: 42px;\n height: 42px;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n.chat-app-window .chat-app-reply .reply-container .reply-clear-btn {\n position: absolute;\n right: 3px;\n top: 3px;\n background: #3b4253;\n border-radius: 50%;\n cursor: pointer;\n padding: 2px;\n}\n.chat-app-window .chat-app-reply .reply-container p {\n margin-bottom: 0;\n}\n.chat-app-window .chat-app-preview {\n padding-left: 1rem;\n max-height: 170px;\n overflow-y: auto;\n background-color: #fff;\n height: 0;\n display: none;\n}\n.chat-app-window .chat-app-preview.show {\n display: block;\n height: auto;\n transition: all 2ms ease-in-out;\n}\n.chat-app-window .chat-app-preview .preview-image-container {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n padding: 10px;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview {\n position: relative;\n border-radius: 5px;\n overflow: hidden;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview .image-preview-clear-btn {\n position: absolute;\n right: 3px;\n top: 3px;\n background: #3b4253;\n border-radius: 50%;\n cursor: pointer;\n padding: 2px;\n}\n.chat-app-window .chat-app-preview .preview-image-container .image-preview .img {\n width: 100px;\n height: 100px;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n border: 1px solid #ebe9f1;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar {\n width: 6px;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar-track {\n background: none;\n}\n.chat-app-window .chat-app-preview::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 10px;\n}\n\n.chat-app-window .image-container {\n min-width: 150px;\n display: flex;\n justify-content: center;\n}\n\n.chat-widget .card-header {\n padding-top: 0.8rem;\n padding-bottom: 0.8rem;\n}\n.chat-widget .chat-app-window .user-chats {\n background-color: #f8f8f8;\n height: 390px;\n}\n.chat-widget .chat-app-window .user-chats div:first-child {\n overflow: auto !important;\n}\n.chat-widget .chat-app-window .chat-app-form {\n border-top: 0;\n border-bottom-left-radius: 0.357rem;\n border-bottom-right-radius: 0.357rem;\n height: 56px;\n}\n.chat-widget .chat-app-window .chat-app-form .input-group-text,\n.chat-widget .chat-app-window .chat-app-form .message {\n border: 0;\n border-left: 0;\n padding-left: 0;\n}\n.chat-widget .chat-app-window .chat-app-form .input-group:not(.bootstrap-touchspin):focus-within {\n box-shadow: none;\n}\n\n.input-group-merge.form-send-message:focus-within {\n box-shadow: none;\n}\n.input-group-merge.form-send-message .message-container {\n padding: 0;\n position: relative;\n flex: 1 1 auto;\n}\n.input-group-merge.form-send-message .message-container .editing {\n height: 100%;\n line-height: 1.5;\n flex: 1 1 auto;\n border: none;\n border-radius: 0;\n padding: 4px 10px;\n user-select: text;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.input-group-merge.form-send-message .message-container .editing:focus {\n outline: none;\n}\n.input-group-merge.form-send-message .message-container .editing .tags {\n color: #0068ff;\n}\n.input-group-merge.form-send-message .message-container .editing.empty:before {\n content: attr(placeholder);\n cursor: text;\n background: none;\n color: #b9b9c3;\n display: block;\n position: absolute;\n padding-top: 2px;\n left: 16px;\n right: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n pointer-events: none;\n}\n.input-group-merge.form-send-message .message-container .editing .editing-message {\n margin: 0;\n user-select: text;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.input-group-merge.form-send-message .message-container .editing-placeholder {\n position: absolute;\n left: 11px;\n top: 6px;\n}\n\n.input-container {\n position: relative;\n}\n.input-container .menu-suggestion {\n border-radius: 6px;\n display: none;\n position: absolute;\n inset: auto auto 0px 0px;\n transform: translate(20px, -50px);\n box-shadow: 0 5px 25px rgba(34, 41, 47, 0.1);\n width: 300px;\n max-height: 600px;\n background-color: #FFFFFF;\n}\n.input-container .menu-suggestion.show {\n display: block;\n}\n.input-container .menu-suggestion .suggest-item {\n cursor: pointer;\n padding: 0.5rem 1rem;\n}\n.input-container .menu-suggestion .suggest-item:hover {\n background-color: #f8f8f8;\n}\n.input-container .menu-suggestion .menu-suggestion-item {\n cursor: pointer;\n padding: 0.5rem 1rem;\n}\n.input-container .menu-suggestion .menu-suggestion-item:hover {\n background-color: #f8f8f8;\n}\n\n.test-editor {\n box-sizing: border-box;\n /*border: 1px solid #ddd;*/\n cursor: text;\n /*padding: 16px;*/\n /*border-radius: 2px;*/\n /*margin-bottom: 2em;*/\n /*box-shadow: inset 0px 1px 8px -3px #ABABAB;*/\n /*background: #fefefe;*/\n max-height: 100px;\n overflow-y: scroll;\n}\n.test-editor::-webkit-scrollbar {\n width: 6px;\n}\n.test-editor::-webkit-scrollbar-track {\n background: none;\n}\n.test-editor::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 5px;\n}\n\n.test-editor :global(.public-DraftEditor-content) {\n min-height: 20px;\n}\n\n.attachment-icon .chat-btn {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 30px;\n height: 30px;\n padding: 0;\n background: none;\n background-color: #FFFFFF !important;\n border: none;\n border-radius: 50%;\n z-index: 999999;\n}\n\n.attachment-icon-emoji > div > button {\n border: 0;\n margin: 0;\n font-size: 23px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 30px;\n height: 30px;\n padding: 0;\n background: none;\n background-color: #FFFFFF !important;\n border: none;\n border-radius: 50%;\n}\n.attachment-icon-emoji button {\n font-size: 18px;\n}\n\n.ass {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n min-height: 18px;\n}");var Jxt=Object.freeze({__proto__:null,createEmptyHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},registerHistory:function(e,t,n){const r=Xxt(e,n);return Vgt(e.registerCommand(Lmt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,a=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Fft,!0)),0===r.length&&e.dispatchCommand(qft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Omt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(qft,!0));const a=n.pop();0===n.length&&e.dispatchCommand(Fft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Yft,(()=>(Qxt(t),!1)),Xft),e.registerCommand(Uft,(()=>(Qxt(t),e.dispatchCommand(Fft,!1),e.dispatchCommand(qft,!1),!0)),Xft),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:a,dirtyElements:i,tags:l})=>{const s=t.current,c=t.redoStack,u=t.undoStack,d=null===s?null:s.editorState;if(null!==s&&n===d)return;const h=r(o,n,s,a,i,l);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Fft,!1)),null!==s&&(u.push({...s}),e.dispatchCommand(qft,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}});function eEt(e,t){let n=Date.now(),r=0;return(o,a,i,l,s,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const a=t._selection,i=e._selection;if(o)return 1;if(!(Tft(a)&&Tft(i)&&i.isCollapsed()&&a.isCollapsed()))return 0;const l=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Hft(n)||o.push(n)}return o}(t,n,r);if(0===l.length)return 0;if(l.length>1){const n=t._nodeMap,r=n.get(a.anchor.key),o=n.get(i.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&zft(r)&&1===r.__text.length&&1===a.anchor.offset?2:0}const s=l[0],c=e._nodeMap.get(s.__key);if(!zft(c)||!zft(s)||c.__mode!==s.__mode)return 0;const u=c.__text,d=s.__text;if(u===d)return 0;const h=a.anchor,p=i.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,v=d.length-u.length;return 1===v&&m===f-1?2:-1===v&&m===f+1?3:-1===v&&m===f?4:0}(o,a,l,s,e.isComposing()),h=(()=>{const h=null===i||i.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=a._selection;return l.size>0||s.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===l.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),a=t._selection,i=n._selection;let l=!1;return Tft(a)&&Tft(i)&&(l="element"===a.anchor.type&&"element"===a.focus.type&&"text"===i.anchor.type&&"text"===i.focus.type),!(l||!zft(r)||!zft(o))&&r.__type===o.__type&&r.__text===o.__text&&r.__mode===o.__mode&&r.__detail===o.__detail&&r.__style===o.__style&&r.__format===o.__format&&r.__parent===o.__parent}(Array.from(l)[0],o,a)?0:1:null!==f?0:2})();return n=u,r=d,h}}function tEt(e){e.undoStack=[],e.redoStack=[],e.current=null}var nEt=Object.freeze({__proto__:null,createEmptyHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},registerHistory:function(e,t,n){const r=eEt(e,n),o=Vgt(e.registerCommand(Lmt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,a=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Fft,!0)),0===r.length&&e.dispatchCommand(qft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Omt,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(qft,!0));const a=n.pop();0===n.length&&e.dispatchCommand(Fft,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),Xft),e.registerCommand(Yft,(()=>(tEt(t),!1)),Xft),e.registerCommand(Uft,(()=>(tEt(t),e.dispatchCommand(Fft,!1),e.dispatchCommand(qft,!1),!0)),Xft),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:a,dirtyElements:i,tags:l})=>{const s=t.current,c=t.redoStack,u=t.undoStack,d=null===s?null:s.editorState;if(null!==s&&n===d)return;const h=r(o,n,s,a,i,l);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Fft,!1)),null!==s&&(u.push({...s}),e.dispatchCommand(qft,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return o}});const rEt="development"===process.env.NODE_ENV?Jxt:nEt,oEt=rEt.createEmptyHistoryState,aEt=rEt.registerHistory;var iEt=Object.freeze({__proto__:null,HistoryPlugin:function({externalHistoryState:t}){const[n]=art();return function(t,n,r=1e3){const o=e.useMemo((()=>n||oEt()),[n]);e.useEffect((()=>aEt(t,o,r)),[r,t,o])}(n,t),null},createEmptyHistoryState:oEt}),lEt=Object.freeze({__proto__:null,HistoryPlugin:function({externalHistoryState:t}){const[n]=art();return function(t,n,r=1e3){const o=e.useMemo((()=>n||oEt()),[n]);e.useEffect((()=>aEt(t,o,r)),[r,t,o])}(n,t),null},createEmptyHistoryState:oEt});const sEt="development"===process.env.NODE_ENV?iEt:lEt,cEt=sEt.HistoryPlugin;sEt.createEmptyHistoryState;var uEt,dEt,hEt,pEt,fEt,mEt,vEt,gEt,bEt,yEt=function(t){var n=t.open,r=t.children,o=t.toggleSidebar,a=t.width,i=t.keyboard,l=t.hiddenBackground,s=t.hiddenFullScreenButton,c=e.useState(!1),u=c[0],d=c[1],h=e.useState(n),p=h[0],f=h[1];e.useEffect((function(){n?f(n):setTimeout((function(){f(n)}),50)}),[n]);var m=function(){f(!1),setTimeout((function(){o()}),400)};return x.default.createElement("div",{tabIndex:0,className:w1e({"d-none":!n}),onKeyDown:function(e){!i&&"Escape"===e.code&&p&&(m(),e.stopPropagation(),e.preventDefault())}},x.default.createElement("div",{className:w1e("offcanvas-backdrop fade",{"d-none":!p||l,show:p}),style:{zIndex:1056},onClick:m}),x.default.createElement("div",{className:w1e("customizer d-none d-md-block ","customizer-".concat(null!=a?a:600),{open:p,fullscreen:u}),style:{zIndex:1057}},x.default.createElement("div",{style:{position:"fixed",top:"50%",transform:"translate(-50%, -50%)",background:"#FFF",filter:"drop-shadow(0.9px 0.9px 1.5px)",height:50,display:"flex",alignItems:"center",borderRadius:"0px 5px 5px 0px",cursor:"pointer",zIndex:9,marginLeft:7},className:w1e({"d-none":s}),onClick:function(){d(!u)}},x.default.createElement(Dnt,{className:"".concat(u?"d-none":""),fontSize:16}),x.default.createElement(Pnt,{className:"".concat(u?"":"d-none"),fontSize:15})),r))},wEt=G8e.div(uEt||(uEt=x0e(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #000;\n overflow: hidden;\n"],["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #000;\n overflow: hidden;\n"]))),xEt=G8e.img(dEt||(dEt=x0e(["\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n transform: translate(","px, ","px)\n scale(",");\n transition: transform "," ease-out;\n user-select: none;\n cursor: ",";\n &:hover {\n opacity: 0.95;\n }\n"],["\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n transform: translate(","px, ","px)\n scale(",");\n transition: transform "," ease-out;\n user-select: none;\n cursor: ",";\n &:hover {\n opacity: 0.95;\n }\n"])),(function(e){return e.translateX}),(function(e){return e.translateY}),(function(e){return e.scale}),(function(e){return e.isDragging?"0s":"0.3s"}),(function(e){return e.isDragging?"grabbing":"grab"})),EEt=G8e(w5e)(hEt||(hEt=x0e(["\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 10px 20px;\n z-index: 1060;\n"],["\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 10px 20px;\n z-index: 1060;\n"]))),kEt=G8e.div(pEt||(pEt=x0e(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-size: 16px;\n"],["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-size: 16px;\n"]))),SEt=G8e.button(fEt||(fEt=x0e(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background: rgba(0, 0, 0, 0.5);\n border: none;\n color: #fff;\n padding: 15px;\n border-radius: 50%;\n cursor: pointer;\n z-index: 1060;\n &:hover {\n background: rgba(0, 0, 0, 0.8);\n }\n"],["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background: rgba(0, 0, 0, 0.5);\n border: none;\n color: #fff;\n padding: 15px;\n border-radius: 50%;\n cursor: pointer;\n z-index: 1060;\n &:hover {\n background: rgba(0, 0, 0, 0.8);\n }\n"]))),CEt=G8e(SEt)(mEt||(mEt=x0e(["\n left: 20px;\n"],["\n left: 20px;\n"]))),MEt=G8e(SEt)(vEt||(vEt=x0e(["\n right: 20px;\n"],["\n right: 20px;\n"]))),_Et=G8e.div(gEt||(gEt=x0e(["\n display: flex;\n overflow-x: auto;\n padding: 10px;\n background: rgba(0, 0, 0, 0.7);\n justify-content: center;\n &::-webkit-scrollbar {\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 4px;\n }\n"],["\n display: flex;\n overflow-x: auto;\n padding: 10px;\n background: rgba(0, 0, 0, 0.7);\n justify-content: center;\n &::-webkit-scrollbar {\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 4px;\n }\n"]))),NEt=G8e.img(bEt||(bEt=x0e(["\n width: 60px;\n height: 60px;\n object-fit: cover;\n margin: 0 5px;\n cursor: pointer;\n border: ",";\n border-radius: 4px;\n opacity: ",";\n &:hover {\n opacity: 1;\n }\n"],["\n width: 60px;\n height: 60px;\n object-fit: cover;\n margin: 0 5px;\n cursor: pointer;\n border: ",";\n border-radius: 4px;\n opacity: ",";\n &:hover {\n opacity: 1;\n }\n"])),(function(e){return e.active?"2px solid #fff":"1px solid #555"}),(function(e){return e.active?1:.7})),AEt=function(t){var n,r,o,a,i=t.openModal,l=t.handleModal,s=t.images,c=t.CDN_URL_VIEW,u=t.initialIndex,d=void 0===u?0:u,h=e.useState(d),p=h[0],f=h[1],m=e.useState(1),v=m[0],g=m[1],b=e.useState({x:0,y:0}),y=b[0],w=b[1],E=e.useState(!1),k=E[0],S=E[1],C=e.useState({x:0,y:0}),M=C[0],_=C[1],N=e.useState(null),A=N[0],O=N[1],I=e.useState(!0),D=I[0],P=I[1],T=e.useState(null),H=T[0],L=T[1],z=e.useRef(new Map),R=e.useRef(null);e.useEffect((function(){i&&(g(1),w({x:0,y:0}),S(!1),O(null),P(!0),z.current.clear(),f(d))}),[i,d]),e.useEffect((function(){g(1),w({x:0,y:0}),S(!1),O(null),P(!0)}),[p]),e.useEffect((function(){[s[(p+1)%s.length],s[(p-1+s.length)%s.length]].filter(Boolean).forEach((function(e){var t,n;(new Image).src="".concat(c,"/").concat(null!==(n=null!==(t=null==e?void 0:e.urlExternal)&&void 0!==t?t:null==e?void 0:e.path)&&void 0!==n?n:"")}))}),[p,s]),e.useEffect((function(){var e=function(e){"ArrowLeft"===e.key&&B(),"ArrowRight"===e.key&&$(),"Escape"===e.key&&l()};return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[p]);var B=function(){f((function(e){return 0===e?s.length-1:e-1}))},$=function(){f((function(e){return e===s.length-1?0:e+1}))},Z=s[p],V=(new Date).getDate(),j=(null==Z?void 0:Z.createdDate)?new Date(null==Z?void 0:Z.createdDate).getDate():null,W=j&&V-j==0?"".concat(jnt(null==Z?void 0:Z.createdDate).format("HH:mm")," Hôm nay"):j&&V-j==1?"".concat(jnt(null==Z?void 0:Z.createdDate).format("HH:mm")," Hôm qua"):(null==Z?void 0:Z.createdDate)?Wnt(null==Z?void 0:Z.createdDate):"";return x.default.createElement(h5e,{zIndex:1058,isOpen:i,toggle:l,className:"modal-dialog-centered modal-fullscreen"},x.default.createElement("div",{className:"modal-header d-flex align-items-center justify-content-between mb-0"},x.default.createElement("div",{className:"d-flex align-items-center"},x.default.createElement("h5",{className:"modal-title"},x.default.createElement(Hnt,{fontSize:17,className:"me-1"}),"Xem ảnh (",p+1,"/",s.length,")")),x.default.createElement($nt,{className:"fw-normal mt-25 cursor-pointer",fontSize:24,onClick:l})),x.default.createElement(v5e,{style:{padding:0}},x.default.createElement(wEt,{onWheel:function(e){e.preventDefault();var t=e.deltaY>0?-.1:.1;g((function(e){return Math.min(Math.max(e+t,.5),3)}))}},D&&x.default.createElement(kEt,null,"Đang tải..."),x.default.createElement(xEt,{ref:R,src:"".concat(c,"/").concat(null!==(r=null!==(n=null==Z?void 0:Z.urlExternal)&&void 0!==n?n:null==Z?void 0:Z.path)&&void 0!==r?r:""),scale:v,translateX:y.x,translateY:y.y,isDragging:k,onPointerDown:function(e){if(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),z.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),L(e.clientX),1===z.current.size)S(!0),_({x:e.clientX-y.x,y:e.clientY-y.y});else if(2===z.current.size){S(!1);var t=Array.from(z.current.values()),n=Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y);O(n),_({x:n,y:v})}},onPointerMove:function(e){if(e.preventDefault(),z.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),k&&1===z.current.size){var t=e.clientX-M.x,n=e.clientY-M.y;w({x:Math.max(Math.min(t,500),-500),y:Math.max(Math.min(n,500),-500)})}else if(2===z.current.size&&null!==A){var r=Array.from(z.current.values()),o=Math.hypot(r[0].x-r[1].x,r[0].y-r[1].y),a=M.y*o/M.x;g(Math.min(Math.max(a,.5),3))}},onPointerUp:function(e){if(e.preventDefault(),e.currentTarget.releasePointerCapture(e.pointerId),z.current.delete(e.pointerId),null!==H&&0===z.current.size){var t=e.clientX-H;t>100?B():t<-100&&$()}if(0===z.current.size)S(!1),w({x:0,y:0}),O(null),L(null);else if(1===z.current.size){S(!0);var n=Array.from(z.current.values())[0];_({x:n.x-y.x,y:n.y-y.y})}},onPointerCancel:function(e){e.preventDefault(),e.currentTarget.releasePointerCapture(e.pointerId),z.current.delete(e.pointerId),S(!1),w({x:0,y:0}),O(null),L(null)},onDoubleClick:function(){g(1===v?2:1),w({x:0,y:0})},onLoad:function(){return P(!1)},onError:function(){return P(!1)},alt:null!==(o=null==Z?void 0:Z.createdByName)&&void 0!==o?o:"Ảnh xem trước"}),s.length>1&&x.default.createElement(x.default.Fragment,null,x.default.createElement(CEt,{onClick:B},x.default.createElement(Dnt,{fontSize:28})),x.default.createElement(MEt,{onClick:$},x.default.createElement(Pnt,{fontSize:28}))))),x.default.createElement(EEt,null,x.default.createElement("div",{className:"d-flex flex-column w-100"},x.default.createElement("div",{className:"d-flex justify-content-between mb-1"},x.default.createElement("div",null,x.default.createElement("strong",null,null!==(a=null==Z?void 0:Z.createdByName)&&void 0!==a?a:""),x.default.createElement("p",{className:"m-0"},W))),s.length>1&&x.default.createElement(_Et,null,s.map((function(e,t){var n,r;return x.default.createElement(NEt,{key:t,src:"".concat(c,"/").concat(null!==(r=null!==(n=null==e?void 0:e.urlExternal)&&void 0!==n?n:null==e?void 0:e.path)&&void 0!==r?r:""),active:t===p,onClick:function(){return f(t)},alt:"Thumbnail ".concat(t+1)})}))))))},OEt=new URL("./assets/avatars/avatar-blank.png","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("index.js",document.baseURI).href).href,IEt=G8e.div(TEt||(TEt=x0e(["\n.nav-item {\n border-bottom: 2px solid #fff;\n &.active {\n border-bottom: 2px solid #eb4619;\n }\n .nav-link .active{\n color: #eb4619;\n }\n}\n"],["\n.nav-item {\n border-bottom: 2px solid #fff;\n &.active {\n border-bottom: 2px solid #eb4619;\n }\n .nav-link .active{\n color: #eb4619;\n }\n}\n"]))),DEt=G8e.div(HEt||(HEt=x0e(["\n &.chat-input-container {\n background-color: #fff;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n justify-content: flex-end;\n width: 100%;\n .editor-container {\n min-width: calc(100% - 50px);\n flex-grow: 1;\n max-height: 150px;\n overflow: auto;\n background: #fff;\n border-radius: 0;\n color: #000;\n font-weight: 400;\n line-height: 20px;\n position: relative;\n text-align: left;\n .editor-input {\n padding: 10px 12px;\n caret-color: #444;\n font-size: 15px;\n outline: 0;\n position: relative;\n resize: none;\n tab-size: 1;\n p{\n margin: 0;\n }\n }\n }\n .send.btn.btn-outline-secondary {\n border: 0 !important;\n }\n }\n .editor-placeholder {\n color: #999;\n display: inline-block;\n font-size: 15px;\n left: 10px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: 10px;\n user-select: none;\n }\n"],["\n &.chat-input-container {\n background-color: #fff;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 4px;\n justify-content: flex-end;\n width: 100%;\n .editor-container {\n min-width: calc(100% - 50px);\n flex-grow: 1;\n max-height: 150px;\n overflow: auto;\n background: #fff;\n border-radius: 0;\n color: #000;\n font-weight: 400;\n line-height: 20px;\n position: relative;\n text-align: left;\n .editor-input {\n padding: 10px 12px;\n caret-color: #444;\n font-size: 15px;\n outline: 0;\n position: relative;\n resize: none;\n tab-size: 1;\n p{\n margin: 0;\n }\n }\n }\n .send.btn.btn-outline-secondary {\n border: 0 !important;\n }\n }\n .editor-placeholder {\n color: #999;\n display: inline-block;\n font-size: 15px;\n left: 10px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: 10px;\n user-select: none;\n }\n"])));function PEt(){return x.default.createElement("div",{className:"editor-placeholder ms-25"},"Nhập bình luận...")}var TEt,HEt,LEt=function(t){var n,r,o,a=t.data,i=t.type,l=t.setType,s=t.t,c=t.checkInitComment,u=t.getCommentPagingApi,d=t.addCommentApi,h=t.getProcessApi,p=t.uploadFileApi,f=t.CDN_URL_VIEW,m="comment"===i,v=function(){l("")},g=e.useState({}),b=g[0],y=g[1],w=e.useState([]),E=w[0],k=w[1],S=e.useState(null),C=S[0],M=S[1],_=e.useState(0),N=_[0],A=_[1],O=e.useState(!1),I=O[0],D=O[1],P=function(){D(!I)},T=e.useRef(null),H=e.useRef(null),L=e.useState(!1),z=L[0],R=L[1];e.useEffect((function(){m&&(h?h({ticketId:null==a?void 0:a.id,status:0}).unwrap().then((function(e){y(e?e[0]:{})})).catch((function(){return knt(s("getDataError"))})):knt(s("getProcessApi không hợp lệ!")))}),[m]),e.useEffect((function(){m?c&&(u?u({Keyword:"",Filter:"ticketId==".concat(a.id,";and"),Order:"",PageNumber:1,PageSize:200}).unwrap().then((function(e){k(e.items)})).catch((function(){return knt(s("getDataError"))})):knt(s("getCommentPagingApi không hợp lệ!"))):(k([]),M(null))}),[c,m]);var B,$,Z,V,j=e.useCallback((function(e){T&&T.current&&T.current.clientHeight>50?R(!0):R(!1),e.read((function(){}))}),[]),W=function(e,t){if(e.trim().length||(null==t?void 0:t.trim().length)){var n={parentId:(null==C?void 0:C.id)||void 0,comment:e.trim(),files:t,sortOrder:E.length+1,ticketId:a.id};d?d(n).unwrap().then((function(e){e.isValid?M(null):knt(s("SendFail"))})).catch((function(){return knt(s("SendFail"))})):knt(s("addCommentApi không hợp lệ!"))}};return x.default.createElement(Fxt,{initialConfig:($=["@"],Z=[Ubt],V=[],{namespace:"chatEditor",theme:Uxt,onError:function(e){throw e},editorState:Gxt("",$,V),nodes:w0e(w0e(w0e([],Z,!0),[Lbt],!0),[hbt],!1)})},x.default.createElement(yEt,{open:m,toggleSidebar:v,width:800},x.default.createElement(Znt,{typeModal:"View_Process",handleModal:v,title:s("ProcessingInformation")}),x.default.createElement("div",{className:"sidebar"},x.default.createElement("div",{className:"sidebar-content sidebar-content-right h-100"},x.default.createElement(IEt,{className:"d-flex flex-column align-items-center",style:{backgroundColor:"#fff"}},x.default.createElement("div",{className:"d-flex flex-column w-100"},x.default.createElement(r2e,{tabs:!0,fill:!0,style:{borderBottom:"1px solid #e0e0e0",justifyContent:"start"}},x.default.createElement(l2e,{style:{flex:"none"},active:0===N,onClick:function(){return A(0)}},x.default.createElement(v2e,{style:{paddingLeft:"1.5rem",paddingRight:"1.5rem"}},x.default.createElement("span",{className:w1e("",{active:0===N})},"".concat(s("Comment")," ").concat((null==b?void 0:b.numberOfComments)>0?"(".concat(null==b?void 0:b.numberOfComments,")"):"")))),x.default.createElement(l2e,{style:{flex:"none"},active:1===N,onClick:function(){return A(1)}},x.default.createElement(v2e,{style:{paddingLeft:"1.5rem",paddingRight:"1.5rem"}},x.default.createElement("span",{className:w1e("",{active:1===N})},"".concat(s("Watcher")," ").concat((null===(n=null==b?void 0:b.listWatcher)||void 0===n?void 0:n.length)>0?"(".concat(null===(r=null==b?void 0:b.listWatcher)||void 0===r?void 0:r.length,")"):""))))))),x.default.createElement(i3e,{style:{height:"95%"},activeTab:N},x.default.createElement(u3e,{tabId:0,className:"h-100"},x.default.createElement("div",{className:"chat-app-window",style:{display:"flex",flexDirection:"column",height:"calc(100% - 70px)"}},x.default.createElement("div",{style:{position:"relative",flex:1}},x.default.createElement(Q3e,{style:{height:"calc(100% - 10px)"}},x.default.createElement("div",{style:{padding:10}},null==E?void 0:E.map((function(e){return x.default.createElement(Lxt,{t:s,commentData:e,setReplyComment:M,handlePreviewImage:P,CDN_URL_VIEW:f})}))))),x.default.createElement("div",{className:"chat-app-form chat-toolbar",ref:H},x.default.createElement(X5e,{className:"attachment-icon mb-0",for:"attach-doc",title:s("FileAttached")},x.default.createElement("div",{className:"chat-btn me-75"},x.default.createElement(Hnt,{className:"cursor-pointer text-secondary",fontSize:18})),x.default.createElement("input",{type:"file",accept:"image/*",id:"attach-doc",hidden:!0,onChange:function(e){return function(e){if(e.target.files&&e.target.files[0]){for(var t=[],n=0;n<e.target.files.length;n++)t.push(e.target.files[n]);var r=new FormData;Array.from(t).map((function(e){r.append("files",e,e.name)})),p?p(r).unwrap().then((function(e){W("",JSON.stringify(null==e?void 0:e.infoFiles))})).catch((function(){return knt(s("SendFail"))})):knt(s("uploadFileApi không hợp lệ!"))}}(e)},multiple:!0})),x.default.createElement(X5e,{className:"attachment-icon mb-0",for:"attach-file",title:s("FileAttached")},x.default.createElement("div",{className:"chat-btn me-75"},x.default.createElement(znt,{className:"cursor-pointer text-secondary",fontSize:18})),x.default.createElement("input",{type:"file",id:"attach-file",hidden:!0,onChange:function(e){return function(e){if(e.target.files&&e.target.files[0]){for(var t=[],n=0;n<e.target.files.length;n++)t.push(e.target.files[n]);var r=new FormData;Array.from(t).map((function(e){r.append("files",e,e.name)})),p?p(r).unwrap().then((function(e){W("",JSON.stringify(null==e?void 0:e.infoFiles))})).catch((function(){return knt(s("SendFail"))})):knt(s("uploadFileApi không hợp lệ!"))}}(e)},multiple:!0}))),x.default.createElement("div",{className:"",style:{borderTop:"1px solid #c4c4c4"}},x.default.createElement("div",{className:w1e("chat-app-reply",{show:!!C})},x.default.createElement("div",{className:"reply-container"},x.default.createElement("div",{className:"reply-quote"}),x.default.createElement("div",{className:"flex flex-column d-inline-flex"},x.default.createElement("div",{className:"reply-content d-flex align-items-center"},x.default.createElement("div",null,x.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},x.default.createElement("path",{fill:"currentColor",d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})),"Trả lời ",x.default.createElement("strong",null,null==C?void 0:C.createdByName))),x.default.createElement("div",null,(null==(B=C)?void 0:B.files)&&(null==B?void 0:B.files.length)>0?"[Đính kèm]":null==B?void 0:B.comment," ")),x.default.createElement($nt,{className:"reply-clear-btn",fontSize:20,color:"#fff",onClick:function(){M(null)}}))),x.default.createElement(DEt,{className:"chat-input-container"},x.default.createElement("div",{ref:T,className:"editor-container",style:{minWidth:z?"100%":"calc(100% - 50px)"}},x.default.createElement(sxt,{contentEditable:x.default.createElement(Sxt,{className:"editor-input"}),placeholder:x.default.createElement(PEt,null),ErrorBoundary:gxt}),x.default.createElement(cEt,null),x.default.createElement(Ybt,null),x.default.createElement(Jbt,null),x.default.createElement(nyt,null),x.default.createElement(jbt,{items:[],targetContainer:H}),x.default.createElement(Wbt,{onEnter:function(e){W(e)},onKeyDown:function(e){e.shiftKey&&e.code}}),x.default.createElement(lyt,{onChange:j})),x.default.createElement(Bbt,{onClick:function(e){W(e)}},x.default.createElement(Bnt,{fontSize:18,color:"#006edc",className:""})))))),x.default.createElement(u3e,{tabId:1,className:"h-100"},x.default.createElement("div",{className:"chat-app-window",style:{display:"flex",flexDirection:"column",height:"calc(100% - 70px)"}},x.default.createElement("div",{style:{position:"relative",flex:1}},x.default.createElement(Q3e,{style:{height:"calc(100% - 10px)"}},null===(o=null==b?void 0:b.listWatcher)||void 0===o?void 0:o.map((function(e,t){return x.default.createElement("div",{key:t,style:{display:"flex",alignItems:"center",padding:"0.6rem 0.8rem",borderBottom:"1px solid #ddd"}},x.default.createElement("div",{style:{display:"flex",alignItems:"center",width:"100%"}},x.default.createElement("div",{style:{marginRight:"0.5rem",flexShrink:0}},x.default.createElement("img",{src:(null==e?void 0:e.photo)&&""!==(null==e?void 0:e.photo)?(null==e?void 0:e.photo.startsWith("http"))?null==e?void 0:e.photo:"".concat(f,"/").concat(null==e?void 0:e.photo):OEt,width:40,height:40,alt:"".concat(null==e?void 0:e.fullName,"'s avatar"),style:{borderRadius:"50%",objectFit:"cover",marginRight:"10px"}})),x.default.createElement("div",{style:{flexGrow:1}},x.default.createElement("p",{style:{fontSize:"13px",fontWeight:"bold",margin:0}},null==e?void 0:e.fullName))))}))))))))),x.default.createElement(AEt,{openModal:I,handleModal:P,CDN_URL_VIEW:f,images:(null==E?void 0:E.flatMap((function(e){return e.files?e.files.map((function(t){return v0e(v0e({},t),{createdDate:e.createdDate,createdByName:e.createdByName})})).filter((function(e){return[".png",".jpg",".jpeg",".gif",".bmp",".webp"].includes(e.type)})):[]})))||[]})))},zEt=function(t){var n=t.t,r=t.nodes,o=t.connectors,a=t.handleContextMenuClick,i=t.contextMenuItems,l=void 0===i?[]:i,s=t.contextMenuOpen,c=t.setSelectedNode,u={lineColor:"#e0e0e0",lineIntervals:[1,9,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75,.25,9.75]},d=e.useRef(null);function h(){var e=document.getElementById("palette-space");e&&window.matchMedia("(max-width:550px)").matches&&(e.classList.contains("sb-mobile-palette-open")?e.classList.remove("sb-mobile-palette-open"):e.classList.add("sb-mobile-palette-open"))}return e.useEffect((function(){!function(){var e;!function(){if(window.matchMedia("(max-width:550px)").matches){var e=document.getElementById("palette-icon");e&&e.addEventListener("click",h,!1)}}(),null===(e=d.current)||void 0===e||e.fitToPage()}()}),[]),x.default.createElement("div",{className:"control-pane diagram-scroll"},x.default.createElement("style",null,"\n \n .diagram-scroll .db-text-input {\n width: calc(100% - 15px);\n padding: 2px 2px 0px 0px;\n }\n \n .diagram-scroll .row{\n margin-right:-15px;\n margin-left:-15px;\n }"),x.default.createElement("div",{className:"control-section"},x.default.createElement("div",{style:{width:"100%"}},x.default.createElement("div",{id:"diagram-space",className:"sb-mobile-diagram",style:{width:"100%",float:"left"}},x.default.createElement(b.DiagramComponent,{id:"diagram",ref:d,width:"100%",height:"860px",tool:b.DiagramTools.ZoomPan,snapSettings:{horizontalGridlines:u,verticalGridlines:u},disabled:!0,scrollSettings:{scrollLimit:"Infinity",canAutoScroll:!0,autoScrollBorder:{left:30,right:30,top:30,bottom:30},scrollableArea:new b.Rect(0,0,1500,1500)},nodes:r,connectors:o,scrollChange:function(e){var t,n;if("Start"!==e.panState){var r=document.getElementById("btnZoomIncrement");r&&(r.content="".concat(Math.round(100*(null!==(n=null===(t=d.current)||void 0===t?void 0:t.scrollSettings.currentZoom)&&void 0!==n?n:1))," %"))}},selectionChange:function(e){var t,n;if("Changed"===e.state){var r=null===(t=d.current)||void 0===t?void 0:t.selectedItems.nodes;r&&1===(r=r.concat((null===(n=d.current)||void 0===n?void 0:n.selectedItems).connectors)).length&&c(r[0])}},contextMenuSettings:{show:!0,items:null==l?void 0:l.map((function(e){return v0e(v0e({},e),{text:n(e.text)})})),showCustomMenuOnly:!0},contextMenuOpen:s,contextMenuClick:function(e){if(d.current){var t=d.current.selectedItems.nodes[0];a&&a(v0e(v0e({},e),{node:t}))}}},x.default.createElement(b.Inject,{services:[b.ConnectorEditing,b.DiagramContextMenu,b.PrintAndExport,b.UndoRedo]}))))))},REt=function(t){var n=t.data,r=t.type,o=t.setType,a=t.t,i=t.checkInitProcess,l=t.getProcessApi,s="diagram"===r,c=function(){o("")},u=e.useState([]),d=u[0],h=u[1],p=e.useState([]),f=p[0],m=p[1];return e.useEffect((function(){i&&s&&(l?l({ticketId:n.id}).unwrap().then((function(e){var t;m([]),h([]);var n=e.find((function(e){return 0===e.sortOrder})),r=JSON.parse(n.logWorkflow),o=JSON.parse((null==r?void 0:r.WorkflowDefinition)||"{}"),a=JSON.parse((null==r?void 0:r.WorkflowState)||"[]"),i=JSON.parse((null==r?void 0:r.WorkflowTransition)||"[]"),l=JSON.parse((null==o?void 0:o.Diagram)||null);if(null!==l){var s=e.filter((function(e){return 1===e.status})).sort((function(e,t){return t.sortOrder-e.sortOrder}))[0],c=i.find((function(e){return e.Id===(null==s?void 0:s.workflowTransitionId)})),u=function(e,t,n){var r=new Set,o=[],a=[],i=function(e){if(r.add(e),o.push(e),e===t)return!0;for(var l=n.filter((function(t){return t.WorkflowStateId===e})),s=0,c=l;s<c.length;s++){var u=c[s];if(!r.has(u.WorkflowToStateId)){if(a.push(u.Id),i(u.WorkflowToStateId))return!0;a.pop()}}return o.pop(),!1};return i(e),{nodes:o,connectors:a}}((null===(t=a.find((function(e){return"Start"===e.Code})))||void 0===t?void 0:t.Id)||"",(null==c?void 0:c.WorkflowStateId)||"",i),d=w0e(w0e([],u.nodes,!0),[(null==c?void 0:c.WorkflowToStateId)||""],!1),p=w0e(w0e([],u.connectors,!0),[(null==c?void 0:c.Id)||""],!1);a.forEach((function(e){var t,n=l.nodes.find((function(t){return t.id===e.Id}));if(n){var r=d.includes(e.Id),o=v0e(v0e({},n),{style:r?{strokeColor:"#28a745",fill:"#28a745"}:void 0,data:e,annotations:[{content:null!==(t=e.Name)&&void 0!==t?t:"",style:{color:r?"#fff":void 0}}]});h((function(e){return w0e(w0e([],e,!0),[o],!1)}))}var a=i.filter((function(t){return t.WorkflowStateId===e.Id}));a.length>0&&a.forEach((function(t){var n,r=l.connectors.find((function(e){return e.id===t.Id}));if(r){var o=p.includes(t.Id),a=v0e(v0e({},r),{style:o?{strokeColor:"#28a745",fill:"#28a745"}:void 0,targetDecorator:o?{style:{strokeColor:"#28a745",fill:"#28a745"}}:void 0,data:t,annotations:[]});"Decision"===e.Description&&"Handle"!==e.Code&&(a.annotations=[{content:null!==(n=t.Name)&&void 0!==n?n:"",style:{color:o?"#28a745":void 0,fill:"white"}}]),m((function(e){return w0e(w0e([],e,!0),[a],!1)}))}}))}))}})).catch((function(){return knt(a("getDataError"))})):knt(a("getProcessApi không hợp lệ!")))}),[s]),x.default.createElement(h5e,{isOpen:s,backdrop:"static",keyboard:!1,toggle:c,className:"modal-dialog-centered modal-fullscreen",contentClassName:"p-0"},x.default.createElement(Znt,{typeModal:"View",handleModal:c,title:a("Workflow")}),x.default.createElement(zEt,{t:a,nodes:d,connectors:f}))},BEt=function(e){var t=e.data,n=e.listData,r=e.type,o=e.setType,a=e.t,i=e.checkInitProcess,l=e.getProcessApi,s=e.approveProcessApi,c=e.approveMultiProcessApi,u=e.checkInitComment,d=e.getCommentPagingApi,h=e.addCommentApi,p=e.deleteCommentApi,f=e.pagingEmployeeApi,m=e.pagingUserApi,v=e.uploadFileApi,g=e.CDN_URL_VIEW,b=e.token,y=e.saveUrl,w=e.approverId,E=e.approverName,k=e.onApproveCompleted;if(!r)return null;var S={approve:Gnt,multiApprove:Gnt,comment:LEt,diagram:REt}[r];return x.default.createElement(S,{data:t,listData:n,type:r,setType:o,t:a,checkInitProcess:i,getProcessApi:l,approveProcessApi:s,approveMultiProcessApi:c,checkInitComment:u,getCommentPagingApi:d,addCommentApi:h,deleteCommentApi:p,pagingEmployeeApi:f,pagingUserApi:m,uploadFileApi:v,CDN_URL_VIEW:g,token:b,saveUrl:y,approverId:w,approverName:E,onApproveCompleted:k})},$Et=function(t){var n,r,o,a,i,l,s,c,u=t.toolbarTemplate,d=t.paramToolbar,h=t.currentPageDefault,p=t.queryOrderDefault,f=t.rowsPerPageDefault,m=t.queryKeyDataView,v=t.isSelectMulti,g=t.canContextMenuItems,b=t.handleContextMenuClick,y=t.rowSelected,w=t.dataSourceFilter,E=t.listContextHide,k=t.querySelectDefault,S=t.t,C=t.contextMenuOpen,M=t.stateId,_=t.viewIdTable,N=t.height,A=t.maxHeight,O=t.hasIndex,I=t.dataSelected,D=t.showColumnChoose,P=t.typeCheckbox,T=t.format,H=t.rowSelection,L=t.dataSource,z=t.columns,Z=t.totalCount,V=t.breakText,j=t.handleDoubleContextMenuClick,W=t.allowResizing,F=t.summary,q=t.hasWorkflow,Y=t.apiWorkflow,U=t.rowClassName,K=t.showToolbar,G=t.allowPaging,X=t.checkInit,J=t.checkInit1,te=t.checkInit2,oe=localStorage.getItem("grid".concat(M)),ae=oe?JSON.parse(oe):null,ie=null==ae?void 0:ae.searchSettings.key,le=null==ae?void 0:ae.filterSettings.columns.map((function(e){return{key:e.fieldOriginal,keyCode:e.fieldOriginal,value:e.value,ope:ge[e.operator],predicate:be[e.predicate]}})),se=localStorage.getItem("sub"),ce=window.localStorage.getItem("i18nextLng"),ue=ce||"vi",de=require("@public/assets/data/locales/".concat(ue,".json")),he=e.useState(""),pe=he[0],fe=he[1],me=e.useState({}),ve=me[0],ye=me[1],we=e.useState(!1),xe=we[0],Ee=we[1],ke=e.useState({Data:[],Total:0}),Se=ke[0],Ce=ke[1],Me=e.useState(null!=h?h:1),_e=Me[0],Ne=Me[1],Ae=e.useState(null!=f?f:100),Oe=Ae[0],Ie=Ae[1],De=e.useState(null!=ie?ie:""),Pe=De[0],Te=De[1],He=e.useState(null!=p?p:[]),Le=He[0],ze=He[1],Re=e.useState(null!=le?le:[]),Be=Re[0],$e=Re[1],Ze=e.useState([]),Ve=Ze[0],je=Ze[1],We=Array.isArray(I)?I:[I],Fe={ascend:"asc",descend:"desc",asc:"asc",desc:"desc"},qe=function(t,n){var r=e.useState(t),o=r[0],a=r[1];return e.useEffect((function(){var e=setTimeout((function(){a(t)}),n);return function(){clearTimeout(e)}}),[t,n]),o}(Pe,500),Ye=function(){return R(void 0,void 0,void 0,(function(){var e,t,n,r,o,a,i,l,s,c,u,h;return B(this,(function(p){switch(p.label){case 0:return M&&Q(L)?(Ee(!0),e=$([],null!=k?k:[],!0),null==d||d.map((function(t){var n,r;("daterange"===t.type||"listDate"===t.type)&&(null===(n=t.data)||void 0===n?void 0:n.length)>0?(e.unshift({key:t.keyCode,value:ee(t.data[0],">="),ope:">=",predicate:";"}),e.unshift({key:t.keyCode,value:ee(t.data[1],"<="),ope:"<=",predicate:";"})):"select"===t.type&&t.isMulti&&(null===(r=t.data)||void 0===r?void 0:r.length)>0?t.data.forEach((function(n){e.unshift({key:t.keyCode,value:n,ope:"==",predicate:";"})})):"select"!==t.type||t.isMulti||Q(t.data)||e.unshift({key:t.keyCode,value:t.data,ope:"==",predicate:";"})})),t=$($([],Be,!0),e,!0).filter((function(e){return!Q(e.value)&&""!==e.value})).map((function(e){return{keyCode:e.key,value:e.value,ope:e.ope,predicate:e.predicate}})),n=null==Le?void 0:Le.map((function(e){return"".concat(e.field,",").concat(Fe[e.order])})).join(";"),[4,_be({ParaJson:JSON.stringify({Filter:JSON.stringify(t),Order:n,PageNumber:_e,PageSize:Oe,Keyword:Pe,ViewId:_,StateId:M})})]):[3,2];case 1:r=p.sent(),o=JSON.parse(null!==(s=null===(l=null==r?void 0:r[0])||void 0===l?void 0:l.dataJson)&&void 0!==s?s:"[]"),a=JSON.parse(null!==(u=null===(c=null==r?void 0:r[0])||void 0===c?void 0:c.workflow)&&void 0!==u?u:"[]"),i={Data:null===(h=JSON.parse(o[0].Data))||void 0===h?void 0:h.map((function(e,t){var n,r,o,i=null==a?void 0:a[e.id];return e.currentProcessCode=null==i?void 0:i.WorkflowStateCode,e.currentProcess=null!==(n=null==i?void 0:i.ProcessStatus)&&void 0!==n?n:S("Unknown"),e.approverId=null==i?void 0:i.ApproverId,e.approver=null==i?void 0:i.ApproverName,e.deadlineStatus=null==i?void 0:i.DeadlineStatus,e.timeLeft=null==i?void 0:i.TimeLeft,e.durationUnit=null==i?void 0:i.DurationUnit,e.hasPermissionApprove=null!==(o=null===(r=null==i?void 0:i.ApproverId)||void 0===r?void 0:r.includes(null!=se?se:""))&&void 0!==o&&o,e.numberOfComments=null==i?void 0:i.NumberOfComments,e.STT=t+1,e})),Total:o[0].Total},setTimeout((function(){Ee(!1),Ce(i)}),150),p.label=2;case 2:return[2]}}))}))};e.useEffect((function(){clearTimeout(c),c=setTimeout((function(){(!Q(X)&&(re(X)&&0===X||ne(X)&&X)||Q(X))&&Ye()}),200)}),$($([qe,_e,Be,Le,Oe,_,M],null!=m?m:[],!0),[X],!1)),e.useEffect((function(){!Q(J)&&(re(J)&&0===J||ne(J)&&J)&&(clearTimeout(c),c=setTimeout((function(){Ye()}),200))}),[J]),e.useEffect((function(){!Q(te)&&(re(te)&&0===te||ne(te)&&te)&&(clearTimeout(c),c=setTimeout((function(){Ye()}),200))}),[te]),e.useEffect((function(){if(_&&Q(z)){R(void 0,void 0,void 0,(function(){var e,t;return B(this,(function(n){switch(n.label){case 0:return[4,Mbe({ParaJson:JSON.stringify({ViewId:_})})];case 1:return e=n.sent(),t=io(e,S,{hasIndex:null==O||O,breakText:V,hasWorkflow:q}),je(t),[2]}}))}))}}),[_]);var Ue=function(e){var t,n=null===(t=e.rowInfo)||void 0===t?void 0:t.rowData;n&&(ye(n),"VIEW_COMMENT"===e.item.id?fe("comment"):"VIEW_PROCESS"===e.item.id?fe("diagram"):"APPROVE_PROCESS"===e.item.id?fe("approve"):"RESET_PROCESS"===e.item.id&&(null==Y?void 0:Y.checkInitProcess)&&function(e,t,n,r,o){var a=hbe(bnt);a.fire({title:e("Confirm"),text:e("ConfirmResetWorkflow"),allowOutsideClick:!1,showCancelButton:!0,confirmButtonText:e("Confirm"),cancelButtonText:e("Cancel"),customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ms-1"},buttonsStyling:!1}).then((function(i){if(i.value){var l={ticketId:n.id,ticketInfo:JSON.stringify(qnt(n)),organizationId:n.organizationId,workflowDefinitionCode:r,isResetProcess:!0,createdBy:null==n?void 0:n.createdBy,createdByName:(null==n?void 0:n.createdByName)||(null==n?void 0:n.createdName)};t(l).unwrap().then((function(t){t.isValid?(o&&o(t),Ent(e("ResetSuccessful"))):knt(e("ResetFail"))})).catch((function(){knt(e("ResetFail"))}))}else i.dismiss,a.DismissReason.cancel}))}(S,null==Y?void 0:Y.initProcessApi,n,M))};return x.default.createElement("div",{className:"App"},x.default.createElement("div",{style:{padding:"0rem"}},x.default.createElement(mbe,{sortMultiple:!0,loading:xe,lang:ue,locale:null===(n=null==de?void 0:de.gridTable)||void 0===n?void 0:n.table,rowKey:"id",showToolbar:K,columns:null!==(r=null!=z?z:Ve)&&void 0!==r?r:[],dataSource:null!==(o=null!=L?L:null==Se?void 0:Se.Data)&&void 0!==o?o:[],height:N,pagination:!1!==G&&{total:null!==(a=null!=Z?Z:null==Se?void 0:Se.Total)&&void 0!==a?a:0,pageSize:Oe,pageSizeOptions:[20,50,100,1e3,1e4],onChange:function(e,t){Ne(e),Ie(t)},locale:null===(i=null==de?void 0:de.gridTable)||void 0===i?void 0:i.pager,showTotal:function(e,t){var n,r,o;return"".concat(t[0],"-").concat(t[1]," / ").concat(e," ").concat(S?S(null!==(o=null===(r=null===(n=null==de?void 0:de.gridTable)||void 0===n?void 0:n.pager)||void 0===r?void 0:r.items)&&void 0!==o?o:"items"):"items")}},scroll:{y:null!=A?A:N},toolbarItems:$([{template:x.default.createElement(wbe,{callback:function(e){Te(null!=e?e:"")},width:250,placeholder:S("Search"),isChangeValueOnEnter:!0}),position:"left"}],null!=u?u:[],!0),recordDoubleClick:function(e){j&&j(e)},format:null!=T?T:{thousandSeparator:",",decimalSeparator:".",decimalScale:2},allowResizing:null==W||W,summary:F,rowClassName:U,showColumnChoose:null==D||D,contextMenuItems:g,contextMenuClick:function(e){b&&(b(e),Ue(e))},contextMenuOpen:C,contextMenuHidden:null!==(l=null==E?void 0:E.list)&&void 0!==l?l:[],rowSelected:y,onFilter:function(e){var t,n=null!==(t=null==e?void 0:e.map((function(e){return(null!=z?z:Ve).some((function(t){return t.field===e.field&&("date"===t.type||"datetime"===t.type)}))&&(e.value=ee(e.value,ge[e.operator])),{key:e.field,keyCode:e.field,value:e.value,ope:ge[e.operator],predicate:be[e.predicate]}})))&&void 0!==t?t:[];$e(n)},onSorter:function(e){Array.isArray(e)?ze(e):Q(null==e?void 0:e.field)?ze([]):ze([e])},selectionSettings:{type:v?"multiple":"single",mode:null!=P?P:void 0,columnWidth:50,hideSelectAll:!1,defaultSelectedRowKeys:null!==(s=null==We?void 0:We.map((function(e){var t;return null!==(t=null==e?void 0:e.rowId)&&void 0!==t?t:null==e?void 0:e.id})))&&void 0!==s?s:[]},editAble:!1,rowSelection:H,t:S,dataSourceFilter:w,onFilterClick:function(e,t){var n=[{value:"equal",label:S("Equal"),key:"=="},{value:"greaterthan",label:S("Greater than"),key:">"},{value:"greaterthanorequal",label:S("Greater Than Or Equal"),key:">="},{value:"lessthan",label:S("Less Than"),key:"<"},{value:"lessthanorequal",label:S("Less Than Or Equal"),key:"<="},{value:"notequal",label:S("Not Equal"),key:"!="}];"building"===e.key&&t(e.key,n)}})),q&&x.default.createElement(BEt,{type:pe,setType:fe,data:ve,listData:[],t:S,checkInitProcess:null==Y?void 0:Y.checkInitProcess,getProcessApi:null==Y?void 0:Y.getProcessApi,approveProcessApi:null==Y?void 0:Y.approveProcessApi,approveMultiProcessApi:null==Y?void 0:Y.approveMultiProcessApi,checkInitComment:null==Y?void 0:Y.checkInitComment,getCommentPagingApi:null==Y?void 0:Y.getCommentPagingApi,addCommentApi:null==Y?void 0:Y.addCommentApi,deleteCommentApi:null==Y?void 0:Y.deleteCommentApi,pagingUserApi:null==Y?void 0:Y.getUserCorePagingApi,uploadFileApi:null==Y?void 0:Y.uploadFileApi,CDN_URL_VIEW:Sbe||"",token:Cbe()||"",saveUrl:"".concat(xbe,"/api/file/upload")}))};function ZEt({children:e,style:t,className:n,role:r,title:o}){return x.default.createElement("div",{role:r,title:o,className:n,style:t},e)}function VEt(e,t){return`${e}__${t}`}function jEt(e,t){return`${e}--${t}`}const WEt="react-split",FEt=jEt(WEt,"dragging"),qEt=jEt(WEt,"vertical"),YEt=jEt(WEt,"horizontal"),UEt=jEt(WEt,"disabled"),KEt=VEt(WEt,"pane"),GEt=VEt(WEt,"sash"),XEt=jEt(GEt,"vertical"),QEt=jEt(GEt,"horizontal"),JEt=jEt(GEt,"disabled");function ekt(...e){const t=[];for(const n of e){if(!n)continue;const e=typeof n;if("string"!==e&&"number"!==e){if("object"===e){if(n.toString!==Object.prototype.toString){t.push(n.toString());continue}for(const e in n)Object.hasOwnProperty.call(n,e)&&n[e]&&t.push(e)}}else t.push(`${n}`)}return t.join(" ")}function tkt(e,t,n=1/0){return void 0===e?n:"number"==typeof e?e:e.endsWith("%")?t*(+e.replace("%","")/100):e.endsWith("px")?+e.replace("px",""):n}var nkt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function rkt(t){var{className:n,render:r,onDragStart:o,onDragging:a,onDragEnd:i}=t,l=nkt(t,["className","render","onDragStart","onDragging","onDragEnd"]);const s=e.useRef(null),[c,u]=e.useState(!1),[d,h]=e.useState(!1),p=function(e){a(e)},f=function(e){h(!1),i(e),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",f)};return x.default.createElement("div",Object.assign({role:"Resizer",className:ekt(GEt,n),onMouseEnter:()=>{s.current=setTimeout((()=>{u(!0)}),150)},onMouseLeave:()=>{s.current&&(u(!1),clearTimeout(s.current))},onMouseDown:e=>{h(!0),o(e),window.addEventListener("mousemove",p),window.addEventListener("mouseup",f)}},l),r(d||c))}var okt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function akt(e){var{className:t,children:n,active:r,type:o}=e,a=okt(e,["className","children","active","type"]);return x.default.createElement("div",Object.assign({className:ekt("split-sash-content",r&&"split-sash-content-active",o&&`split-sash-content-${o}`,t)},a),n)}var ikt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const lkt=t=>{var n,{children:r,sizes:o,allowResize:a=!0,split:i="vertical",className:l,sashRender:s=(e,t)=>x.default.createElement(akt,{active:t,type:"vscode"}),resizerSize:c=4,performanceMode:u=!1,onChange:d=()=>null,onDragStart:h=()=>null,onDragEnd:p=()=>null}=t,f=ikt(t,["children","sizes","allowResize","split","className","sashRender","resizerSize","performanceMode","onChange","onDragStart","onDragEnd"]);const m=e.useRef({x:0,y:0}),v=e.useRef(null),g=e.useRef({sizes:[],sashPosSizes:[]}),[b,y]=e.useState({}),[w,E]=e.useState(!1);e.useEffect((()=>{const e=new ResizeObserver((()=>{var e,t;y(null!==(t=null===(e=null==v?void 0:v.current)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==t?t:{})}));return e.observe(v.current),()=>{e.disconnect()}}),[]);const{sizeName:k,splitPos:S,splitAxis:C}=e.useMemo((()=>({sizeName:"vertical"===i?"width":"height",splitPos:"vertical"===i?"left":"top",splitAxis:"vertical"===i?"x":"y"})),[i]),M=null!==(n=b[k])&&void 0!==n?n:0,_=e.useMemo((()=>r.map((e=>{const t=[0,1/0];if(e.type===ZEt){const{minSize:n,maxSize:r}=e.props;t[0]=tkt(n,M,0),t[1]=tkt(r,M)}return t}))),[r,M]),N=e.useMemo((function(){let e=0,t=0;const n=r.map(((n,r)=>{const a=tkt(o[r],M);return a===1/0?e++:t+=a,a}));if(t>M||!e&&t<M){const e=(t-M)/t;return n.map((t=>t===1/0?0:t-t*e))}if(e>0){const r=(M-t)/e;return n.map((e=>e===1/0?r:e))}return n}),[...o,r.length,M]),A=e.useMemo((()=>N.reduce(((e,t)=>[...e,e[e.length-1]+t]),[0])),[...N]),O=e.useCallback((function(e){var t,n;null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.classList)||void 0===n||n.add(UEt),m.current={x:e.pageX,y:e.pageY},g.current={sizes:N,sashPosSizes:A},E(!0),h(e)}),[h,N,A]),I=e.useCallback((function(e){var t,n;null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.classList)||void 0===n||n.remove(UEt),m.current={x:e.pageX,y:e.pageY},g.current={sizes:N,sashPosSizes:A},E(!1),p(e)}),[p,N,A]),D=e.useCallback((function(e,t){let n={x:e.pageX,y:e.pageY}[C]-m.current[C];const r=-Math.min(N[t]-_[t][0],_[t+1][1]-N[t+1]),o=Math.min(N[t+1]-_[t+1][0],_[t][1]-N[t]);n<r&&(n=r),n>o&&(n=o);const a=[...N];a[t]+=n,a[t+1]-=n,d(a)}),[_,d]),P=!(u&&w),T=P?N:g.current.sizes,H=P?A:g.current.sashPosSizes;return x.default.createElement("div",Object.assign({className:ekt(WEt,"vertical"===i&&qEt,"horizontal"===i&&YEt,w&&FEt,l),ref:v},f),r.map(((e,t)=>{const n=e.type===ZEt,r=n?e.props:{};return x.default.createElement(ZEt,{key:t,className:ekt(KEt,r.className),style:Object.assign(Object.assign({},r.style),{[k]:T[t],[S]:H[t]})},n?r.children:e)})),A.slice(1,-1).map(((e,t)=>x.default.createElement(rkt,{key:t,className:ekt(!a&&JEt,"vertical"===i?XEt:QEt),style:{[k]:c,[S]:e-c/2},render:s.bind(null,t),onDragStart:O,onDragging:e=>D(e,t),onDragEnd:I}))))};Pa(".react-split {\n flex: 1;\n height: 100%;\n position: relative;\n width: 100%;\n}\n.react-split__pane {\n height: 100%;\n position: absolute;\n white-space: normal;\n width: 100%;\n overflow: hidden;\n}\n.react-split__sash {\n height: 100%;\n position: absolute;\n top: 0;\n transition: background-color 0.1s;\n width: 100%;\n z-index: 2;\n}\n.react-split__sash--disabled {\n pointer-events: none;\n}\n.react-split__sash--vertical {\n cursor: col-resize;\n}\n.react-split__sash--horizontal {\n cursor: row-resize;\n}\n.react-split__sash-content {\n width: 100%;\n height: 100%;\n}\n.react-split__sash-content--active {\n background-color: #175ede;\n}\n.react-split--dragging.react-split--vertical {\n cursor: col-resize;\n}\n.react-split--dragging.react-split--horizontal {\n cursor: row-resize;\n}\n\nbody.react-split--disabled {\n user-select: none;\n}\n\n.split-sash-content {\n width: 100%;\n height: 100%;\n}\n.split-sash-content.split-sash-content-vscode.split-sash-content-active {\n background-color: #175ede;\n}");var skt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ckt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},ukt="e-rtl",dkt="e-overlay",hkt="e-nav-arrow",pkt="e-nav-right-arrow",fkt="e-nav-left-arrow",mkt="e-scroll-nav",vkt="e-scroll-right-nav",gkt="e-scroll-left-nav",bkt="e-scroll-device",ykt="e-scroll-overlay",wkt="e-scroll-right-overlay",xkt="e-scroll-left-overlay",Ekt=function(e){function t(t,n){return e.call(this,t,n)||this}return skt(t,e),t.prototype.preRender=function(){this.browser=zKe.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=zKe.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=jUe("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(ukt)},t.prototype.render=function(){this.touchModule=new uXe(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),RKe.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(bkt),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){ZUe(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var n=this.element,r=0,o=[].slice.call(n.children);r<o.length;r++){var a=o[r];e.appendChild(a)}t.appendChild(e),n.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var t=this.element;t.style.display="",t.classList.remove("e-hscroll"),t.classList.remove(bkt);var n=QKe(".e-"+t.id+"_nav."+mkt,t),r=QKe("."+ykt,t);[].slice.call(r).forEach((function(e){UKe(e)}));for(var o=0,a=[].slice.call(this.scrollItems.children);o<a.length;o++){var i=a[o];t.appendChild(i)}this.uniqueId&&this.element.removeAttribute("id"),UKe(this.scrollEle),n.length>0&&(UKe(n[0]),ZUe(n[1])||UKe(n[1])),RKe.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},t.prototype.disable=function(e){var t=QKe(".e-scroll-nav:not(."+dkt+")",this.element);e?this.element.classList.add(dkt):this.element.classList.remove(dkt),[].slice.call(t).forEach((function(t){t.setAttribute("tabindex",e?"-1":"0")}))},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),n=this.createElement("div",{className:ykt+" "+wkt}),r="e-"+e.id.concat("_nav "+mkt+" "+vkt),o=this.createElement("div",{id:t.concat("_right"),className:r}),a=this.createElement("div",{className:pkt+" "+hkt+" e-icons"});o.appendChild(a);var i=this.createElement("div",{className:ykt+" "+xkt});this.ieCheck&&o.classList.add("e-ie-align"),e.appendChild(n),e.appendChild(o),e.insertBefore(i,e.firstChild),this.eventBinding([o])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav "+mkt+" "+vkt),r={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},o=this.createElement("div",{className:n,attrs:r});o.setAttribute("aria-disabled","false");var a=this.createElement("div",{className:pkt+" "+hkt+" e-icons"}),i="e-"+e.id.concat("_nav "+mkt+" "+gkt),l={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},s=this.createElement("div",{className:i+" "+dkt,attrs:l});s.setAttribute("aria-disabled","true");var c=this.createElement("div",{className:fkt+" "+hkt+" e-icons"});s.appendChild(c),o.appendChild(a),e.appendChild(o),e.insertBefore(s,e.firstChild),this.ieCheck&&(o.classList.add("e-ie-align"),s.classList.add("e-ie-align")),this.eventBinding([o,s])},t.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout((function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)}),100)}},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach((function(e){new uXe(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",(function(e){e.preventDefault()})),RKe.add(e,"click",t.clickEventHandler,t)}))},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,n=e.originalEvent.target;n=this.contains(n,mkt)?n.firstElementChild:n;this.timeout=window.setInterval((function(){t.eleScrolling(10,n,!0)}),50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,n){var r=this.element,o=t.classList;o.contains(mkt)&&(o=t.querySelector("."+hkt).classList),this.contains(r,ukt)&&this.browserCheck&&(e=-e),!this.contains(r,ukt)||this.browserCheck||this.ieCheck?o.contains(pkt)?this.frameScrollRequest(e,"add",n):this.frameScrollRequest(e,"",n):o.contains(fkt)?this.frameScrollRequest(e,"add",n):this.frameScrollRequest(e,"",n)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(e){var t,n=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var r=.5,o=function(){var a=Math.sin(r);a<=0?window.cancelAnimationFrame(a):("Left"===e.swipeDirection?n.scrollLeft+=t*a:"Right"===e.swipeDirection&&(n.scrollLeft-=t*a),r-=.5,window.requestAnimationFrame(o))};o()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e},t.prototype.frameScrollRequest=function(e,t,n){var r=this;if(n)this.scrollUpdating(e,t);else{this.customStep||[].slice.call(QKe("."+ykt,this.element)).forEach((function(t){e-=t.offsetWidth}));var o=function(){var n,a;r.contains(r.element,ukt)&&r.browserCheck?(n=-e,a=-10):(n=e,a=10),n<10?window.cancelAnimationFrame(a):(r.scrollUpdating(a,t),e-=a,window.requestAnimationFrame(o))};o()}},t.prototype.touchHandler=function(e){var t=this.scrollEle,n=e.distanceX;this.ieCheck&&this.contains(this.element,ukt)&&(n=-n),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+n:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-n)},t.prototype.arrowDisabling=function(e,t){if(this.isDevice){var n=(ZUe(e)?t:e).querySelector("."+hkt);ZUe(e)?nGe(n,[pkt],[fkt]):nGe(n,[fkt],[pkt])}else e&&t&&(e.classList.add(dkt),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(dkt),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0"));this.repeatScroll()},t.prototype.scrollHandler=function(e){var t=e.target,n=t.offsetWidth;this.element;var r=this.element.querySelector("."+gkt),o=this.element.querySelector("."+vkt),a=this.element.querySelector("."+xkt),i=this.element.querySelector("."+wkt),l=t.scrollLeft;if(l<=0&&(l=-l),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(a=this.element.querySelector("."+wkt),i=this.element.querySelector("."+xkt)),a.style.width=l<40?l+"px":"40px",t.scrollWidth-Math.ceil(n+l)<40?i.style.width=t.scrollWidth-Math.ceil(n+l)+"px":i.style.width="40px"),0===l)this.arrowDisabling(r,o);else if(Math.ceil(n+l+.1)>=t.scrollWidth)this.arrowDisabling(o,r);else{var s=this.element.querySelector("."+mkt+"."+dkt);s&&(s.classList.remove(dkt),s.setAttribute("aria-disabled","false"),s.setAttribute("tabindex","0"))}},t.prototype.onPropertyChanged=function(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(ukt):this.element.classList.remove(ukt)}}},ckt([vGe(null)],t.prototype,"scrollStep",void 0),t=ckt([wGe],t)}(qGe),kkt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Skt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Ckt="e-rtl",Mkt="e-overlay",_kt="e-nav-arrow",Nkt="e-nav-up-arrow",Akt="e-nav-down-arrow",Okt="e-scroll-nav",Ikt="e-scroll-up-nav",Dkt="e-scroll-down-nav",Pkt="e-scroll-device",Tkt="e-scroll-overlay",Hkt="e-scroll-up-overlay",Lkt="e-scroll-down-overlay",zkt=function(e){function t(t,n){return e.call(this,t,n)||this}return kkt(t,e),t.prototype.preRender=function(){this.browser=zKe.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=zKe.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=jUe("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(Ckt)},t.prototype.render=function(){this.touchModule=new uXe(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),RKe.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(Pkt),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),RKe.add(this.element,"wheel",this.wheelEventHandler,this)},t.prototype.setScrollState=function(){ZUe(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){var e=$Ke("div",{className:"e-vscroll-content"}),t=$Ke("div",{className:"e-vscroll-bar"});t.setAttribute("tabindex","-1");for(var n=this.element,r=0,o=[].slice.call(n.children);r<o.length;r++){var a=o[r];e.appendChild(a)}t.appendChild(e),n.appendChild(t),t.style.overflow="hidden",this.scrollEle=t,this.scrollItems=e},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"vScroll"},t.prototype.destroy=function(){var t=this.element;t.style.display="",VKe([this.element],["e-vscroll",Pkt]);var n=QKe(".e-"+t.id+"_nav."+Okt,t),r=QKe("."+Tkt,t);[].slice.call(r).forEach((function(e){UKe(e)}));for(var o=0,a=[].slice.call(this.scrollItems.children);o<a.length;o++){var i=a[o];t.appendChild(i)}this.uniqueId&&this.element.removeAttribute("id"),UKe(this.scrollEle),n.length>0&&(UKe(n[0]),ZUe(n[1])||UKe(n[1])),RKe.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},t.prototype.disable=function(e){var t=QKe(".e-scroll-nav:not(."+Mkt+")",this.element);e?this.element.classList.add(Mkt):this.element.classList.remove(Mkt),[].slice.call(t).forEach((function(t){t.setAttribute("tabindex",e?"-1":"0")}))},t.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),n=$Ke("div",{className:Tkt+" "+Lkt}),r="e-"+e.id.concat("_nav "+Okt+" "+Dkt),o=$Ke("div",{id:t.concat("down"),className:r}),a=$Ke("div",{className:Akt+" "+_kt+" e-icons"});o.appendChild(a);var i=$Ke("div",{className:Tkt+" "+Hkt});this.ieCheck&&o.classList.add("e-ie-align"),e.appendChild(n),e.appendChild(o),e.insertBefore(i,e.firstChild),this.eventBinding([o])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav "+Okt+" "+Dkt),r=$Ke("div",{id:t.concat("_down"),className:n});r.setAttribute("aria-disabled","false");var o=$Ke("div",{className:Akt+" "+_kt+" e-icons"}),a="e-"+e.id.concat("_nav "+Okt+" "+Ikt),i=$Ke("div",{id:t.concat("_up"),className:a+" "+Mkt});i.setAttribute("aria-disabled","true");var l=$Ke("div",{className:Nkt+" "+_kt+" e-icons"});i.appendChild(l),r.appendChild(o),r.setAttribute("tabindex","0"),e.appendChild(r),e.insertBefore(i,e.firstChild),this.ieCheck&&(r.classList.add("e-ie-align"),i.classList.add("e-ie-align")),this.eventBinding([r,i])},t.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout((function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)}),100)}},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach((function(e){new uXe(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",(function(e){e.preventDefault()})),RKe.add(e,"click",t.clickEventHandler,t)}))},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,n=e.originalEvent.target;n=this.contains(n,Okt)?n.firstElementChild:n;this.timeout=window.setInterval((function(){t.eleScrolling(10,n,!0)}),50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,n){var r=t.classList;r.contains(Okt)&&(r=t.querySelector("."+_kt).classList),r.contains(Akt)?this.frameScrollRequest(e,"add",n):r.contains(Nkt)&&this.frameScrollRequest(e,"",n)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},t.prototype.swipeHandler=function(e){var t,n=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var r=.5,o=function(){var a=Math.sin(r);a<=0?window.cancelAnimationFrame(a):("Up"===e.swipeDirection?n.scrollTop+=t*a:"Down"===e.swipeDirection&&(n.scrollTop-=t*a),r-=.02,window.requestAnimationFrame(o))};o()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},t.prototype.frameScrollRequest=function(e,t,n){var r=this;if(n)this.scrollUpdating(e,t);else{this.customStep||[].slice.call(QKe("."+Tkt,this.element)).forEach((function(t){e-=t.offsetHeight}));var o=function(){e<10?window.cancelAnimationFrame(10):(r.scrollUpdating(10,t),e-=10,window.requestAnimationFrame(o))};o()}},t.prototype.touchHandler=function(e){var t=this.scrollEle,n=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+n:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-n)},t.prototype.arrowDisabling=function(e,t){if(this.isDevice){var n=(ZUe(e)?t:e).querySelector("."+_kt);ZUe(e)?nGe(n,[Akt],[Nkt]):nGe(n,[Nkt],[Akt])}else e.classList.add(Mkt),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(Mkt),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0");this.repeatScroll()},t.prototype.scrollEventHandler=function(e){var t=e.target,n=t.offsetHeight,r=this.element.querySelector("."+Ikt),o=this.element.querySelector("."+Dkt),a=this.element.querySelector("."+Hkt),i=this.element.querySelector("."+Lkt),l=t.scrollTop;if(l<=0&&(l=-l),this.isDevice&&(a.style.height=l<40?l+"px":"40px",t.scrollHeight-Math.ceil(n+l)<40?i.style.height=t.scrollHeight-Math.ceil(n+l)+"px":i.style.height="40px"),0===l)this.arrowDisabling(r,o);else if(Math.ceil(n+l+.1)>=t.scrollHeight)this.arrowDisabling(o,r);else{var s=this.element.querySelector("."+Okt+"."+Mkt);s&&(s.classList.remove(Mkt),s.setAttribute("aria-disabled","false"),s.setAttribute("tabindex","0"))}},t.prototype.onPropertyChanged=function(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(Ckt):this.element.classList.remove(Ckt)}}},Skt([vGe(null)],t.prototype,"scrollStep",void 0),t=Skt([wGe],t)}(qGe),Rkt=function(){function e(e){return this.subQuery=null,this.isChild=!1,this.distincts=[],this.queries=[],this.key="",this.fKey="","string"==typeof e?this.fromTable=e:e&&e instanceof Array&&(this.lookups=e),this.expands=[],this.sortedColumns=[],this.groupedColumns=[],this.subQuery=null,this.isChild=!1,this.params=[],this.lazyLoad=[],this}return e.prototype.setKey=function(e){return this.key=e,this},e.prototype.using=function(e){return this.dataManager=e,this},e.prototype.execute=function(e,t,n,r){return(e=e||this.dataManager)?e.executeQuery(this,t,n,r):Zkt.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.executeLocal=function(e){return(e=e||this.dataManager)?e.executeLocal(this):Zkt.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.clone=function(){var t=new e;return t.queries=this.queries.slice(0),t.key=this.key,t.isChild=this.isChild,t.dataManager=this.dataManager,t.fromTable=this.fromTable,t.params=this.params.slice(0),t.expands=this.expands.slice(0),t.sortedColumns=this.sortedColumns.slice(0),t.groupedColumns=this.groupedColumns.slice(0),t.subQuerySelector=this.subQuerySelector,t.subQuery=this.subQuery,t.fKey=this.fKey,t.isCountRequired=this.isCountRequired,t.distincts=this.distincts.slice(0),t.lazyLoad=this.lazyLoad.slice(0),t},e.prototype.from=function(e){return this.fromTable=e,this},e.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},e.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.where=function(e,t,n,r,o){t=t?t.toLowerCase():null;var a=null;return"string"==typeof e?a=new Bkt(e,t,n,r,o):e instanceof Bkt&&(a=e),this.queries.push({fn:"onWhere",e:a}),this},e.prototype.search=function(e,t,n,r,o){"string"==typeof t&&(t=[t]),n&&"none"!==n||(n="contains");var a=Zkt.fnOperators[n];return this.queries.push({fn:"onSearch",e:{fieldNames:t,operator:n,searchKey:e,ignoreCase:r,ignoreAccent:o,comparer:a}}),this},e.prototype.sortBy=function(e,t,n){return this.sortByForeignKey(e,t,n)},e.prototype.sortByForeignKey=function(t,n,r,o){var a,i,l=ZUe(o)?"ascending":o;if("string"==typeof t&&Zkt.endsWith(t.toLowerCase()," desc")&&(t=t.replace(/ desc$/i,""),n="descending"),n&&"string"!=typeof n||(l=n?n.toLowerCase():"ascending",n=Zkt.fnSort(n)),r){a=e.filterQueries(this.queries,"onSortBy");for(var s=0;s<a.length;s++)if("string"==typeof(i=a[s].e.fieldName)){if(i===t)return this}else if(i instanceof Array)for(var c=0;c<i.length;c++)if(i[c]===t||t.toLowerCase()===i[c]+" desc")return this}return this.queries.push({fn:"onSortBy",e:{fieldName:t,comparer:n,direction:l}}),this},e.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},e.prototype.group=function(e,t,n){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:n||null}}),this},e.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},e.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},e.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},e.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},e.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},e.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},e.prototype.foreignKey=function(e){return this.fKey=e,this},e.prototype.requiresCount=function(){return this.isCountRequired=!0,this},e.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},e.filterQueries=function(e,t){return e.filter((function(e){return e.fn===t}))},e.filterQueryLists=function(e,t){for(var n=e.filter((function(e){return-1!==t.indexOf(e.fn)})),r={},o=0;o<n.length;o++)r[n[o].fn]||(r[n[o].fn]=n[o].e);return r},e}(),Bkt=function(){function e(t,n,r,o,a){return void 0===o&&(o=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof t?(this.field=t,this.operator=n.toLowerCase(),this.value=r,this.ignoreCase=o,this.ignoreAccent=a,this.isComplex=!1,this.comparer=Zkt.fnOperators.processOperator(this.operator)):(t instanceof e&&r instanceof e||r instanceof Array)&&(this.isComplex=!0,this.condition=n.toLowerCase(),this.predicates=[t],r instanceof Array?[].push.apply(this.predicates,r):this.predicates.push(r)),this}return e.and=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.combinePredicates([].slice.call(t,0),"and")},e.prototype.and=function(t,n,r,o,a){return e.combine(this,t,n,r,"and",o,a)},e.or=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.combinePredicates([].slice.call(t,0),"or")},e.prototype.or=function(t,n,r,o,a){return e.combine(this,t,n,r,"or",o,a)},e.fromJson=function(e){if(e instanceof Array){for(var t=[],n=0,r=e.length;n<r;n++)t.push(this.fromJSONData(e[n]));return t}var o=e;return this.fromJSONData(o)},e.prototype.validate=function(e){var t,n,r=this.predicates?this.predicates:[];if(!this.isComplex&&this.comparer)return this.comparer.call(this,Zkt.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);t="and"===this.condition;for(var o=0;o<r.length;o++)if(n=r[o].validate(e),t){if(!n)return!1}else if(n)return!0;return t},e.prototype.toJson=function(){var e,t;if(this.isComplex){e=[],t=this.predicates;for(var n=0;n<t.length;n++)e.push(t[n].toJson())}return{isComplex:this.isComplex,field:this.field,operator:this.operator,value:this.value,ignoreCase:this.ignoreCase,ignoreAccent:this.ignoreAccent,condition:this.condition,predicates:e}},e.combinePredicates=function(t,n){if(1===t.length){if(!(t[0]instanceof Array))return t[0];t=t[0]}return new e(t[0],n,t.slice(1))},e.combine=function(t,n,r,o,a,i,l){return n instanceof e?e[a](t,n):"string"==typeof n?e[a](t,new e(n,r,o,i,l)):Zkt.throwError("Predicate - "+a+" : invalid arguments")},e.fromJSONData=function(t){for(var n=t.predicates||[],r=n.length,o=[],a=0;a<r;a++)o.push(this.fromJSONData(n[a]));return t.isComplex?new e(o[0],t.condition,o.slice(1)):new e(t.field,t.operator,t.value,t.ignoreCase,t.ignoreAccent)},e}(),$kt={GroupGuid:"{271bbba0-1ee7}"},Zkt=function(){function e(){}return e.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},e.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},e.startsWith=function(e,t){return e.slice(0,t.length)===t},e.fnSort=function(t){return"ascending"===(t=t?e.toLowerCase(t):"ascending")?this.fnAscending:this.fnDescending},e.fnAscending=function(e,t){return ZUe(e)&&ZUe(t)||null==t?-1:"string"==typeof e?e.localeCompare(t):null==e?1:e-t},e.fnDescending=function(e,t){return ZUe(e)&&ZUe(t)?-1:null==t?1:"string"==typeof e?-1*e.localeCompare(t):null==e?-1:t-e},e.extractFields=function(e,t){for(var n={},r=0;r<t.length;r++)n=this.setValue(t[r],this.getObject(t[r],e),n);return n},e.select=function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(this.extractFields(e[r],t));return n},e.group=function(t,n,r,o,a,i,l){o=o||1;var s=t,c="GroupGuid";if(s.GroupGuid===$kt[c]){for(var u=function(e){if(ZUe(a))s[e].items=d.group(s[e].items,n,r,s.level+1,null,i,l),s[e].count=s[e].items.length;else{var t,o=a.filter((function(t){return t.key===s[e].key}));t=a.indexOf(o[0]),s[e].items=d.group(s[e].items,n,r,s.level+1,a[t].items,i,l),s[e].count=a[t].count}},d=this,h=0;h<s.length;h++)u(h);return s.childLevels+=1,s}var p={},f=[];f.GroupGuid=$kt[c],f.level=o,f.childLevels=0,f.records=s;for(var m=function(e){var t=v.getVal(s,e,n);if(ZUe(i)||(t=i(t,n)),!p[t]&&(p[t]={key:t,count:0,items:[],aggregates:{},field:n},f.push(p[t]),!ZUe(a))){var o=a.filter((function(e){return e.key===p[t].key}));p[t].count=o[0].count}p[t].count=ZUe(a)?p[t].count+=1:p[t].count,(!l||l&&r.length)&&p[t].items.push(s[e])},v=this,g=0;g<s.length;g++)m(g);if(r&&r.length){var b=function(t){for(var n={},o=void 0,i=r,l=0;l<r.length;l++)if(o=e.aggregates[r[l].type],ZUe(a))o&&(n[i[l].field+" - "+i[l].type]=o(f[t].items,i[l].field));else{var s=a.filter((function(e){return e.key===f[t].key}));o&&(n[i[l].field+" - "+i[l].type]=o(s[0].items,i[l].field))}f[t].aggregates=n};for(g=0;g<f.length;g++)b(g)}if(l&&f.length&&r.length)for(g=0;g<f.length;g++)f[g].items=[];return s.length&&f||s},e.buildHierarchy=function(e,t,n,r,o){var a,i={};for(r.result&&(r=r.result),r.GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),a=0;a<r.length;a++){(i[l=this.getObject(e,r[a])]||(i[l]=[])).push(r[a])}for(a=0;a<n.length;a++){var l=this.getObject(o||e,n[a]);n[a][t]=i[l]}},e.getFieldList=function(e,t,n){if(void 0===n&&(n=""),null==t)return this.getFieldList(e,[],n);for(var r=e,o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];"object"!=typeof r[i]||r[i]instanceof Array?t.push(n+i):this.getFieldList(r[i],t,n+i+".")}return t},e.getObject=function(e,t){if(!e)return t;if(t){if(-1===e.indexOf("."))return t[e];for(var n=t,r=e.split("."),o=0;o<r.length&&null!=n;o++)n=n[r[o]];return n}},e.setValue=function(e,t,n){var r,o,a=e.toString().split("."),i=n||{},l=i,s=a.length;for(r=0;r<s;r++)o=a[r],r+1===s?l[o]=void 0===t?void 0:t:ZUe(l[o])&&(l[o]={}),l=l[o];return i},e.sort=function(e,t,n){if(e.length<=1)return e;var r=parseInt((e.length/2).toString(),10),o=e.slice(0,r),a=e.slice(r);return o=this.sort(o,t,n),a=this.sort(a,t,n),this.merge(o,a,t,n)},e.ignoreDiacritics=function(t){return"string"!=typeof t?t:t.split("").map((function(t){return t in e.diacritics?e.diacritics[t]:t})).join("")},e.merge=function(e,t,n,r){for(var o,a=[];e.length>0||t.length>0;)o=e.length>0&&t.length>0?r?r(this.getVal(e,0,n),this.getVal(t,0,n),e[0],t[0])<=0?e:t:e[0][n]<e[0][n]?e:t:e.length>0?e:t,a.push(o.shift());return a},e.getVal=function(e,t,n){return n?this.getObject(n,e[t]):e[t]},e.toLowerCase=function(e){return e?"string"==typeof e?e.toLowerCase():e.toString():0===e||!1===e?e.toString():""},e.callAdaptorFunction=function(e,t,n,r){if(t in e){var o=e[t](n,r);ZUe(o)||(n=o)}return n},e.getAddParams=function(t,n,r){var o={};return e.callAdaptorFunction(t,"addParams",{dm:n,query:r,params:r.params,reqParams:o}),o},e.isPlainObject=function(e){return!!e&&e.constructor===Object},e.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},e.getGuid=function(e){var t;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,(function(e,n){if("crypto"in window&&"getRandomValues"in crypto){var r=new Uint8Array(1);window.crypto.getRandomValues(r),t=r[0]%16|0}else t=16*Math.random()|0;return"0123456789abcdef"[19===n?3&t|8:t]}))},e.isNull=function(e){return null==e},e.getItemFromComparer=function(t,n,r){var o,a,i,l=0,s="string"==typeof e.getVal(t,0,n);if(t.length)for(;ZUe(o)&&l<t.length;)o=e.getVal(t,l,n),i=t[l++];for(;l<t.length;l++)ZUe(a=e.getVal(t,l,n))||(s&&(o=+o,a=+a),r(o,a)>0&&(o=a,i=t[l]));return i},e.distinct=function(t,n,r){r=!ZUe(r)&&r;var o,a=[],i={};return t.forEach((function(l,s){(o="object"==typeof t[s]?e.getVal(t,s,n):t[s])in i||(a.push(r?t[s]:o),i[o]=1)})),a},e.processData=function(e,t){var n=this.prepareQuery(e),r=new Qkt(t);e.requiresCounts&&n.requiresCount();var o=r.executeLocal(n),a={result:e.requiresCounts?o.result:o,count:o.count,aggregates:JSON.stringify(o.aggregates)};return e.requiresCounts?a:o},e.prepareQuery=function(t){var n=this,r=new Rkt;(t.select&&r.select(t.select),t.where)&&e.parse.parseJson(t.where).filter((function(e){if(ZUe(e.condition))r.where(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent);else{var t=[];e.field?t.push(new Bkt(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent)):t=t.concat(n.getPredicate(e.predicates)),"or"==e.condition?r.where(Bkt.or(t)):"and"==e.condition&&r.where(Bkt.and(t))}}));t.search&&e.parse.parseJson(t.search).filter((function(e){return r.search(e.key,e.fields,e.operator,e.ignoreCase,e.ignoreAccent)}));return t.aggregates&&t.aggregates.filter((function(e){return r.aggregate(e.type,e.field)})),t.sorted&&t.sorted.filter((function(e){return r.sortBy(e.name,e.direction)})),t.skip&&r.skip(t.skip),t.take&&r.take(t.take),t.group&&t.group.filter((function(e){return r.group(e)})),r},e.getPredicate=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.field)t.push(new Bkt(r.field,r.operator,r.value,r.ignoreCase,r.ignoreAccent));else{for(var o=[],a=this.getPredicate(r.predicates),i=0,l=Object.keys(a);i<l.length;i++){var s=l[i];o.push(a[s])}t.push("or"==r.condition?Bkt.or(o):Bkt.and(o))}}return t},e.serverTimezoneOffset=null,e.timeZoneHandling=!0,e.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},e.aggregates={sum:function(t,n){for(var r,o=0,a="number"!=typeof e.getVal(t,0,n),i=0;i<t.length;i++)r=e.getVal(t,i,n),isNaN(r)||null===r||(a&&(r=+r),o+=r);return o},average:function(t,n){return e.aggregates.sum(t,n)/t.length},min:function(t,n){var r;return"function"==typeof n&&(r=n,n=null),e.getObject(n,e.getItemFromComparer(t,n,r||e.fnAscending))},max:function(t,n){var r;return"function"==typeof n&&(r=n,n=null),e.getObject(n,e.getItemFromComparer(t,n,r||e.fnDescending))},truecount:function(e,t){return new Qkt(e).executeLocal((new Rkt).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new Qkt(e).executeLocal((new Rkt).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},e.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},e.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},e.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof"},e.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains"},e.diacritics={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e.fnOperators={equal:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?e.toLowerCase(t)===e.toLowerCase(n):t===n},notequal:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),!e.fnOperators.equal(t,n,r)},lessthan:function(t,n,r){return r?e.toLowerCase(t)<e.toLowerCase(n):(ZUe(t)&&(t=void 0),t<n)},greaterthan:function(t,n,r){return r?e.toLowerCase(t)>e.toLowerCase(n):t>n},lessthanorequal:function(t,n,r){return r?e.toLowerCase(t)<=e.toLowerCase(n):(ZUe(t)&&(t=void 0),t<=n)},greaterthanorequal:function(t,n,r){return r?e.toLowerCase(t)>=e.toLowerCase(n):t>=n},contains:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?!ZUe(t)&&!ZUe(n)&&-1!==e.toLowerCase(t).indexOf(e.toLowerCase(n)):!ZUe(t)&&!ZUe(n)&&-1!==t.toString().indexOf(n)},notnull:function(e){return null!==e},isnull:function(e){return null===e},startswith:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?t&&n&&e.startsWith(e.toLowerCase(t),e.toLowerCase(n)):t&&n&&e.startsWith(t,n)},endswith:function(t,n,r,o){return o&&(t=e.ignoreDiacritics(t),n=e.ignoreDiacritics(n)),r?t&&n&&e.endsWith(e.toLowerCase(t),e.toLowerCase(n)):t&&n&&e.endsWith(t,n)},processSymbols:function(t){var n=e.operatorSymbols[t];return n?e.fnOperators[n]:e.throwError("Query - Process Operator : Invalid operator")},processOperator:function(t){var n=e.fnOperators[t];return n||e.fnOperators.processSymbols(t)}},e.parse={parseJson:function(t){return"string"==typeof t?t=JSON.parse(t,e.parse.jsonReviver):t instanceof Array?e.parse.iterateAndReviveArray(t):"object"==typeof t&&null!==t&&e.parse.iterateAndReviveJson(t),t},iterateAndReviveArray:function(t){for(var n=0;n<t.length;n++)"object"==typeof t[n]&&null!==t[n]?e.parse.iterateAndReviveJson(t[n]):"string"!=typeof t[n]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(t[n])?t[n]=e.parse.parseJson(t[n]):t[n]=e.parse.jsonReviver("",t[n])},iterateAndReviveJson:function(t){for(var n,r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];e.startsWith(a,"__")||("object"==typeof(n=t[a])?n instanceof Array?e.parse.iterateAndReviveArray(n):n&&e.parse.iterateAndReviveJson(n):t[a]=e.parse.jsonReviver(t[a],n))}},jsonReviver:function(t,n){if("string"==typeof n){var r=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(n),o=e.timeZoneHandling?e.serverTimezoneOffset:null;if(r)return e.dateParse.toTimeZone(new Date(parseInt(r[1],10)),o,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(n)){var a=n.indexOf("Z")>-1||n.indexOf("z")>-1,i=n.split(/[^0-9.]/);if(a)n=e.dateParse.toTimeZone(new Date(parseInt(i[0],10),parseInt(i[1],10)-1,parseInt(i[2],10),parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)),e.serverTimezoneOffset,!1);else{var l=new Date(parseInt(i[0],10),parseInt(i[1],10)-1,parseInt(i[2],10),parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)),s=parseInt(i[6],10),c=parseInt(i[7],10);if(isNaN(s)&&isNaN(c))return l;n.indexOf("+")>-1?l.setHours(l.getHours()-s,l.getMinutes()-c):l.setHours(l.getHours()+s,l.getMinutes()+c),n=e.dateParse.toTimeZone(l,e.serverTimezoneOffset,!1)}null==e.serverTimezoneOffset&&(n=e.dateParse.addSelfOffset(n))}}return n},isJson:function(t){return"string"==typeof t[0]?t:e.parse.parseJson(t)},isGuid:function(e){return null!=/[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i.exec(e)},replacer:function(t,n){return e.isPlainObject(t)?e.parse.jsonReplacer(t,n):t instanceof Array?e.parse.arrayReplacer(t):t instanceof Date?e.parse.jsonReplacer({val:t},n).val:t},jsonReplacer:function(t,n){for(var r,o=0,a=Object.keys(t);o<a.length;o++){var i=a[o];if((r=t[i])instanceof Date){var l=r;null==e.serverTimezoneOffset?t[i]=e.dateParse.toTimeZone(l,null).toJSON():(l=new Date(+l+36e5*e.serverTimezoneOffset),t[i]=e.dateParse.toTimeZone(e.dateParse.addSelfOffset(l),null).toJSON())}}return t},arrayReplacer:function(t){for(var n=0;n<t.length;n++)e.isPlainObject(t[n])?t[n]=e.parse.jsonReplacer(t[n]):t[n]instanceof Date&&(t[n]=e.parse.jsonReplacer({date:t[n]}).date);return t},jsonDateReplacer:function(t,n){if("value"===t&&n){if("string"==typeof n){var r=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(n);if(r)n=e.dateParse.toTimeZone(new Date(parseInt(r[1],10)),null,!0);else if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(n)){var o=n.split(/[^0-9]/);n=e.dateParse.toTimeZone(new Date(parseInt(o[0],10),parseInt(o[1],10)-1,parseInt(o[2],10),parseInt(o[3],10),parseInt(o[4],10),parseInt(o[5],10)),null,!0)}}if(n instanceof Date)return n=e.dateParse.addSelfOffset(n),null===e.serverTimezoneOffset?e.dateParse.toTimeZone(e.dateParse.addSelfOffset(n),null).toJSON():(n=e.dateParse.toTimeZone(n,n.getTimezoneOffset()/60*2-e.serverTimezoneOffset,!1)).toJSON()}return n}},e.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(t,n,r){if(null===n)return t;var o=r?e.dateParse.toUTC(t):t;return new Date(+o-36e5*n)},toLocalTime:function(e){var t=e,n=-t.getTimezoneOffset(),r=n>=0?"+":"-",o=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return t.getFullYear()+"-"+o(t.getMonth()+1)+"-"+o(t.getDate())+"T"+o(t.getHours())+":"+o(t.getMinutes())+":"+o(t.getSeconds())+r+o(n/60)+":"+o(n%60)}},e}(),Vkt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jkt={GroupGuid:"{271bbba0-1ee7}"},Wkt=function(){function e(t){this.options={from:"table",requestType:"json",sortBy:"sorted",select:"select",skip:"skip",group:"group",take:"take",search:"search",count:"requiresCounts",where:"where",aggregates:"aggregates",expand:"expand"},this.type=e,this.dataSource=t,this.pvt={}}return e.prototype.processResponse=function(e,t,n,r){return e},e}(),Fkt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vkt(t,e),t.prototype.processQuery=function(e,t){for(var n,r,o,a=e.dataSource.json.slice(0),i=a.length,l=!0,s={},c=0,u=[],d=0;d<t.lazyLoad.length;d++)c++,s[t.lazyLoad[d].key]=t.lazyLoad[d].value;var h={};for(d=0;d<t.queries.length;d++)"onPage"!==(r=t.queries[d]).fn&&"onGroup"!==r.fn||!t.lazyLoad.length?(n=this[r.fn].call(this,a,r.e,t),"onAggregates"===r.fn?h[r.e.field+" - "+r.e.type]=n:a=void 0!==n?n:a,"onPage"!==r.fn&&"onSkip"!==r.fn&&"onTake"!==r.fn&&"onRange"!==r.fn||(l=!1),l&&(i=a.length)):("onGroup"===r.fn&&u.push(r.e),"onPage"===r.fn&&(o=r.e));if(c){var p={query:t,lazyLoad:s,result:a,group:u,page:o},f=this.lazyLoadGroup(p);a=f.result,i=f.count}return t.isCountRequired&&(a={result:a,count:i,aggregates:h}),a},t.prototype.lazyLoadGroup=function(e){var t=0,n=this.getAggregate(e.query),r=e.result;if(ZUe(e.lazyLoad.onDemandGroupInfo)){i=e.group[0].fieldName;t=(r=Zkt.group(r,i,n,null,null,e.group[0].comparer,!0)).length;l=r;e.page&&(r=this.onPage(r,e.page,e.query)),this.formGroupResult(r,l)}else{for(var o=e.lazyLoad.onDemandGroupInfo,a=o.where.length-1;a>=0;a--)r=this.onWhere(r,o.where[a]);if(e.group.length!==o.level){var i=e.group[o.level].fieldName;r=Zkt.group(r,i,n,null,null,e.group[0].comparer,!0)}t=r.length;var l=r;r=(r=r.slice(o.skip)).slice(0,o.take),e.group.length!==o.level&&this.formGroupResult(r,l)}return{result:r,count:t}},t.prototype.formGroupResult=function(e,t){if(e.length&&t.length){var n="GroupGuid",r="childLevels",o="level",a="records";e[n]=t[n],e[r]=t[r],e[o]=t[o],e[a]=t[a]}return e},t.prototype.getAggregate=function(e){var t=Rkt.filterQueries(e.queries,"onAggregates"),n=[];if(t.length)for(var r=void 0,o=0;o<t.length;o++)r=t[o].e,n.push({type:r.type,field:Zkt.getValue(r.field,e)});return n},t.prototype.batchRequest=function(e,t,n){var r,o=t.deletedRecords.length;for(r=0;r<t.addedRecords.length;r++)this.insert(e,t.addedRecords[r]);for(r=0;r<t.changedRecords.length;r++)this.update(e,n.key,t.changedRecords[r]);for(r=0;r<o;r++)this.remove(e,n.key,t.deletedRecords[r]);return t},t.prototype.onWhere=function(e,t){return e&&e.length?e.filter((function(e){if(t)return t.validate(e)})):e},t.prototype.onAggregates=function(e,t){var n=Zkt.aggregates[t.type];return e&&n&&0!==e.length?n(e,t.field):null},t.prototype.onSearch=function(e,t){return e&&e.length?(0===t.fieldNames.length&&Zkt.getFieldList(e[0],t.fieldNames),e.filter((function(e){for(var n=0;n<t.fieldNames.length;n++)if(t.comparer.call(e,Zkt.getObject(t.fieldNames[n],e),t.searchKey,t.ignoreCase,t.ignoreAccent))return!0;return!1}))):e},t.prototype.onSortBy=function(e,t,n){if(!e||!e.length)return e;var r,o=Zkt.getValue(t.fieldName,n);if(!o)return e.sort(t.comparer);if(o instanceof Array){for(var a=(o=o.slice(0)).length-1;a>=0;a--)o[a]&&(r=t.comparer,Zkt.endsWith(o[a]," desc")&&(r=Zkt.fnSort("descending"),o[a]=o[a].replace(" desc","")),e=Zkt.sort(e,o[a],r));return e}return Zkt.sort(e,o,t.comparer)},t.prototype.onGroup=function(e,t,n){if(!e||!e.length)return e;var r=this.getAggregate(n);return Zkt.group(e,Zkt.getValue(t.fieldName,n),r,null,null,t.comparer)},t.prototype.onPage=function(e,t,n){var r=Zkt.getValue(t.pageSize,n),o=(Zkt.getValue(t.pageIndex,n)-1)*r,a=o+r;return e&&e.length?e.slice(o,a):e},t.prototype.onRange=function(e,t){return e&&e.length?e.slice(Zkt.getValue(t.start),Zkt.getValue(t.end)):e},t.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,Zkt.getValue(t.nos)):e},t.prototype.onSkip=function(e,t){return e&&e.length?e.slice(Zkt.getValue(t.nos)):e},t.prototype.onSelect=function(e,t){return e&&e.length?Zkt.select(e,Zkt.getValue(t.fieldNames)):e},t.prototype.insert=function(e,t,n,r,o){return ZUe(o)?e.dataSource.json.push(t):e.dataSource.json.splice(o,0,t)},t.prototype.remove=function(e,t,n,r){var o,a=e.dataSource.json;for("object"!=typeof n||n instanceof Date||(n=Zkt.getObject(t,n)),o=0;o<a.length&&Zkt.getObject(t,a[o])!==n;o++);return o!==a.length?a.splice(o,1):null},t.prototype.update=function(e,t,n,r){var o,a,i=e.dataSource.json;for(ZUe(t)||(a=TUe(t,n)),o=0;o<i.length&&(ZUe(t)||TUe(t,i[o])!==a);o++);return o<i.length?BUe(i[o],n):null},t}(Wkt),qkt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Vkt(t,e),t.prototype.processQuery=function(e,t,n){var r,o,a=this.getQueryRequest(t),i=Rkt.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),l=t.params,s=e.dataSource.url,c=null,u=this.options,d={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in i?(r=i.onPage,o=((o=Zkt.getValue(r.pageIndex,t))-1)*(c=Zkt.getValue(r.pageSize,t))):"onRange"in i&&(o=(r=i.onRange).start,c=r.end-r.start);for(var h=0;h<a.sorts.length;h++)r=Zkt.getValue(a.sorts[h].e.fieldName,t),d.sorts.push(Zkt.callAdaptorFunction(this,"onEachSort",{name:r,direction:a.sorts[h].e.direction},t));n&&(r=this.getFiltersFrom(n,t))&&d.filters.push(Zkt.callAdaptorFunction(this,"onEachWhere",r.toJson(),t));for(h=0;h<a.filters.length;h++){var p=Zkt.callAdaptorFunction(this,"onEachWhere",a.filters[h].e.toJson(),t);this.getModuleName&&"ODataV4Adaptor"===this.getModuleName()&&!ZUe(a.filters[h].e.key)&&a.filters.length>1&&(p="("+p+")"),d.filters.push(p);for(var f=0,m="object"==typeof d.filters[h]?Object.keys(d.filters[h]):[];f<m.length;f++){var v=m[f];Zkt.isNull(d[v])&&delete d[v]}}for(h=0;h<a.searches.length;h++)r=a.searches[h].e,d.searches.push(Zkt.callAdaptorFunction(this,"onEachSearch",{fields:r.fieldNames,operator:r.operator,key:r.searchKey,ignoreCase:r.ignoreCase},t));for(h=0;h<a.groups.length;h++)d.groups.push(Zkt.getValue(a.groups[h].e.fieldName,t));for(h=0;h<a.aggregates.length;h++)r=a.aggregates[h].e,d.aggregates.push({type:r.type,field:Zkt.getValue(r.field,t)});var g={};if(this.getRequestQuery(u,t,i,d,g),Zkt.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:l,reqParams:g}),t.lazyLoad.length)for(h=0;h<t.lazyLoad.length;h++)g[t.lazyLoad[h].key]=t.lazyLoad[h].value;for(var b=0,y=Object.keys(g);b<y.length;b++){v=y[b];(Zkt.isNull(g[v])||""===g[v]||0===g[v].length)&&delete g[v]}u.skip in g&&u.take in g||null===c||(g[u.skip]=Zkt.callAdaptorFunction(this,"onSkip",o,t),g[u.take]=Zkt.callAdaptorFunction(this,"onTake",c,t));var w=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(g,Zkt.parse.jsonDateReplacer),url:s,pvtData:w,type:"POST",contentType:"application/json; charset=utf-8"}:(r=this.convertToQueryString(g,t,e),{type:"GET",url:(r=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+r).length?s.replace(/\/*$/,r):s,pvtData:w})},t.prototype.getRequestQuery=function(e,t,n,r,o){var a=o;a[e.from]=t.fromTable,e.apply&&t.distincts.length&&(a[e.apply]="onDistinct"in this?Zkt.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(a[e.expand]="onExpand"in this&&"onSelect"in n?Zkt.callAdaptorFunction(this,"onExpand",{selects:Zkt.getValue(n.onSelect.fieldNames,t),expands:t.expands},t):t.expands),a[e.select]="onSelect"in n&&!t.distincts.length?Zkt.callAdaptorFunction(this,"onSelect",Zkt.getValue(n.onSelect.fieldNames,t),t):"",a[e.count]=t.isCountRequired?Zkt.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",a[e.search]=r.searches.length?Zkt.callAdaptorFunction(this,"onSearch",r.searches,t):"",a[e.skip]="onSkip"in n?Zkt.callAdaptorFunction(this,"onSkip",Zkt.getValue(n.onSkip.nos,t),t):"",a[e.take]="onTake"in n?Zkt.callAdaptorFunction(this,"onTake",Zkt.getValue(n.onTake.nos,t),t):"",a[e.where]=r.filters.length||r.searches.length?Zkt.callAdaptorFunction(this,"onWhere",r.filters,t):"",a[e.sortBy]=r.sorts.length?Zkt.callAdaptorFunction(this,"onSortBy",r.sorts,t):"",a[e.group]=r.groups.length?Zkt.callAdaptorFunction(this,"onGroup",r.groups,t):"",a[e.aggregates]=r.aggregates.length?Zkt.callAdaptorFunction(this,"onAggregates",r.aggregates,t):"",a.param=[]},t.prototype.convertToQueryString=function(e,t,n){return""},t.prototype.processResponse=function(e,t,n,r,o,a){if(r&&r.getResponseHeader("Content-Type")&&-1!==r.getResponseHeader("Content-Type").indexOf("application/json")){var i=Zkt.timeZoneHandling;t&&!t.timeZoneHandling&&(Zkt.timeZoneHandling=!1),e=Zkt.parse.parseJson(e),Zkt.timeZoneHandling=i}var l=o,s=l.pvtData||{},c=e?e.groupDs:[];if(r&&r.getResponseHeader("Content-Type")&&-1!==r.getResponseHeader("Content-Type").indexOf("xml"))return n.isCountRequired?{result:[],count:0}:[];var u=JSON.parse(l.data);if(u&&"batch"===u.action&&e&&e.addedRecords)return a.addedRecords=e.addedRecords,a;e&&e.d&&(e=e.d);var d={};e&&"count"in e&&(d.count=e.count),d.result=e&&e.result?e.result:e;var h=!1;if(Array.isArray(e.result)&&e.result.length){if(ZUe(e.result[0].key)||(d.result=this.formRemoteGroupedData(d.result,1,s.groups.length-1)),n&&n.lazyLoad.length&&s.groups.length)for(var p=0;p<n.lazyLoad.length;p++)if("onDemandGroupInfo"===n.lazyLoad[p].key){var f=n.lazyLoad[p].value.level;s.groups.length===f&&(h=!0)}}return h||this.getAggregateResult(s,e,d,c,n),Zkt.isNull(d.count)?d.result:{result:d.result,count:d.count,aggregates:d.aggregates}},t.prototype.formRemoteGroupedData=function(e,t,n){for(var r=0;r<e.length;r++)e[r].items.length&&Object.keys(e[r].items[0]).indexOf("key")>-1&&this.formRemoteGroupedData(e[r].items,t+1,n-1);var o="GroupGuid",a="records";return e[o]=jkt[o],e.level=t,e.childLevels=n,e[a]=e[0].items.length?this.getGroupedRecords(e,!ZUe(e[0].items[a])):[],e},t.prototype.getGroupedRecords=function(e,t){for(var n=[],r=0;r<e.length;r++)if(t)n=n.concat(e[r].items.records);else for(var o=0;o<e[r].items.length;o++)n.push(e[r].items[o]);return n},t.prototype.onGroup=function(e){return this.pvt.groups=e,e},t.prototype.onAggregates=function(e){this.pvt.aggregates=e},t.prototype.batchRequest=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.removeUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify($Ue({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:n[undefined],key:n[undefined]},Zkt.getAddParams(this,e,r)))}},t.prototype.beforeSend=function(e,t){},t.prototype.insert=function(e,t,n,r){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:t,table:n,action:"insert"},Zkt.getAddParams(this,e,r)))}},t.prototype.remove=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{key:n,keyColumn:t,table:r,action:"remove"},Zkt.getAddParams(this,e,o)))}},t.prototype.update=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:n,action:"update",keyColumn:t,key:Zkt.getObject(t,n),table:r},Zkt.getAddParams(this,e,o)))}},t.prototype.getFiltersFrom=function(e,t){var n,r=t.fKey,o=r,a=t.key,i=[];"object"!=typeof e[0]&&(o=null);for(var l=0;l<e.length;l++)n="object"==typeof e[0]?Zkt.getObject(a||o,e[l]):e[l],i.push(new Bkt(r,"equal",n));return Bkt.or(i)},t.prototype.getAggregateResult=function(e,t,n,r,o){var a=t;if(t&&t.result&&(a=t.result),e&&e.aggregates&&e.aggregates.length){var i=e.aggregates,l=void 0,s=a,c={};t.aggregate&&(s=t.aggregate);for(var u=0;u<i.length;u++)(l=Zkt.aggregates[i[u].type])&&(c[i[u].field+" - "+i[u].type]=l(s,i[u].field));n.aggregates=c}var d=Array.isArray(t.result)&&t.result.length&&!ZUe(t.result[0].key);if(e&&e.groups&&e.groups.length&&!d){var h=e.groups;for(u=0;u<h.length;u++){ZUe(r)||(r=Zkt.group(r,h[u]));var p=Rkt.filterQueries(o.queries,"onGroup")[u].e;a=Zkt.group(a,h[u],e.aggregates,null,r,p.comparer)}n.result=a}return n},t.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=Rkt.filterQueries(e.queries,"onSortBy"),t.groups=Rkt.filterQueries(e.queries,"onGroup"),t.filters=Rkt.filterQueries(e.queries,"onWhere"),t.searches=Rkt.filterQueries(e.queries,"onSearch"),t.aggregates=Rkt.filterQueries(e.queries,"onAggregates"),t},t.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var n=0,r=e.params;n<r.length;n++){var o=r[n];if(t[o.key])throw new Error("Query() - addParams: Custom Param is conflicting other request arguments");t[o.key]=o.value,o.fn&&(t[o.key]=o.fn.call(e.query,o.key,e.query,e.dm)),t.params[o.key]=t[o.key]}},t}(Wkt),Ykt=function(e){function t(t){var n=e.call(this)||this;return n.options=$Ue({},n.options,{requestType:"get",accept:"application/json;odata=light;q=1,application/json;odata=verbose;q=0.5",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$inlinecount",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PUT"}),$Ue(n.options,t||{}),n}return Vkt(t,e),t.prototype.getModuleName=function(){return"ODataAdaptor"},t.prototype.onPredicate=function(e,n,r){var o,a,i="",l=e.value,s=typeof l,c=e.field?t.getField(e.field):null;if(l instanceof Date&&(l="datetime'"+Zkt.parse.replacer(l)+"'"),"string"===s&&(l=l.replace(/'/g,"''"),e.ignoreCase&&(l=l.toLowerCase()),l="'"+(l=encodeURIComponent(l))+"'",r&&(c="cast("+c+", 'Edm.String')"),Zkt.parse.isGuid(l)&&(a="guid"),e.ignoreCase&&(a||(c="tolower("+c+")"),l=l.toLowerCase())),o=Zkt.odBiOperator[e.operator])return i+=c,i+=o,a&&(i+=a),i+l;if("substringof"===(o=ZUe(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Zkt.odUniOperator[e.operator]:Zkt.odv4UniOperator[e.operator])){var u=l;l=c,c=u}return i+=o+"(",i+=c+",",a&&(i+=a),i+=l+")"},t.prototype.addParams=function(t){e.prototype.addParams.call(this,t),delete t.reqParams.params},t.prototype.onComplexPredicate=function(e,t,n){for(var r=[],o=0;o<e.predicates.length;o++)r.push("("+this.onEachWhere(e.predicates[o],t,n)+")");return r.join(" "+e.condition+" ")},t.prototype.onEachWhere=function(e,t,n){return e.isComplex?this.onComplexPredicate(e,t,n):this.onPredicate(e,t,n)},t.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},t.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&Zkt.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],n=0;n<e.fields.length;n++)t.push(new Bkt(e.fields[n],e.operator,e.key,e.ignoreCase));this.pvt.search=t},t.prototype.onSearch=function(e){return this.pvt.search=Bkt.or(this.pvt.search),""},t.prototype.onEachSort=function(e){var n=[];if(e.name instanceof Array)for(var r=0;r<e.name.length;r++)n.push(t.getField(e.name[r])+("descending"===e.direction?" desc":""));else n.push(t.getField(e.name)+("descending"===e.direction?" desc":""));return n.join(",")},t.prototype.onSortBy=function(e){return e.reverse().join(",")},t.prototype.onGroup=function(e){return this.pvt.groups=e,[]},t.prototype.onSelect=function(e){for(var n=0;n<e.length;n++)e[n]=t.getField(e[n]);return e.join(",")},t.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},t.prototype.onCount=function(e){return!0===e?"allpages":""},t.prototype.beforeSend=function(e,t,n){Zkt.endsWith(n.url,this.options.batch)&&"post"===n.type.toLowerCase()?(t.setRequestHeader("Accept",this.options.multipartAccept),t.setRequestHeader("DataServiceVersion","2.0"),t.overrideMimeType("text/plain; charset=x-user-defined")):t.setRequestHeader("Accept",this.options.accept),t.setRequestHeader("DataServiceVersion","2.0"),t.setRequestHeader("MaxDataServiceVersion","2.0")},t.prototype.processResponse=function(e,t,n,r,o,a){var i="odata.metadata";if(o&&"GET"===o.type&&!this.rootUrl&&e[i]){var l=e[i].split("/$metadata#");this.rootUrl=l[0],this.resourceTableName=l[1]}if(!ZUe(e.d)){var s=n&&n.isCountRequired?e.d.results:e.d,c="__metadata";if(!ZUe(s))for(var u=0;u<s.length;u++)ZUe(s[u][c])||delete s[u][c]}var d=o&&o.pvtData,h=this.processBatchResponse(e,n,r,o,a);if(h)return h;var p=r&&o.getResponseHeader("DataServiceVersion"),f=null,m=p&&parseInt(p,10)||2;if(n&&n.isCountRequired){var v="__count";(e[v]||e["odata.count"])&&(f=e[v]||e["odata.count"]),e.d&&(e=e.d),(e[v]||e["odata.count"])&&(f=e[v]||e["odata.count"])}3===m&&e.value&&(e=e.value),e.d&&(e=e.d),m<3&&e.results&&(e=e.results);var g={};return g.count=f,g.result=e,this.getAggregateResult(d,e,g,null,n),Zkt.isNull(f)?g.result:{result:g.result,count:g.count,aggregates:g.aggregates}},t.prototype.convertToQueryString=function(e,t,n){var r=[],o="table",a=e[o]||"";delete e[o],n.dataSource.requiresFormat&&(e.$format="json");for(var i=0,l=Object.keys(e);i<l.length;i++){var s=l[i];r.push(s+"="+e[s])}return r=r.join("&"),n.dataSource.url&&-1!==n.dataSource.url.indexOf("?")&&!a?r:r.length?a+"?"+r:a||""},t.prototype.localTimeReplacer=function(e,t){for(var n=0,r=ZUe(t)?[]:Object.keys(t);n<r.length;n++){var o=r[n];t[o]instanceof Date&&(t[o]=Zkt.dateParse.toLocalTime(t[o]))}return t},t.prototype.insert=function(e,t,n){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},t.prototype.remove=function(e,t,n,r){var o;return o="string"!=typeof n||Zkt.parse.isGuid(n)?"("+n+")":"('"+n+"')",{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:"")+o}},t.prototype.update=function(e,t,n,r,o,a){var i;return"PATCH"!==this.options.updateType||ZUe(a)||(n=this.compareAndRemove(n,a,t)),i="string"!=typeof n[t]||Zkt.parse.isGuid(n[t])?"("+n[t]+")":"('"+n[t]+"')",{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:"")+i,data:JSON.stringify(n,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},t.prototype.batchRequest=function(e,t,n,r,o){var a=n.guid=Zkt.getGuid(this.options.batchPre),i=this.rootUrl?this.rootUrl+"/"+this.options.batch:e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);n.url=this.resourceTableName?this.resourceTableName:n.url;var l={url:n.url,key:n.key,cid:1,cSet:Zkt.getGuid(this.options.changeSet)},s="--"+a+"\n";return s+="Content-Type: multipart/mixed; boundary="+l.cSet.replace("--","")+"\n",this.pvt.changeSet=0,s+=this.generateInsertRequest(t.addedRecords,l,e),s+=this.generateUpdateRequest(t.changedRecords,l,e,o?o.changedRecords:[]),s+=this.generateDeleteRequest(t.deletedRecords,l,e),s+=l.cSet+"--\n",{type:"POST",url:i,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+a,data:s+="--"+a+"--"}},t.prototype.generateDeleteRequest=function(e,t,n){if(!e)return"";var r={method:"DELETE ",url:function(e,t,n){var r=Zkt.getObject(n,e[t]);return"number"==typeof r||Zkt.parse.isGuid(r)?"("+r+")":r instanceof Date?"("+e[t][n].toJSON()+")":"('"+r+"')"},data:function(e,t){return""}};return this.generateBodyContent(e,t,r,n)+"\n"},t.prototype.generateInsertRequest=function(e,t,n){if(!e)return"";var r={method:"POST ",url:function(e,t,n){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,r,n)},t.prototype.generateUpdateRequest=function(e,t,n,r){var o=this;if(!e)return"";e.forEach((function(e){return e=o.compareAndRemove(e,r.filter((function(n){return Zkt.getObject(t.key,n)===Zkt.getObject(t.key,e)}))[0],t.key)}));var a={method:this.options.updateType+" ",url:function(e,t,n){return"number"==typeof e[t][n]||Zkt.parse.isGuid(e[t][n])?"("+e[t][n]+")":e[t][n]instanceof Date?"("+e[t][n].toJSON()+")":"('"+e[t][n]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,a,n)},t.getField=function(e){return e.replace(/\./g,"/")},t.prototype.generateBodyContent=function(e,t,n,r){for(var o="",a=0;a<e.length;a++)o+="\n"+t.cSet+"\n",o+=this.options.changeSetContent+"\n\n",o+=n.method,"POST "===n.method?o+=(r.dataSource.insertUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n":"PUT "===n.method||"PATCH "===n.method?o+=(r.dataSource.updateUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n":"DELETE "===n.method&&(o+=(r.dataSource.removeUrl||r.dataSource.crudUrl||t.url)+n.url(e,a,t.key)+" HTTP/1.1\n"),o+="Accept: "+this.options.accept+"\n",o+="Content-Id: "+this.pvt.changeSet+++"\n",o+=this.options.batchChangeSetContentType+"\n",ZUe(e[a]["@odata.etag"])?o+="\n":(o+="If-Match: "+e[a]["@odata.etag"]+"\n\n",delete e[a]["@odata.etag"]),o+=n.data(e,a);return o},t.prototype.processBatchResponse=function(e,t,n,r,o){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return t.isCountRequired?{result:[],count:0}:[];if(r&&this.options.batch&&Zkt.endsWith(r.url,this.options.batch)&&"post"===r.type.toLowerCase()){var a=n.getResponseHeader("Content-Type"),i=void 0,l=void 0,s=e+"";if(a=a.substring(a.indexOf("=batchresponse")+1),(s=s.split(a)).length<2)return{};s=s[1];var c=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(s);c&&s.replace(c[0],"");for(var u=c?c[1]:"",d=(s=s.split(u)).length;d>-1;d--)/\bContent-ID:/i.test(s[d])&&/\bHTTP.+201/.test(s[d])&&(i=parseInt(/\bContent-ID: (\d+)/i.exec(s[d])[1],10),o.addedRecords[i]&&(l=Zkt.parse.parseJson(/^\{.+\}/m.exec(s[d])[0]),$Ue({},o.addedRecords[i],this.processResponse(l))));return o}return null},t.prototype.compareAndRemove=function(e,t,n){var r=this;return ZUe(t)||Object.keys(e).forEach((function(o){o!==n&&"@odata.etag"!==o&&(Zkt.isPlainObject(e[o])?(r.compareAndRemove(e[o],t[o]),0===Object.keys(e[o]).filter((function(e){return"@odata.etag"!==e})).length&&delete e[o]):(e[o]===t[o]||e[o]&&t[o]&&e[o].valueOf()===t[o].valueOf())&&delete e[o])})),e},t}(qkt);!function(e){function t(t){var n=e.call(this,t)||this;return n.options=$Ue({},n.options,{requestType:"get",accept:"application/json, text/javascript, */*; q=0.01",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$count",search:"$search",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PATCH",localTime:!1,apply:"$apply"}),$Ue(n.options,t||{}),n}Vkt(t,e),t.prototype.getModuleName=function(){return"ODataV4Adaptor"},t.prototype.onCount=function(e){return!0===e?"true":""},t.prototype.onPredicate=function(t,n,r){var o="",a=t.value,i=a instanceof Date;if(n instanceof Rkt)for(var l=this.getQueryRequest(n),s=0;s<l.filters.length;s++)l.filters[s].e.key===t.value&&(r=!0);return o=e.prototype.onPredicate.call(this,t,n,r),i&&(o=o.replace(/datetime'(.*)'$/,"$1")),Zkt.parse.isGuid(a)&&(o=o.replace("guid","").replace(/'/g,"")),o},t.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},t.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},t.prototype.onExpand=function(e){var t=this,n={},r={},o=e.expands.slice(),a=[];return e.selects.filter((function(e){return e.indexOf(".")>-1})).forEach((function(e){var r=e.split(".");if(r[0]in n||(n[r[0]]=[]),2==r.length)n[r[0]].length&&-1!==Object.keys(n).indexOf(r[0])?-1!==n[r[0]][0].indexOf("$expand")&&-1===n[r[0]][0].indexOf(";$select=")?n[r[0]][0]=n[r[0]][0]+";$select="+r[1]:n[r[0]][0]=n[r[0]][0]+","+r[1]:n[r[0]].push("$select="+r[1]);else{for(var o="$select="+r[r.length-1],a="",i="",l=1;l<r.length-1;l++)a=a+"$expand="+r[l]+"(",i+=")";var s=a+o+i;if(n[r[0]].length&&-1!==Object.keys(n).indexOf(r[0])&&t.expandQueryIndex(n[r[0]],!0)){var c=t.expandQueryIndex(n[r[0]]);n[r[0]][c]=n[r[0]][c]+s.replace("$expand=",",")}else n[r[0]].push(s)}})),Object.keys(n).forEach((function(e){-1===o.indexOf(e)&&o.push(e)})),o.forEach((function(e){r[e]=e in n?e+"("+n[e].join(";")+")":e})),Object.keys(r).forEach((function(e){return a.push(r[e])})),a.join(",")},t.prototype.expandQueryIndex=function(e,t){for(var n=0;n<e.length;n++)if(-1!==e[n].indexOf("$expand"))return!!t||n;return!t&&0},t.prototype.onDistinct=function(e){return"groupby(("+e.map((function(e){return Ykt.getField(e)})).join(",")+"))"},t.prototype.onSelect=function(t){return e.prototype.onSelect.call(this,t.filter((function(e){return-1===e.indexOf(".")})))},t.prototype.beforeSend=function(e,t,n){"POST"!==n.type&&"PUT"!==n.type&&"PATCH"!==n.type||t.setRequestHeader("Prefer","return=representation"),t.setRequestHeader("Accept",this.options.accept)},t.prototype.processResponse=function(t,n,r,o,a,i){var l="@odata.context";if(a&&"GET"===a.type&&!this.rootUrl&&t[l]){var s=t[l].split("/$metadata#");this.rootUrl=s[0],this.resourceTableName=s[1]}var c=a&&a.pvtData,u=e.prototype.processBatchResponse.call(this,t,r,o,a,i);if(u)return u;var d=null,h="@odata.count";r&&r.isCountRequired&&h in t&&(d=t[h]),t=ZUe(t.value)?t:t.value;var p={};return p.count=d,p.result=t,this.getAggregateResult(c,t,p,null,r),Zkt.isNull(d)?p.result:{result:p.result,count:d,aggregates:p.aggregates}}}(Ykt),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Vkt(t,e),t.prototype.getModuleName=function(){return"WebApiAdaptor"},t.prototype.insert=function(e,t,n){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},t.prototype.remove=function(e,t,n,r){return{type:"DELETE",url:e.dataSource.url+"/"+n,data:JSON.stringify(n)}},t.prototype.update=function(e,t,n,r){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(n)}},t.prototype.batchRequest=function(e,t,n){var r=this,o=n.guid=Zkt.getGuid(this.options.batchPre),a=e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);n.url=this.resourceTableName?this.resourceTableName:n.url;for(var i=[],l=function(r,a){t.addedRecords.forEach((function(a,l){var s=function(e,t,n){return""};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("POST /api/"+(e.dataSource.insertUrl||e.dataSource.crudUrl||n.url)+s(t.addedRecords,r,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")}))},s=0,c=t.addedRecords.length;s<c;s++)l(s);var u=function(a,l){t.changedRecords.forEach((function(l,s){r.options.updateType;var c=function(e,t,n){return""};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("PUT /api/"+(e.dataSource.updateUrl||e.dataSource.crudUrl||n.url)+c(t.changedRecords,a,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",l?JSON.stringify(l):"")}))};for(s=0,c=t.changedRecords.length;s<c;s++)u(s);var d=function(r,a){t.deletedRecords.forEach((function(a,l){var s=function(e,t,n){var r=Zkt.getObject(n,e[t]);return"number"==typeof r||Zkt.parse.isGuid(r)?"/"+r:r instanceof Date?"/"+e[t][n].toJSON():"/'"+r+"'"};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("DELETE /api/"+(e.dataSource.removeUrl||e.dataSource.crudUrl||n.url)+s(t.deletedRecords,r,n.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")}))};for(s=0,c=t.deletedRecords.length;s<c;s++)d(s);return i.push("--"+o+"--",""),{type:"POST",url:a,contentType:"multipart/mixed; boundary="+o,data:i.join("\r\n")}},t.prototype.beforeSend=function(e,t,n){t.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01")},t.prototype.processResponse=function(e,t,n,r,o,a){var i=o&&o.pvtData,l=null,s={};if(o&&"post"!==o.type.toLowerCase()){var c=r&&o.getResponseHeader("DataServiceVersion"),u=c&&parseInt(c,10)||2;n&&n.isCountRequired&&(Zkt.isNull(e.Count)||(l=e.Count)),u<3&&e.Items&&(e=e.Items),s.count=l,s.result=e,this.getAggregateResult(i,e,s,null,n)}return s.result=s.result||e,Zkt.isNull(l)?s.result:{result:s.result,count:s.count,aggregates:s.aggregates}}}(Ykt),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Vkt(t,e),t.prototype.processQuery=function(e,t,n){var r=(new qkt).processQuery(e,t,n),o=Zkt.parse.parseJson(r.data),a={};if(o.param)for(var i=0;i<o.param.length;i++){var l=o.param[i],s=Object.keys(l)[0];a[s]=l[s]}a.value=o;return{data:JSON.stringify(a),url:r.url,pvtData:r.pvtData,type:"POST",contentType:"application/json; charset=utf-8"}}}(qkt);var Ukt=function(e){function t(){var t=e.call(this)||this;return HUe("beforeSend",qkt.prototype.beforeSend,t),t}return Vkt(t,e),t.prototype.insert=function(e,t,n,r,o){return this.pvt.position=o,this.updateType="add",{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:t,table:n,action:"insert"},Zkt.getAddParams(this,e,r)))}},t.prototype.remove=function(t,n,r,o,a){return e.prototype.remove.call(this,t,n,r),{type:"POST",url:t.dataSource.removeUrl||t.dataSource.crudUrl||t.dataSource.url,data:JSON.stringify($Ue({},{key:r,keyColumn:n,table:o,action:"remove"},Zkt.getAddParams(this,t,a)))}},t.prototype.update=function(e,t,n,r,o){return this.updateType="update",this.updateKey=t,{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify($Ue({},{value:n,action:"update",keyColumn:t,key:n[t],table:r},Zkt.getAddParams(this,e,o)))}},t.prototype.processResponse=function(t,n,r,o,a,i,l){var s;if(t="batch"===(a?JSON.parse(a.data):t).action?Zkt.parse.parseJson(t):t,"add"===this.updateType&&e.prototype.insert.call(this,n,t,null,null,this.pvt.position),"update"===this.updateType&&e.prototype.update.call(this,n,this.updateKey,t),this.updateType=void 0,t.added)for(s=0;s<t.added.length;s++)e.prototype.insert.call(this,n,t.added[s]);if(t.changed)for(s=0;s<t.changed.length;s++)e.prototype.update.call(this,n,l.key,t.changed[s]);if(t.deleted)for(s=0;s<t.deleted.length;s++)e.prototype.remove.call(this,n,l.key,t.deleted[s]);return t},t.prototype.batchRequest=function(e,t,n,r,o){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify($Ue({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:n.url,key:n.key},Zkt.getAddParams(this,e,r)))}},t.prototype.addParams=function(e){(new qkt).addParams(e)},t}(Fkt),Kkt=function(e){function t(t){var n=e.call(this)||this;return n.options=$Ue({},n.options,{getData:new Function,addRecord:new Function,updateRecord:new Function,deleteRecord:new Function,batchUpdate:new Function}),$Ue(n.options,t||{}),n}return Vkt(t,e),t.prototype.getModuleName=function(){return"CustomDataAdaptor"},t}(qkt);!function(e){function t(t){var n=e.call(this)||this;return n.opt=t,n.schema=n.opt.response,n.query=n.opt.query,n.getVariables=n.opt.getVariables?n.opt.getVariables:function(){},n.getQuery=function(){return n.query},n}Vkt(t,e),t.prototype.getModuleName=function(){return"GraphQLAdaptor"},t.prototype.processQuery=function(t,n){var r=e.prototype.processQuery.apply(this,arguments),o=JSON.parse(r.data),a={};["skip","take","sorted","table","select","where","search","requiresCounts","aggregates","params"].filter((function(e){a[e]="searchwhereparams".indexOf(e)>-1?JSON.stringify(o[e]):o[e]}));var i=this.getVariables()||{};i.datamanager=a;var l=JSON.stringify({query:this.getQuery(),variables:i});return r.data=l,r},t.prototype.processResponse=function(e,t,n,r,o){var a,i,l=e,s=TUe(this.schema.result,l.data);this.schema.count&&(a=TUe(this.schema.count,l.data)),this.schema.aggregates&&(i=ZUe(i=TUe(this.schema.aggregates,l.data))?i:Zkt.parse.parseJson(i));var c=o.pvtData||{},u={result:s,aggregates:i},d=u;return c&&c.groups&&c.groups.length&&this.getAggregateResult(c,d,u,null,n),ZUe(a)?u.result:{result:u.result,count:a,aggregates:i}},t.prototype.insert=function(){var t=e.prototype.insert.apply(this,arguments);return this.generateCrudData(t,"insert")},t.prototype.update=function(){var t=e.prototype.update.apply(this,arguments);return this.generateCrudData(t,"update")},t.prototype.remove=function(){var t=e.prototype.remove.apply(this,arguments);return this.generateCrudData(t,"remove")},t.prototype.batchRequest=function(t,n,r,o,a){var i=e.prototype.batchRequest.apply(this,arguments),l=JSON.parse(i.data);return l.key=r.key,i.data=JSON.stringify(l),this.generateCrudData(i,"batch")},t.prototype.generateCrudData=function(e,t){var n=JSON.parse(e.data);return e.data=JSON.stringify({query:this.opt.getMutation(t),variables:n}),e}}(qkt);var Gkt,Xkt=function(e){function t(t,n,r){var o=e.call(this)||this;o.isCrudAction=!1,o.isInsertAction=!1,ZUe(t)||(o.cacheAdaptor=t),o.pageSize=r,o.guidId=Zkt.getGuid("cacheAdaptor");window.localStorage.setItem(o.guidId,JSON.stringify({keys:[],results:[]}));var a=o.guidId;return ZUe(n)||setInterval((function(){var e;e=Zkt.parse.parseJson(window.localStorage.getItem(a));for(var t=[],r=0;r<e.results.length;r++){var o=+new Date,i=+new Date(e.results[r].timeStamp);e.results[r].timeStamp=o-i,o-i>n&&t.push(r)}for(r=0;r<t.length;r++)e.results.splice(t[r],1),e.keys.splice(t[r],1);window.localStorage.removeItem(a),window.localStorage.setItem(a,JSON.stringify(e))}),n),o}return Vkt(t,e),t.prototype.generateKey=function(e,t){var n=this.getQueryRequest(t),r=Rkt.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),o=e,a="onPage";a in r&&(o+=r[a].pageIndex),n.sorts.forEach((function(e){o+=e.e.direction+e.e.fieldName})),n.groups.forEach((function(e){o+=e.e.fieldName})),n.searches.forEach((function(e){o+=e.e.searchKey}));for(var i=0;i<n.filters.length;i++){var l=n.filters[i];if(l.e.isComplex){var s=t.clone();s.queries=[];for(var c=0;c<l.e.predicates.length;c++)s.queries.push({fn:"onWhere",e:l.e.predicates[c],filter:t.queries.filter});o+=l.e.condition+this.generateKey(e,s)}else o+=l.e.field+l.e.operator+l.e.value}return o},t.prototype.processQuery=function(e,t,n){var r,o=this.generateKey(e.dataSource.url,t),a=(r=Zkt.parse.parseJson(window.localStorage.getItem(this.guidId)))?r.results[r.keys.indexOf(o)]:null;return null==a||this.isCrudAction||this.isInsertAction?(this.isCrudAction=null,this.isInsertAction=null,this.cacheAdaptor.processQuery.apply(this.cacheAdaptor,[].slice.call(arguments,0))):a},t.prototype.processResponse=function(e,t,n,r,o,a){if(this.isInsertAction||o&&this.cacheAdaptor.options.batch&&Zkt.endsWith(o.url,this.cacheAdaptor.options.batch)&&"post"===o.type.toLowerCase())return this.cacheAdaptor.processResponse(e,t,n,r,o,a);e=this.cacheAdaptor.processResponse.apply(this.cacheAdaptor,[].slice.call(arguments,0));var i=n?this.generateKey(t.dataSource.url,n):t.dataSource.url,l={},s=(l=Zkt.parse.parseJson(window.localStorage.getItem(this.guidId))).keys.indexOf(i);for(-1!==s&&(l.results.splice(s,1),l.keys.splice(s,1)),l.results[l.keys.push(i)-1]={keys:i,result:e.result,timeStamp:new Date,count:e.count};l.results.length>this.pageSize;)l.results.splice(0,1),l.keys.splice(0,1);return window.localStorage.setItem(this.guidId,JSON.stringify(l)),e},t.prototype.beforeSend=function(e,t,n){!ZUe(this.cacheAdaptor.options.batch)&&Zkt.endsWith(n.url,this.cacheAdaptor.options.batch)&&"post"===n.type.toLowerCase()&&t.setRequestHeader("Accept",this.cacheAdaptor.options.multipartAccept),e.dataSource.crossDomain||t.setRequestHeader("Accept",this.cacheAdaptor.options.accept)},t.prototype.update=function(e,t,n,r){return this.isCrudAction=!0,this.cacheAdaptor.update(e,t,n,r)},t.prototype.insert=function(e,t,n){return this.isInsertAction=!0,this.cacheAdaptor.insert(e,t,n)},t.prototype.remove=function(e,t,n,r){return this.isCrudAction=!0,this.cacheAdaptor.remove(e,t,n,r)},t.prototype.batchRequest=function(e,t,n){return this.cacheAdaptor.batchRequest(e,t,n)},t}(qkt),Qkt=function(){function e(e,t,n){var r,o=this;return this.dateParse=!0,this.timeZoneHandling=!0,this.requests=[],e||this.dataSource||(e=[]),n=n||e.adaptor,e&&!1===e.timeZoneHandling&&(this.timeZoneHandling=e.timeZoneHandling),e instanceof Array?r={json:e,offline:!0}:"object"==typeof e?(e.json||(e.json=[]),r={url:e.url,insertUrl:e.insertUrl,removeUrl:e.removeUrl,updateUrl:e.updateUrl,crudUrl:e.crudUrl,batchUrl:e.batchUrl,json:e.json,headers:e.headers,accept:e.accept,data:e.data,timeTillExpiration:e.timeTillExpiration,cachingPageSize:e.cachingPageSize,enableCaching:e.enableCaching,requestType:e.requestType,key:e.key,crossDomain:e.crossDomain,jsonp:e.jsonp,dataType:e.dataType,offline:void 0!==e.offline?e.offline:!(e.adaptor instanceof Ukt||e.adaptor instanceof Kkt)&&!e.url,requiresFormat:e.requiresFormat}):Zkt.throwError("DataManager: Invalid arguments"),void 0!==r.requiresFormat||Zkt.isCors()||(r.requiresFormat=!!ZUe(r.crossDomain)||r.crossDomain),void 0===r.dataType&&(r.dataType="json"),this.dataSource=r,this.defaultQuery=t,r.url&&r.offline&&!r.json.length?(this.isDataAvailable=!1,this.adaptor=n||new Ykt,this.dataSource.offline=!1,this.ready=this.executeQuery(t||new Rkt),this.ready.then((function(e){o.dataSource.offline=!0,o.isDataAvailable=!0,r.json=e.result,o.adaptor=new Fkt}))):this.adaptor=r.offline?new Fkt:new Ykt,!r.jsonp&&this.adaptor instanceof Ykt&&(r.jsonp="callback"),this.adaptor=n||this.adaptor,r.enableCaching&&(this.adaptor=new Xkt(this.adaptor,r.timeTillExpiration,r.cachingPageSize)),this}return e.prototype.setDefaultQuery=function(e){return this.defaultQuery=e,this},e.prototype.executeLocal=function(t){this.defaultQuery||t instanceof Rkt||Zkt.throwError("DataManager - executeLocal() : A query is required to execute"),this.dataSource.json||Zkt.throwError("DataManager - executeLocal() : Json data is required to execute"),t=t||this.defaultQuery;var n=this.adaptor.processQuery(this,t);if(t.subQuery){var r=t.subQuery.fromTable,o=t.subQuery.lookups,a=t.isCountRequired?n.result:n;o&&o instanceof Array&&Zkt.buildHierarchy(t.subQuery.fKey,r,a,o,t.subQuery.key);for(var i=0;i<a.length;i++)a[i][r]instanceof Array&&(a[i]=$Ue({},{},a[i]),a[i][r]=this.adaptor.processResponse(t.subQuery.using(new e(a[i][r].slice(0))).executeLocal(),this,t))}return this.adaptor.processResponse(n,this,t)},e.prototype.executeQuery=function(t,n,r,o){var a=this,i="makeRequest";"function"==typeof t&&(o=r,r=n,n=t,t=null),t||(t=this.defaultQuery),t instanceof Rkt||Zkt.throwError("DataManager - executeQuery() : A query is required to execute");var l=new Jkt,s={query:t};if(!this.dataSource.offline&&void 0!==this.dataSource.url&&""!==this.dataSource.url||!ZUe(this.adaptor[i])||this.isCustomDataAdaptor(this.adaptor)){var c=this.adaptor.processQuery(this,t);ZUe(this.adaptor[i])?!ZUe(c.url)||this.isCustomDataAdaptor(this.adaptor)?this.makeRequest(c,l,s,t):(s=e.getDeferedArgs(t,c,s),l.resolve(s)):this.adaptor[i](c,l,s,t)}else e.nextTick((function(){var n=a.executeLocal(t);s=e.getDeferedArgs(t,n,s),l.resolve(s)}));return(n||r)&&l.promise.then(n,r),o&&l.promise.then(o,o),l.promise},e.getDeferedArgs=function(e,t,n){return e.isCountRequired?(n.result=t.result,n.count=t.count,n.aggregates=t.aggregates):n.result=t,n},e.nextTick=function(e){(window.setImmediate||window.setTimeout)(e,0)},e.prototype.extendRequest=function(e,t,n){return $Ue({},{type:"GET",dataType:this.dataSource.dataType,crossDomain:this.dataSource.crossDomain,jsonp:this.dataSource.jsonp,cache:!0,processData:!1,onSuccess:t,onFailure:n},e)},e.prototype.makeRequest=function(e,t,n,r){var o=this,a=!!r.subQuerySelector,i=function(e){n.error=e,t.reject(n)},l=function(e,r,o,a,i,l,s){n.xhr=o,n.count=r?parseInt(r.toString(),10):0,n.result=e,n.request=a,n.aggregates=l,n.actual=i,n.virtualSelectRecords=s,t.resolve(n)},s=function(e,t){var s=new Jkt,c={parent:n};r.subQuery.isChild=!0;var u=o.adaptor.processQuery(o,r.subQuery,e?o.adaptor.processResponse(e):t),d=o.makeRequest(u,s,c,r.subQuery);return a||s.then((function(t){e&&(Zkt.buildHierarchy(r.subQuery.fKey,r.subQuery.fromTable,e,t,r.subQuery.key),l(e,t.count,t.xhr))}),i),d},c=this.extendRequest(e,(function(e,t){if(o.isGraphQLAdaptor(o.adaptor)&&!ZUe(e.errors))return i(e.errors);o.isCustomDataAdaptor(o.adaptor)&&(t=$Ue({},o.ajaxReqOption,t)),-1===t.httpRequest.getResponseHeader("Content-Type").indexOf("xml")&&o.dateParse&&(e=Zkt.parse.parseJson(e));var n=o.adaptor.processResponse(e,o,r,t.httpRequest,t),c=0,u=null,d=e.virtualSelectRecords;r.isCountRequired&&(c=n.count,u=n.aggregates,n=n.result),r.subQuery?a||s(n,t):l(n,c,t.httpRequest,t.type,e,u,d)}),i);if(this.isCustomDataAdaptor(this.adaptor)){this.ajaxReqOption=c;var u=c;this.adaptor.options.getData({data:u.data,onSuccess:u.onSuccess,onFailure:u.onFailure})}else{var d=new _Ke(c);d.beforeSend=function(){o.beforeSend(d.httpRequest,d)},(c=d.send()).catch((function(e){return!0})),this.requests.push(d)}if(a){var h=r.subQuerySelector.call(this,{query:r.subQuery,parent:r});h&&h.length?Promise.all([c,s(null,h)]).then((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],i=o.adaptor.processResponse(n[0],o,r,o.requests[0].httpRequest,o.requests[0]),s=0;r.isCountRequired&&(s=i.count,i=i.result);var c=o.adaptor.processResponse(n[1],o,r.subQuery,o.requests[1].httpRequest,o.requests[1]);s=0,r.subQuery.isCountRequired&&(s=c.count,c=c.result),Zkt.buildHierarchy(r.subQuery.fKey,r.subQuery.fromTable,i,c,r.subQuery.key),a=!1,l(i,s,o.requests[0].httpRequest)})):a=!1}return c},e.prototype.beforeSend=function(e,t){this.adaptor.beforeSend(this,e,t);for(var n,r=this.dataSource.headers,o=0;r&&o<r.length;o++){n=[];for(var a=0,i=Object.keys(r[o]);a<i.length;a++){var l=i[a];n.push(l),e.setRequestHeader(l,r[o][l])}}},e.prototype.saveChanges=function(e,t,n,r,o){var a=this;n instanceof Rkt&&(r=n,n=null);var i={url:n,key:t||this.dataSource.key},l=this.adaptor.batchRequest(this,e,i,r||new Rkt,o),s="doAjaxRequest";if(this.dataSource.offline)return l;if(ZUe(this.adaptor[s])){if(this.isCustomDataAdaptor(this.adaptor))return this.doAjaxRequest(l,this.adaptor.options.batchUpdate);var c=new Jkt,u=new _Ke(l);return u.beforeSend=function(){a.beforeSend(u.httpRequest,u)},u.onSuccess=function(t,n){a.isGraphQLAdaptor(a.adaptor)&&(ZUe(t.errors)||u.onFailure(JSON.stringify(t.errors))),c.resolve(a.adaptor.processResponse(t,a,null,n.httpRequest,n,e,i))},u.onFailure=function(e){c.reject([{error:e}])},u.send().catch((function(e){return!0})),c.promise}return this.adaptor[s](l)},e.prototype.insert=function(e,t,n,r){t instanceof Rkt&&(n=t,t=null);var o=this.adaptor.insert(this,e,t,n,r),a="doAjaxRequest";return this.dataSource.offline?o:ZUe(this.adaptor[a])?this.doAjaxRequest(o,this.adaptor.options.addRecord):this.adaptor[a](o)},e.prototype.remove=function(e,t,n,r){"object"==typeof t&&(t=Zkt.getObject(e,t)),n instanceof Rkt&&(r=n,n=null);var o=this.adaptor.remove(this,e,t,n,r),a="doAjaxRequest";if(this.dataSource.offline)return o;if(ZUe(this.adaptor[a])){var i=this.adaptor.options.deleteRecord;return this.doAjaxRequest(o,i)}return this.adaptor[a](o)},e.prototype.update=function(e,t,n,r,o){n instanceof Rkt&&(r=n,n=null);var a=this.adaptor.update(this,e,t,n,r,o),i="doAjaxRequest";if(this.dataSource.offline)return a;if(ZUe(this.adaptor[i])){var l=this.adaptor.options.updateRecord;return this.doAjaxRequest(a,l)}return this.adaptor[i](a)},e.prototype.isCustomDataAdaptor=function(e){return this.adaptor.getModuleName&&"CustomDataAdaptor"===this.adaptor.getModuleName()},e.prototype.isGraphQLAdaptor=function(e){return this.adaptor.getModuleName&&"GraphQLAdaptor"===this.adaptor.getModuleName()},e.prototype.successFunc=function(e,t){if(this.isGraphQLAdaptor(this.adaptor)){var n=JSON.parse(e);ZUe(n.errors)||this.failureFunc(JSON.stringify(n.errors))}this.isCustomDataAdaptor(this.adaptor)&&(t=$Ue({},this.ajaxReqOption,t));try{Zkt.parse.parseJson(e)}catch(t){e=[]}e=this.adaptor.processResponse(Zkt.parse.parseJson(e),this,null,t.httpRequest,t),this.ajaxDeffered.resolve(e)},e.prototype.failureFunc=function(e){this.ajaxDeffered.reject([{error:e}])},e.prototype.doAjaxRequest=function(e,t){var n=this;if(e=$Ue({},{type:"POST",contentType:"application/json; charset=utf-8",processData:!1},e),this.ajaxDeffered=new Jkt,this.isCustomDataAdaptor(this.adaptor))this.ajaxReqOption=e,t.call(this,{data:e.data,onSuccess:this.successFunc.bind(this),onFailure:this.failureFunc.bind(this)});else{var r=new _Ke(e);r.beforeSend=function(){n.beforeSend(r.httpRequest,r)},r.onSuccess=this.successFunc.bind(this),r.onFailure=this.failureFunc.bind(this),r.send().catch((function(e){return!0}))}return this.ajaxDeffered.promise},e}(),Jkt=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)},eSt={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"};function tSt(e,t){var n={};if(ZUe(e)||"string"==typeof e||"number"==typeof e||!ZUe(e.isHeader))return e;for(var r=0,o=Object.keys(t);r<o.length;r++){var a=t[o[r]],i=ZUe(a)||"string"!=typeof a?void 0:TUe(a,e);ZUe(i)||(n[a]=i)}return n}function nSt(e){if(e)try{return document.querySelector(e)?LXe(document.querySelector(e).innerHTML.trim()):LXe(e)}catch(t){return LXe(e)}}!function(e){e.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null,sortBy:null};var t={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},n={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:e.defaultMappedFields,ariaAttributes:t,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};function r(e,t,n,r,a){return y(e,o(e,t,n,r,a),null,r)}function o(e,t,r,o,a){var i=[],l=$Ue({},n,o);eSt=v(l.moduleName);for(var s=p(),c=0;c<t.length;c++)if(!ZUe(t[c])){var u=void 0;if(l.itemCreating&&"function"==typeof l.itemCreating){var d={dataSource:t,curData:t[c],text:t[c],options:l};l.itemCreating(d)}if(u=r?m(e,t[c],void 0,null,null,[],null,s,c,o):b(e,t[c],void 0,null,null,o,a),l.itemCreated&&"function"==typeof l.itemCreated){d={dataSource:t,curData:t[c],text:t[c],item:u,options:l};l.itemCreated(d)}i.push(u)}return i}function a(r,o,a,i,l,s){var c=$Ue({},n,a);eSt=v(c.moduleName);var h,g=!s||"listview"!==s.getModuleName()&&"multiselect"!==s.getModuleName()?$Ue({},e.defaultMappedFields,c.fields):c.fields,y=$Ue({},t,c.ariaAttributes),w=[];i&&(y.level=i);var x,E,k=[];o&&o.length&&!ZUe(u(o).item)&&!u(o).item.hasOwnProperty(g.id)&&(h=p());for(var S=0;S<o.length;S++){var C=tSt(o[S],g);if(!ZUe(o[S])){if(c.itemCreating&&"function"==typeof c.itemCreating){var M={dataSource:o,curData:o[S],text:C[g.text],options:c,fields:g};c.itemCreating(M)}var _=o[S];c.itemCreating&&"function"==typeof c.itemCreating&&(C=tSt(o[S],g)),C.hasOwnProperty(g.id)&&!ZUe(C[g.id])&&(h=C[g.id]);var N=[];if(c.showCheckBox&&(c.itemNavigable&&(C[g.url]||C[g.urlAttributes])?w.push(r("input",{className:eSt.check,attrs:{type:"checkbox"}})):N.push(r("input",{className:eSt.check,attrs:{type:"checkbox"}}))),!0===l)c.showIcon&&C.hasOwnProperty(g.iconCss)&&!ZUe(C[g.iconCss])&&N.push(r("span",{className:eSt.icon+" "+C[g.iconCss]})),E=(x=m(r,_,C,g,c.itemClass,N,!(!_.hasOwnProperty("isHeader")||!_.isHeader),h,S,a)).querySelector("."+eSt.anchorWrap),c.itemNavigable&&w.length&&FKe(w,x.firstElementChild);else{if((x=b(r,_,C,g,c.itemClass,a,s)).classList.add(eSt.level+"-"+y.level),x.setAttribute("aria-level",y.level.toString()),E=x.querySelector("."+eSt.anchorWrap),C.hasOwnProperty(g.tooltip)&&x.setAttribute("title",C[g.tooltip]),C.hasOwnProperty(g.htmlAttributes)&&C[g.htmlAttributes]&&d(x,C[g.htmlAttributes]),C.hasOwnProperty(g.enabled)&&!1===C[g.enabled]&&x.classList.add(eSt.disabled),C.hasOwnProperty(g.isVisible)&&!1===C[g.isVisible]&&(x.style.display="none"),C.hasOwnProperty(g.imageUrl)&&!ZUe(C[g.imageUrl])&&!c.template){var A={src:C[g.imageUrl]};BUe(A,C[g.imageAttributes]);var O=r("img",{className:eSt.image,attrs:A});E?E.insertAdjacentElement("afterbegin",O):FKe([O],x.firstElementChild)}if(c.showIcon&&C.hasOwnProperty(g.iconCss)&&!ZUe(C[g.iconCss])&&!c.template){var I=r("div",{className:eSt.icon+" "+C[g.iconCss]});E?E.insertAdjacentElement("afterbegin",I):FKe([I],x.firstElementChild)}N.length&&FKe(N,x.firstElementChild),c.itemNavigable&&w.length&&FKe(w,x.firstElementChild),f(r,C,g,o,c,x,y.level)}if(E&&ZKe([x],[eSt.navigable]),c.itemCreated&&"function"==typeof c.itemCreated){M={dataSource:o,curData:o[S],text:C[g.text],item:x,options:c,fields:g};c.itemCreated(M)}w=[],k.push(x)}}return k}function i(e,t,r,o,i,l){var s=$Ue({},n,r);return y(e,a(e,t,r,o,i,l),s.listClass,r)}function l(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function s(e,t,n){if(void 0===n&&(n=new Rkt),"Ascending"===e)n.sortBy(t,"ascending",!0);else if("Descending"===e)n.sortBy(t,"descending",!0);else for(var r=0;r<n.queries.length;r++)"onSortBy"===n.queries[r].fn&&n.queries.splice(r,1);return n}function c(e,t){return new Qkt(e).executeLocal(t)}function u(e){for(var t={typeof:null,item:null},n=0;n<e.length;n++)if(!ZUe(e[n]))return{typeof:typeof e[n],item:e[n]};return t}function d(e,t){var n={};BUe(n,t),n.class&&(ZKe([e],n.class.split(" ")),delete n.class),GKe(e,n)}function h(e){for(var t={},n=e.attributes,r=0;r<n.length;r++)t[n[r].nodeName]=n[r].nodeValue;return t}function p(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function f(e,t,n,r,o,a,l){var s=t[n.child]||[],c=t[n.hasChildren];if(s.length&&(c=!0,a.classList.add(eSt.hasChild),o.processSubChild)){var u=i(e,s,o,++l);a.appendChild(u)}o.expandCollapse&&c&&!o.template&&(a.firstElementChild.classList.add(eSt.iconWrapper),("Left"===o.expandIconPosition?FKe:qKe)([e("div",{className:"e-icons "+o.expandIconClass})],a.querySelector("."+eSt.textContent)))}function m(e,r,o,a,i,l,s,c,u,h){var p,f,m=$Ue({},n,h),v=$Ue({},t,m.ariaAttributes),b=r,y=r;"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r&&(p=r,b="boolean"==typeof o[a.text]||"number"==typeof o[a.text]?o[a.text]:o[a.text]||"",y=o[a.value]),f=ZUe(p)||ZUe(o[a.id])||""===o[a.id]?c+"-"+u:c;var w=e("li",{className:(!0===s?eSt.group:eSt.li)+" "+(ZUe(i)?"":i),id:f,attrs:""!==v.groupItemRole&&""!==v.itemRole?{role:!0===s?v.groupItemRole:v.itemRole}:{}});return p&&o.hasOwnProperty(a.enabled)&&"false"===o[a.enabled].toString()&&w.classList.add(eSt.disabled),s?w.innerText=b:(w.setAttribute("data-value",ZUe(y)?"null":y),w.setAttribute("role","option"),p&&o.hasOwnProperty(a.htmlAttributes)&&o[a.htmlAttributes]&&d(w,o[a.htmlAttributes]),l.length&&!m.itemNavigable&&qKe(l,w),p&&(o[a.url]||o[a.urlAttributes]&&o[a.urlAttributes].href)?w.appendChild(g(e,p,a,b,l,m.itemNavigable)):(l.length&&m.itemNavigable&&qKe(l,w),w.appendChild(document.createTextNode(b)))),w}function v(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function g(e,t,n,r,o,a){var i,l=tSt(t,n),s={href:l[n.url]};if(l.hasOwnProperty(n.urlAttributes)&&l[n.urlAttributes]&&(BUe(s,l[n.urlAttributes]),s.href=l[n.url]?l[n.url]:l[n.urlAttributes].href),a){i=e("a",{className:eSt.text+" "+eSt.url});var c=e("div",{className:eSt.anchorWrap});o&&o.length&&qKe(o,c),c.appendChild(document.createTextNode(r)),qKe([c],i)}else i=e("a",{className:eSt.text+" "+eSt.url,innerHTML:r});return d(i,s),i}function b(e,r,o,a,i,l,s){var c,u,d,h=$Ue({},n,l),f=$Ue({},t,h.ariaAttributes),m=r;"string"!=typeof r&&"number"!=typeof r&&(d=r,m=o[a.text]||"",c=ZUe(o._id)?o[a.id]:o._id,u=!(!r.hasOwnProperty("isHeader")||!r.isHeader)),l&&l.enableHtmlSanitizer;var v=e("li",{className:(!0===u?eSt.group:eSt.li)+" "+(ZUe(i)?"":i),attrs:""!==f.groupItemRole&&""!==f.itemRole?{role:!0===u?f.groupItemRole:f.itemRole}:{}});if(!0==!ZUe(c)?v.setAttribute("data-uid",c):v.setAttribute("data-uid",p()),u&&l&&l.groupTemplate){var b=nSt(l.groupTemplate);if(s&&"listview"!==s.getModuleName())(y=b(r,s,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate,null,v))&&qKe(y,v);else qKe(b(r,s,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate),v)}else if(!u&&l&&l.template){var y;b=nSt(l.template);if(s&&"listview"!==s.getModuleName())(y=b(r,s,"template",h.templateID,!!h.isStringTemplate,null,v))&&qKe(y,v);else qKe(b(r,s,"template",h.templateID,!!h.isStringTemplate),v)}else{var w=e("div",{className:eSt.textContent,attrs:""!==f.wrapperRole?{role:f.wrapperRole}:{}});if(d&&(o[a.url]||o[a.urlAttributes]&&o[a.urlAttributes].href))w.appendChild(g(e,d,a,m,null,h.itemNavigable));else{var x=e("span",{className:eSt.text,attrs:""!==f.itemText?{role:f.itemText}:{}});l&&l.enableHtmlSanitizer?x.innerText=m:x.innerHTML=m,w.appendChild(x)}v.appendChild(w)}return v}function y(e,r,o,a){var i=$Ue({},n,a),l=$Ue({},t,i.ariaAttributes),s=e("ul",{className:(eSt=v(i.moduleName)).ul+" "+(ZUe(o)?"":o),attrs:""!==l.listRole?{role:l.listRole}:{}});return qKe(r,s),s}e.createList=function(e,o,a,l,s){var c=$Ue({},n,a),d=$Ue({},t,c.ariaAttributes),h=u(o).typeof;return"string"===h||"number"===h?r(e,o,l,a,s):i(e,o,a,d.level,l,s)},e.createListFromArray=r,e.createListItemFromArray=o,e.createListItemFromJson=a,e.createListFromJson=i,e.getSiblingLI=function(e,t,r){if(eSt=v(n.moduleName),e&&e.length){var o,a,i=Array.prototype.slice.call(e);for(o=i[(a=t?l(t,i):!0===r?i.length:-1)+(!0===r?-1:1)];o&&(!WKe(o)||o.classList.contains(eSt.disabled));)o=i[a+=!0===r?-1:1];return o}},e.indexOf=l,e.groupDataSource=function(t,n,r){void 0===r&&(r="None");var o=$Ue({},e.defaultMappedFields,n),a=(new Rkt).group(o.groupBy),i=c(t,a=s(r,"key",a));t=[];for(var l=0;l<i.length;l++){var u=i[l].items,d={};d[o.text]=i[l].key,d.isHeader=!0;var h=o.text;"id"===h&&(d[h="text"]=i[l].key),d._id="group-list-item-"+(i[l].key?i[l].key.toString().trim():"undefined"),d.items=u,t.push(d);for(var p=0;p<u.length;p++)t.push(u[p])}return t},e.addSorting=s,e.getDataSource=c,e.createJsonFromElement=function t(r,o){var a=$Ue({},n,o),i=$Ue({},e.defaultMappedFields,a.fields),l=r.cloneNode(!0),s=[];l.classList.add("json-parent");var c=l.querySelectorAll(".json-parent>li");l.classList.remove("json-parent");for(var u=0;u<c.length;u++){for(var d=c[u],f=d.querySelector("a"),m=d.querySelector("ul"),v={},g=f?f.childNodes:d.childNodes,b=Object.keys(g),y=0;y<g.length;y++)g[Number(b[y])].hasChildNodes()||(v[i.text]=g[Number(b[y])].textContent);var w=h(d);w.id?(v[i.id]=w.id,delete w.id):v[i.id]=p(),Object.keys(w).length&&(v[i.htmlAttributes]=w),f&&(w=h(f),Object.keys(w).length&&(v[i.urlAttributes]=w)),m&&(v[i.child]=t(m,o)),s.push(v)}return s},e.renderContentTemplate=function(t,r,o,a,i,l){for(var s,c=t("ul",{className:(eSt=v(n.moduleName)).ul,attrs:{role:"presentation"}}),u=$Ue({},n,i),d=$Ue({},e.defaultMappedFields,a),h=nSt(r),f=[],m=p(),g=0;g<o.length;g++){var b=tSt(o[g],d),y=o[g],w=y.isHeader;if(s="string"==typeof o[g]||"number"==typeof o[g]?y:b[d.value],u.itemCreating&&"function"==typeof u.itemCreating){var x={dataSource:o,curData:y,text:s,options:u,fields:d};u.itemCreating(x)}u.itemCreating&&"function"==typeof u.itemCreating&&(b=tSt(o[g],d),s="string"==typeof o[g]||"number"==typeof o[g]?y:b[d.value]);var E=t("li",{id:m+"-"+g,className:w?eSt.group:eSt.li,attrs:{role:"presentation"}});if(w)"string"==typeof o[g]||"number"==typeof o[g]?E.innerText=y:E.innerText=b[d.text];else{var k,S=w?u.groupTemplateID:u.templateID;if(w)if(l&&"listview"!=l.getModuleName())(k=h(y,l,"headerTemplate",S,!!u.isStringTemplate,null,E))&&qKe(k,E);else qKe(h(y,l,"headerTemplate",S,!!u.isStringTemplate),E);else if(l&&"listview"!==l.getModuleName())(k=h(y,l,"template",S,!!u.isStringTemplate,null,E))&&qKe(k,E);else qKe(h(y,l,"template",S,!!u.isStringTemplate),E);E.setAttribute("data-value",ZUe(s)?"null":s),E.setAttribute("role","option")}if(u.itemCreated&&"function"==typeof u.itemCreated){x={dataSource:o,curData:y,text:s,item:E,options:u,fields:d};u.itemCreated(x)}f.push(E)}return qKe(f,c),c},e.renderGroupTemplate=function(t,r,o,a,i,l){for(var s=nSt(t),c=$Ue({},e.defaultMappedFields,o),u=$Ue({},n,i),d=c.groupBy,h=0,p=a;h<p.length;h++){var f=p[h],m={};if(m[d]=f.textContent,f.innerHTML="",l&&"listview"!==l.getModuleName()){var v=s(m,l,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate,null,f);v&&qKe(v,f)}else qKe(s(m,l,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),f)}return a},e.generateId=p,e.generateUL=y,e.generateIcon=function(e,t,r,o){var a=$Ue({},n,o);return eSt=v(a.moduleName),("Left"===a.expandIconPosition?FKe:qKe)([e("div",{className:"e-icons "+a.expandIconClass+" "+(ZUe(r)?"":r)})],t.querySelector("."+eSt.textContent)),t}}(Gkt||(Gkt={}));var rSt,oSt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),aSt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},iSt="e-vertical",lSt="e-toolbar-items",sSt="e-toolbar-item",cSt="e-rtl",uSt="e-separator",dSt="e-popup-up-icon",hSt="e-popup-down-icon",pSt="e-popup-open",fSt="e-template",mSt="e-overlay",vSt="e-toolbar-text",gSt="e-popup-text",bSt="e-overflow-show",ySt="e-overflow-hide",wSt="e-hor-nav",xSt="e-scroll-nav",ESt="e-toolbar-center",kSt="e-tbar-pos",SSt="e-hscroll-bar",CSt="e-toolbar-pop",MSt="e-toolbar-popup",_St="e-nav-active",NSt="e-ignore",ASt="e-popup-alone",OSt="e-hidden",ISt="e-toolbar-multirow",DSt="e-multirow-pos",PSt="e-multirow-separator",TSt="e-extended-separator",HSt="e-extended-toolbar",LSt="e-toolbar-extended",zSt="e-tbar-extended",RSt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oSt(t,e),aSt([vGe("")],t.prototype,"id",void 0),aSt([vGe("")],t.prototype,"text",void 0),aSt([vGe("auto")],t.prototype,"width",void 0),aSt([vGe("")],t.prototype,"cssClass",void 0),aSt([vGe(!1)],t.prototype,"showAlwaysInPopup",void 0),aSt([vGe(!1)],t.prototype,"disabled",void 0),aSt([vGe("")],t.prototype,"prefixIcon",void 0),aSt([vGe("")],t.prototype,"suffixIcon",void 0),aSt([vGe(!0)],t.prototype,"visible",void 0),aSt([vGe("None")],t.prototype,"overflow",void 0),aSt([vGe("")],t.prototype,"template",void 0),aSt([vGe("Button")],t.prototype,"type",void 0),aSt([vGe("Both")],t.prototype,"showTextOn",void 0),aSt([vGe(null)],t.prototype,"htmlAttributes",void 0),aSt([vGe("")],t.prototype,"tooltipText",void 0),aSt([vGe("Left")],t.prototype,"align",void 0),aSt([yGe()],t.prototype,"click",void 0),t}(HGe),BSt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.resizeContext=r.resize.bind(r),r.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},r}return oSt(t,e),t.prototype.destroy=function(){var t=this;(this.isReact||this.isAngular)&&this.clearTemplate();var n=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(n).forEach((function(e){ZUe(e)||ZUe(e.ej2_instances)||ZUe(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()})),this.unwireEvents(),this.tempId.forEach((function(e){ZUe(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),UKe(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&VKe([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach((function(e){return t.element.removeAttribute(e)})),e.prototype.destroy.call(this)},t.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(iSt),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,cSt)},t.prototype.wireEvents=function(){RKe.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),this.allowKeyboard&&this.wireKeyboardEvent()},t.prototype.wireKeyboardEvent=function(){this.keyModule=new oXe(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),RKe.add(this.element,"keydown",this.docKeyDown,this),this.element.setAttribute("tabIndex","0")},t.prototype.unwireKeyboardEvent=function(){this.keyModule&&(RKe.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},t.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var t=!ZUe(this.popObj)&&WKe(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},t.prototype.unwireEvents=function(){RKe.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),RKe.remove(document,"scroll",this.docEvent),RKe.remove(document,"click",this.docEvent)},t.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},t.prototype.docEvent=function(e){var t=eGe(e.target,".e-popup");this.popObj&&WKe(this.popObj.element)&&!t&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},t.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,kSt),this.scrollModule.destroy(),this.scrollModule=null)},t.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+sSt)).forEach((function(e){UKe(e)})),this.tbarAlign){var e=this.element.querySelector("."+lSt);[].slice.call(e.children).forEach((function(e){UKe(e)})),this.tbarAlign=!1,this.remove(e,kSt)}this.clearProperty()},t.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,cSt),this.destroyScroll()),this.remove(this.element,zSt),this.remove(this.element,HSt);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,ISt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},t.prototype.add=function(e,t){e.classList.add(t)},t.prototype.remove=function(e,t){e.classList.remove(t)},t.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},t.prototype.clstElement=function(e,t){return e&&this.popObj&&WKe(this.popObj.element)?this.popObj.element.querySelector("."+sSt):this.element===t||e?this.element.querySelector("."+sSt+":not(."+mSt+" ):not(."+uSt+" ):not(."+OSt+" )"):eGe(t,"."+sSt)},t.prototype.keyHandling=function(e,t,n,r,o){var a,i,l=this.popObj,s=this.element,c={name:"FadeOut",duration:100},u="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":if(this.isVertical)return;s===n?this.elementFocus(e):r||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;r||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var d=eGe(e,".e-popup"),h=this.element.querySelector("."+LSt);"Extended"===this.overflowMode&&h&&h.classList.contains("e-popup-open")&&(d="end"===t.action?h:null),d?WKe(this.popObj.element)&&(i=[].slice.call(d.children),a="home"===t.action?i[0]:i[i.length-1]):(i=this.element.querySelectorAll("."+lSt+" ."+sSt+":not(."+uSt+")"),a="home"===t.action?i[0]:i[i.length-1]),a&&this.elementFocus(a)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(l&&eGe(n,".e-popup")){var p=l.element,f=p.firstElementChild;if("previous"===u&&f===e||"next"===u&&p.lastElementChild===e)return;this.eleFocus(e,u)}else"moveDown"===t.action&&l&&WKe(l.element)&&this.elementFocus(e);break;case"tab":if(!o&&!r){var m=e.firstElementChild;s===n&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(m),m.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":l&&"Extended"!==this.overflowMode&&l.hide(c);break;case"popupOpen":if(!r)return;l&&!WKe(l.element)?(l.element.style.top=s.offsetHeight+"px",l.show({name:"FadeIn",duration:100})):l.hide(c)}},t.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains(mSt)){e.preventDefault();var n=t.classList.contains(wSt),r=t.classList.contains(xSt),o=this.clstElement(n,t);(o||r)&&this.keyHandling(o,e,t,n,r)}},t.prototype.disable=function(e){var t=this.element;e?t.classList.add(mSt):t.classList.remove(mSt),t.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(WKe(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},t.prototype.eleContains=function(e){return e.classList.contains(uSt)||e.classList.contains(mSt)||e.getAttribute("disabled")||e.classList.contains(OSt)||!WKe(e)},t.prototype.eleFocus=function(e,t){var n=Object(e)[t+"ElementSibling"];if(n){if(this.eleContains(n))return void this.eleFocus(n,t);this.elementFocus(n)}else if(this.tbarAlign){var r=Object(e.parentElement)[t+"ElementSibling"];if(ZUe(r)||0!==r.children.length||(r=Object(r)[t+"ElementSibling"]),!ZUe(r)&&r.children.length>0)if("next"===t){var o=r.querySelector("."+sSt);this.eleContains(o)?this.eleFocus(o,t):(o.firstElementChild.focus(),this.activeEleSwitch(o))}else{o=r.lastElementChild;this.eleContains(o)?this.eleFocus(o,t):this.elementFocus(o)}}},t.prototype.clickHandler=function(e){var t,n=this,r=e.target,o=this.element,a=!ZUe(eGe(r,"."+CSt)),i=r.classList,l=eGe(r,"."+wSt);l||(l=r),o.children[0].classList.contains("e-hscroll")||o.children[0].classList.contains("e-vscroll")||!i.contains(wSt)||(i=r.querySelector(".e-icons").classList),(i.contains(dSt)||i.contains(hSt))&&this.popupClickHandler(o,l,cSt);var s=eGe(e.target,"."+sSt);if(!ZUe(s)&&!s.classList.contains(mSt)||l.classList.contains(wSt)){if(s)t=this.items[this.tbarEle.indexOf(s)];var c={originalEvent:e,item:t};t&&!ZUe(t.click)&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",c),c.cancel||this.trigger("clicked",c,(function(e){!ZUe(n.popObj)&&a&&!e.cancel&&"Popup"===n.overflowMode&&e.item&&"Input"!==e.item.type&&n.popObj.hide({name:"FadeOut",duration:100})}))}},t.prototype.popupClickHandler=function(e,t,n){var r=this.popObj;WKe(r.element)?(t.classList.remove(_St),r.hide({name:"FadeOut",duration:100})):(e.classList.contains(n)&&(r.enableRtl=!0,r.position={X:"left",Y:"top"}),0!==r.offsetX||e.classList.contains(n)||(r.enableRtl=!1,r.position={X:"right",Y:"top"}),r.dataBind(),r.refreshPosition(),r.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(r.element.style.minHeight="0px"),t.classList.add(_St),r.show({name:"FadeIn",duration:100}))},t.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},t.prototype.initialize=function(){var e=qUe(this.width),t=qUe(this.height);"msie"===zKe.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||tGe(this.element,{height:t}),tGe(this.element,{width:e});var n={role:"toolbar","aria-disabled":"false","aria-haspopup":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};GKe(this.element,n),this.cssClass&&ZKe([this.element],this.cssClass.split(" "))},t.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},t.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},t.prototype.itemsAlign=function(e,t){var n,r;this.tbarEle||(this.tbarEle=[]);for(var o=0;o<e.length;o++)n=this.renderSubComponent(e[o],o),-1===this.tbarEle.indexOf(n)&&this.tbarEle.push(n),this.tbarAlign||this.tbarItemAlign(e[o],t,o),(r=t.querySelector(".e-toolbar-"+e[o].align.toLowerCase()))?(e[o].showAlwaysInPopup&&"Show"!==e[o].overflow||this.tbarAlgEle[(e[o].align+"s").toLowerCase()].push(n),r.appendChild(n)):t.appendChild(n);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},t.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(iSt),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(iSt),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),tGe(this.element,{height:qUe(this.height),width:qUe(this.width)})),this.destroyMode(),this.refreshOverflow()},t.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+lSt+" ."+ESt).removeAttribute("style"),this.isVertical?this.scrollModule=new zkt({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new Ekt({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&ZKe([t[0]],this.cssClass.split(" ")),this.remove(this.scrollModule.element,kSt),tGe(this.element,{overflow:"hidden"}))},t.prototype.itemWidthCal=function(e){var t,n=this,r=0;return[].slice.call(QKe("."+sSt,e)).forEach((function(e){WKe(e)&&(t=window.getComputedStyle(e),r+=n.isVertical?e.offsetHeight:e.offsetWidth,r+=parseFloat(n.isVertical?t.marginTop:t.marginRight),r+=parseFloat(n.isVertical?t.marginBottom:t.marginLeft))})),r},t.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},t.prototype.checkOverflow=function(e,t){if(ZUe(e)||ZUe(t)||!WKe(e))return!1;var n=this.isVertical?e.offsetHeight:e.offsetWidth,r=this.isVertical?t.offsetHeight:t.offsetWidth;(this.tbarAlign||this.scrollModule||n===r)&&(r=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t));var o=e.querySelector("."+wSt),a=e.querySelector("."+xSt),i=0;return o?i=this.isVertical?o.offsetHeight:o.offsetWidth:a&&(i=this.isVertical?2*a.offsetHeight:2*a.offsetWidth),r>n-i},t.prototype.refreshOverflow=function(){this.resize()},t.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,kSt),this.itemPositioning())},t.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+lSt),n=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===zKe.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":ZUe(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(lSt)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||n)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,ISt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,DSt)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==zKe.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,HSt),(this.checkOverflow(e,t)||n)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},t.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(QKe("."+lSt+" ."+sSt,e))),this.element.querySelector("."+wSt).setAttribute("tabIndex","0"),this.element.querySelector("."+wSt).setAttribute("role","list")},t.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+uSt)),n=e.querySelector("."+PSt),r=e.querySelector("."+TSt),o="MultiRow"===this.overflowMode?n:r;null!==o&&("MultiRow"===this.overflowMode?o.classList.remove(PSt):"Extended"===this.overflowMode&&o.classList.remove(TSt));for(var a=0;a<=t.length-1;a++)t[a].offsetLeft<30&&0!==t[a].offsetLeft&&("MultiRow"===this.overflowMode?t[a].classList.add(PSt):"Extended"===this.overflowMode&&t[a].classList.add(TSt))},t.prototype.createPopupEle=function(e,t){var n=e.querySelector("."+wSt),r=this.isVertical;n||this.createPopupIcon(e),n=e.querySelector("."+wSt);var o=r?n.offsetHeight:n.offsetWidth,a=(r?e.offsetHeight:e.offsetWidth)-o;this.element.classList.remove("e-rtl"),tGe(this.element,{direction:"initial"}),this.checkPriority(e,t,a,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},t.prototype.pushingPoppedEle=function(e,t,n,r,o){var a=e.element,i=[].slice.call(QKe("."+MSt,a.querySelector("."+lSt))),l=QKe("."+bSt,n),s=0,c=0;i.forEach((function(a,i){l=QKe("."+bSt,n),a.classList.contains(bSt)&&l.length>0?e.tbResize&&l.length>i?(n.insertBefore(a,l[i]),++c):(n.insertBefore(a,n.children[l.length]),++c):a.classList.contains(bSt)||e.tbResize&&a.classList.contains(ySt)&&n.children.length>0&&0===l.length?(n.insertBefore(a,n.firstChild),++c):a.classList.contains(ySt)?t.push(a):e.tbResize?(n.insertBefore(a,n.childNodes[s+c]),++s):n.appendChild(a),a.classList.contains(uSt)?tGe(a,{display:"",height:o+"px"}):tGe(a,{display:"",height:r+"px"})})),t.forEach((function(e){n.appendChild(e)}));for(var u=QKe("."+sSt,a.querySelector("."+lSt)),d=u.length-1;d>=0;d--){var h=u[d];if(!h.classList.contains(uSt)||"Extended"===this.overflowMode)break;tGe(h,{display:"none"})}},t.prototype.createPopup=function(){var e,t,n=this.element;"Extended"===this.overflowMode&&(t=n.querySelector("."+uSt+":not(."+MSt+")"),e="auto"===n.style.height||""===n.style.height?null:t.offsetHeight);var r,o=n.querySelector("."+sSt+":not(."+uSt+"):not(."+MSt+")"),a="auto"===n.style.height||""===n.style.height?null:o&&o.offsetHeight;if(XKe("#"+n.id+"_popup."+CSt,n))r=XKe("#"+n.id+"_popup."+CSt,n);else{var i=this.createElement("div",{id:n.id+"_popup",className:CSt+" "+LSt}),l=this.createElement("div",{id:n.id+"_popup",className:CSt});r="Extended"===this.overflowMode?i:l}this.pushingPoppedEle(this,[],r,a,e),this.popupInit(n,r)},t.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},t.prototype.popupInit=function(e,t){if(this.popObj){var n=this.popObj.element;tGe(n,{maxHeight:"",display:"block"}),tGe(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(t),this.cssClass&&ZKe([t],this.cssClass.split(" ")),tGe(this.element,{overflow:""});var r=window.getComputedStyle(this.element),o=new IQe(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if(o.appendTo(t),"Extended"===this.overflowMode&&(o.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth),o.offsetX=0),RKe.add(document,"scroll",this.docEvent.bind(this)),RKe.add(document,"click ",this.docEvent.bind(this)),o.element.style.maxHeight=o.element.offsetHeight+"px",this.isVertical&&(o.element.style.visibility="hidden"),this.isExtendedOpen){var a=this.element.querySelector("."+wSt);a.classList.add(_St),nGe(a.firstElementChild,[dSt],[hSt]),this.element.querySelector("."+LSt).classList.add(pSt)}else o.hide();this.popObj=o,this.element.setAttribute("aria-haspopup","true")}},t.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,zSt):this.remove(this.element,zSt))},t.prototype.popupOpen=function(e){var t=this.popObj;this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,o=r.querySelector("."+wSt);tGe(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px","Extended"===this.overflowMode&&(t.element.style.minHeight="");var a=n.offsetTop+n.offsetHeight+KXe(r).top,i=o.firstElementChild;o.classList.add(_St),nGe(i,[dSt],[hSt]),this.tbarPopupHandler(!0);var l=ZUe(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+l<a&&this.element.offsetTop<n.offsetHeight){var s=n.offsetHeight-(a-window.innerHeight-l+5);t.height=s+"px";for(var c=0;c<=n.childElementCount;c++){var u=n.children[c];if(u.offsetTop+u.offsetHeight>s){s=u.offsetTop;break}}tGe(t.element,{maxHeight:s+"px"})}else if(this.isVertical){var d=this.element.getBoundingClientRect();tGe(t.element,{maxHeight:d.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(t){var h=n.getBoundingClientRect();h.right>document.documentElement.clientWidth&&h.width>r.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition()}},t.prototype.popupClose=function(e){var t=this.element.querySelector("."+wSt),n=t.firstElementChild;t.classList.remove(_St),nGe(n,[hSt],[dSt]),this.tbarPopupHandler(!1)},t.prototype.checkPriority=function(e,t,n,r){for(var o,a=this.popupPriCount>0,i=n,l=0,s=0,c=0,u=function(e,t){var n=!1;return t.forEach((function(t){e.classList.contains(t)&&(n=!0)})),n},d=t.length-1;d>=0;d--){var h=void 0,p=window.getComputedStyle(t[d]);this.isVertical?(h=parseFloat(p.marginTop),h+=parseFloat(p.marginBottom)):(h=parseFloat(p.marginRight),h+=parseFloat(p.marginLeft));var f=t[d]===this.tbarEle[0];f&&(this.tbarEleMrgn=h),o=this.isVertical?t[d].offsetHeight:t[d].offsetWidth;var m=f?o+h:o;if(u(t[d],[ASt])&&a&&(t[d].classList.add(MSt),this.isVertical?tGe(t[d],{display:"none",minHeight:m+"px"}):tGe(t[d],{display:"none",minWidth:m+"px"}),c++),this.isVertical?t[d].offsetTop+t[d].offsetHeight+h>n:t[d].offsetLeft+t[d].offsetWidth+h>n){if(t[d].classList.contains(uSt)){if("Extended"===this.overflowMode){if(s===c)u(v=t[d],[uSt,NSt])&&(t[d].classList.add(MSt),c++);s++}else if("Popup"===this.overflowMode){var v;if(l>0&&s===c)u(v=t[d+s+(l-1)],[uSt,NSt])&&tGe(v,{display:"none"});l++,s=0,c=0}}else s++;t[d].classList.contains(bSt)&&r||u(t[d],[uSt,NSt])?n-=(this.isVertical?t[d].offsetHeight:t[d].offsetWidth)+h:(t[d].classList.add(MSt),this.isVertical?tGe(t[d],{display:"none",minHeight:m+"px"}):tGe(t[d],{display:"none",minWidth:m+"px"}),c++)}}if(r){var g=QKe("."+sSt+":not(."+MSt+")",this.element);this.checkPriority(e,g,i,!1)}},t.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),n="e-"+e.id.concat("_nav e-hor-nav");n="Extended"===this.overflowMode?n+" e-expended-nav":n;var r=this.createElement("div",{id:t,className:n});"msie"!==zKe.info.name&&"edge"!==zKe.info.name||r.classList.add("e-ie-align");var o=this.createElement("div",{className:hSt+" e-icons"});r.appendChild(o),r.setAttribute("tabindex","0"),r.setAttribute("role","list"),e.appendChild(r)},t.prototype.tbarPriRef=function(e,t,n,r,o,a,i,l){var s=l,c=this.popObj.element,u="."+sSt+":not(."+uSt+"):not(."+bSt+")",d=QKe("."+MSt+":not(."+bSt+")",c).length,h=function(e,t){return e.classList.contains(t)};if(0===QKe(u,e).length){var p=e.children[t-(t-n)-1],f=!ZUe(p)&&h(p,NSt);if(!ZUe(p)&&h(p,uSt)&&!WKe(p)||f){p.style.display="inherit";var m=p.offsetWidth+2*parseFloat(window.getComputedStyle(p).marginRight),v=p.previousElementSibling;a+m<i||o?(e.insertBefore(r,e.children[t+s-(t-n)]),ZUe(v)||(v.style.display="")):v.classList.contains(uSt)&&(v.style.display="none"),p.style.display=""}else e.insertBefore(r,e.children[t+s-(t-n)])}else e.insertBefore(r,e.children[t+s-d])},t.prototype.popupRefresh=function(e,t){var n=this,r=this.element,o=this.isVertical,a=r.querySelector("."+lSt),i=r.querySelector("."+wSt);if(!ZUe(i)){var l;a.removeAttribute("style"),e.style.display="block",l=o?r.offsetHeight-(i.offsetHeight+a.offsetHeight):r.offsetWidth-(i.offsetWidth+a.offsetWidth);var s=0;[].slice.call(e.children).forEach((function(e){s+=n.popupEleWidth(e),tGe(e,{position:""})})),l+(o?i.offsetHeight:i.offsetWidth)>s&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(l,e,t),e.style.display="",0===e.children.length&&i&&this.popObj&&(UKe(i),i=null,this.popObj.destroy(),UKe(this.popObj.element),this.popObj=null,r.setAttribute("aria-haspopup","false"))}},t.prototype.ignoreEleFetch=function(e,t){var n=[].slice.call(t.querySelectorAll("."+NSt)),r=[],o=0;return n.length>0?(n.forEach((function(e){r.push([].slice.call(t.children).indexOf(e))})),r.forEach((function(t){t<=e&&o++})),o):0},t.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var n=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var r=e.offsetWidth-e.querySelector("."+wSt).offsetWidth,o=e.querySelector("."+lSt).offsetWidth;return t.style.removeProperty("display"),r>n+o},t.prototype.popupEleWidth=function(e){e.style.position="absolute";var t=this.isVertical?e.offsetHeight:e.offsetWidth,n=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains(gSt)){var r=e.children[0];!ZUe(n)&&e.classList.contains(gSt)?n.style.display="none":!ZUe(n)&&e.classList.contains(vSt)&&(n.style.display="block"),r.style.minWidth="0%",t=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),r.style.minWidth="",r.style.minHeight="",ZUe(n)||(n.style.display="")}return t},t.prototype.popupEleRefresh=function(e,t,n){for(var r,o,a=this.popupPriCount>0,i=this.tbarEle,l=this.element.querySelector("."+lSt),s=0,c=function(t){if(t.classList.contains(ASt)&&a&&!n)return"continue";var c=u.popupEleWidth(t);if(t===u.tbarEle[0]&&(c+=u.tbarEleMrgn),t.style.position="",!(c<e||n))return"break";if(tGe(t,{minWidth:"",height:"",minHeight:""}),t.classList.contains(ySt)||t.classList.remove(MSt),o=u.tbarEle.indexOf(t),u.tbarAlign){var d=u.items[o].align;o=u.tbarAlgEle[(d+"s").toLowerCase()].indexOf(t),i=u.tbarAlgEle[(d+"s").toLowerCase()],l=u.element.querySelector("."+lSt+" .e-toolbar-"+d.toLowerCase())}var h=0;"Extended"!==u.overflowMode&&i.slice(0,o).forEach((function(t){(t.classList.contains(bSt)||t.classList.contains(uSt))&&(t.classList.contains(uSt)&&(t.style.display="",e-=t.offsetWidth),h++)})),s=u.ignoreEleFetch(o,l),t.classList.contains(bSt)?(u.tbarPriRef(l,o,h,t,n,c,e,s),e-=t.offsetWidth):0===o?(l.insertBefore(t,l.firstChild),e-=t.offsetWidth):(r=QKe("."+bSt,u.popObj.element).length,l.insertBefore(t,l.children[o+s-r]),e-=t.offsetWidth),t.style.height=""},u=this,d=0,h=[].slice.call(t.children);d<h.length;d++){if("break"===c(h[d]))break}this.checkOverflow(this.element,this.element.getElementsByClassName(lSt)[0])&&!n&&this.renderOverflowMode()},t.prototype.removePositioning=function(){var e=this.element.querySelector("."+lSt);if(!ZUe(e)&&e.classList.contains(kSt)){this.remove(e,kSt);var t=[].slice.call(e.childNodes);t[1].removeAttribute("style"),t[2].removeAttribute("style")}},t.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+lSt);this.add(e,kSt),this.itemPositioning()},t.prototype.itemPositioning=function(){var e,t=this.element.querySelector("."+lSt);if(!ZUe(t)&&t.classList.contains(kSt)){var n,r=this.element.querySelector("."+wSt);if(this.scrollModule){var o=this.isVertical?"e-vscroll-content":"e-hscroll-content";n=[].slice.call(t.querySelector("."+o).children)}else n=[].slice.call(t.childNodes);e=this.isVertical?n[0].offsetHeight+n[2].offsetHeight:n[0].offsetWidth+n[2].offsetWidth;var a=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(r){a-=this.isVertical?r.offsetHeight:r.offsetWidth;var i=(this.isVertical?r.offsetHeight:r.offsetWidth)+"px";n[2].removeAttribute("style"),this.isVertical?this.enableRtl?n[2].style.top=i:n[2].style.bottom=i:this.enableRtl?n[2].style.left=i:n[2].style.right=i}if(!(a<=e)){var l=(a-e-(this.isVertical?n[1].offsetHeight:n[1].offsetWidth))/2;n[1].removeAttribute("style");var s=(this.isVertical?n[0].offsetHeight:n[0].offsetWidth)+l+"px";this.isVertical?this.enableRtl?n[1].style.marginBottom=s:n[1].style.marginTop=s:this.enableRtl?n[1].style.marginRight=s:n[1].style.marginLeft=s}}},t.prototype.tbarItemAlign=function(e,t,n){var r=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var o=[];if(o.push(this.createElement("div",{className:"e-toolbar-left"})),o.push(this.createElement("div",{className:ESt})),o.push(this.createElement("div",{className:"e-toolbar-right"})),0===n&&"Left"!==e.align)o.forEach((function(e){t.appendChild(e)})),this.tbarAlign=!0,this.add(t,kSt);else if("Left"!==e.align){var a=t.childNodes,i=o[0];[].slice.call(a).forEach((function(e){r.tbarAlgEle.lefts.push(e),i.appendChild(e)})),t.appendChild(i),t.appendChild(o[1]),t.appendChild(o[2]),this.tbarAlign=!0,this.add(t,kSt)}}},t.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,lSt),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach((function(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,sSt))}))},t.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var n=void 0;e&&e.children.length>0&&(n=e.querySelector("."+lSt)),n||(n=this.createElement("div",{className:lSt})),this.itemsAlign(t,n),e.appendChild(n)}},t.prototype.setAttr=function(e,t){for(var n,r=Object.keys(e),o=0;o<r.length;o++)"class"===(n=r[o])?this.add(t,e[n]):t.setAttribute(n,e[n])},t.prototype.enableItems=function(e,t){var n,r=e,o=r.length;ZUe(t)&&(t=!0);var a=function(e,t){e?(t.classList.remove(mSt),t.setAttribute("aria-disabled","false")):(t.classList.add(mSt),t.setAttribute("aria-disabled","true"))};if(!ZUe(o)&&o>=1){for(var i=0,l=[].slice.call(r);i<o;i++){var s=l[i];if("number"==typeof s){if(ZUe(n=this.getElementByIndex(s)))return;r[i]=n}else n=s;a(t,n)}t?VKe(r,mSt):ZKe(r,mSt)}else{if("number"==typeof r){if(ZUe(n=this.getElementByIndex(r)))return}else n=e;a(t,n)}},t.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]:null},t.prototype.addItems=function(e,t){var n;this.extendedOpen();var r=this.element.querySelector("."+lSt);if(ZUe(r))this.itemsRerender(e);else{var o,a="Left";ZUe(t)&&(t=0),e.forEach((function(e){ZUe(e.align)||"Left"===e.align||"Left"!==a||(a=e.align)}));for(var i=0,l=e;i<l.length;i++){var s=l[i];if(ZUe(s.type)&&(s.type="Button"),n=QKe("."+sSt,this.element),s.align=a,o=this.renderSubComponent(s,t),this.tbarEle.length>=t&&n.length>=0){ZUe(this.scrollModule)&&this.destroyMode();var c="L"===s.align[0]?0:"C"===s.align[0]?1:2,u=void 0;this.tbarAlign||"Left"===a?this.tbarAlign?((u=eGe(n[0],"."+lSt).children[c]).insertBefore(o,u.children[t]),this.tbarAlgEle[(s.align+"s").toLowerCase()].splice(t,0,o),this.refreshPositioning()):0===n.length?(n=QKe("."+lSt,this.element))[0].appendChild(o):n[0].parentNode.insertBefore(o,n[t]):(this.tbarItemAlign(s,r,1),this.tbarAlign=!0,(u=eGe(n[0],"."+lSt).children[c]).appendChild(o),this.tbarAlgEle[(s.align+"s").toLowerCase()].push(o),this.refreshPositioning()),this.items.splice(t,0,s),s.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,o),t++,this.offsetWid=r.offsetWidth}}r.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},t.prototype.removeItems=function(e){var t,n=e,r=[].slice.call(QKe("."+sSt,this.element));if("number"==typeof n)t=parseInt(e.toString(),10),this.removeItemByIndex(t,r);else if(n&&n.length>1)for(var o=0,a=[].slice.call(n);o<a.length;o++){var i=a[o];t=this.tbarEle.indexOf(i),this.removeItemByIndex(t,r),r=QKe("."+sSt,this.element)}else{i=n&&n.length&&1===n.length?n[0]:e;t=r.indexOf(i),this.removeItemByIndex(t,r)}this.resize()},t.prototype.removeItemByIndex=function(e,t){if(this.tbarEle[e]&&t[e]){var n=this.tbarEle.indexOf(t[e]);if(this.tbarAlign){var r=this.tbarAlgEle[(this.items[n].align+"s").toLowerCase()].indexOf(this.tbarEle[n]);this.tbarAlgEle[(this.items[n].align+"s").toLowerCase()].splice(r,1)}this.isReact&&this.clearTemplate();var o=t[e].querySelector(".e-control.e-btn");ZUe(o)||ZUe(o.ej2_instances[0])||o.ej2_instances[0].isDestroyed||o.ej2_instances[0].destroy(),UKe(t[e]),this.items.splice(n,1),this.tbarEle.splice(n,1)}},t.prototype.templateRender=function(e,t,n,r){var o,a=n.type,i=e;if("object"==typeof e&&(o="function"==typeof i.appendTo),"string"!=typeof e&&o){if("Input"===a){u=this.createElement("input");n.id?u.id=n.id:u.id=jUe("tbr-ipt"),t.appendChild(u),i.appendTo(u)}}else{var l,s=void 0,c=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);l="string"==typeof e?e.trim():e;try{if("object"!=typeof e||ZUe(e.tagName))if("string"==typeof e&&c.test(l))t.innerHTML=l;else if(document.querySelectorAll(l).length){var u,d=(u=document.querySelector(l)).outerHTML.trim();t.appendChild(u),u.style.display="",ZUe(d)||this.tempId.push(l)}else s=LXe(l);else t.appendChild(e)}catch(e){s=LXe(l)}var h=void 0;if(!ZUe(s))h=s({},this,"template",this.element.id+r+"_template",this.isStringTemplate);!ZUe(h)&&h.length>0&&[].slice.call(h).forEach((function(e){ZUe(e.tagName)||(e.style.display=""),t.appendChild(e)}))}this.add(t,fSt),this.tbarEle.push(t)},t.prototype.buttonRendering=function(e,t){var n=this.createElement("button",{className:"e-tbar-btn"});n.setAttribute("type","button");var r,o,a=e.text;e.id?n.id=e.id:n.id=jUe("e-tbr-btn");var i=this.createElement("span",{className:"e-tbar-btn-text"});a?(i.innerHTML=this.enableHtmlSanitizer?YXe.sanitize(a):a,n.appendChild(i),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(r=e.prefixIcon+" e-icons",o="Left"):(r=e.suffixIcon+" e-icons",o="Right"));var l=new BQe({iconCss:r,iconPosition:o});return l.createElement=this.createElement,l.appendTo(n),e.width&&tGe(n,{width:qUe(e.width)}),n},t.prototype.renderSubComponent=function(e,t){var n,r=this.createElement("div",{className:sSt});r.setAttribute("aria-disabled","false");var o=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?YXe.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,r),e.tooltipText&&r.setAttribute("title",o.textContent),e.cssClass&&(r.className=r.className+" "+e.cssClass),e.template)this.templateRender(e.template,r,e,t);else switch(e.type){case"Button":(n=this.buttonRendering(e,r)).setAttribute("tabindex","-1"),n.setAttribute("aria-label",e.text||e.tooltipText),r.appendChild(n),r.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(r,uSt)}if(e.showTextOn){var a=e.showTextOn;"Toolbar"===a?(this.add(r,vSt),this.add(r,"e-tbtn-align")):"Overflow"===a&&this.add(r,gSt)}if(e.overflow){var i=e.overflow;"Show"===i?this.add(r,bSt):"Hide"===i&&(r.classList.contains(uSt)||this.add(r,ySt))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!r.classList.contains(uSt)&&(this.add(r,ASt),this.popupPriCount++),e.disabled&&this.add(r,mSt),!1===e.visible&&this.add(r,OSt),r},t.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},t.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},t.prototype.activeEleRemove=function(e){ZUe(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,ZUe(this.trgtEle)&&!e.parentElement.classList.contains(fSt)?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.getModuleName=function(){return"toolbar"},t.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},t.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var t=this.checkOverflow(e,e.getElementsByClassName(lSt)[0]);if(!t){this.destroyScroll();var n=e.querySelector("."+lSt);ZUe(n)||(this.remove(n,DSt),this.tbarAlign&&this.add(n,kSt))}if(!t||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||t)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var r=window.getComputedStyle(this.element);this.popObj.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth)}this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()}this.element.querySelector("."+SSt)&&(this.scrollStep=this.element.querySelector("."+SSt).offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator()}},t.prototype.extendedOpen=function(){var e=this.element.querySelector("."+LSt);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(pSt))},t.prototype.onPropertyChanged=function(e,t){var n=this.element,r=n.offsetWidth;this.extendedOpen();for(var o=0,a=Object.keys(e);o<a.length;o++){switch(a[o]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var i=Object.keys(e.items),l=0;l<i.length;l++){var s=parseInt(Object.keys(e.items)[l],10),c=Object.keys(e.items[s])[0],u=Object(e.items[s])[c];if("function"!=typeof u){if(this.tbarAlign||"align"===c){this.refresh(),this.trigger("created");break}var d="showAlwaysInPopup"===c&&!u,h="overflow"===c&&0!==this.popupPriCount;(d||this.items[s].showAlwaysInPopup&&h)&&--this.popupPriCount,ZUe(this.scrollModule)&&this.destroyMode();var p=[].slice.call(QKe("."+lSt+" ."+sSt,n));this.isReact&&this.clearTemplate(),UKe(p[s]),this.tbarEle.splice(s,1),this.addItems([this.items[s]],s),this.items.splice(s,1),this.items[s].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":tGe(n,{width:qUe(e.width)}),this.renderOverflowMode(),this.popObj&&r<n.offsetWidth&&this.popupRefresh(this.popObj.element,!1);break;case"height":tGe(this.element,{height:qUe(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(n,cSt),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(n,cSt):this.remove(n,cSt),ZUe(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,cSt):this.remove(this.scrollModule.element,cSt)),ZUe(this.popObj)||(e.enableRtl?this.add(this.popObj.element,cSt):this.remove(this.popObj.element,cSt)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":t.cssClass&&VKe([this.element],t.cssClass.split(" ")),e.cssClass&&ZKe([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}}},t.prototype.hideItem=function(e,t){var n,r,o="object"==typeof e,a=e,i=[].slice.call(QKe("."+sSt,this.element));if(o)r=e;else if(this.tbarEle[a]){r=[].slice.call(QKe("."+sSt,this.element))[a]}if(r){if(t?r.classList.add(OSt):r.classList.remove(OSt),t&&ZUe(this.element.getAttribute("tabindex"))&&!r.classList.contains(uSt)){if(ZUe(r.firstElementChild.getAttribute("tabindex"))){r.firstElementChild.setAttribute("tabindex","-1");var l=[].slice.call(QKe("."+sSt,this.element));o&&(a=l.indexOf(r));for(var s=l[++a];s;){if(!this.eleContains(s)){s.firstElementChild.removeAttribute("tabindex");break}s=l[++a]}}}else if(ZUe(this.element.getAttribute("tabindex"))&&!r.classList.contains(uSt))for(var c=!1,u=!1,d=i[n=0];d;)if(d.classList.contains(uSt))d=i[++n];else if(ZUe(d.firstElementChild.getAttribute("tabindex")))d.firstElementChild.setAttribute("tabindex","-1"),c=!0;else{if(c&&u)break;this.eleContains(d)||(d.firstElementChild.removeAttribute("tabindex"),u=!0),d=i[++n]}this.refreshOverflow()}},aSt([bGe([],RSt)],t.prototype,"items",void 0),aSt([vGe("auto")],t.prototype,"width",void 0),aSt([vGe("auto")],t.prototype,"height",void 0),aSt([vGe("")],t.prototype,"cssClass",void 0),aSt([vGe("Scrollable")],t.prototype,"overflowMode",void 0),aSt([vGe()],t.prototype,"scrollStep",void 0),aSt([vGe(!0)],t.prototype,"enableCollision",void 0),aSt([vGe(!0)],t.prototype,"enableHtmlSanitizer",void 0),aSt([vGe(!0)],t.prototype,"allowKeyboard",void 0),aSt([yGe()],t.prototype,"clicked",void 0),aSt([yGe()],t.prototype,"created",void 0),aSt([yGe()],t.prototype,"destroyed",void 0),aSt([yGe()],t.prototype,"beforeCreate",void 0),t=aSt([wGe],t)}(qGe),$St=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZSt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},VSt="e-tab",jSt="e-tab-header",WSt="e-content",FSt="e-nested",qSt="e-item",YSt="e-template",USt="e-rtl",KSt="e-active",GSt="e-disable",XSt="e-hidden",QSt="e-focused",JSt="e-icons",eCt="e-icon",tCt="e-icon-tab",nCt="e-close-icon",rCt="e-close-show",oCt="e-tab-text",aCt="e-indicator",iCt="e-tab-wrap",lCt="e-text-wrap",sCt="e-tab-icon",cCt="e-toolbar-items",uCt="e-toolbar-item",dCt="e-toolbar-pop",hCt="e-toolbar-popup",pCt="e-progress",fCt="e-overlay",mCt="e-vertical-tab",vCt="e-vertical",gCt="e-vertical-left",bCt="e-vertical-right",yCt="e-horizontal-bottom",wCt="e-fill-mode",xCt="tabitem_",ECt="e-reorder-active-item",kCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([vGe("SlideLeftIn")],t.prototype,"effect",void 0),ZSt([vGe(600)],t.prototype,"duration",void 0),ZSt([vGe("ease")],t.prototype,"easing",void 0),t}(HGe),SCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([gGe({effect:"SlideLeftIn",duration:600,easing:"ease"},kCt)],t.prototype,"previous",void 0),ZSt([gGe({effect:"SlideRightIn",duration:600,easing:"ease"},kCt)],t.prototype,"next",void 0),t}(HGe),CCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([vGe("")],t.prototype,"text",void 0),ZSt([vGe("")],t.prototype,"iconCss",void 0),ZSt([vGe("left")],t.prototype,"iconPosition",void 0),t}(HGe),MCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $St(t,e),ZSt([gGe({},CCt)],t.prototype,"header",void 0),ZSt([vGe(null)],t.prototype,"headerTemplate",void 0),ZSt([vGe("")],t.prototype,"content",void 0),ZSt([vGe("")],t.prototype,"cssClass",void 0),ZSt([vGe(!1)],t.prototype,"disabled",void 0),ZSt([vGe(!0)],t.prototype,"visible",void 0),ZSt([vGe()],t.prototype,"id",void 0),t}(HGe),_Ct=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.show={},r.hide={},r.maxHeight=0,r.title="Close",r.isInteracted=!1,r.lastIndex=0,r.isAdd=!1,r.isIconAlone=!1,r.draggableItems=[],r.resizeContext=r.refreshActiveTabBorder.bind(r),r.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},r}return $St(t,e),t.prototype.destroy=function(){var t=this;if((this.isReact||this.isAngular)&&this.clearTemplate(),ZUe(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation","aria-owns"].forEach((function(e){t.element.removeAttribute(e)})),this.expTemplateContent(),this.isTemplate){var n=XKe(".e-tab > ."+WSt,this.element);this.element.classList.remove(YSt),ZUe(n)||(n.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)KKe(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var r=0;r<this.draggableItems.length;r++)this.draggableItems[r].destroy(),this.draggableItems[r]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},t.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},t.prototype.preRender=function(){var e=eGe(this.element,"."+WSt);this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=ZUe(this.dragArea)?"#"+this.element.id+" ."+jSt:this.dragArea),ZUe(e)||(e.parentElement.classList.add(FSt),this.isNested=!0);var t=zKe.info.name,n="msie"===t?"e-ie":"edge"===t?"e-edge":"safari"===t?"e-safari":"";tGe(this.element,{width:qUe(this.width),height:qUe(this.height)}),this.setCssClass(this.element,this.cssClass,!0),GKe(this.element,{role:"tablist","aria-disabled":"false","aria-activedescendant":"","aria-owns":this.element.id+"_tab_header_items"}),this.setCssClass(this.element,n,!0),this.updatePopAnimationConfig()},t.prototype.render=function(){this.btnCls=this.createElement("span",{className:JSt+" "+nCt,attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:"-"+Math.random().toString(36).substr(2,5),this.renderContainer(),this.wireEvents(),this.initRender=!1},t.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach((function(e,t){ZUe(e.id)&&!ZUe(e.setProperties)&&e.setProperties({id:xCt+t.toString()},!0)})),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:WSt})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:jSt})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add(YSt);var t=e.querySelector("."+jSt);t&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,t)}if(!ZUe(XKe("."+jSt,this.element))&&!ZUe(XKe("."+WSt,this.element))){if(this.renderHeader(),this.tbItems=XKe("."+jSt+" ."+cCt,this.element),ZUe(this.tbItems)||_Ge(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),QKe("."+uCt,this.element).length>0){this.tbItems=XKe("."+jSt+" ."+cCt,this.element),this.bdrLine=this.createElement("div",{className:aCt+" "+XSt+" e-ignore"});var n=XKe("."+this.scrCntClass,this.tbItems);ZUe(n)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):n.insertBefore(this.bdrLine,n.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}if(!ZUe(this.tbItem))for(var r=0;r<this.items.length;r++)if(this.items[r]){var o=this.items[r].id;this.tbItem[r].setAttribute("data-id",o)}this.setRTL(this.enableRtl)}},t.prototype.renderHeader=function(){var e=this,t=this.headerPlacement,n=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(jSt)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r=this.hdrEle.children.length,o=[],a=0;a<r;a++)o.push(this.hdrEle.children.item(a).innerHTML);if(r>0){for(;this.hdrEle.firstElementChild;)UKe(this.hdrEle.firstElementChild);var i=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(i),o.forEach((function(t,n){e.lastIndex=n;var r={className:qSt,id:qSt+e.tabId+"_"+n,attrs:{role:"tab","aria-controls":WSt+e.tabId+"_"+n,"aria-selected":"false"}},o=e.createElement("span",{className:oCt,innerHTML:t,attrs:{role:"presentation"}}).outerHTML,a=e.createElement("div",{className:lCt,innerHTML:o+e.btnCls.outerHTML}).outerHTML,l=e.createElement("div",{className:iCt,innerHTML:a,attrs:{tabIndex:"-1"}});i.appendChild(e.createElement("div",r)),QKe("."+qSt,i)[n].appendChild(l)}))}}else n=this.parseObject(this.items,0);this.tbObj=new BSt({width:"Left"===t||"Right"===t?"auto":"100%",height:"Left"===t||"Right"===t?"100%":"auto",overflowMode:this.overflowMode,items:0!==n.length?n:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),GKe(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton);var l=this.tbObj.element.querySelector("."+cCt);ZUe(l)||((ZUe(l.id)||""===l.id)&&(l.id=this.element.id+"_tab_header_items"),this.element.setAttribute("aria-owns",l.id))},t.prototype.renderContent=function(){this.cntEle=XKe("."+WSt,this.element);var e=QKe("."+uCt,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,n=0;n<e.length;n++)t.length-1>=n&&(ZKe([t.item(n)],qSt),GKe(t.item(n),{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_"+n}),t.item(n).id=WSt+this.tabId+"_"+n)}},t.prototype.reRenderItems=function(){this.renderContainer(),ZUe(this.cntEle)||(this.touchModule=new uXe(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},t.prototype.parseObject=function(e,t){var n=this,r=QKe(".e-tab-header ."+uCt,this.element),o=this.lastIndex;if(!this.isReplace&&r.length>0){var a=[];r.forEach((function(e){a.push(parseInt(e.id.slice(e.id.indexOf("_")+1),10))})),o=Math.max.apply(Math,a)}var i,l=[],s=[];return e.forEach((function(e,a){var c=ZUe(e.header)||ZUe(e.header.iconPosition)?"":e.header.iconPosition,u=ZUe(e.header)||ZUe(e.header.iconCss)?"":e.header.iconCss;if(ZUe(e.headerTemplate)&&(ZUe(e.header)||ZUe(e.header.text)||0===e.header.text.length&&""===u))s.push(a);else{var d,h=e.headerTemplate||e.header.text;if("string"==typeof h&&n.enableHtmlSanitizer&&(h=YXe.sanitize(h)),n.isReplace&&!ZUe(n.tbId)&&""!==n.tbId){var p=n.tbId.indexOf("_");d=parseInt(n.tbId.substring(p+1),10),n.tbId=""}else d=t+a;n.lastIndex=0===r.length?a:n.isReplace?d:o+1+a;var f=e.disabled?" "+GSt+" "+fCt:"",m=!1===e.visible?" "+XSt:"";i=n.createElement("div",{className:oCt,attrs:{role:"presentation"}});var v=h instanceof Object?h.outerHTML:h,g=!ZUe(v)&&""!==v;ZUe(h.tagName)?n.headerTextCompile(i,h,a):i.appendChild(h);var b=n.createElement("span",{className:JSt+" "+sCt+" "+eCt+"-"+c+" "+u}),y=n.createElement("div",{className:lCt});y.appendChild(i),""!==h&&void 0!==h&&""!==u?("left"===c||"top"===c?y.insertBefore(b,y.firstElementChild):y.appendChild(b),n.isIconAlone=!1):(""===u?i:b)===b&&(UKe(i),y.appendChild(b),n.isIconAlone=!0);var w=e.disabled?{}:{tabIndex:"-1"};y.appendChild(n.btnCls.cloneNode(!0));var x=n.createElement("div",{className:iCt,attrs:w});x.appendChild(y),n.itemIndexArray===[]?n.itemIndexArray.push(qSt+n.tabId+"_"+n.lastIndex):n.itemIndexArray.splice(t+a,0,qSt+n.tabId+"_"+n.lastIndex);var E={htmlAttributes:{id:qSt+n.tabId+"_"+n.lastIndex,role:"tab","aria-selected":"false"},template:x};E.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+f+" "+m+" "+(""!==u?"e-i"+c:"")+" "+(g?"":eCt),"top"!==c&&"bottom"!==c||n.element.classList.add("e-vertical-icon"),l.push(E),a++}})),this.isAdd||s.forEach((function(e){n.items.splice(e,1)})),this.isIconAlone?this.element.classList.add(tCt):this.element.classList.remove(tCt),l},t.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var t=QKe("."+uCt+"."+KSt,e);[].slice.call(t).forEach((function(e){return e.classList.remove(KSt)}))}},t.prototype.checkPopupOverflow=function(e){this.tbPop=XKe("."+dCt,this.element);var t=XKe(".e-hor-nav",this.element),n=XKe("."+cCt,this.element),r=n.lastChild,o=!1;return(!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>n.offsetLeft||!this.enableRtl&&t.offsetLeft<n.offsetWidth)||this.isVertical()&&t.offsetTop<r.offsetTop+r.offsetHeight)&&(o=!0),o&&(e.classList.add(hCt),this.tbPop.insertBefore(e,QKe("."+hCt,this.tbPop)[0])),!0},t.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element");ZUe(t)||(t.outerHTML="",e.querySelector("."+iCt).classList.remove("e-ripple")),this.tbItem=QKe("."+cCt+" ."+uCt,this.hdrEle);var n=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(hCt),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(n)){var r=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(r)}this.isPopup=!0}return QKe("."+uCt,this.tbItems).length-1},t.prototype.updateOrientationAttribute=function(){GKe(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},t.prototype.setCloseButton=function(e){var t=XKe("."+jSt,this.element);!0===e?t.classList.add(rCt):t.classList.remove(rCt),this.tbObj.refreshOverflow(),this.refreshActiveTabBorder()},t.prototype.prevCtnAnimation=function(e,t){return this.enableRtl||this.element.classList.contains(USt),this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},t.prototype.triggerPrevAnimation=function(e,t){var n=this,r=this.prevCtnAnimation(t,this.selectedItem);ZUe(r)?e.classList.remove(KSt):(r.begin=function(){tGe(e,{position:"absolute"}),e.classList.add(pCt),e.classList.add("e-view")},r.end=function(){e.style.display="none",e.classList.remove(KSt),e.classList.remove(pCt),e.classList.remove("e-view"),tGe(e,{display:"",position:""}),0!==e.childNodes.length||n.isTemplate||UKe(e)},new MGe(r).animate(e))},t.prototype.triggerAnimation=function(e,t){var n,r=this,o=this.prevIndex;[].slice.call(this.element.querySelector("."+WSt).children).forEach((function(e){e.id===r.prevActiveEle&&(n=e)}));var a=this.tbItem[o],i=this.getTrgContent(this.cntEle,this.extIndex(e));if(ZUe(n)&&!ZUe(a)){var l=this.extIndex(a.id);n=this.getTrgContent(this.cntEle,l)}if(ZUe(i)||(this.prevActiveEle=i.id),this.initRender||!1===t||this.animation==={}||ZUe(this.animation))n&&n!==i&&n.classList.remove(KSt);else{var s,c=XKe("."+WSt,this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var u=this.animation.previous.effect;s={name:"None"===u?"":"SlideLeftIn"!==u?u:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var d=this.animation.next.effect;s={name:"None"===d?"":"SlideRightIn"!==d?d:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}s.progress=function(){c.classList.add(pCt),r.setActiveBorder()},s.end=function(){c.classList.remove(pCt),i.classList.add(KSt)},this.initRender||ZUe(n)||this.triggerPrevAnimation(n,o),this.isPopup=!1,""===s.name?i.classList.add(KSt):new MGe(s).animate(i)}},t.prototype.keyPressed=function(e){var t=eGe(e,"."+jSt+" ."+uCt),n=this.getEleIndex(t);!ZUe(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():ZUe(t)||!1!==t.classList.contains(KSt)||(this.selectTab(n,null,!0),ZUe(this.popEle)||this.popObj.hide(this.hide))},t.prototype.getTabHeader=function(){if(!ZUe(this.element)){var e=[].slice.call(this.element.children).filter((function(e){return e.classList.contains(jSt)}));if(e.length>0)return e[0];var t=[].slice.call(this.element.children).filter((function(e){return!e.classList.contains("blazor-template")}))[0];if(t)return[].slice.call(t.children).filter((function(e){return e.classList.contains(jSt)}))[0]}},t.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(QKe("."+uCt,this.getTabHeader()),e)},t.prototype.extIndex=function(e){return e.replace(qSt+this.tabId+"_","")},t.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach((function(t){ZUe(e.element.querySelector(t))||(document.body.appendChild(e.element.querySelector(t)).style.display="none")}))},t.prototype.templateCompile=function(e,t,n){var r=this.createElement("div");this.compileElement(r,t,"content",n),0!==r.childNodes.length&&e.appendChild(r),this.isReact&&this.renderReactTemplates()},t.prototype.compileElement=function(e,t,n,r){var o,a;"string"==typeof t?(t=t.trim(),this.isVue?o=LXe(YXe.sanitize(t)):e.innerHTML=YXe.sanitize(t)):o=LXe(t),ZUe(o)||(a=o({},this,n)),!ZUe(o)&&a.length>0&&[].slice.call(a).forEach((function(t){e.appendChild(t)}))},t.prototype.headerTextCompile=function(e,t,n){this.compileElement(e,t,"headerTemplate",n)},t.prototype.getContent=function(e,t,n,r){var o;if("string"==typeof(t=ZUe(t)?"":t)||ZUe(t.innerHTML))if("string"==typeof t&&this.enableHtmlSanitizer&&(t=YXe.sanitize(t)),"."===t[0]||"#"===t[0])if(document.querySelectorAll(t).length){var a=document.querySelector(t);o=a.outerHTML.trim(),"clone"===n?e.appendChild(a.cloneNode(!0)):(e.appendChild(a),a.style.display="")}else this.templateCompile(e,t,r);else this.templateCompile(e,t,r);else e.appendChild(t);ZUe(o)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},t.prototype.getTrgContent=function(e,t){return this.element.classList.contains(FSt)?XKe("."+FSt+"> ."+WSt+" > #"+WSt+this.tabId+"_"+t,this.element):this.findEle(e.children,WSt+this.tabId+"_"+t)},t.prototype.findEle=function(e,t){for(var n,r=0;r<e.length;r++)if(e[r].id===t){n=e[r];break}return n},t.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},t.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?gCt:bCt;ZKe([this.hdrEle],[vCt,e]),this.element.classList.contains(FSt)?ZKe([this.hdrEle],[mCt,e]):ZKe([this.element],[mCt,e])}"Bottom"===this.headerPlacement&&ZKe([this.hdrEle],[yCt])},t.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},t.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var t=this.hdrEle.querySelector("."+KSt),n=!!this.hdrEle.classList.contains(vCt);VKe([this.element],[mCt]),VKe([this.hdrEle],[vCt,gCt,bCt]),n!==this.isVertical()&&(this.changeToolbarOrientation(),!ZUe(t)&&t.classList.contains(hCt)&&this.popupHandler(t)),this.addVerticalClass(),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},t.prototype.focusItem=function(){var e=XKe(" #"+qSt+this.tabId+"_"+this.selectedItem,this.hdrEle);ZUe(e)||e.firstElementChild.focus()},t.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},t.prototype.setOrientation=function(e,t){var n=Array.prototype.indexOf.call(this.element.children,t),r=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+WSt));"Bottom"===e&&r>n?this.element.appendChild(t):(VKe([t],[yCt]),this.element.insertBefore(t,XKe("."+WSt,this.element)))},t.prototype.setCssClass=function(e,t,n){if(""!==t)for(var r=t.split(" "),o=0;o<r.length;o++)n?e.classList.add(r[o]):e.classList.remove(r[o])},t.prototype.setContentHeight=function(e){if(this.element.classList.contains(wCt)&&VKe([this.element],[wCt]),!ZUe(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode){if("auto"===this.height)return;this.isVertical()||tGe(this.cntEle,{height:this.element.offsetHeight-t.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)ZKe([this.element],[wCt]),tGe(this.element,{height:"100%"}),tGe(this.cntEle,{height:this.element.offsetHeight-t.offsetHeight+"px"});else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var n=QKe("."+WSt+" > ."+qSt,this.element),r=0;r<n.length;r++)n[r].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n[r])),n[r].style.removeProperty("display"),n[r].style.removeProperty("visibility");else{this.cntEle=XKe("."+WSt,this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:WSt+this.tabId+"_0",className:qSt+" "+KSt,attrs:{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_0"}}));var o=this.cntEle.children.item(0);for(r=0;r<this.items.length;r++)for(this.getContent(o,this.items[r].content,"clone",r),this.maxHeight=Math.max(this.maxHeight,this.getHeight(o));o.firstChild;)o.removeChild(o.firstChild);this.isReact&&this.clearTemplate(["content"]),this.templateEle=[],this.getContent(o,this.items[0].content,"render",0),this.prevIndex!==this.selectedItem&&o.classList.remove(KSt)}tGe(this.cntEle,{height:this.maxHeight+"px"})}else tGe(this.cntEle,{height:"auto"})}},t.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},t.prototype.setActiveBorder=function(){var e=this.getTabHeader(),t=XKe("."+uCt+"."+KSt,e);if(!ZUe(t)){this.reorderActiveTab?e&&e.classList.remove(ECt):(t.classList.contains(hCt)&&!this.bdrLine.classList.contains(XSt)&&this.bdrLine.classList.add(XSt),e&&!e.classList.contains(ECt)&&e.classList.add(ECt));var n=eGe(t,"."+VSt);if(this.element===n){this.tbItems=XKe("."+cCt,e);var r=XKe("."+aCt,e),o=XKe("."+cCt+" ."+this.scrCntClass,e);if(this.isVertical()){tGe(r,{left:"",right:""}),tGe(r,0!==(ZUe(o)?this.tbItems.offsetHeight:o.offsetHeight)?{top:t.offsetTop+"px",height:t.offsetHeight+"px"}:{top:0,height:0})}else{if("MultiRow"===this.overflowMode)tGe(XKe("."+aCt,this.element),{top:t.offsetHeight+t.offsetTop+"px",height:""});else tGe(r,{top:"",height:""});var a=ZUe(o)?this.tbItems.offsetWidth:o.offsetWidth;tGe(r,0!==a?{left:t.offsetLeft+"px",right:a-(t.offsetLeft+t.offsetWidth)+"px"}:{left:"auto",right:"auto"})}ZUe(this.bdrLine)||t.classList.contains(hCt)||this.bdrLine.classList.remove(XSt)}}},t.prototype.setActive=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1),this.tbItem=QKe("."+uCt,this.getTabHeader());var r=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length))if(e>=0&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),r.classList.contains(KSt))this.setActiveBorder();else{if(!this.isTemplate){var o=this.tbItem[this.prevIndex];ZUe(o)||o.removeAttribute("aria-controls"),GKe(r,{"aria-controls":WSt+this.tabId+"_"+e})}var a=r.id;this.removeActiveClass(),r.classList.add(KSt),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),r.setAttribute("aria-selected","true");var i=Number(this.extIndex(a));if(ZUe(this.prevActiveEle)&&(this.prevActiveEle=WSt+this.tabId+"_"+i),GKe(this.element,{"aria-activedescendant":a}),this.isTemplate){if(XKe("."+WSt,this.element).children.length>0){var l=this.findEle(XKe("."+WSt,this.element).children,WSt+this.tabId+"_"+i);ZUe(l)||l.classList.add(KSt),this.triggerAnimation(a,this.enableAnimation)}}else{this.cntEle=XKe(".e-tab > ."+WSt,this.element);var s=this.getTrgContent(this.cntEle,this.extIndex(a));if(ZUe(s)){this.cntEle.appendChild(this.createElement("div",{id:WSt+this.tabId+"_"+this.extIndex(a),className:qSt+" "+KSt,attrs:{role:"tabpanel","aria-labelledby":qSt+this.tabId+"_"+this.extIndex(a)}}));var c=this.getTrgContent(this.cntEle,this.extIndex(a)),u=Array.prototype.indexOf.call(this.itemIndexArray,a);this.getContent(c,this.items[u].content,"render",u)}else s.classList.add(KSt);this.triggerAnimation(a,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(r),!this.initRender&&!t){r.firstElementChild.focus();var d={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:r,selectedIndex:e,selectedContent:XKe("#"+WSt+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:n};this.trigger("selected",d)}}},t.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=XKe("."+cCt,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},t.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,USt,e),this.refreshActiveBorder()},t.prototype.refreshActiveBorder=function(){ZUe(this.bdrLine)||this.bdrLine.classList.add(XSt),this.setActiveBorder()},t.prototype.showPopup=function(e){var t=XKe(".e-popup.e-toolbar-pop",this.hdrEle);if(t.classList.contains("e-popup-close")){var n=t&&t.ej2_instances[0];n.position.X="Left"===this.headerPlacement?"left":"right",n.dataBind(),n.show(e)}},t.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector("."+jSt);if(t)t.querySelectorAll("."+uCt).forEach((function(t){e.initializeDrag(t)}))}},t.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),RKe.add(this.element,"mouseover",this.hoverHandler,this),RKe.add(this.element,"keydown",this.spaceKeyDown,this),ZUe(this.cntEle)||(this.touchModule=new uXe(this.cntEle,{swipe:this.swipeHandler.bind(this)})),this.keyModule=new oXe(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new oXe(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},t.prototype.unWireEvents=function(){ZUe(this.keyModule)||this.keyModule.destroy(),ZUe(this.tabKeyModule)||this.tabKeyModule.destroy(),ZUe(this.cntEle)||ZUe(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),RKe.remove(this.element,"mouseover",this.hoverHandler),RKe.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(USt),this.element.classList.remove(QSt)},t.prototype.clickHandler=function(e){this.element.classList.remove(QSt);var t=e.originalEvent.target,n=eGe(t,"."+uCt),r=this.getEleIndex(n);t.classList.contains(nCt)?this.removeTab(r):this.isVertical()&&eGe(t,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,ZUe(n)||r===this.selectedItem&&r===this.prevIndex||this.selectTab(r,e.originalEvent,!0))},t.prototype.swipeHandler=function(e){if(!(e.velocity<3&&ZUe(e.originalEvent.changedTouches))){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var n=this.selectedItem-1;n>=0;n--)if(!this.tbItem[n].classList.contains(XSt)){this.selectTab(n,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==QKe("."+uCt,this.element).length-1)for(var r=this.selectedItem+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(XSt)){this.selectTab(r,null,!0);break}this.isSwipeed=!1}}},t.prototype.spaceKeyDown=function(e){(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(ZUe(eGe(e.target,"."+jSt))||e.preventDefault())},t.prototype.keyHandler=function(e){if(!this.element.classList.contains(GSt)){this.element.classList.add(QSt);var t=e.target,n=this.getTabHeader(),r=XKe("."+KSt,n);this.popEle=XKe("."+dCt,n),ZUe(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var o=eGe(document.activeElement,"."+uCt),a=eGe(t,"."+uCt);switch(e.action){case"space":case"enter":if(t.parentElement.classList.contains(GSt))return;if("enter"===e.action&&t.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(t);break;case"tab":case"shiftTab":t.classList.contains(iCt)&&!1===eGe(t,"."+uCt).classList.contains(KSt)&&t.setAttribute("tabindex","-1"),this.popObj&&WKe(this.popObj.element)&&this.popObj.hide(this.hide),r.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":ZUe(o)||this.refreshItemVisibility(o);break;case"openPopup":e.preventDefault(),!ZUe(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!ZUe(a)){var i=a.nextSibling;!ZUe(i)&&i.classList.contains(uCt)&&i.firstElementChild.focus(),this.removeTab(this.getEleIndex(a))}this.setActiveBorder()}}},t.prototype.refreshActiveTabBorder=function(){var e=XKe("."+uCt+"."+hCt+"."+KSt,this.element);!ZUe(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},t.prototype.refreshItemVisibility=function(e){var t=XKe("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!ZUe(t)){var n=XKe(".e-hscroll-bar",this.tbItems),r=n.scrollLeft,o=r+n.offsetWidth,a=e.offsetLeft,i=e.offsetWidth,l=e.offsetLeft+e.offsetWidth;if(r<a&&o<l){var s=o-a;n.scrollLeft=r+(i-s)}else if(r>a&&o>l){s=l-r;n.scrollLeft=r-(i-s)}}},t.prototype.hoverHandler=function(e){var t=e.target;!ZUe(t.classList)&&t.classList.contains(nCt)&&t.setAttribute("title",new aXe("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},t.prototype.evalOnPropertyChangeItems=function(e,t){if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,ZUe(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var n=XKe(".e-tab > ."+WSt,this.element);n.firstElementChild;)UKe(n.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else for(var r=Object.keys(e.items),o=0;o<r.length;o++)for(var a=parseInt(Object.keys(e.items)[o],10),i=Object.keys(e.items[a]),l=0;l<i.length;l++){var s=Object(t.items[a])[i[l]],c=Object(e.items[a])[i[l]],u=this.element.querySelectorAll("."+uCt)[a],d=void 0;if(u&&!ZUe(u.id)&&""!==u.id){var h=u.id.lastIndexOf("_");d=parseInt(u.id.substring(h+1),10)}else d=a;var p=XKe("."+cCt+" #"+qSt+this.tabId+"_"+d,this.element),f=XKe("."+WSt+" #"+WSt+this.tabId+"_"+d,this.element);if("header"===i[l]||"headerTemplate"===i[l]){var m=ZUe(this.items[a].header)||ZUe(this.items[a].header.iconCss)?"":this.items[a].header.iconCss;if(""===(this.items[a].headerTemplate||this.items[a].header.text)&&""===m)this.removeTab(a);else{this.tbId=u.id;var v=[];v.push(this.items[a]),this.items.splice(a,1),this.itemIndexArray.splice(a,1),this.tbObj.items.splice(a,1);var g=p.classList.contains(XSt);UKe(p),this.isReplace=!0,this.addTab(v,a),g&&this.hideTab(a),this.isReplace=!1}}if("content"===i[l]&&!ZUe(f))if(("string"==typeof c||ZUe(c.innerHTML))&&("."===c[0]||"#"===c[0])&&c.length){var b=document.querySelector(c);f.appendChild(b),b.style.display=""}else""===c&&"#"===s[0]?(document.body.appendChild(this.element.querySelector(s)).style.display="none",f.innerHTML=c):this.isReact?(f.innerHTML="",this.templateCompile(f,c,a)):"function"!=typeof c&&(f.innerHTML=c);"cssClass"===i[l]&&(ZUe(p)||(p.classList.remove(s),p.classList.add(c)),ZUe(f)||(f.classList.remove(s),f.classList.add(c))),"disabled"===i[l]&&this.enableTab(a,!0!==c),"visible"===i[l]&&this.hideTab(a,!0!==c)}},t.prototype.initializeDrag=function(e){var t=this,n=new QGe(e,{dragArea:this.dragArea,dragTarget:"."+uCt,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var n,r,o=t.getEleIndex(t.dragItem),a={draggedItem:t.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+uCt),clonedElement:t.cloneElement,index:o};if(ZUe(e.target.closest("."+VSt))||e.target.closest("."+VSt).isEqualNode(t.element)||t.dragArea==="."+jSt){if(e.target.closest(t.dragArea)||"Popup"===t.overflowMode?(document.body.style.cursor="",t.dragItem.querySelector("."+iCt).style.visibility="hidden",t.cloneElement.classList.contains(XSt)&&VKe([t.cloneElement],XSt)):(document.body.style.cursor="not-allowed",ZKe([t.cloneElement],XSt),t.dragItem.classList.contains(XSt)&&VKe([t.dragItem],XSt),t.dragItem.querySelector("."+iCt).style.visibility="visible"),"Scrollable"===t.overflowMode&&!ZUe(t.element.querySelector(".e-hscroll"))){var i=t.element.querySelector(".e-scroll-right-nav"),l=t.element.querySelector(".e-scroll-left-nav"),s=t.element.querySelector(".e-hscroll-bar");!ZUe(i)&&Math.abs(i.offsetWidth/2+i.offsetLeft)>t.cloneElement.offsetLeft+t.cloneElement.offsetWidth&&(s.scrollLeft-=10),!ZUe(l)&&Math.abs(l.offsetLeft+l.offsetWidth-t.cloneElement.offsetLeft)>l.offsetWidth/2&&(s.scrollLeft+=10)}t.cloneElement.style.pointerEvents="none",r=eGe(e.target,"."+uCt+".e-draggable");var c=0;"Scrollable"!==t.overflowMode||ZUe(t.element.querySelector(".e-hscroll"))||(c=t.element.querySelector(".e-hscroll-content").offsetWidth),null!=r&&!r.isSameNode(t.dragItem)&&r.closest("."+VSt).isSameNode(t.dragItem.closest("."+VSt))&&((n=t.getEleIndex(r))<o&&Math.abs(r.offsetLeft+r.offsetWidth-t.cloneElement.offsetLeft)>r.offsetWidth/2&&t.dragAction(r,o,n),n>o&&Math.abs(r.offsetWidth/2)+r.offsetLeft-c<t.cloneElement.offsetLeft+t.cloneElement.offsetWidth&&t.dragAction(r,o,n)),t.droppedIndex=t.getEleIndex(t.dragItem),t.trigger("dragging",a)}else t.trigger("dragging",a)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(n)},t.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),ZKe([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+jSt).classList.contains(rCt)&&ZKe([this.cloneElement],rCt),VKe([this.cloneElement.querySelector("."+iCt)],"e-ripple"),ZUe(this.cloneElement.querySelector(".e-ripple-element"))||KKe(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},t.prototype.itemDragStart=function(e){var t=this;this.draggingItems=this.items.map((function(e){return e})),this.dragItem=e.element;var n={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",n,(function(e){e.cancel?UKe(t.cloneElement):(t.removeActiveClass(),ZKe([t.tbItems.querySelector("."+aCt)],XSt),t.dragItem.querySelector("."+iCt).style.visibility="hidden")}))},t.prototype.dragAction=function(e,t,n){if(this.items.length>0){var r=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(n,0,r)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>n)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){var o=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(e.parentElement.lastChild,o.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var a=e.parentElement.lastChild;if(e.isSameNode(a)){o=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(a,o.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<n&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(e,this.dragItem):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},t.prototype.itemDragStop=function(e){var t=this;UKe(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+iCt).style.visibility="visible",document.body.style.cursor="";var n={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",n,(function(e){e.cancel?t.refresh():t.items.length>0&&t.draggingItems.length>0?(t.items=t.draggingItems,t.selectedItem=t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+iCt).style.visibility="",VKe([t.tbItems.querySelector("."+aCt)],XSt),t.selectTab(t.droppedIndex,null,!0))})),this.dragItem=null},t.prototype.enableTab=function(e,t){var n=QKe("."+uCt,this.element)[e];ZUe(n)||(!0===t?(n.classList.remove(GSt,fCt),n.firstElementChild.setAttribute("tabindex","-1")):(n.classList.add(GSt,fCt),n.firstElementChild.removeAttribute("tabindex"),n.classList.contains(KSt)&&this.select(e+1)),ZUe(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),n.setAttribute("aria-disabled",!0===t?"false":"true"))},t.prototype.addTab=function(e,t){var n=this,r={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):this.trigger("adding",r,(function(r){r.cancel||n.addingTabContent(e,t)})),this.isReact&&this.renderReactTemplates()},t.prototype.addingTabContent=function(e,t){var n=this,r=0;if(this.hdrEle=XKe("."+jSt,this.element),ZUe(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var o=QKe(".e-tab-header ."+uCt,this.element).length;if(0!==o&&(r=this.lastIndex+1),ZUe(t)&&(t=o-1),o<t||t<0||isNaN(t))return;0!==o||ZUe(this.hdrEle)||(this.hdrEle.style.display=""),ZUe(this.bdrLine)||this.bdrLine.classList.add(XSt),this.tbItems=XKe("."+cCt,this.getTabHeader()),this.isAdd=!0;var a=this.parseObject(e,t);this.isAdd=!1;var i,l=0;e.forEach((function(e,o){if(i=e.headerTemplate||e.header.text,ZUe(e.headerTemplate||e.header)||ZUe(i)||0===i.length&&!ZUe(e.header)&&ZUe(e.header.iconCss)||(a[o]&&(ZUe(e.id)&&(e.id=xCt+(r+o).toString()),a[o].htmlAttributes["data-id"]=e.id),n.items.splice(t+l,0,e),l++),n.isTemplate&&!ZUe(e.header)&&!ZUe(e.header.text)){var s=r+o,c=n.createElement("div",{id:WSt+n.tabId+"_"+s,className:qSt,attrs:{role:"tabpanel","aria-labelledby":qSt+"_"+s}});n.cntEle.insertBefore(c,n.cntEle.children[t+o]);var u=n.getTrgContent(n.cntEle,s.toString());n.getContent(u,e.content,"render",t)}})),this.tbObj.addItems(a,t),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===t?this.select(t):(this.setActiveBorder(),this.tbItem=QKe("."+uCt,this.getTabHeader())),this.bindDraggable()}},t.prototype.removeTab=function(e){var t=this,n=QKe("."+uCt,this.element)[e];if(!ZUe(n)){var r={removedItem:n,removedIndex:e,cancel:!1};this.trigger("removing",r,(function(r){if(!r.cancel){t.tbObj.removeItems(e),t.allowDragAndDrop&&e!==Array.prototype.indexOf.call(t.itemIndexArray,n.id)&&(e=Array.prototype.indexOf.call(t.itemIndexArray,n.id)),t.items.splice(e,1),t.itemIndexArray.splice(e,1),t.refreshActiveBorder();var o=XKe("#"+WSt+t.tabId+"_"+t.extIndex(n.id),XKe("."+WSt,t.element));ZUe(o)||UKe(o),t.trigger("removed",r),t.draggableItems&&t.draggableItems.length>0&&(t.draggableItems[e].destroy(),t.draggableItems[e]=null,t.draggableItems.splice(e,1)),n.classList.contains(KSt)?(e=e>QKe("."+uCt+":not(."+hCt+")",t.element).length-1?e-1:e,t.enableAnimation=!1,t.selectedItem=e,t.select(e)):e!==t.selectedItem&&(e<t.selectedItem&&(e=t.itemIndexArray.indexOf(t.tbItem[t.selectedItem].id),t.setProperties({selectedItem:e>-1?e:t.selectedItem},!0),t.prevIndex=t.selectedItem),t.tbItem=QKe("."+uCt,t.getTabHeader())),0===QKe("."+uCt,t.element).length&&(t.hdrEle.style.display="none"),t.enableAnimation=!0}}))}},t.prototype.hideTab=function(e,t){var n,r=QKe("."+uCt,this.element)[e];if(!ZUe(r)){if(ZUe(t)&&(t=!0),this.bdrLine.classList.add(XSt),!0===t)if(r.classList.add(XSt),0!==(n=QKe("."+uCt+":not(."+XSt+")",this.tbItems)).length&&r.classList.contains(KSt)){if(0!==e)for(var o=e-1;o>=0;o--){if(!this.tbItem[o].classList.contains(XSt)){this.select(o);break}if(0===o)for(var a=e+1;a<this.tbItem.length;a++)if(!this.tbItem[a].classList.contains(XSt)){this.select(a);break}}else for(a=e+1;a<this.tbItem.length;a++)if(!this.tbItem[a].classList.contains(XSt)){this.select(a);break}}else 0===n.length&&this.element.classList.add(XSt);else this.element.classList.remove(XSt),n=QKe("."+uCt+":not(."+XSt+")",this.tbItems),r.classList.remove(XSt),0===n.length&&this.select(e);this.setActiveBorder(),r.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},t.prototype.selectTab=function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=!1),this.isInteracted=n,this.select(e,t)},t.prototype.select=function(e,t){var n=this,r=this.getTabHeader();this.tbItems=XKe("."+cCt,r),this.tbItem=QKe("."+uCt,r),this.content=XKe("."+WSt,this.element),this.prevItem=this.tbItem[this.prevIndex],ZUe(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var o=this.tbItem[e];ZUe(o)?this.selectedID="0":this.selectingID=this.extIndex(o.id),ZUe(this.prevItem)||this.prevItem.classList.contains(GSt)||this.prevItem.children.item(0).setAttribute("tabindex","-1");var a={event:t,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:ZUe(this.content)?null:XKe("#"+WSt+this.tabId+"_"+this.selectedID,this.content),selectingItem:o,selectingIndex:e,selectingContent:ZUe(this.content)?null:XKe("#"+WSt+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",a,(function(t){t.cancel||n.selectingContent(e,n.isInteracted)})),this.isInteracted=!1},t.prototype.selectingContent=function(e,t){if("number"==typeof e){if(!ZUe(this.tbItem[e])&&(this.tbItem[e].classList.contains(GSt)||this.tbItem[e].classList.contains(XSt)))for(var n=e+1;n<this.items.length;n++){if(!1===this.items[n].disabled&&!0===this.items[n].visible){e=n;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(hCt)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!ZUe(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=QKe("."+cCt+" ."+uCt,this.hdrEle);var r=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,r);var o=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,o)}}else this.setActive(e,null,t);else this.setActive(0,null,t)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},t.prototype.getItemIndex=function(e){for(var t,n=0;n<this.tbItem.length;n++){if(e===this.tbItem[n].getAttribute("data-id")){t=n;break}}return t},t.prototype.disable=function(e){this.setCssClass(this.element,GSt,e),this.element.setAttribute("aria-disabled",""+e)},t.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},t.prototype.getModuleName=function(){return"tab"},t.prototype.onPropertyChanged=function(e,t){for(var n=this,r=0,o=Object.keys(e);r<o.length;r++){switch(o[r]){case"width":tGe(this.element,{width:qUe(e.width)});break;case"height":tGe(this.element,{height:qUe(e.height)}),this.setContentHeight(!1);break;case"cssClass":var a=this.element.querySelector("."+jSt);""===t.cssClass||ZUe(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),ZUe(a)||this.setCssClass(a,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),ZUe(a)||(this.setCssClass(a,t.cssClass,!1),this.setCssClass(a,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach((function(e){e.dragArea=n.dragArea})),this.refresh())}}},t.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+cCt),t=this.element.querySelector("."+uCt+"."+KSt),n=t.id,r=n.indexOf("_"),o=parseInt(n.substring(r+1),10),a=t.innerText,i=this.element.querySelector("."+WSt).querySelector("."+KSt).children[0],l=i.innerHTML;UKe(t),UKe(i);var s={className:uCt+" "+YSt+" "+KSt,id:qSt+this.tabId+"_"+o,attrs:{role:"tab","aria-controls":WSt+this.tabId+"_"+o,"aria-disabled":"false","aria-selected":"true"}},c=this.createElement("span",{className:oCt,innerHTML:a,attrs:{role:"presentation"}}).outerHTML,u=this.createElement("div",{className:lCt,innerHTML:c+this.btnCls.outerHTML}).outerHTML,d=this.createElement("div",{className:iCt,innerHTML:u,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",s),e.children[o+1]),this.element.querySelector("."+uCt+"."+KSt).appendChild(d);x=this.createElement("div",{innerHTML:l});this.element.querySelector("."+WSt).querySelector("."+KSt).appendChild(x)}else if(this.element.querySelector("."+uCt+"."+KSt)){UKe(this.element.querySelector("."+uCt+"."+KSt).children[0]),UKe(this.element.querySelector("."+WSt).querySelector("."+KSt).children[0]);var h=this.items[this.selectedItem],p=ZUe(h.header)||ZUe(h.header.iconPosition)?"":h.header.iconPosition,f=ZUe(h.header)||ZUe(h.header.iconCss)?"":h.header.iconCss,m=h.headerTemplate||h.header.text,v=this.createElement("div",{className:oCt,attrs:{role:"presentation"}});ZUe(m.tagName)?this.headerTextCompile(v,m,this.selectedItem):v.appendChild(m);var g=this.createElement("span",{className:JSt+" "+sCt+" "+eCt+"-"+p+" "+f}),b=this.createElement("div",{className:lCt});b.appendChild(v),""!==m&&void 0!==m&&""!==f?("left"===p||"top"===p?b.insertBefore(g,b.firstElementChild):b.appendChild(g),this.isIconAlone=!1):(""===f?v:g)===g&&(UKe(v),b.appendChild(g),this.isIconAlone=!0);var y=h.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var w=this.createElement("div",{className:iCt,attrs:y});w.appendChild(b),"top"!==p&&"bottom"!==p||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+uCt+"."+KSt).appendChild(w);var x=this.createElement("div"),E=h.content,k=void 0;if("string"==typeof E||ZUe(E.innerHTML))if("string"==typeof E&&this.enableHtmlSanitizer&&(E=YXe.sanitize(E)),"."===E[0]||"#"===E[0])if(document.querySelectorAll(E).length){var S=document.querySelector(E);k=S.outerHTML.trim(),x.appendChild(S),S.style.display=""}else this.compileElement(x,E,"content",this.selectedItem);else this.compileElement(x,E,"content",this.selectedItem);else x.appendChild(E);ZUe(k)||-1===this.templateEle.indexOf(E.toString())&&this.templateEle.push(E.toString()),this.element.querySelector("."+qSt+"."+KSt).appendChild(x)}this.isReact&&this.renderReactTemplates()},ZSt([bGe([],MCt)],t.prototype,"items",void 0),ZSt([vGe("100%")],t.prototype,"width",void 0),ZSt([vGe("auto")],t.prototype,"height",void 0),ZSt([vGe("")],t.prototype,"cssClass",void 0),ZSt([vGe(0)],t.prototype,"selectedItem",void 0),ZSt([vGe("Top")],t.prototype,"headerPlacement",void 0),ZSt([vGe("Content")],t.prototype,"heightAdjustMode",void 0),ZSt([vGe("Scrollable")],t.prototype,"overflowMode",void 0),ZSt([vGe("Dynamic")],t.prototype,"loadOn",void 0),ZSt([vGe(!1)],t.prototype,"enablePersistence",void 0),ZSt([vGe(!1)],t.prototype,"enableHtmlSanitizer",void 0),ZSt([vGe(!1)],t.prototype,"showCloseButton",void 0),ZSt([vGe(!0)],t.prototype,"reorderActiveTab",void 0),ZSt([vGe()],t.prototype,"scrollStep",void 0),ZSt([vGe()],t.prototype,"dragArea",void 0),ZSt([vGe(!1)],t.prototype,"allowDragAndDrop",void 0),ZSt([gGe({},SCt)],t.prototype,"animation",void 0),ZSt([yGe()],t.prototype,"created",void 0),ZSt([yGe()],t.prototype,"adding",void 0),ZSt([yGe()],t.prototype,"added",void 0),ZSt([yGe()],t.prototype,"selecting",void 0),ZSt([yGe()],t.prototype,"selected",void 0),ZSt([yGe()],t.prototype,"removing",void 0),ZSt([yGe()],t.prototype,"removed",void 0),ZSt([yGe()],t.prototype,"onDragStart",void 0),ZSt([yGe()],t.prototype,"dragging",void 0),ZSt([yGe()],t.prototype,"dragged",void 0),ZSt([yGe()],t.prototype,"destroyed",void 0),t=ZSt([wGe],t)}(qGe),NCt="e-rtl",ACt="e-disabled",OCt="e-input",ICt="e-multi-line-input",DCt="e-input-group",PCt="e-float-input",TCt="e-float-line",HCt="e-float-text",LCt="e-float-text-content",zCt="e-clear-icon",RCt="e-clear-icon-hide",BCt="e-label-top",$Ct="e-label-bottom",ZCt="e-no-float-label",VCt="e-input-custom-tag",jCt="e-float-custom-tag";!function(e){var t,n=!0;function r(e){o(e.floatLabelType,e.element),e.element.addEventListener("focus",(function(){var e=h(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")})),e.element.addEventListener("blur",(function(){var e=h(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")})),e.element.addEventListener("input",(function(){o(t,e.element)}))}function o(e,t){var n=t.value;""!==n&&!ZUe(n)&&t.parentElement?t.parentElement.classList.add("e-valid-input"):"Always"!==e&&t.parentElement&&t.parentElement.classList.remove("e-valid-input")}function a(){var e=h(this).getElementsByClassName("e-float-text")[0];ZUe(e)||(ZKe([e],BCt),e.classList.contains($Ct)&&VKe([e],$Ct))}function i(){var e=h(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var t=e.getElementsByClassName("e-float-text")[0];ZUe(t)||(t.classList.contains(BCt)&&VKe([t],BCt),ZKe([t],$Ct))}}function l(e){e.addEventListener("focus",a),e.addEventListener("blur",i)}function s(e,t,n){var r=ZUe(n)?$Ke:n;"Auto"===e.floatLabelType&&l(e.element),ZUe(t.container)?(t.container=m(e,PCt,jCt,"div",r),e.element.parentNode&&e.element.parentNode.insertBefore(t.container,e.element)):(ZUe(e.customTag)||t.container.classList.add(jCt),t.container.classList.add(PCt));var o=r("span",{className:TCt}),a=r("label",{className:HCt});if(ZUe(e.element.id)||""===e.element.id||(a.id="label_"+e.element.id.replace(/ /g,"_"),GKe(e.element,{"aria-labelledby":a.id})),ZUe(e.element.placeholder)||""===e.element.placeholder||(a.innerText=v(e.element.placeholder),e.element.removeAttribute("placeholder")),ZUe(e.properties)||ZUe(e.properties.placeholder)||""===e.properties.placeholder||(a.innerText=v(e.properties.placeholder)),a.innerText||t.container.classList.add(ZCt),t.container.classList.contains("e-float-icon-left")){var i=t.container.querySelector(".e-input-in-wrap");i.appendChild(e.element),i.appendChild(o),i.appendChild(a)}else t.container.appendChild(e.element),t.container.appendChild(o),t.container.appendChild(a);d(e.element.value,a),"Always"===e.floatLabelType&&(a.classList.contains($Ct)&&VKe([a],$Ct),ZKe([a],BCt)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",(function(t){d(e.element.value,a,e.element)})),e.element.addEventListener("blur",(function(t){d(e.element.value,a)}))),ZUe(e.element.getAttribute("id"))||a.setAttribute("for",e.element.getAttribute("id"))}function c(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function u(e,t,n){e&&!n?VKe([t],RCt):ZKe([t],RCt)}function d(e,t,n){(void 0===n&&(n=null),e)?(ZKe([t],BCt),t.classList.contains($Ct)&&VKe([t],$Ct)):(null==n||n!==document.activeElement)&&(t.classList.contains(BCt)&&VKe([t],BCt),ZKe([t],$Ct))}function h(e){var t=ZUe(e.parentNode)?e:e.parentNode;return t&&t.classList.contains("e-input-in-wrap")&&(t=t.parentNode),t}function p(e,t,r){(null==n||n)&&t.addEventListener("click",(function(n){e.classList.contains(ACt)||e.readOnly||(n.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",ZKe([t],RCt))})),e.addEventListener("input",(function(n){u(e.value,t)})),e.addEventListener("focus",(function(n){u(e.value,t,e.readOnly)})),e.addEventListener("blur",(function(e){setTimeout((function(){ZKe([t],RCt)}),200)}))}function f(e,t){if(h(e).classList.contains(PCt)&&"Auto"===t){var n=h(e).getElementsByClassName("e-float-text")[0];d(e.value,n,e)}}function m(e,t,n,r,o){var a,i=ZUe(o)?$Ke:o;return ZUe(e.customTag)?a=i(r,{className:t}):(a=i(e.customTag,{className:t})).classList.add(n),a.classList.add("e-control-wrapper"),a}function v(e){var t="";if(!ZUe(e)&&""!==e){var n=document.createElement("span");n.innerHTML='<input placeholder="'+e+'"/>',t=n.children[0].placeholder}return t}function g(e,t,n){ZUe(n)||""===n||VKe(t,n.split(" ")),ZUe(e)||""===e||ZKe(t,e.split(" "))}function b(e,t){ZUe(t.getElementsByClassName("e-float-text-content")[0])||(t.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&t.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(e.clientWidth<t.getElementsByClassName("e-float-text-content")[0].clientWidth||e.clientWidth===t.getElementsByClassName("e-float-text-content")[0].clientWidth)&&t.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function y(e,t){e=v(e);var n=h(t);n.classList.contains(PCt)?ZUe(e)||""===e?(n.classList.add(ZCt),n.getElementsByClassName("e-float-text-content")[0]?n.getElementsByClassName(HCt)[0].children[0].textContent="":n.getElementsByClassName(HCt)[0].textContent=""):(n.getElementsByClassName("e-float-text-content")[0]?n.getElementsByClassName(HCt)[0].children[0].textContent=e:n.getElementsByClassName(HCt)[0].textContent=e,n.classList.remove(ZCt),t.removeAttribute("placeholder")):ZUe(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):GKe(t,{placeholder:e,"aria-placeholder":e})}function w(e,t,n){e?GKe(t,{readonly:""}):t.removeAttribute("readonly"),ZUe(n)||f(t,n)}function x(e,t){e?ZKe(t,NCt):VKe(t,NCt)}function E(e,t,n,r){var o={disabled:"disabled","aria-disabled":"true"},a=!ZUe(r);e?(t.classList.remove(ACt),S(o,t),a&&VKe([r],ACt)):(t.classList.add(ACt),C(o,t),a&&ZKe([r],ACt)),ZUe(n)||f(t,n)}function k(e,t,n,r,o){var a=ZUe(o)?$Ke:o;e?n.clearButton=function(e,t,n,r){var o=(ZUe(r)?$Ke:r)("span",{className:zCt}),a=t.container;return ZUe(n)?(t.container.classList.contains(PCt)?t.container.querySelector("."+HCt):e).insertAdjacentElement("afterend",o):a.appendChild(o),!ZUe(a)&&a.classList.contains(PCt)&&ZKe([a],DCt),ZKe([o],RCt),p(e,o),o.setAttribute("aria-label","close"),o}(t,n,r,a):(KKe(n.clearButton),n.clearButton=null)}function S(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],a=h(t);"disabled"===o&&t.classList.remove(ACt),"disabled"===o&&a.classList.contains(DCt)&&a.classList.remove(ACt),"placeholder"===o&&a.classList.contains(PCt)?a.getElementsByClassName(HCt)[0].textContent="":t.removeAttribute(o)}}function C(e,t){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],a=h(t);"disabled"===o&&t.classList.add(ACt),"disabled"===o&&a.classList.contains(DCt)&&a.classList.add(ACt),"placeholder"===o&&a.classList.contains(PCt)?a.getElementsByClassName(HCt)[0].textContent=e[o]:t.setAttribute(o,e[o])}}function M(e,t){if(e.container.classList.contains("e-outline")&&e.container.getElementsByClassName("e-float-text")[0]){var n=t("span",{className:LCt});n.innerHTML=e.container.getElementsByClassName("e-float-text")[0].innerHTML,e.container.getElementsByClassName("e-float-text")[0].innerHTML="",e.container.getElementsByClassName("e-float-text")[0].appendChild(n)}}function _(e,t,n){var r=[];r.push(n);var o=ZUe(n)?t.querySelectorAll(".e-input-group-icon"):r;if(e&&o.length>0)for(var a=0;a<o.length;a++)o[a].addEventListener("mousedown",N,!1),o[a].addEventListener("mouseup",A,!1);else if(o.length>0)for(a=0;a<o.length;a++)o[a].removeEventListener("mousedown",N,this),o[a].removeEventListener("mouseup",A,this)}function N(){for(var e,t,n=this.parentElement;!n.classList.contains("e-input-group");)n=n.parentElement;t=this,(e=n).classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}function A(){var e=this;setTimeout((function(){e.classList.remove("e-input-btn-ripple")}),500)}function O(e,t){var n=t("span",{className:e});return n.classList.add("e-input-group-icon"),n}function I(e,t,n,r){var o=ZUe(r)?$Ke:r,a=O(e,o);t.classList.add("e-float-icon-left");var i=t.querySelector(".e-input-in-wrap");if(ZUe(i)){i=o("span",{className:"e-input-in-wrap"}),n.parentNode.insertBefore(i,n);var l=t.querySelectorAll(n.tagName+" ~ *");i.appendChild(n);for(var s=0;s<l.length;s++)i.appendChild(l[s])}return i.parentNode.insertBefore(a,i),t.classList.contains(DCt)||t.classList.add(DCt),_(!0,t,a),a}function D(e,t,n){var r=O(e,ZUe(n)?$Ke:n);return t.classList.contains(DCt)||t.classList.add(DCt),(t.classList.contains("e-float-icon-left")?t.querySelector(".e-input-in-wrap"):t).appendChild(r),_(!0,t,r),r}function P(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}e.createInput=function(e,o){var a=ZUe(o)?$Ke:o,i={container:null,buttons:[],clearButton:null};if(t=e.floatLabelType,n=e.bindClearAction,ZUe(e.floatLabelType)||"Never"===e.floatLabelType?(i.container=m(e,DCt,VCt,"span",a),e.element.parentNode.insertBefore(i.container,e.element),ZKe([e.element],OCt),i.container.appendChild(e.element)):s(e,i,a),r(e),ZUe(e.properties)||ZUe(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(k(e.properties.showClearButton,e.element,i,!0,a),i.clearButton.setAttribute("role","button"),i.container.classList.contains(PCt)&&ZKe([i.container],DCt)),!ZUe(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var l=0;l<e.buttons.length;l++)i.buttons.push(D(e.buttons[l],i.container,a));return ZUe(e.element)||"TEXTAREA"!==e.element.tagName||ZKe([i.container],ICt),P(i.container,e.element),i=function(e,t){if(!ZUe(e.properties))for(var n=0,r=Object.keys(e.properties);n<r.length;n++){switch(r[n]){case"cssClass":g(e.properties.cssClass,[t.container]),c(e.floatLabelType,t.container);break;case"enabled":E(e.properties.enabled,e.element,e.floatLabelType,t.container);break;case"enableRtl":x(e.properties.enableRtl,[t.container]);break;case"placeholder":y(e.properties.placeholder,e.element);break;case"readonly":w(e.properties.readonly,e.element)}}return t}(e,i),M(i,a),i},e.bindInitialEvent=r,e.wireFloatingEvents=l,e.wireClearBtnEvents=p,e.setValue=function(e,t,n,r){if(t.value=e,ZUe(t.getAttribute("value"))&&b(t,t.parentElement),ZUe(n)||"Auto"!==n||f(t,n),!ZUe(r)&&r){var a=h(t);if(!ZUe(a)){var i=a.getElementsByClassName(zCt)[0];ZUe(i)||(t.value&&a.classList.contains("e-input-focus")?VKe([i],RCt):ZKe([i],RCt))}}o(n,t)},e.setCssClass=g,e.calculateWidth=b,e.setWidth=function(e,t){"number"==typeof e?t.style.width=qUe(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:qUe(e)),b(t.firstChild,t)},e.setPlaceholder=y,e.setReadonly=w,e.setEnableRtl=x,e.setEnabled=E,e.setClearButton=k,e.removeAttributes=S,e.addAttributes=C,e.removeFloating=function(e){var t=e.container;if(!ZUe(t)&&t.classList.contains(PCt)){var n=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),r=t.querySelector("."+HCt).textContent,o=null!==t.querySelector(".e-clear-icon");UKe(t.querySelector("."+TCt)),UKe(t.querySelector("."+HCt)),nGe(t,[DCt],[PCt]),function(e){e.removeEventListener("focus",a),e.removeEventListener("blur",i)}(n),GKe(n,{placeholder:r}),n.classList.add(OCt),o||"INPUT"!==n.tagName||n.removeAttribute("required")}},e.addFloating=function(e,n,r,o){var a=ZUe(o)?$Ke:o,i=eGe(e,"."+DCt);if(t=n,"Never"!==n){var l=i.tagName,u={element:e,floatLabelType:n,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:r}},d=i.querySelector(".e-clear-icon"),h={container:i};e.classList.remove(OCt),s(u,h,a),M(h,a),b(u.element,h.container);var p=i.classList.contains("e-float-icon-left");if(ZUe(d))if(p)d=i.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon");else d=i.querySelector(".e-input-group-icon");if(ZUe(d))p&&(d=i.querySelector(".e-input-group-icon")),ZUe(d)&&i.classList.remove(DCt);else{var f=i.querySelector("."+TCt),m=i.querySelector("."+HCt),v=p?i.querySelector(".e-input-in-wrap"):i;v.insertBefore(e,d),v.insertBefore(f,d),v.insertBefore(m,d)}}c(n,e.parentElement)},e.createSpanElement=M,e.setRipple=function(e,t){for(var n=0;n<t.length;n++)_(e,t[n].container)},e.addIcon=function(e,t,n,r,o){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var i=0,l=a;i<l.length;i++){D(l[i],n,o)}else for(var s=0,c=a;s<c.length;s++){I(c[s],n,r,o)}n.getElementsByClassName("e-input-group-icon")[0]&&n.getElementsByClassName("e-float-text-overflow")[0]&&n.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},e.prependSpan=I,e.appendSpan=D,e.validateInputType=P}(rSt||(rSt={}));var WCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),FCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return WCt(t,e),t.moduleName="tabItem",t.complexTemplate={headerText:"header.text"},t}(s0e),qCt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return WCt(t,e),t.propertyName="items",t.moduleName="tabItems",t}(s0e),YCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),UCt=function(e){function t(t){var n=e.call(this,t)||this;return n.initRenderCalled=!1,n.checkInjectedModules=!1,n.directivekeys={tabItems:"tabItem"},n.immediateRender=!1,n.portals=[],n}return YCt(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return E.createElement("div",this.getDefaultAttributes(),[].concat(this.props.children,this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(_Ct);i0e(UCt,[a0e,E.Component]);var KCt=function(t){var n=$be().t,r=t.listFile,o=t.height,a=[{headerText:"STT",field:"#",align:"center",width:50},{field:"title",type:"string",headerText:n("Title")},{field:"name",headerText:n("File name")},{field:"size",headerText:n("Size"),template:function(t){var n=t.size/Math.pow(1024,2);return x.default.createElement(e.Fragment,null,n.toFixed(2),"MB")}}];return x.default.createElement(e.Fragment,null,x.default.createElement(mbe,{key:"parent",dataSource:Array.isArray(JSON.parse(r))?JSON.parse(r):[],columns:null!=a?a:[],scroll:o,t:n,format:{decimalSeparator:X.decimalSeparatorDisplay,thousandSeparator:X.thousandSeparatorDisplay,decimalScale:oe("quantity")}}))},GCt=function(e){var t=e.breadCrumbTitle,n=e.breadCrumbParent,r=e.breadCrumbActive;return x.default.createElement("div",{className:"content-header row"},x.default.createElement("div",{className:"content-header-left col-md-9 col-12"},x.default.createElement("div",{className:"row breadcrumbs-top"},x.default.createElement("div",{className:"col-12"},t?x.default.createElement("h2",{className:"content-header-title float-start mb-0"},t):"",x.default.createElement("div",{className:"breadcrumb-wrapper vs-breadcrumbs d-sm-block d-none col-12"},x.default.createElement(Mt,{className:"breadcrumb-nowrap"},x.default.createElement(It,{tag:"li"},x.default.createElement("a",{href:"/"},x.default.createElement(Rn,{fontSize:20}))),n&&n.length>0&&(null==n?void 0:n.map((function(e,t){return x.default.createElement(It,{key:t,tag:"li"},e.link?x.default.createElement("a",{href:e.link},e.title):e.title)}))),x.default.createElement(It,{tag:"li",active:!0},r)))))))};GCt.propTypes={breadCrumbActive:pt.string.isRequired,breadCrumbParent:pt.object};var XCt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),QCt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},JCt="e-other-month",eMt="e-other-year",tMt="e-calendar",nMt="e-device",rMt="e-rtl",oMt="e-year",aMt="e-month",iMt="e-decade",lMt="e-icons",sMt="e-disabled",cMt="e-overlay",uMt="e-week-number",dMt="e-selected",hMt="e-focused-date",pMt="e-month-hide",fMt="e-today",mMt="e-day",vMt="e-cell",gMt="e-zoomin",bMt="e-calendar-day-header-lg",yMt=864e5,wMt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.effect="",r.isPopupClicked=!1,r.isDateSelected=!0,r.isTodayClicked=!1,r.preventChange=!1,r.isAngular=!1,r}return XCt(t,e),t.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new kKe(this.locale),(ZUe(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(tMt),this.enableRtl&&this.element.classList.add(rMt),zKe.isDevice&&this.element.classList.add(nMt),GKe(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(tMt),this.enableRtl&&this.calendarElement.classList.add(rMt),zKe.isDevice&&this.calendarElement.classList.add(nMt),GKe(this.calendarElement,{role:"calendar"})),this.createHeader(),this.createContent(),this.wireEvents()},t.prototype.rangeValidation=function(e,t){ZUe(e)&&this.setProperties({min:new Date(1900,0,1)},!0),ZUe(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},t.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},t.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!ZUe(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},t.prototype.setOverlayIndex=function(e,t,n,r){if(r&&!ZUe(t)&&!ZUe(n)&&!ZUe(e)){var o=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3;n.style.zIndex=(o-1).toString(),e.style.zIndex=o.toString()}},t.prototype.minMaxUpdate=function(e){+this.min<=+this.max?VKe([this.element],cMt):(this.setProperties({min:this.min},!0),ZKe([this.element],cMt)),this.min=ZUe(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=ZUe(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.createHeader=function(){this.headerElement=this.createElement("div",{className:"e-header"});var e=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),_Ge(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),GKe(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),_Ge(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(GKe(this.previousIcon,{tabIndex:"-1"}),GKe(this.nextIcon,{tabIndex:"-1"})),GKe(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),this.headerTitleElement=this.createElement("div",{className:mMt+" e-title"}),GKe(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+lMt})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next "+lMt})),e.appendChild(this.previousIcon),e.appendChild(this.nextIcon),this.headerElement.appendChild(e),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},t.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{tabIndex:"0",role:"grid","aria-activedescendant":""}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},t.prototype.getCultureValues=function(){var e,t,n=[],r="days.stand-alone."+this.dayHeaderFormat.toLowerCase();e="en"===this.locale||"en-US"===this.locale?TUe(r,SKe.getDependables(yKe,"",t,!1)[EKe[1]]):this.getCultureObjects(yKe,""+this.locale);for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];n.push(TUe(i,e))}return n},t.prototype.toCapitalize=function(e){return!ZUe(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},t.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content .e-week-header")[0])||UKe(this.element.querySelectorAll(".e-content .e-week-header")[0]):ZUe(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||UKe(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number"></th>',"calendar"===this.getModuleName()?ZKe([this.element],""+uMt):ZKe([this.calendarElement],""+uMt));for(var t=this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek),n=0;n<=6;n++)e+='<th class="">'+this.toCapitalize(t[n])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},t.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content tbody")[0])||UKe(this.element.querySelectorAll(".e-content tbody")[0]):ZUe(this.calendarElement.querySelectorAll(".e-content tbody")[0])||UKe(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},t.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today"))},t.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),t=new Date(+this.max);this.globalize=new kKe(this.locale),this.l10=new aXe(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),_Ge(this.todayElement),this.updateFooter(),ZKe([this.todayElement],["e-btn",fMt,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||ZKe([this.todayElement],sMt),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(sMt)||RKe.add(this.todayElement,"click",this.todayButtonClick,this)}},t.prototype.wireEvents=function(e,t,n,r){RKe.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new oXe(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new oXe(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},t.prototype.dateWireEvents=function(e,t,n,r){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,n),this.serverModuleName=r},t.prototype.todayButtonClick=function(e,t,n){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),n):this.navigateTo("Month",new Date(this.checkValue(t)),n))},t.prototype.resetCalendar=function(){this.calendarElement&&UKe(this.calendarElement),this.tableBodyElement&&UKe(this.tableBodyElement),this.table&&UKe(this.table),this.tableHeadElement&&UKe(this.tableHeadElement),this.nextIcon&&UKe(this.nextIcon),this.previousIcon&&UKe(this.previousIcon),this.footer&&UKe(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},t.prototype.keyActionHandle=function(e,t,n){var r,o=this.tableBodyElement.querySelector("tr td.e-focused-date");r=n?ZUe(o)||+t!==parseInt(o.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):o:this.tableBodyElement.querySelector("tr td.e-selected");var a=this.getViewNumber(this.currentView()),i=this.getViewNumber(this.depth),l=a===i&&this.getViewNumber(this.start)>=i;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,a,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,a,e,this.max,this.min),e.preventDefault();break;case"moveUp":0===a?this.keyboardNavigate(-7,a,e,this.max,this.min):this.keyboardNavigate(-4,a,e,this.max,this.min),e.preventDefault();break;case"moveDown":0===a?this.keyboardNavigate(7,a,e,this.max,this.min):this.keyboardNavigate(4,a,e,this.max,this.min),e.preventDefault();break;case"select":if(e.target===this.todayElement)this.todayButtonClick(e,t);else{var s=ZUe(o)?r:o;if(!ZUe(s)&&!s.classList.contains(sMt))if(l){var c=new Date(parseInt(""+s.id,0));this.selectDate(e,c,s)}else this.contentClick(null,--a,s,t)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":ZUe(o)&&(ZUe(r)||l)||this.contentClick(null,--a,o||r,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),UKe(this.tableBodyElement),0===a?this.renderMonths(e):1===a?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,a),UKe(this.tableBodyElement),0===a?this.renderMonths(e):1===a?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault()}"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.keyboardNavigate=function(e,t,n,r,o){var a=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderDecades(n)):this.currentDate=a;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderYears(n)):this.currentDate=a;break;case 0:this.addDay(this.currentDate,e,n,r,o),this.isMinMaxRange(this.currentDate)?(UKe(this.tableBodyElement),this.renderMonths(n)):this.currentDate=a}},t.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},t.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),n=new Date(new Date(+this.min).setHours(0,0,0,0)),r=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+n&&+t!=+r||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},t.prototype.renderMonths=function(e,t,n){var r,o=this.weekNumber?8:7;r="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,n):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(r,o,aMt,e,t):this.islamicModule.islamicRenderTemplate(r,o,aMt,e,t)},t.prototype.renderDays=function(e,t,n,r,o){var a,i=[],l=o?new Date(+e):this.getDate(new Date,this.timezone),s=new Date(this.checkValue(e)),c=s.getMonth();this.titleUpdate(e,"days");var u=s;for(s=new Date(u.getFullYear(),u.getMonth(),0,u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds());s.getDay()!==this.firstDayOfWeek;)this.setStartDate(s,-864e5);for(var d=0;d<42;++d){var h=this.createElement("td",{className:vMt}),p=this.createElement("span");if(d%7==0&&this.weekNumber){var f="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,m=new Date(s.getFullYear(),s.getMonth(),s.getDate()+f);p.textContent=""+this.getWeek(m),h.appendChild(p),ZKe([h],""+uMt),i.push(h)}a=new Date(+s),s=this.minMaxDate(s);var v={type:"dateTime",skeleton:"full"},g=this.globalize.parseDate(this.globalize.formatDate(s,v),v),b=this.dayCell(s),y=this.globalize.formatDate(s,{type:"date",skeleton:"full"}),w=this.createElement("span");w.textContent=this.globalize.formatDate(s,{format:"d",type:"date",skeleton:"yMd"});var x=this.min>s||this.max<s;x?(ZKe([b],sMt),ZKe([b],cMt)):w.setAttribute("title",""+y),c!==s.getMonth()&&ZKe([b],JCt),0!==s.getDay()&&6!==s.getDay()||ZKe([b],"e-weekend"),b.appendChild(w),this.renderDayCellArgs={date:s,isDisabled:!1,element:b,isOutOfRange:x};var E=this.renderDayCellArgs;if(this.renderDayCellEvent(E),E.isDisabled){var k=new Date(this.checkValue(t)),S=new Date(this.checkValue(E.date));if(n){if(!ZUe(r)&&r.length>0)for(var C=0;C<r.length;C++){+new Date(this.globalize.formatDate(E.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(r[C],{type:"date",skeleton:"yMd"}))&&(r.splice(C,1),C=-1)}}else k&&+k==+S&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!b.classList.contains(dMt)&&(ZKe([b],sMt),ZKe([b],cMt),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var M=b.classList.contains(JCt),_=b.classList.contains(sMt);if(_||RKe.add(b,"click",this.clickHandler,this),!n||ZUe(r)||_)!_&&this.getDateVal(s,t)&&ZKe([b],dMt);else{for(var N=0;N<r.length;N++){var A={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(s,A)===this.globalize.formatDate(r[N],A)&&this.getDateVal(s,r[N])||this.getDateVal(s,t)?ZKe([b],dMt):this.updateFocus(M,_,s,b,e)}r.length<=0&&this.updateFocus(M,_,s,b,e)}this.updateFocus(M,_,s,b,e),g.getFullYear()===l.getFullYear()&&g.getMonth()===l.getMonth()&&g.getDate()===l.getDate()&&ZKe([b],fMt),i.push(this.renderDayCellArgs.element),s=new Date(+a),this.addDay(s,1,null,this.max,this.min)}return i},t.prototype.updateFocus=function(e,t,n,r,o){o.getDate()!==n.getDate()||e||t?(o>=this.max&&parseInt(r.id,0)===+this.max&&!e&&!t&&ZKe([r],hMt),o<=this.min&&parseInt(r.id,0)===+this.min&&!e&&!t&&ZKe([r],hMt)):ZKe([r],hMt)},t.prototype.renderYears=function(e,t){this.removeTableHeadElement();var n=[],r=ZUe(t),o=new Date(this.checkValue(this.currentDate)),a=o.getMonth(),i=o.getFullYear(),l=o,s=l.getFullYear(),c=new Date(this.checkValue(this.min)).getFullYear(),u=new Date(this.checkValue(this.min)).getMonth(),d=new Date(this.checkValue(this.max)).getFullYear(),h=new Date(this.checkValue(this.max)).getMonth();l.setMonth(0),this.titleUpdate(this.currentDate,"months"),l.setDate(1);for(var p=0;p<12;++p){var f=this.dayCell(l),m=this.createElement("span"),v=t&&t.getMonth()===l.getMonth(),g=t&&t.getFullYear()===i&&v;m.textContent=this.toCapitalize(this.globalize.formatDate(l,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(s<c||p<u&&s===c)||this.max&&(s>d||p>h&&s>=d)?ZKe([f],sMt):!r&&g?ZKe([f],dMt):l.getMonth()===a&&this.currentDate.getMonth()===a&&ZKe([f],hMt),l.setDate(1),l.setMonth(l.getMonth()+1),f.classList.contains(sMt)||RKe.add(f,"click",this.clickHandler,this),f.appendChild(m),n.push(f)}this.renderTemplate(n,4,oMt,e,t)},t.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var n=[],r=new Date(this.checkValue(this.currentDate));r.setMonth(0),r.setDate(1);var o=r.getFullYear(),a=new Date(r.setFullYear(o-o%10)),i=new Date(r.setFullYear(o-o%10+9)),l=a.getFullYear(),s=i.getFullYear(),c=this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"y"}),u=this.globalize.formatDate(i,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=c+" - "+u;for(var d=new Date(o-o%10-1,0,1).getFullYear(),h=0;h<12;++h){var p=d+h;r.setFullYear(p);var f=this.dayCell(r);GKe(f,{role:"gridcell"});var m=this.createElement("span");m.textContent=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"}),p<l||p>s?(ZKe([f],eMt),ZUe(t)||r.getFullYear()!==t.getFullYear()||ZKe([f],dMt),(p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear())&&ZKe([f],sMt)):p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear()?ZKe([f],sMt):ZUe(t)||r.getFullYear()!==t.getFullYear()?r.getFullYear()!==this.currentDate.getFullYear()||f.classList.contains(sMt)||ZKe([f],hMt):ZKe([f],dMt),f.classList.contains(sMt)||RKe.add(f,"click",this.clickHandler,this),f.appendChild(m),n.push(f)}this.renderTemplate(n,4,"e-decade",e,t)},t.prototype.dayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},n=this.globalize.parseDate(this.globalize.formatDate(e,t),t).valueOf(),r={className:vMt,attrs:{id:""+jUe(""+n),"aria-selected":"false",role:"gridcell"}};return this.createElement("td",r)},t.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+JCt):this.tableBodyElement.querySelectorAll("td:not(."+eMt);if(t.length)for(var n=0;n<t.length;n++)if(!t[n].classList.contains(sMt)){e=new Date(parseInt(t[n].id,0));break}return e},t.prototype.lastDay=function(e,t){var n=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var r=Math.abs(n.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return r&&n.setHours(this.firstDay(e).getHours()+r/60),this.findLastDay(n)}return this.findLastDay(this.firstDay(n))},t.prototype.checkDateValue=function(e){return!ZUe(e)&&e instanceof Date&&!isNaN(+e)?e:null},t.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+eMt):this.tableBodyElement.querySelectorAll("td:not(."+JCt);if(t.length)for(var n=t.length-1;n>=0;n--)if(!t[n].classList.contains(sMt)){e=new Date(parseInt(t[n].id,0));break}return e},t.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?ZUe(this.element.querySelectorAll(".e-content table thead")[0])||UKe(this.tableHeadElement):ZUe(this.calendarElement.querySelectorAll(".e-content table thead")[0])||UKe(this.tableHeadElement)},t.prototype.renderTemplate=function(e,t,n,r,o){var a,i=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),VKe([this.contentElement,this.headerElement],[aMt,iMt,oMt]),ZKe([this.contentElement,this.headerElement],[n]);for(var l=t,s=0,c=0;c<e.length/t;++c){for(a=this.createElement("tr",{attrs:{role:"row"}}),s=0+s;s<l;s++)e[s].classList.contains("e-week-number")||ZUe(e[s].children[0])||(ZKe([e[s].children[0]],[mMt]),_Ge(e[s].children[0],{duration:600,isCenterRipple:!0})),a.appendChild(e[s]),this.weekNumber&&7===s&&e[7].classList.contains(JCt)&&ZKe([a],pMt),!this.weekNumber&&6===s&&e[6].classList.contains(JCt)&&ZKe([a],pMt),this.weekNumber?41===s&&e[41].classList.contains(JCt)&&ZKe([a],pMt):35===s&&e[35].classList.contains(JCt)&&ZKe([a],pMt);l+=t,s+=0,this.tableBodyElement.appendChild(a)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(i!==this.getViewNumber(this.currentView())||0===i&&i!==this.getViewNumber(this.currentView()))&&this.navigateHandler(r),this.setAriaActiveDescendant()},t.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var n=e.currentTarget,r=this.getViewNumber(this.currentView());n.classList.contains(JCt)?this.contentClick(e,0,null,t):r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===r?this.contentClick(e,1,null,t):n.classList.contains(JCt)||0!==r?this.contentClick(e,0,n,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.clickEventEmitter=function(e){e.preventDefault()},t.prototype.contentClick=function(e,t,n,r){var o=this.getViewNumber(this.currentView()),a=this.getIdValue(e,n);switch(t){case 0:o===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(UKe(this.tableBodyElement),this.currentDate=a,this.effect=gMt,this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(a.getMonth()),a.getMonth()>0&&this.currentDate.getMonth()!==a.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(a.getFullYear())):this.currentDate=a,this.effect=gMt,UKe(this.tableBodyElement),this.renderMonths(e));break;case 1:if(o===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,a,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(a.getFullYear());else{var i=this.islamicModule.getIslamicDate(a);this.currentDate=this.islamicModule.toGregorian(i.year,i.month,1)}this.effect=gMt,UKe(this.tableBodyElement),this.renderYears(e)}}},t.prototype.switchView=function(e,t,n,r){switch(e){case 0:UKe(this.tableBodyElement),this.renderMonths(t,null,r),n&&!ZUe(this.tableBodyElement.querySelectorAll("."+hMt)[0])&&this.tableBodyElement.querySelectorAll("."+hMt)[0].classList.remove(hMt);break;case 1:UKe(this.tableBodyElement),this.renderYears(t);break;case 2:UKe(this.tableBodyElement),this.renderDecades(t)}},t.prototype.getModuleName=function(){return"calendar"},t.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},t.prototype.onPropertyChanged=function(e,t,n,r){this.effect="";for(var o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];switch(i){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===i?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&UKe(this.tableBodyElement),this.minMaxUpdate(),n&&this.validateValues(n,r),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(VKe([this.todayElement],sMt),UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new kKe(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():ZUe(this.todayElement)||ZUe(this.footer)||(UKe(this.todayElement),UKe(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},t.prototype.validateValues=function(e,t){if(e&&!ZUe(t)&&t.length>0){for(var n=this.copyValues(t),r=0;r<n.length;r++){var o=n[r],a="Gregorian"===this.calendarMode?"gregorian":"islamic",i=void 0;i="Gregorian"===this.calendarMode?this.globalize.formatDate(o,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(o,{type:"dateTime",skeleton:"full",calendar:"islamic"});var l={type:"date",skeleton:"yMd",calendar:a},s=this.globalize.formatDate(this.min,l),c={type:"date",skeleton:"yMd",calendar:a},u=this.globalize.formatDate(this.max,c);(+new Date(i)<+new Date(s)||+new Date(i)>+new Date(u))&&(n.splice(r,1),r=-1)}this.setProperties({values:n},!0)}},t.prototype.setValueUpdate=function(){ZUe(this.tableBodyElement)||(UKe(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},t.prototype.copyValues=function(e){var t=[];if(!ZUe(e)&&e.length>0)for(var n=0;n<e.length;n++)t.push(new Date(+e[n]));return t},t.prototype.titleUpdate=function(e,t){var n,r,o=new kKe(this.locale),a="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(n=o.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:a}),r=o.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:a})):(n=o.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:a}),r=o.formatDate(e,{type:"dateTime",format:"y",calendar:a})),t){case"days":this.headerTitleElement.textContent=this.toCapitalize(n);break;case"months":this.headerTitleElement.textContent=r}},t.prototype.setActiveDescendant=function(){var e,t,n=this.tableBodyElement.querySelector("tr td.e-focused-date"),r=this.tableBodyElement.querySelector("tr td.e-selected"),o="Gregorian"===this.calendarMode?"gregorian":"islamic",a=this.currentView();return t="Month"===a?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:o}):"Year"===a?"islamic"!==o?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:o}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:o}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:o}),(r||n)&&(ZUe(r)||r.setAttribute("aria-selected","true"),(n||r).setAttribute("aria-label",t),e=(n||r).getAttribute("id")),e},t.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},t.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&VKe([this.element],[tMt]),"calendar"===this.getModuleName()&&this.element&&(RKe.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&RKe.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),ZUe(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),e.prototype.destroy.call(this)},t.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=gMt,this.switchView(++t,e)},t.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},t.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},t.prototype.navigatePrevious=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},t.prototype.navigateNext=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},t.prototype.navigateTo=function(e,t,n){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,n)},t.prototype.currentView=function(){return this.contentElement.classList.contains(oMt)?"Year":this.contentElement.classList.contains(iMt)?"Decade":"Month"},t.prototype.getDateVal=function(e,t){return!ZUe(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.getCultureObjects=function(e,t){var n=".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),r=".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?TUe("main."+this.locale+n,e):TUe("main."+this.locale+r,e)},t.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),n=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-n+yMt)/yMt/7)},t.prototype.setStartDate=function(e,t){var n=e.getTimezoneOffset(),r=new Date(e.getTime()+t),o=r.getTimezoneOffset()-n;e.setTime(r.getTime()+6e4*o)},t.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var n=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(n,this.getMaxDays(e)))}else{var r=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(r.year,r.month+t,1)}},t.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var n=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(n,this.getMaxDays(e)))}else{var r=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(r.year+t,r.month,1)}},t.prototype.getIdValue=function(e,t){var n;n=e?e.currentTarget:t;var r={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},o=this.globalize.formatDate(new Date(parseInt(""+n.getAttribute("id"),0)),r),a=this.globalize.parseDate(o,r),i=a.valueOf()-a.valueOf()%1e3;return new Date(i)},t.prototype.adjustLongHeaderSize=function(){VKe([this.element],bMt),"Wide"===this.dayHeaderFormat&&ZKe(["calendar"===this.getModuleName()?this.element:this.calendarElement],bMt)},t.prototype.selectDate=function(e,t,n,r,o){var a=n||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,t.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,t);else{if(r&&!this.checkPresentDate(t,o)){var i=this.copyValues(o);!ZUe(o)&&i.length>0?(i.push(new Date(this.checkValue(t))),this.setProperties({values:i},!0),this.setProperties({value:o[o.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)}else this.setProperties({value:new Date(this.checkValue(t))},!0);this.currentDate=new Date(this.checkValue(t))}var l=eGe(a,"."+tMt);if(ZUe(l)&&(l=this.tableBodyElement),r||ZUe(l.querySelector("."+dMt))||VKe([l.querySelector("."+dMt)],dMt),r||ZUe(l.querySelector("."+hMt))||VKe([l.querySelector("."+hMt)],hMt),r){i=this.copyValues(o);for(var s=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),c=0;c<s.length;c++){var u=l.querySelectorAll("td."+hMt)[0],d=l.querySelectorAll("td."+dMt)[0];s[c]===u&&VKe([s[c]],hMt),s[c]!==d||this.checkPresentDate(new Date(parseInt(d.getAttribute("id").split("_")[0],10)),o)||VKe([s[c]],dMt)}if(a.classList.contains(dMt)){VKe([a],dMt);for(var h=0;h<i.length;h++){var p={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if(this.globalize.formatDate(t,p)===this.globalize.formatDate(i[h],p)){c=i.indexOf(i[h]);i.splice(c,1),ZKe([a],hMt)}}this.setProperties({values:i},!0)}else ZKe([a],dMt)}else ZKe([a],dMt);this.isDateSelected=!0},t.prototype.checkPresentDate=function(e,t){var n=!1;if(!ZUe(t))for(var r=0;r<t.length;r++){var o="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:o})===this.globalize.formatDate(t[r],{format:null,type:"date",skeleton:"short",calendar:o})&&(n=!0)}return n},t.prototype.setAriaActiveDescendant=function(){GKe(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},t.prototype.previousIconHandler=function(e){e?(RKe.remove(this.previousIcon,"click",this.navigatePreviousHandler),ZKe([this.previousIcon],""+sMt),ZKe([this.previousIcon],""+cMt),this.previousIcon.setAttribute("aria-disabled","true")):(RKe.add(this.previousIcon,"click",this.navigatePreviousHandler),VKe([this.previousIcon],""+sMt),VKe([this.previousIcon],""+cMt),this.previousIcon.setAttribute("aria-disabled","false"))},t.prototype.renderDayCellEvent=function(e){$Ue(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.navigatedEvent=function(e){$Ue(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},t.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},t.prototype.nextIconHandler=function(e){e?(RKe.remove(this.nextIcon,"click",this.navigateNextHandler),ZKe([this.nextIcon],sMt),ZKe([this.nextIcon],cMt),this.nextIcon.setAttribute("aria-disabled","true")):(RKe.add(this.nextIcon,"click",this.navigateNextHandler),VKe([this.nextIcon],sMt),VKe([this.nextIcon],cMt),this.nextIcon.setAttribute("aria-disabled","false"))},t.prototype.compare=function(e,t,n){var r,o,a=t.getFullYear();return r=a,o=0,n&&(r=(a-=a%n)-a%n+n-1),e.getFullYear()>r?o=1:e.getFullYear()<a&&(o=-1),o},t.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},t.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},t.prototype.compareYear=function(e,t){return this.compare(e,t,0)},t.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},t.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},t.prototype.addDay=function(e,t,n,r,o){var a=t,i=new Date(+e);if(!ZUe(this.tableBodyElement)&&!ZUe(n)){for(;this.findNextTD(new Date(+e),a,r,o);)a+=t;var l=new Date(i.setDate(i.getDate()+a));a=+l>+r||+l<+o?a===t?t-t:t:a}e.setDate(e.getDate()+a)},t.prototype.findNextTD=function(e,t,n,r){var o=new Date(e.setDate(e.getDate()+t)),a=[],i=!1;if((!ZUe(o)&&o.getMonth())===(!ZUe(this.currentDate)&&this.currentDate.getMonth())){a=("Gregorian"===this.calendarMode?this.renderDays(o):this.islamicModule.islamicRenderDays(this.currentDate,o)).filter((function(e){return e.classList.contains(sMt)}))}else a=this.tableBodyElement.querySelectorAll("td."+sMt);if(+o<=+n&&+o>=+r&&a.length)for(var l=0;l<a.length&&!(i=+o==+new Date(parseInt(a[l].id,0)));l++);return i},t.prototype.getMaxDays=function(e){var t,n=new Date(this.checkValue(e));t=28;for(var r=n.getMonth();n.getMonth()===r;)++t,n.setDate(t);return t-1},t.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},t.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},t.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},t.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},t.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},QCt([vGe(new Date(1900,0,1))],t.prototype,"min",void 0),QCt([vGe(!0)],t.prototype,"enabled",void 0),QCt([vGe(null)],t.prototype,"cssClass",void 0),QCt([vGe(new Date(2099,11,31))],t.prototype,"max",void 0),QCt([vGe(null)],t.prototype,"firstDayOfWeek",void 0),QCt([vGe("Gregorian")],t.prototype,"calendarMode",void 0),QCt([vGe("Month")],t.prototype,"start",void 0),QCt([vGe("Month")],t.prototype,"depth",void 0),QCt([vGe(!1)],t.prototype,"weekNumber",void 0),QCt([vGe("FirstDay")],t.prototype,"weekRule",void 0),QCt([vGe(!0)],t.prototype,"showTodayButton",void 0),QCt([vGe("Short")],t.prototype,"dayHeaderFormat",void 0),QCt([vGe(!1)],t.prototype,"enablePersistence",void 0),QCt([vGe(null)],t.prototype,"keyConfigs",void 0),QCt([vGe(null)],t.prototype,"serverTimezoneOffset",void 0),QCt([yGe()],t.prototype,"created",void 0),QCt([yGe()],t.prototype,"destroyed",void 0),QCt([yGe()],t.prototype,"navigated",void 0),QCt([yGe()],t.prototype,"renderDayCell",void 0),t=QCt([wGe],t)}(qGe);!function(e){function t(t,n){return e.call(this,t,n)||this}XCt(t,e),t.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&FUe("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!ZUe(this.values)&&this.values.length>0){for(var t=[],n=[],r=0;r<this.values.length;r++)-1===t.indexOf(+this.values[r])&&(t.push(+this.values[r]),n.push(this.values[r]));this.setProperties({values:n},!0);for(var o=0;o<this.values.length;o++)if(!this.checkDateValue(this.values[o]))if("string"==typeof this.values[o]&&this.checkDateValue(new Date(this.checkValue(this.values[o])))){var a=new Date(this.checkValue(this.values[o]));this.values.splice(o,1),this.values.splice(o,0,a)}else this.values.splice(o,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),e.prototype.render.call(this),"calendar"===this.getModuleName()){var i=eGe(this.element,"form");i&&RKe.add(i,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},t.prototype.setEnable=function(e){e?VKe([this.element],sMt):ZKe([this.element],sMt)},t.prototype.setClass=function(e,t){ZUe(t)||(t=t.replace(/\s+/g," ").trim()),ZUe(e)||(e=e.replace(/\s+/g," ").trim()),ZUe(t)||""===t||VKe([this.element],t.split(" ")),ZUe(e)||ZKe([this.element],e.split(" "))},t.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},t.prototype.setTimeZone=function(e){if(!ZUe(this.serverTimezoneOffset)&&this.value){var t=e+(new Date).getTimezoneOffset()/60;t=this.isDayLightSaving()?t--:t,this.value=new Date(this.value.getTime()+60*t*60*1e3)}},t.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},t.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!ZUe(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},t.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!ZUe(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!ZUe(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||ZUe(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!ZUe(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!ZUe(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},t.prototype.generateTodayVal=function(t){var n=new Date;return ZUe(this.timezone)||(n=e.prototype.getDate.call(this,n,this.timezone)),t&&ZUe(this.timezone)?(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),n.setMilliseconds(t.getMilliseconds())):n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),n},t.prototype.todayButtonClick=function(t){if(this.showTodayButton){var n=this.generateTodayVal(this.value);if(this.setProperties({value:n},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var r=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,n,this.values)||(r.push(n),this.setProperties({values:r}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},t.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},t.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},t.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},t.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},t.prototype.renderMonths=function(t,n,r){e.prototype.renderMonths.call(this,t,this.value,r)},t.prototype.renderDays=function(t,n,r,o,a){var i=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,a);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),i},t.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},t.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},t.prototype.renderTemplate=function(t,n,r,o){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,n,r,o,this.value):this.islamicModule.islamicRenderTemplate(t,n,r,o,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},t.prototype.clickHandler=function(t){var n=t.currentTarget;if(this.isPopupClicked=!0,n.classList.contains(JCt))if(this.isMultiSelection){var r=this.copyValues(this.values);r.push(this.getIdValue(t,null)),this.setProperties({values:r},!0),this.setProperties({value:this.values[this.values.length-1]},!0)}else this.setProperties({value:this.getIdValue(t,null)},!0);var o=this.currentView();e.prototype.clickHandler.call(this,t,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!ZUe(this.tableBodyElement.querySelectorAll("."+hMt)[0])&&"Year"===o&&this.tableBodyElement.querySelectorAll("."+hMt)[0].classList.remove(hMt)},t.prototype.switchView=function(t,n,r,o){e.prototype.switchView.call(this,t,n,this.isMultiSelection,o)},t.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},t.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},t.prototype.onPropertyChanged=function(t,n){this.effect="",this.rangeValidation(this.min,this.max);for(var r=0,o=Object.keys(t);r<o.length;r++){switch(o[r]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:n.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var a=this.copyValues(this.values),i=0;i<a.length;i++){var l=a[i];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,a)&&a.push(l)}this.setProperties({values:a},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,n.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,n,this.isMultiSelection,this.values)}}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var t=eGe(this.element,"form");t&&RKe.remove(t,"reset",this.formResetHandler.bind(this))}},t.prototype.navigateTo=function(t,n,r){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,n,r)},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.addDate=function(t){if("string"!=typeof t&&"number"!=typeof t){var n=this.copyValues(this.values);if("object"==typeof t&&t.length>0)for(var r=t,o=0;o<r.length;o++)this.checkDateValue(r[o])&&!e.prototype.checkPresentDate.call(this,r[o],n)&&(!ZUe(n)&&n.length>0?n.push(r[o]):n=[new Date(+r[o])]);else this.checkDateValue(t)&&!e.prototype.checkPresentDate.call(this,t,n)&&(!ZUe(n)&&n.length>0?n.push(t):n=[new Date(+t)]);this.setProperties({values:n},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,n),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!ZUe(this.values)&&this.values.length>0){var t=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var n=e,r=0;r<n.length;r++)for(var o=0;o<t.length;o++)+t[o]==+n[r]&&t.splice(o,1);else for(o=0;o<t.length;o++)+t[o]==+e&&t.splice(o,1);this.setProperties({values:t},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},t.prototype.setTodayDate=function(t){var n=new Date(+t);this.setProperties({value:n},!0),e.prototype.todayButtonClick.call(this,null,n,!0)},t.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},t.prototype.selectDate=function(t,n,r){e.prototype.selectDate.call(this,t,n,r,this.isMultiSelection,this.values),this.isMultiSelection&&!ZUe(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(t)},t.prototype.changeEvent=function(e){((this.value&&this.value.valueOf())!==(this.previousDate&&+this.previousDate.valueOf())||this.isMultiSelection)&&(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},t.prototype.triggerChange=function(e){!ZUe(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!ZUe(e),ZUe(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||+this.value==+this.previousDate&&(null!=this.previousDate||isNaN(+this.value))?ZUe(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},QCt([vGe(null)],t.prototype,"value",void 0),QCt([vGe(null)],t.prototype,"values",void 0),QCt([vGe(!1)],t.prototype,"isMultiSelection",void 0),QCt([yGe()],t.prototype,"change",void 0),t=QCt([wGe],t)}(wMt);var xMt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EMt=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},kMt="e-input-group",SMt="e-popup",CMt="e-left-calendar",MMt="e-right-calendar",_Mt="e-daterangepicker",NMt="e-error",AMt="e-active",OMt="e-start-date",IMt="e-end-date",DMt="e-start-btn",PMt="e-input-focus",TMt="e-range-hover",HMt="e-other-month",LMt="e-start-label",zMt="e-end-label",RMt="e-disabled",BMt="e-selected",$Mt="e-calendar",ZMt="e-next",VMt="e-prev",jMt="e-header",WMt="e-title",FMt="e-icon-container",qMt="e-date-range-container",YMt="e-presets",UMt="e-today",KMt="e-focused-date",GMt="e-content",XMt="e-day-span",QMt="e-week-number",JMt="e-date-disabled",e_t="e-icon-disabled",t_t="e-device",n_t="e-overlay",r_t="e-list-item",o_t="e-hover",a_t="e-range-overflow",i_t="e-flat",l_t="e-css",s_t="e-non-edit",c_t="e-daterange-hidden",u_t=["title","class","style"],d_t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xMt(t,e),EMt([vGe()],t.prototype,"label",void 0),EMt([vGe()],t.prototype,"start",void 0),EMt([vGe()],t.prototype,"end",void 0),t}(HGe),h_t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.isCustomRange=!1,r.isCustomWindow=!1,r.presetsItem=[],r.liCollections=[],r.previousEleValue="",r.isKeyPopup=!1,r.dateDisabled=!1,r.isRangeIconClicked=!1,r.isMaxDaysClicked=!1,r.disabledDays=[],r.preventBlur=!1,r.preventFocus=!1,r.invalidValueString=null,r.isAngular=!1,r.preventChange=!1,r.dateRangeOptions=t,r}return xMt(t,e),t.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},t.prototype.preRender=function(){if(this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),VKe([this.cloneElement],[_Mt,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=jUe("ej2-datetimepicker"),null!==this.angularTag&&GKe(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var t=this.value.split(" "+this.separator+" ");this.value=[new Date(t[0]),new Date(t[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=eGe(this.element,"form")},t.prototype.updateValue=function(){this.value&&this.value.length>0?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"==typeof this.value[0]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))):(this.startValue=null,this.setValue()),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):"string"==typeof this.value[1]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):"string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end)),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):ZUe(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},t.prototype.initProperty=function(){this.globalize=new kKe(this.locale),this.checkFormat(),this.checkView(),(ZUe(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},t.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||ZUe(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},t.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),BUe(this.defaultKeyConfigs,{shiftTab:"shift+tab",tab:"tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new aXe("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},t.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var n=0;n<this.element.attributes.length;n++)t[this.element.attributes[n].name]=this.element.getAttribute(this.element.attributes[n].name);for(var r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];0===a.indexOf("data")&&(this.firstHiddenChild.setAttribute(a,t[a]),this.secondHiddenChild.setAttribute(a,t[a]))}},t.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):GKe(this.inputElement,{readonly:""}),this.updateClearIconState()},t.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&VKe([this.inputWrapper.container],[s_t]):""===this.inputElement.value?VKe([this.inputWrapper.container],[s_t]):ZKe([this.inputWrapper.container],[s_t])},t.prototype.validationAttribute=function(e,t){var n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",n),e.removeAttribute("name");for(var r=["required","aria-required","form"],o=0;o<r.length;o++)if(!ZUe(e.getAttribute(r[o]))){var a=e.getAttribute(r[o]);t.setAttribute(r[o],a),e.removeAttribute(r[o])}},t.prototype.updateHtmlAttributeToWrapper=function(){if(!ZUe(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var n=t[e];if(u_t.indexOf(n)>-1)if("class"===n){var r=this.htmlAttributes[n].replace(/\s+/g," ").trim();""!==r&&ZKe([this.inputWrapper.container],r.split(" "))}else if("style"===n){var o=this.inputWrapper.container.getAttribute(n);o=ZUe(o)?this.htmlAttributes[n]:o+this.htmlAttributes[n],this.inputWrapper.container.setAttribute(n,o)}else this.inputWrapper.container.setAttribute(n,this.htmlAttributes[n])}},t.prototype.updateHtmlAttributeToElement=function(){if(!ZUe(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var n=t[e];u_t.indexOf(n)<0&&this.inputElement.setAttribute(n,this.htmlAttributes[n])}},t.prototype.updateCssClass=function(e,t){ZUe(t)||(t=t.replace(/\s+/g," ").trim()),ZUe(e)||(e=e.replace(/\s+/g," ").trim()),rSt.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&rSt.setCssClass(e,[this.popupWrapper],t)},t.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,n=this.presets;t<n.length;t++){var r=n[t],o=r.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof r.end?this.presetsItem.push({id:o,text:r.label,end:new Date(this.checkValue(r.end)),start:new Date(this.checkValue(r.start))}):this.presetsItem.push({id:o,text:r.label,start:r.start,end:r.end})}var a=ZUe(this.startValue)?null:new Date(+this.startValue),i=ZUe(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:a,end:i}),ZUe(this.startValue)||ZUe(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},t.prototype.bindEvents=function(){RKe.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),RKe.add(this.inputElement,"focus",this.inputFocusHandler,this),RKe.add(this.inputElement,"blur",this.inputBlurHandler,this),RKe.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&RKe.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new oXe(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&RKe.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},t.prototype.unBindEvents=function(){RKe.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),RKe.remove(this.inputElement,"blur",this.inputBlurHandler),RKe.remove(this.inputElement,"focus",this.inputFocusHandler),RKe.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&RKe.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||ZUe(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&RKe.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},t.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={type:"datetime",skeleton:"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.endDate,e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change")}},t.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},t.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&RKe.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},t.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e)}},t.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},t.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var t=this.inputElement.getAttribute("value");ZUe(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(ZUe(this.value)||ZUe(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),t="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(rSt.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},t.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&this.value.length>0&&this.setProperties({value:null},!0),rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),ZUe(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},t.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||ZUe(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),ZKe([this.inputWrapper.container],[PMt])))},t.prototype.checkHtmlAttributes=function(e){this.globalize=new kKe(this.locale);for(var t=e?ZUe(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],n={format:this.formatString,type:"date",skeleton:"yMd"},r=0,o=t;r<o.length;r++){var a=o[r];if(!ZUe(this.inputElement.getAttribute(a)))switch(a){case"disabled":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var i="disabled"===this.inputElement.getAttribute(a)||""===this.inputElement.getAttribute(a)||"true"===this.inputElement.getAttribute(a);this.setProperties({enabled:!i},!e)}break;case"readonly":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var l="readonly"===this.inputElement.getAttribute(a)||"true"===this.inputElement.getAttribute(a)||""===this.inputElement.getAttribute(a);this.setProperties({readonly:l},!e)}break;case"placeholder":(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(a)},!e);break;case"value":if(ZUe(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var s=this.inputElement.getAttribute(a);this.setProperties(HUe(a,s,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(a));break;case"min":if(ZUe(this.min)||+this.min==+new Date(1900,0,1)||e){var c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.setProperties(HUe(a,c,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(a));break;case"max":if(ZUe(this.max)||+this.max==+new Date(2099,11,31)||e){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.setProperties(HUe(a,c,{}),!e)}break;case"startDate":if(ZUe(this.startDate)){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.startValue=c,this.setValue()}break;case"endDate":if(ZUe(this.endDate)){c=this.globalize.parseDate(this.inputElement.getAttribute(a),n);this.endValue=c,this.setValue()}break;case"minDays":ZUe(this.minDays)&&this.setProperties(HUe(a,parseInt(this.inputElement.getAttribute(a),10),{}),!0);break;case"maxDays":ZUe(this.maxDays)&&this.setProperties(HUe(a,parseInt(this.inputElement.getAttribute(a),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(a)&&this.inputElement.setAttribute("type","text")}}},t.prototype.createPopup=function(){for(var e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,n=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(t.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(n.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=$Ke("div",{id:this.element.id+"_popup",className:_Mt+" "+SMt}),this.adjustLongHeaderWidth();var r=!this.isCustomRange||this.isMobile;!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&r?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},t.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),ZUe(this.endValue)||ZUe(this.startValue)||this.disabledDateRender(),this.updateHeader()},t.prototype.clearCalendarEvents=function(){RKe.clearEvents(this.leftCalPrevIcon),RKe.clearEvents(this.leftCalNextIcon),RKe.clearEvents(this.rightCalPrevIcon),RKe.clearEvents(this.rightCalNextIcon)},t.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},t.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(RMt)&&RKe.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(RMt)&&RKe.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(RMt)&&RKe.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(RMt)&&RKe.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},t.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),RKe.add(this.startButton.element,"click",this.deviceHeaderClick,this),RKe.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+MMt+" ."+jMt+" ."+WMt),this.headerTitleElement=this.popupObj.element.querySelector("."+CMt+" ."+jMt+" ."+WMt),this.defaultKeyConfigs=$Ue(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new oXe(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new oXe(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.calendarIconRipple=function(){_Ge(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),_Ge(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},t.prototype.deviceCalendarEvent=function(){RKe.clearEvents(this.nextIcon),RKe.clearEvents(this.previousIcon),_Ge(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),_Ge(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(RMt)&&RKe.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(RMt)&&RKe.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},t.prototype.deviceNavNext=function(e){var t=eGe(e.target,"."+$Mt);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},t.prototype.deviceNavPrevious=function(e){var t=eGe(e.target,"."+$Mt);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},t.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+VMt),this.nextIcon=e.querySelector("."+ZMt),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+GMt),this.tableBodyElement=XKe("."+GMt+" tbody",e),this.table=e.querySelector("."+GMt).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+jMt+" ."+WMt),this.headerElement=e.querySelector("."+jMt))},t.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains(DMt)&&!ZUe(this.startValue)){this.endButton.element.classList.remove(AMt),this.startButton.element.classList.add(AMt);var t=this.popupObj.element.querySelector("."+$Mt);this.updateDeviceCalendar(t),ZUe(this.calendarElement.querySelector("."+OMt+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),KKe(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!ZUe(this.startValue)&&!ZUe(this.endValue)){this.startButton.element.classList.remove(AMt),this.endButton.element.classList.add(AMt);t=this.popupObj.element.querySelector("."+$Mt);this.updateDeviceCalendar(t),ZUe(this.calendarElement.querySelector("."+IMt+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),KKe(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)),this.selectableDates()}},t.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.updateHiddenInput(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},t.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(ZUe(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!ZUe(t)&&""!==t.trim()){var n=t.split(" "+this.separator+" ");if(n.length>1){this.invalidValueString=null;var r={format:this.formatString,type:"date",skeleton:"yMd"},o=this.globalize.parseDate(n[0].trim(),r),a=this.globalize.parseDate(n[1].trim(),r);if(!(ZUe(o)||isNaN(+o)||ZUe(a)||isNaN(+a))){var i=this.startValue;this.startValue=o;var l=this.endValue;if(this.endValue=a,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var s={model:this};this.trigger("blur",s)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=i,this.endValue=l))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(ZUe(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(ZUe(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;s={model:this};this.trigger("blur",s)}}this.updateHiddenInput()}},t.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},t.prototype.errorClass=function(){var e=this.inputElement.value.trim();(ZUe(this.endValue)&&ZUe(this.startValue)&&""!==e||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(ZKe([this.inputWrapper.container],NMt),GKe(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(VKe([this.inputWrapper.container],NMt),GKe(this.inputElement,{"aria-invalid":"false"}))},t.prototype.keyCalendarUpdate=function(e,t,n){return void 0===n&&(n=!0),n&&this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},t.prototype.navInCalendar=function(e,t,n,r,o){var a,i,l=this.getViewNumber(this.currentView()),s=this.min;switch(i=ZUe(this.maxDays)||!this.isMaxDaysClicked||ZUe(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":a=new Date(+this.currentDate),this.addDay(a,1,e,i,s),t&&+a==+r&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(1,l,e,i,s),this.keyNavigation(o,e);break;case"moveLeft":a=new Date(+this.currentDate),this.addDay(a,-1,e,i,s),t||+a==+n&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-1,l,e,i,s),this.keyNavigation(o,e);break;case"moveUp":0===l?(a=new Date(+this.currentDate),this.addDay(a,-7,e,i,s),+a<=+n&&!t&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-7,l,e,i,s)):this.keyboardNavigate(-4,l,e,this.max,this.min),this.keyNavigation(o,e);break;case"moveDown":0===l?(a=new Date(+this.currentDate),this.addDay(a,7,e,i,s),t&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(7,l,e,i,s)):this.keyboardNavigate(4,l,e,this.max,this.min),this.keyNavigation(o,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),KKe(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,l),KKe(this.tableBodyElement),0===l?this.renderMonths(e):1===l?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"tab":if(this.tabKeyValidation(o,CMt))ZUe((o=this.keyCalendarUpdate(!1,o,!1)).querySelector(".e-focused-date"))&&(this.currentDate=this.firstCellToFocus(this.rightCalendar)),this.keyboardNavigate(0,l,e,i,s),this.keyNavigation(o,e);break;case"shiftTab":if(this.tabKeyValidation(o,MMt))ZUe((o=this.keyCalendarUpdate(!0,o,!1)).querySelector(".e-focused-date"))&&(this.currentDate=this.firstCellToFocus(this.leftCalendar)),this.keyboardNavigate(0,l,e,i,s),this.keyNavigation(o,e)}},t.prototype.firstCellToFocus=function(e){var t=e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-month)"),n=t&&t.id?t.id.split("_")[0]:null,r=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return n?new Date(+n):r},t.prototype.keyInputHandler=function(t,n){var r,o=this.getViewNumber(this.currentView()),a=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),i=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),l=eGe(t.target,"."+MMt),s=(l=ZUe(l)?this.leftCalendar:l).classList.contains(CMt);this.updateCalendarElement(l);var c=this.tableBodyElement.querySelector("tr td.e-selected"),u=l.querySelector("tr td."+KMt),d=l.querySelector("tr td."+OMt),h=l.querySelector("tr td."+IMt),p=this.getViewNumber(this.depth),f=o===p&&this.getViewNumber(this.start)>=p,m=eGe(t.target,"."+CMt),v=eGe(t.target,"."+MMt),g=eGe(t.target,"."+YMt);switch(ZUe(u)?ZUe(h)||this.dateDisabled?ZUe(d)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",t.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(t),this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt]));break;case"select":if(f){var b=ZUe(u)?d:u;ZUe(b)||b.classList.contains(RMt)||this.selectRange(null,b)}else(ZUe(c)||f)&&ZUe(u)||(ZUe(this.value)||(n=this.calendarElement.classList.contains(CMt)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--o,u||c,n));t.preventDefault();break;case"controlHome":var y=new Date(this.currentDate.getFullYear(),0,1);!s&&+y<+i&&(l=this.keyCalendarUpdate(!0,l)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(l,t);break;case"altRightArrow":ZUe(m)?ZUe(v)?ZUe(g)||this.cancelButton.element.focus():ZUe(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),t.preventDefault();break;case"altLeftArrow":ZUe(m)?ZUe(v)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),t.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(CMt),this.calendarNavigation(t,this.calendarElement),t.preventDefault();break;case"controlDown":ZUe(c)&&ZUe(u)||f||(ZUe(this.value)||(n=this.calendarElement.classList.contains(CMt)?this.startDate:this.endDate),this.controlDown=t,this.contentClick(null,--o,c||u,n)),t.preventDefault();break;case"controlEnd":y=new Date(this.currentDate.getFullYear(),11,31);s&&+y>+a&&(l=this.keyCalendarUpdate(!1,l)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(l,t);break;case"pageUp":r=new Date(+this.currentDate),this.addMonths(r,-1),!s&&+r<=+i&&(l=this.keyCalendarUpdate(!0,l)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"pageDown":r=new Date(+this.currentDate),this.addMonths(r,1),s&&+r>=+a&&(l=this.keyCalendarUpdate(!1,l)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftPageUp":r=new Date(+this.currentDate),this.addYears(r,-1),!s&&+r<=+i&&(l=this.keyCalendarUpdate(!0,l)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftPageDown":r=new Date(+this.currentDate),this.addYears(r,1),s&&+r>=+a&&(l=this.keyCalendarUpdate(!1,l)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(l,t);break;case"shiftTab":ZUe(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),s&&t.preventDefault(),this.tabKeyValidation(l,MMt)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(t,s,i,a,l));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(t);break;case"tab":this.tabKeyValidation(l,CMt)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(t,s,i,a,l));break;default:this.navInCalendar(t,s,i,a,l),this.checkMinMaxDays()}this.presetHeight()},t.prototype.tabKeyValidation=function(e,t){var n=e.classList.contains(t),r=this.rightCalendar.querySelector(".e-header"),o=this.leftCalendar.querySelector(".e-header"),a=!!r&&r.classList.contains("e-month"),i=!!o&&o.classList.contains("e-month");return n&&i&&a&&!this.isMobile},t.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(CMt)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},t.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||ZUe(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},t.prototype.bindCalendarCellEvents=function(e){for(var t=0,n=e?e.querySelectorAll("."+$Mt+" td"):this.popupObj.element.querySelectorAll("."+$Mt+" td");t<n.length;t++){var r=n[t];RKe.clearEvents(r),r.classList.contains(RMt)||r.classList.contains(JMt)||r.classList.contains(QMt)||(this.isMobile||RKe.add(r,"mouseover",this.hoverSelection,this),RKe.add(r,"mousedown",this.selectRange,this))}},t.prototype.removeFocusedDate=function(){for(var e=!ZUe(this.startValue)||!ZUe(this.endValue),t=0,n=this.popupObj.element.querySelectorAll("."+$Mt+" ."+KMt);t<n.length;t++){var r=n[t],o=new Date,a=this.getIdValue(null,r);("Month"===this.depth&&"Month"===this.currentView()&&(!r.classList.contains(UMt)||r.classList.contains(UMt)&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(o,a)&&!this.isSameYear(o,a)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(o,a)||e))&&(r.classList.remove(KMt),r.classList.contains(OMt)||r.classList.contains(IMt)||r.removeAttribute("aria-label"))}},t.prototype.hoverSelection=function(e,t){var n=t||e.currentTarget,r=this.getIdValue(null,n);if(!ZUe(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&ZUe(this.endValue)&&ZUe(this.startValue)||!ZUe(this.startValue)&&ZUe(this.endValue)))for(var o=0,a=this.popupObj.element.querySelectorAll("."+$Mt+" td");o<a.length;o++){var i=a[o],l=!i.classList.contains(RMt)||i.classList.contains(JMt);if(!i.classList.contains(QMt)&&l){var s=this.getIdValue(null,i),c=new Date(+this.startValue);new Date(+s).setHours(0,0,0,0)>=c.setHours(0,0,0,0)&&+s<=+r?ZKe([i],TMt):VKe([i],[TMt])}}},t.prototype.isSameStartEnd=function(e,t){var n=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(n=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(n=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(n=!0),n},t.prototype.updateRange=function(e){if(!ZUe(this.startValue))for(var t=0,n=e;t<n.length;t++)for(var r=0,o=n[t].querySelectorAll("."+$Mt+" td");r<o.length;r++){var a=o[r];if(!a.classList.contains(QMt)&&!a.classList.contains(RMt)){var i=this.getIdValue(null,a),l=this.getIdValue(null,a);if(ZUe(this.endValue)?VKe([a],[TMt]):this.currentView()===this.depth&&+l.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+l.setHours(0,0,0,0)<=+new Date(+this.endValue).setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&ZKe([a],TMt),a.classList.contains(BMt)&&a.classList.contains(IMt)&&+l!=+this.endValue&&(VKe([a],[BMt]),VKe([a],[IMt])),a.classList.contains(TMt)&&+l>+this.endValue&&VKe([a],[TMt]),!a.classList.contains(HMt)){var s=new Date(+this.startValue),c=new Date(+i);this.currentView()===this.depth&&+c.setHours(0,0,0,0)==+s.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)>=+s.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(ZKe([a],[OMt,BMt]),this.addSelectedAttributes(a,this.startValue,!0));var u=new Date(+this.endValue);"Year"===this.currentView()?c=new Date(c.getFullYear(),c.getMonth()+1,0):"Decade"===this.currentView()&&(c=new Date(c.getFullYear(),11,31)),this.currentView()===this.depth&&!ZUe(this.endValue)&&+c.setHours(0,0,0,0)==+u.setHours(0,0,0,0)&&+c.setHours(0,0,0,0)<=+u.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(ZKe([a],[IMt,BMt]),this.addSelectedAttributes(a,this.startValue,!1)),+i!=+this.startValue||ZUe(this.endValue)||+i!=+this.endValue||this.addSelectedAttributes(a,this.endValue,!1,!0)}}}},t.prototype.checkMinMaxDays=function(){(!ZUe(this.minDays)&&this.minDays>0||!ZUe(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+CMt)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+MMt))))},t.prototype.rangeArgs=function(e){var t,n,r=ZUe(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),o=ZUe(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"});return ZUe(this.endValue)||ZUe(this.startValue)?(t="",n=0):(t=r+" "+this.separator+" "+o,n=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:n,event:e||null,element:this.element,isInteracted:!ZUe(e),text:t}},t.prototype.otherMonthSelect=function(e,t,n){var r=+this.getIdValue(null,e),o='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+r),a=this.popupObj&&this.popupObj.element.querySelector(o);ZUe(a)||(t?(ZKe([a],[OMt,BMt]),this.addSelectedAttributes(a,this.startValue,!0)):(ZKe([a],[IMt,BMt]),this.addSelectedAttributes(a,this.endValue,!0)),n&&this.addSelectedAttributes(e,this.endValue,!1,!0))},t.prototype.selectRange=function(e,t){var n,r;e&&e.preventDefault();var o=ZUe(e)?this.getIdValue(null,t):this.getIdValue(e,null),a=o.getFullYear(),i=o.getMonth(),l=new Date(a,i,1),s=new Date(a,i+1,0),c=new Date(a,0,1),u=new Date(a,11,31);ZUe(this.endValue)||ZUe(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(AMt)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(AMt))&&this.removeSelection();var d=t||e.currentTarget;if(ZUe(this.startValue))ZUe(this.previousStartValue)||(o.setHours(this.previousStartValue.getHours()),o.setMinutes(this.previousStartValue.getMinutes()),o.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?l:c,this.endValue=null,this.setValue(),ZKe([d],OMt),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(HMt)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(AMt),this.startButton.element.classList.remove(AMt),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+o==+this.startValue||+o>+this.startValue){if(+o==+this.startValue&&!ZUe(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),ZUe(this.previousEndValue)||(o.setHours(this.previousEndValue.getHours()),o.setMinutes(this.previousEndValue.getMinutes()),o.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?s:u,this.setValue();var h=this.popupObj.element.querySelectorAll("."+IMt);if(this.isMobile){this.startButton.element.classList.remove(AMt),this.endButton.element.classList.add(AMt);for(var p=0,f=h;p<f.length;p++){var m=f[p];m.removeAttribute("aria-label"),m.classList.contains(OMt)?(this.addSelectedAttributes(m,this.startValue,!0),VKe([m],[IMt])):(m.setAttribute("aria-selected","false"),VKe([m],[IMt,BMt]))}}ZKe([d],IMt),+this.endValue==+this.startValue?this.addSelectedAttributes(d,this.endValue,!1,!0):this.addSelectedAttributes(d,this.endValue,!1),d.classList.contains(HMt)&&(+this.endValue==+this.startValue?this.otherMonthSelect(d,!1,!0):this.otherMonthSelect(d,!1));for(var v=0,g=h=this.popupObj.element.querySelectorAll("."+IMt);v<g.length;v++){var b=g[v];b.classList.contains(OMt)&&VKe([b],[TMt])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+o<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?l:c,this.setValue(),this.removeSelectedAttributes(),VKe(this.popupObj.element.querySelectorAll("."+OMt),[OMt,BMt]),ZKe([d],OMt),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(HMt)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays());e&&(n=eGe(e.target,"."+CMt)),ZUe(n)?(e&&(r=e&&eGe(e.target,"."+MMt)),ZUe(r)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),ZKe([d],BMt),this.updateHeader(),this.removeFocusedDate()},t.prototype.selectableDates=function(){if(!ZUe(this.startValue)){var e=this.calendarElement.querySelectorAll("."+$Mt+" td"),t=!1;if(this.currentView()===this.depth){for(var n=0,r=e;n<r.length;n++){if(!(i=r[n]).classList.contains(OMt)&&!i.classList.contains(QMt)&&!i.classList.contains(RMt)){if(+this.getIdValue(null,i)<+this.startValue){ZKe([i],[JMt,RMt,n_t]),RKe.clearEvents(i);continue}break}if(i.classList.contains(OMt)&&!i.classList.contains(HMt)){t=!0;break}}t&&(this.previousIcon.classList.contains(RMt)||ZKe([this.previousIcon],[e_t,RMt,n_t]))}else{for(var o=0,a=e;o<a.length;o++){var i=a[o],l=this.startValue.getMonth(),s=this.startValue.getFullYear(),c=this.getIdValue(null,i);if(this.startButton.element.classList.contains(AMt)||!("Year"===this.currentView()&&c.getMonth()<l&&c.getFullYear()<=s||"Decade"===this.currentView()&&c.getMonth()<=l&&c.getFullYear()<s))break;ZKe([i],[RMt])}e[0].classList.contains(RMt)?this.previousIconHandler(!0):e[e.length-1].classList.contains(RMt)&&this.nextIconHandler(!0)}}},t.prototype.updateMinMaxDays=function(e){if(!ZUe(this.startValue)&&ZUe(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(AMt)){if(!ZUe(this.minDays)&&this.minDays>0||!ZUe(this.maxDays)&&this.maxDays>0){var t=this.removeTimeValueFromDate(this.startValue),n=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),r=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1)));n=!ZUe(this.minDays)&&this.minDays>0?n:null,r=!ZUe(this.maxDays)&&this.maxDays>0?r:null,"Year"===this.currentView()?(n=ZUe(n)?null:new Date(n.getFullYear(),n.getMonth(),0),r=ZUe(r)?null:new Date(r.getFullYear(),r.getMonth(),1)):"Decade"===this.currentView()&&(n=ZUe(n)?null:new Date(n.getFullYear()-1,11,1),r=ZUe(r)?null:new Date(r.getFullYear(),0,1));for(var o=void 0,a=0,i=e.querySelectorAll("."+$Mt+" td");a<i.length;a++){var l=i[a];if(!l.classList.contains(OMt)&&!l.classList.contains(QMt)){var s=this.getIdValue(null,l);if(s=this.removeTimeValueFromDate(s),!ZUe(n)&&+s==+n&&l.classList.contains(RMt)&&n.setDate(n.getDate()+1),!l.classList.contains(RMt)){if(+s<=+t)continue;!ZUe(n)&&+s<+n&&(ZKe([l],[JMt,RMt,n_t]),RKe.clearEvents(l)),!ZUe(r)&&+s>+r&&(ZKe([l],[JMt,RMt,n_t]),this.isMaxDaysClicked=!0,RKe.clearEvents(l),ZUe(o)&&!l.classList.contains(HMt)&&(o=l))}}}if(!ZUe(o))if(this.isMobile)this.nextIcon.classList.contains(RMt)||ZKe([this.nextIcon],[e_t,RMt,n_t]);else{var c=eGe(o,"."+MMt);(c=ZUe(c)?this.leftCalendar:c).classList.contains(CMt)?(this.rightCalNextIcon.classList.contains(RMt)||ZKe([this.rightCalNextIcon],[e_t,RMt,n_t]),this.leftCalNextIcon.classList.contains(RMt)||ZKe([this.leftCalNextIcon],[e_t,RMt,n_t]),this.rightCalPrevIcon.classList.contains(RMt)||ZKe([this.rightCalPrevIcon],[e_t,RMt,n_t])):this.rightCalNextIcon.classList.contains(RMt)||ZKe([this.rightCalNextIcon],[e_t,RMt,n_t])}}}else this.isMaxDaysClicked=!1},t.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.prototype.removeClassDisabled=function(){for(var e=0,t=this.popupObj.element.querySelectorAll("."+$Mt+" td."+JMt);e<t.length;e++){var n=t[e];n.classList.contains(JMt)&&(VKe([n],[JMt,RMt,n_t]),RKe.add(n,"click",this.selectRange,this),this.isMobile||RKe.add(n,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(e_t)&&VKe([this.nextIcon],[e_t,RMt,n_t]),this.previousIcon.classList.contains(e_t)&&VKe([this.previousIcon],[e_t,RMt,n_t])):(this.rightCalNextIcon.classList.contains(e_t)&&VKe([this.rightCalNextIcon],[e_t,RMt,n_t]),this.rightCalPrevIcon.classList.contains(e_t)&&VKe([this.rightCalPrevIcon],[e_t,RMt,n_t]),this.leftCalNextIcon.classList.contains(e_t)&&VKe([this.leftCalNextIcon],[e_t,RMt,n_t]))},t.prototype.updateHeader=function(){var e={type:"date",skeleton:"yMMMd"};if(ZUe(this.endValue)||ZUe(this.startValue))this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays");else{var t=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;ZUe(this.disabledDayCnt)||(t-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+XMt).textContent=t.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(ZUe(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),ZUe(this.endValue)||ZUe(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(ZUe(this.endValue)||ZUe(this.startValue)?this.popupObj.element.querySelector("."+zMt).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+zMt).textContent=this.globalize.formatDate(this.endValue,e),ZUe(this.startValue)?this.popupObj.element.querySelector("."+LMt).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+LMt).textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+XMt).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+LMt).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+zMt).textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},t.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll("."+BMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+BMt),[OMt,IMt,BMt]),this.popupObj.element.querySelectorAll("."+KMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+KMt),KMt),this.popupObj.element.querySelectorAll("."+TMt).length>0&&VKe(this.popupObj.element.querySelectorAll("."+TMt),[TMt]))},t.prototype.addSelectedAttributes=function(e,t,n,r){if(e){var o=this.globalize.formatDate(t,{type:"date",skeleton:"full"});!ZUe(r)&&r?e.setAttribute("aria-label","The current start and end date is "+o):e.setAttribute("aria-label","The current "+(n?"start":"end")+" date is "+o),e.setAttribute("aria-selected","true")}},t.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+OMt);e<t.length;e++){(o=t[e]).setAttribute("aria-selected","false"),o.removeAttribute("aria-label")}for(var n=0,r=this.popupObj.element.querySelectorAll("."+IMt);n<r.length;n++){var o;(o=r[n]).setAttribute("aria-selected","false"),o.removeAttribute("aria-label")}}},t.prototype.updateCalendarElement=function(e){e.classList.contains(CMt)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector("."+GMt),this.tableBodyElement=XKe("."+GMt+" tbody",e),this.table=e.querySelector("."+GMt).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+jMt+" ."+WMt),this.headerElement=e.querySelector("."+jMt)},t.prototype.navPrevMonth=function(e){e.preventDefault();var t=eGe(e.target,"."+CMt);t=ZUe(t)?eGe(e.target,"."+MMt):t,this.updateCalendarElement(t),this.navigatePrevious(e),!ZUe(this.startValue)&&ZUe(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+$Mt)]),this.endButton.element.classList.contains(AMt)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+$Mt)),this.endButton.element.classList.contains(AMt)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},t.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(MMt)?this.rightCalCurrentDate=new Date(+(t||this.currentDate)):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},t.prototype.navNextMonth=function(e){e.preventDefault();var t=eGe(e.target,"."+CMt);t=ZUe(t)?eGe(e.target,"."+MMt):t,this.updateCalendarElement(t),this.navigateNext(e),!ZUe(this.startValue)&&ZUe(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},t.prototype.isPopupOpen=function(){return!(ZUe(this.popupObj)||!this.popupObj.element.classList.contains(SMt))},t.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var t=this.createElement("button",{className:"e-end-btn"}),n=this.createElement("button",{className:DMt});this.startButton=new BQe({content:this.l10n.getConstant("startLabel")},n),this.endButton=new BQe({content:this.l10n.getConstant("endLabel")},t),e.appendChild(n),e.appendChild(t)}else{var r=this.createElement("a",{className:LMt}),o=this.createElement("a",{className:zMt}),a=this.createElement("span",{className:"e-change-icon e-icons"});GKe(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),GKe(o,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(r),e.appendChild(a),e.appendChild(o),r.textContent=this.l10n.getConstant("startLabel"),o.textContent=this.l10n.getConstant("endLabel")}return e},t.prototype.disableInput=function(){this.strictMode?ZUe(this.previousStartValue)||ZUe(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),rSt.setEnabled(this.enabled,this.inputElement),this.bindEvents()},t.prototype.validateMinMax=function(){this.min=ZUe(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=ZUe(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(ZUe(this.minDays)||ZUe(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!ZUe(this.minDays)&&this.minDays<0&&(this.minDays=null),!ZUe(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},t.prototype.validateRangeStrict=function(){ZUe(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),ZUe(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},t.prototype.validateRange=function(){this.validateMinMaxDays()},t.prototype.validateMinMaxDays=function(){if(!ZUe(this.startValue)&&!ZUe(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!ZUe(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var t=new Date(+this.startValue);t.setDate(t.getDate()+(this.minDays-1)),+t>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=t,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();ZUe(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},t.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add($Mt),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),GKe(this.calendarElement,{role:"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},t.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},t.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},t.prototype.isSameDecade=function(e,t){var n=e.getFullYear(),r=t.getFullYear();return n-n%10==r-r%10},t.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},t.prototype.selectNextMonth=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},t.prototype.selectNextYear=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1))},t.prototype.selectNextDecade=function(){if(ZUe(this.endValue)||ZUe(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;this.currentDate.setFullYear(e)}else this.currentDate=new Date(+this.endValue),(!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue||!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10))},t.prototype.selectStartMonth=function(){ZUe(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!ZUe(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!ZUe(this.endValue)&&+this.endValue>+this.max||!ZUe(this.startValue)&&+this.startValue<+this.min||!ZUe(this.startValue)&&!ZUe(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},t.prototype.createCalendar=function(){var t=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){ZUe(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var n=this.calendarElement.querySelector("."+$Mt+" ."+VMt),r=this.calendarElement.querySelector("."+$Mt+" ."+ZMt);KKe(this.calendarElement.querySelector("."+$Mt+" ."+FMt)),this.calendarElement.querySelector("."+$Mt+" ."+jMt).appendChild(r),this.calendarElement.querySelector("."+$Mt+" ."+jMt).appendChild(n),FKe([n],this.calendarElement.querySelector("."+$Mt+" ."+jMt)),this.deviceCalendar=this.calendarElement,t.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+$Mt+" ."+jMt+" ."+WMt)}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(CMt),this.leftCalPrevIcon=this.calendarElement.querySelector("."+CMt+" ."+VMt),this.leftCalNextIcon=this.calendarElement.querySelector("."+CMt+" ."+ZMt),this.leftTitle=this.calendarElement.querySelector("."+CMt+" ."+WMt),KKe(this.calendarElement.querySelector("."+CMt+" ."+FMt)),this.calendarElement.querySelector("."+CMt+" ."+jMt).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+CMt+" ."+jMt).appendChild(this.leftCalPrevIcon),FKe([this.leftCalPrevIcon],this.calendarElement.querySelector("."+CMt+" ."+jMt)),this.leftCalendar=this.calendarElement;var o=this.createElement("div",{className:"e-left-container"}),a=this.createElement("div",{className:"e-right-container"});o.appendChild(this.leftCalendar),t.appendChild(o),this.isMobile||RKe.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),ZKe([this.calendarElement],MMt),this.rightCalendar=this.calendarElement,VKe([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),VKe([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+MMt+" ."+VMt),this.rightCalNextIcon=this.calendarElement.querySelector("."+MMt+" ."+ZMt),this.rightTitle=this.calendarElement.querySelector("."+MMt+" ."+WMt),KKe(this.calendarElement.querySelector("."+MMt+" ."+FMt)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+MMt+" ."+jMt).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+MMt+" ."+jMt).appendChild(this.rightCalPrevIcon),FKe([this.rightCalPrevIcon],this.calendarElement.querySelector("."+MMt+" ."+jMt)),a.appendChild(this.rightCalendar),t.appendChild(a),this.isMobile||RKe.add(this.rightTitle,"click",this.rightNavTitle,this)}return t},t.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.calendarNavigation=function(t,n){this.table=n.querySelector("table"),this.headerTitleElement=n.querySelector(".e-title"),this.tableBodyElement=n.querySelector("tbody"),this.tableHeadElement=n.querySelector("thead"),this.contentElement=n.querySelector(".e-content"),this.updateCalendarElement(n),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},t.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},t.prototype.clickEventEmitter=function(e){this.isMobile||(eGe(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},t.prototype.currentView=function(){return e.prototype.currentView.call(this)},t.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},t.prototype.navigatedEvent=function(t){if(this.trigger("navigated",this.navigatedArgs),!ZUe(this.popupObj)){var n=this.getCalendarView(this.currentView());if(this.isMobile)n===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates();else if(this.isMobile||n!==this.depth)this.updateNavIcons(),this.calendarIconEvent();else{if((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!t||t.currentTarget.children[0].classList.contains("e-icons"))&&ZUe(this.controlDown))(t&&!t.currentTarget.children[0].classList.contains("e-icons")||!ZUe(this.controlDown))&&(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&ZUe(this.endValue)&&("Month"===n&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()||"Year"===n&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear())?e.prototype.navigateTo.call(this,n,new Date(+this.startValue)):e.prototype.navigateTo.call(this,n,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null);else{this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,n,this.rightCalCurrentDate);var r=this.rightCalCurrentDate?this.rightCalCurrentDate:this.currentDate;this.updateControl(this.rightCalendar,r),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null}this.checkMinMaxDays()}}},t.prototype.createControl=function(){var e=this.createElement("div",{className:qMt}),t=this.createElement("div",{className:"e-range-header"}),n=this.createRangeHeader();t.appendChild(n);var r=this.createElement("div",{className:XMt});GKe(r,{"aria-label":"Selected Days"}),r.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(r);var o=this.createElement("div",{className:"e-separator"}),a=this.createCalendar();e.appendChild(t),e.appendChild(o),e.appendChild(a);var i=this.createElement("div",{className:"e-footer"}),l=this.createElement("button",{className:"e-cancel "+i_t+" "+l_t}),s=this.createElement("button");ZKe([s],["e-apply",i_t,"e-primary",l_t]),i.appendChild(s),i.appendChild(l);var c=!ZUe(this.startValue)&&!ZUe(this.endValue);(this.cancelButton=new BQe({content:this.l10n.getConstant("cancelText")},l),this.applyButton=new BQe({content:this.l10n.getConstant("applyText"),disabled:!c},s),RKe.add(s,"click",this.applyFunction,this),RKe.add(l,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile)||(VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),ZKe([e],"e-range-border"),ZKe([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector("."+YMt).style.height=this.popupWrapper.querySelector("."+qMt).getBoundingClientRect().height+"px"));this.popupWrapper.appendChild(i),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},t.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},t.prototype.deviceHeaderUpdate=function(){ZUe(this.startValue)&&ZUe(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(AMt)):ZUe(this.startValue)||this.startButton.element.classList.add(AMt)},t.prototype.applyFunction=function(e){var t=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),ZKe([this.inputWrapper.container],[PMt])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),ZUe(this.startValue)||ZUe(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,rSt.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),eGe(e.target,"."+kMt)||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new oXe(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},t.prototype.onMouseClick=function(e,t){if("touchstart"!==e.type){var n=eGe(t||e.target,"."+r_t),r=n&&n.classList.contains(AMt);n&&n.classList.contains(r_t)&&this.setListSelection(n,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,n&&n.classList.contains(r_t)&&"custom_range"===n.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():r||"keydown"!==e.type||this.inputElement.focus())}},t.prototype.onMouseOver=function(e){var t=eGe(e.target,"."+r_t);t&&t.classList.contains(r_t)&&!t.classList.contains(o_t)&&ZKe([t],o_t)},t.prototype.onMouseLeave=function(e){var t=eGe(e.target,"."+o_t);ZUe(t)||VKe([t],o_t)},t.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(AMt)||this.isMobile&&e.classList.contains(AMt))){if(this.isMobile&&e.classList.contains(AMt))return this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id?void this.renderCustomPopup():void 0;this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),ZKe([e],AMt),e.setAttribute("aria-selected","true");var n=this.presetsItem[this.activeIndex];"custom_range"===n.id?this.renderCustomPopup():this.applyPresetRange(n,t)}},t.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+AMt);ZUe(e)||(VKe([e],AMt),e.removeAttribute("aria-selected"))},t.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},t.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},t.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},t.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:_Mt+" "+SMt}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},t.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++){_Ge(t[e])}},t.prototype.createPresets=function(){if(!VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:YMt,attrs:{tabindex:"0"}});var e=Gkt.createList(this.createElement,this.presetsItem,null,!0);GKe(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var t=this.presetElement.querySelector("#custom_range");ZUe(t)||(t.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+r_t),this.wireListEvents(),this.isMobile&&(this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!ZUe(this.activeIndex)&&this.activeIndex>-1&&ZKe([this.liCollections[this.activeIndex]],AMt)}},t.prototype.wireListEvents=function(){RKe.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(RKe.add(this.presetElement,"mouseover",this.onMouseOver,this),RKe.add(this.presetElement,"mouseout",this.onMouseLeave,this))},t.prototype.unWireListEvents=function(){ZUe(this.presetElement)||(RKe.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(RKe.remove(this.presetElement,"mouseover",this.onMouseOver),RKe.remove(this.presetElement,"mouseout",this.onMouseLeave)))},t.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var t=this.popupWrapper.getBoundingClientRect().width;ZUe(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new IQe(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:ZUe(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-t,offsetY:4,collision:this.isMobile?VUe(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){GKe(e.inputElement,{"aria-expanded":"true"}),ZKe([e.inputWrapper.buttons[0]],AMt),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new oXe(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new oXe(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),ZUe(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),ZUe(e.presetElement)||(e.keyInputConfigs=$Ue(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new oXe(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new oXe(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),ZUe(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!zKe.isDevice&&RKe.add(document,"keydown",e.popupCloseHandler,e)},close:function(){GKe(e.inputElement,{"aria-expanded":"false"}),VKe([e.inputWrapper.buttons[0]],AMt),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),VUe(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),ZUe(e.popupObj)||(ZUe(e.popupObj.element.parentElement)||UKe(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!zKe.isDevice&&RKe.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){zKe.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add(t_t),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(ZKe([this.modal],[t_t,_Mt,"e-range-modal"]),document.body.className+=" "+a_t,this.modal.style.display="block"),RKe.add(document,"mousedown touchstart",this.documentHandler,this)},t.prototype.popupCloseHandler=function(e){if(27===e.keyCode)this.hide(e)},t.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+OMt);if(e){var t=eGe(e,"."+MMt);t=ZUe(t)?this.leftCalendar:t,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,t.children[1].firstElementChild.focus()),ZKe([e],KMt)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},t.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+YMt),t=this.popupObj&&this.popupObj.element.querySelector("."+qMt);ZUe(e)||ZUe(t)||(e.style.height=t.getBoundingClientRect().height+"px")},t.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var t=this.getHoverLI(),n=this.getActiveLI();if(!ZUe(this.leftCalendar)&&!ZUe(n))if(ZUe(t)||!ZUe(n)&&n===t)if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(n),"custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),n.classList.remove(o_t),void e.preventDefault();ZUe(t)&&ZUe(n)||this.onMouseClick(e,t||n),e.preventDefault();break;case"tab":if(this.leftCalendar){var r=this.getHoverLI();ZUe(r)||r.classList.remove(o_t)}else this.hide(e),e.preventDefault()}},t.prototype.listMoveDown=function(e){var t=this.getHoverLI(),n=this.getActiveLI();if(ZUe(t))if(ZUe(n))ZKe([this.liCollections[0]],o_t);else{var r;!ZUe(r=n.nextElementSibling)&&r.classList.contains(r_t)&&ZKe([r],o_t)}else!ZUe(r=t.nextElementSibling)&&r.classList.contains(r_t)&&(VKe([t],o_t),ZKe([r],o_t))},t.prototype.listMoveUp=function(e){var t=this.getHoverLI(),n=this.getActiveLI();if(ZUe(t)){if(!ZUe(n)){var r;!ZUe(r=n.previousElementSibling)&&r.classList.contains(r_t)&&ZKe([r],o_t)}}else!ZUe(r=t.previousElementSibling)&&r.classList.contains(r_t)&&(VKe([t],o_t),ZKe([r],o_t))},t.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+o_t)},t.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+AMt)},t.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new oXe(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=$Ue(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new oXe(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},t.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,t=this.presetElement.querySelector("."+o_t),n=this.presetElement.querySelector("."+AMt),r=ZUe(t)?n:t;if(!ZUe(r)){var o=r.nextElementSibling,a=o?o.offsetTop:r.offsetTop,i=r.getBoundingClientRect().height;a+r.offsetTop>e?this.presetElement.scrollTop=o?a-(e/2+i/2):a:this.presetElement.scrollTop=0}},t.prototype.popupKeyActionHandle=function(e){var t=eGe(e.target,"."+YMt);switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":ZUe(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":ZUe(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():ZUe(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},t.prototype.documentHandler=function(e){if(!ZUe(this.popupObj)){var t=e.target;this.inputWrapper.container.contains(t)&&(ZUe(this.popupObj)||eGe(t,'[id="'+this.popupWrapper.id+'"]'))||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!ZUe(this.targetElement)&&(ZUe(this.targetElement)||t===this.targetElement)||eGe(t,'[id="'+this.popupWrapper.id+'"]')||eGe(t,"."+kMt)===this.inputWrapper.container||eGe(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},t.prototype.createInput=function(){var e=this.cssClass;ZUe(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=rSt.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),GKe(this.inputElement,{"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),rSt.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),ZUe(this.placeholder)||""===this.placeholder.trim()||rSt.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),ZKe([this.inputWrapper.container],"e-date-range-wrapper"),ZUe(this.inputElement.getAttribute("name"))&&GKe(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},t.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?qUe(this.width):"100%"},t.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&ZKe([this.popupWrapper],"e-daterange-day-header-lg")},t.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),ZUe(this.endValue)||ZUe(this.startValue)||e||this.disabledDateRender(),this.errorClass(),this.previousStartValue=ZUe(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=ZUe(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},t.prototype.updateInput=function(){if(!ZUe(this.endValue)&&!ZUe(this.startValue)){var e={format:this.formatString,type:"date",skeleton:"yMd"},t=this.globalize.formatDate(this.startValue,e),n=this.globalize.formatDate(this.endValue,e);rSt.setValue(t+" "+this.separator+" "+n,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&ZUe(this.value)&&this.invalidValueString&&rSt.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},t.prototype.checkInvalidRange=function(e){if(!ZUe(e)){var t=!1,n=void 0,r=void 0,o=null,a=null,i=null,l=!1,s=!1,c=!1;if("string"==typeof e){var u=e.split(" "+this.separator+" ");2===u.length?(o=u[0],a=u[1]):(t=!0,i=e)}else e.length>0?(n=e[0],r=e[1]):(n=e.start,r=e.end),n instanceof Date||"object"==typeof n?n instanceof Date?l=!0:ZUe(n)||(c=!0):o=this.getstringvalue(n),r instanceof Date||"object"==typeof r?r instanceof Date?s=!0:ZUe(r)||(c=!0):a=this.getstringvalue(r);(ZUe(o)&&!l&&!ZUe(a)||!ZUe(o)&&!s&&ZUe(a))&&(t=!0),c&&(o=a=i=null,t=!0),o&&(t=t||this.checkInvalidValue(o)),a&&(t=t||this.checkInvalidValue(a)),t&&(l&&!c&&(o=n.toLocaleDateString()),s&&!c&&(a=r.toLocaleDateString()),ZUe(o)||ZUe(a)?ZUe(o)?ZUe(a)||(i=a):i=o:i=o+" "+this.separator+" "+a,this.invalidValueString=i,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},t.prototype.getstringvalue=function(e){var t=null;return ZUe(e)||"number"!=typeof e?ZUe(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},t.prototype.checkInvalidValue=function(e){var t,n=e,r=!1;if(t={format:this.formatString,type:"date",skeleton:"yMd"},"string"!=typeof n)r=!0;else{var o=new kKe(this.locale);if(!this.checkDateValue(o.parseDate(n,t))){var a=null;a=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(n)&&!a.test(n)||/^[a-zA-Z0-9- ]*$/.test(n)||isNaN(+new Date(this.checkValue(n))))&&(r=!0)}}return r},t.prototype.isDateDisabled=function(e){if(ZUe(e))return!1;var t=new Date(+e);if(+t<+this.min||+t>+this.max)return!0;this.virtualRenderCellArgs={date:t,isDisabled:!1};var n=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(n),!!n.isDisabled},t.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue&&+this.endValue<=+this.max;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var n=this.virtualRenderCellArgs;this.virtualRenderCellEvent(n),n.isDisabled&&(this.disabledDays.push(new Date(+n.date)),+e>+this.startValue&&+e<+this.endValue&&t++),this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},t.prototype.virtualRenderCellEvent=function(e){$Ue(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},t.prototype.disabledDates=function(){var e=!1,t=!1;return ZUe(this.endValue)||ZUe(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},t.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&this.value.length>0||this.valueType&&this.valueType.length>0?(+this.startDate==+this.value[0]&&+this.endDate==+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},t.prototype.dispatchEvent=function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!1,!0),e.dispatchEvent(n),this.firstHiddenChild.dispatchEvent(n)},t.prototype.changeTrigger=function(e){+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},t.prototype.navigateTo=function(t,n){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,n):(n<this.min?n=new Date(+this.min):n>=this.max&&(n=new Date(+this.max)),"Month"===t&&this.isSameMonth(n,this.max)?n=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(n,this.max)?n=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(n,this.max)&&(n=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=n,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),n="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=n,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},t.prototype.navigate=function(t,n,r){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,r,n)},t.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(ZKe([this.inputWrapper.container],[PMt]),this.inputElement.focus())},t.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(VKe([this.inputWrapper.container],[PMt]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},t.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var t={"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(VKe([this.inputElement],[_Mt]),RKe.remove(this.inputElement,"blur",this.inputBlurHandler),rSt.removeAttributes(t,this.inputElement),ZUe(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),ZUe(this.inputWrapper)||(RKe.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),UKe(this.inputWrapper.container))),ZUe(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&RKe.remove(this.formElement,"reset",this.formResetHandler),ZUe(this.firstHiddenChild)||ZUe(this.secondHiddenChild)||(UKe(this.firstHiddenChild),UKe(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name"))},t.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)ZUe(this.cloneElement.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])))},t.prototype.getModuleName=function(){return"daterangepicker"},t.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},t.prototype.getSelectedRange=function(){var e;return ZUe(this.startValue)||ZUe(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,this.disabledDateRender(),ZUe(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},t.prototype.show=function(t,n){var r=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){t&&(this.targetElement=t),this.createPopup(),(this.isMobile||zKe.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:n||null,appendTo:this.isMobile||zKe.isDevice?this.mobileRangePopupWrap:document.body};var o=this.openEventArgs;this.trigger("open",o,(function(o){if(r.openEventArgs=o,!r.openEventArgs.cancel){r.openEventArgs.appendTo.appendChild(r.popupWrapper),r.showPopup(t,n);var a=!r.isCustomRange||r.isMobile&&r.isCustomRange;!VUe(r.presets[0].start&&r.presets[0].end&&r.presets[0].label)&&a&&r.setScrollPosition(),r.checkMinMaxDays(),r.isMobile&&!ZUe(r.startDate)&&ZUe(r.endDate)&&(r.endButton.element.classList.add(AMt),r.startButton.element.classList.remove(AMt),r.endButton.element.removeAttribute("disabled"),r.selectableDates()),e.prototype.setOverlayIndex.call(r,r.mobileRangePopupWrap,r.popupObj.element,r.modal,r.isMobile||zKe.isDevice)}}))}},t.prototype.hide=function(e){var t=this;if(this.popupObj){if(ZUe(this.previousEndValue)&&ZUe(this.previousStartValue)?this.clearRange():(ZUe(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),ZUe(this.previousEndValue)?(this.endValue=null,this.setValue()):(this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue())),this.isPopupOpen()){this.closeEventArgs={cancel:!1,popup:this.popupObj,date:this.inputElement.value,model:this,event:e||null};var n=this.closeEventArgs;this.trigger("close",n,(function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?VKe([t.inputWrapper.buttons[0]],AMt):(t.isMobile&&(ZUe(t.startButton)||ZUe(t.endButton)||(RKe.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),RKe.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick))),t.popupObj&&(t.popupObj.hide(),t.preventBlur&&(t.inputElement.focus(),ZKe([t.inputWrapper.container],[PMt]))),t.isMobile||(ZUe(t.leftKeyboardModule)||ZUe(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),ZUe(t.presetElement)||t.presetKeyboardModule.destroy(),ZUe(t.cancelButton)||t.btnKeyboardModule.destroy()),t.targetElement=null,VKe([document.body],a_t),RKe.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),(t.isMobile||zKe.isDevice)&&(ZUe(t.mobileRangePopupWrap)||(t.mobileRangePopupWrap.remove(),t.mobileRangePopupWrap=null)),t.isKeyPopup=t.dateDisabled=!1),t.updateClearIconState(),t.updateHiddenInput(),t.isMobile&&t.allowEdit&&!t.readonly&&t.inputElement.removeAttribute("readonly")}))}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},t.prototype.setLocale=function(){this.globalize=new kKe(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),rSt.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},t.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},t.prototype.setDate=function(){rSt.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},t.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),rSt.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},t.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):(t.value&&t.value.start||t.value&&!t.value.start)&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},t.prototype.createHiddenInput=function(){ZUe(this.firstHiddenChild)&&ZUe(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),ZUe(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),GKe(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:c_t}),GKe(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:c_t});var e={type:"datetime",skeleton:"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},t.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&ZUe(this.startValue)&&ZUe(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},t.prototype.onPropertyChanged=function(e,t){for(var n={format:this.formatString,type:"date",skeleton:"yMd"},r=0,o=Object.keys(e);r<o.length;r++){var a=o[r];switch(["maxDays","minDays","value"].indexOf(a)<0&&this.hide(null),a){case"width":this.setEleWidth(this.width);break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":rSt.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":rSt.setReadonly(this.readonly,this.inputElement),this.inputElement.setAttribute("aria-readonly",""+this.readonly),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),rSt.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),rSt.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"locale":this.globalize=new kKe(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),rSt.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":rSt.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,n)),+this.initStartDate!=+e.startDate&&(this.startValue=this.checkDateValue(new Date(this.checkValue(e.startDate))),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(e.endDate,n)),+this.initEndDate!=+e.endDate&&(this.endValue=this.checkDateValue(new Date(this.checkValue(e.endDate))),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,t);else{var i=e.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[1])],this.updateValue(),this.setDate()}else!ZUe(e.value)&&e.value.length>0||!ZUe(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1===e.value.length||e.value.start?this.clearModelvalue(e,t):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,t):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||((1===e.value.length||e.value.start)&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(ZUe(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t));if(this.isPopupOpen()){if(ZUe(this.startValue)&&ZUe(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,rSt.removeFloating(this.inputWrapper),rSt.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}}},EMt([vGe(null)],t.prototype,"value",void 0),EMt([vGe(!1)],t.prototype,"enablePersistence",void 0),EMt([vGe(new Date(1900,0,1))],t.prototype,"min",void 0),EMt([vGe(new Date(2099,11,31))],t.prototype,"max",void 0),EMt([vGe(null)],t.prototype,"locale",void 0),EMt([vGe(null)],t.prototype,"firstDayOfWeek",void 0),EMt([vGe(!1)],t.prototype,"weekNumber",void 0),EMt([vGe("Gregorian")],t.prototype,"calendarMode",void 0),EMt([vGe(!1)],t.prototype,"openOnFocus",void 0),EMt([yGe()],t.prototype,"created",void 0),EMt([yGe()],t.prototype,"destroyed",void 0),EMt([yGe()],t.prototype,"change",void 0),EMt([yGe()],t.prototype,"cleared",void 0),EMt([yGe()],t.prototype,"navigated",void 0),EMt([yGe()],t.prototype,"renderDayCell",void 0),EMt([vGe(null)],t.prototype,"startDate",void 0),EMt([vGe(null)],t.prototype,"endDate",void 0),EMt([bGe([{}],d_t)],t.prototype,"presets",void 0),EMt([vGe("")],t.prototype,"width",void 0),EMt([vGe(1e3)],t.prototype,"zIndex",void 0),EMt([vGe(!0)],t.prototype,"showClearButton",void 0),EMt([vGe(!0)],t.prototype,"showTodayButton",void 0),EMt([vGe("Month")],t.prototype,"start",void 0),EMt([vGe("Month")],t.prototype,"depth",void 0),EMt([vGe("")],t.prototype,"cssClass",void 0),EMt([vGe("-")],t.prototype,"separator",void 0),EMt([vGe(null)],t.prototype,"minDays",void 0),EMt([vGe(null)],t.prototype,"maxDays",void 0),EMt([vGe(!1)],t.prototype,"strictMode",void 0),EMt([vGe(null)],t.prototype,"keyConfigs",void 0),EMt([vGe(null)],t.prototype,"format",void 0),EMt([vGe(!0)],t.prototype,"enabled",void 0),EMt([vGe(!1)],t.prototype,"readonly",void 0),EMt([vGe(!0)],t.prototype,"allowEdit",void 0),EMt([vGe("Never")],t.prototype,"floatLabelType",void 0),EMt([vGe(null)],t.prototype,"placeholder",void 0),EMt([vGe({})],t.prototype,"htmlAttributes",void 0),EMt([yGe()],t.prototype,"open",void 0),EMt([yGe()],t.prototype,"close",void 0),EMt([yGe()],t.prototype,"select",void 0),EMt([yGe()],t.prototype,"focus",void 0),EMt([yGe()],t.prototype,"blur",void 0),t=EMt([wGe],t)}(wMt),p_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f_t=function(e){function t(t){var n=e.call(this,t)||this;return n.initRenderCalled=!1,n.checkInjectedModules=!1,n.directivekeys={presets:"preset"},n.immediateRender=!1,n.portals=[],n}return p_t(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return E.createElement(E.Fragment,null,[].concat(E.createElement("input",this.getDefaultAttributes()),this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(h_t);i0e(f_t,[a0e,E.Component]);var m_t=function(e){void 0===e&&(e=new Date);var t=e.getDay(),n=0===t?-6:1-t,r=new Date(e);return r.setDate(e.getDate()+n),r},v_t=function(e){void 0===e&&(e=new Date);var t=e.getDay(),n=0===t?0:7-t,r=new Date(e);return r.setDate(e.getDate()+n),r},g_t=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate();return[{type:1,label:ro("Năm hiện tại"),value:[new Date(t,0,1),new Date(t+1,0,0)]},{type:2,label:ro("Quý hiện tại"),value:[new Date(t,3*Math.floor(n/3),1),new Date(t,3*Math.floor(n/3)+3,0)]},{type:3,label:ro("Tháng hiện tại"),value:[new Date(t,n,1),new Date(t,n+1,0)]},{type:4,label:ro("30 ngày trước"),value:[new Date(t,n,r-30),new Date]},{type:5,label:ro("30 ngày sau"),value:[new Date,new Date(t,n,r+30)]},{type:6,label:ro("Tuần hiện tại"),value:[m_t(),v_t()]},{type:7,label:ro("Ngày hiện tại"),value:[new Date,new Date]},{type:8,label:ro("Năm trước"),value:[new Date(t-1,0,1),new Date(t,0,0)]},{type:9,label:ro("Quý trước"),value:[new Date(t,3*Math.floor(n/3-1),1),new Date(t,3*Math.floor(n/3-1)+3,0)]},{type:10,label:ro("Tháng trước"),value:[new Date(t,n-1,1),new Date(t,n,0)]},{type:11,label:ro("Tháng sau"),value:[new Date(t,n+1,1),new Date(t,n+2,0)]},{type:12,label:ro("Tuần trước"),value:[m_t(new Date(t,n,r-7)),v_t(new Date(t,n,r-7))]},{type:13,label:ro("Tuần sau"),value:[m_t(new Date(t,n,r+7)),v_t(new Date(t,n,r+7))]},{type:14,label:ro("Ngày trước"),value:[new Date(t,n,r-1),new Date(t,n,r-1)]}]};exports.ExternalInterface=$Et,exports.ExternalInterfaceExtend=function(t){var n=t.toolbarTemplate,r=t.paramToolbar,o=t.currentPageDefault,a=t.queryOrderDefault,i=t.rowsPerPageDefault,l=t.queryKeyDataView,s=t.isSelectMulti,c=t.canContextMenuItems,u=t.handleContextMenuClick,d=t.rowSelected,h=t.dataSourceFilter,p=t.listContextHide,f=t.querySelectDefault,m=t.api,v=t.t,g=t.contextMenuOpen,b=t.stateId,y=t.viewIdTable,w=t.height,E=t.hasIndex,k=t.dataSelected,S=t.showColumnChoose,C=t.typeCheckbox,M=t.format,_=t.rowSelection,N=t.dataSource,A=t.columns,O=t.totalCount,I=t.breakText,D=t.allowPaging,P=t.allowResizing,T=t.handleDoubleContextMenuClick,H=t.stateChildId,L=t.titleChild,z=t.loading,R=t.checkInit1,B=t.checkInit2,$=t.checkInit,Z=t.hasWorkflow,V=t.apiWorkflow,j=t.rowClassName,W=null!=w?w:500,F=[W,0],q=[W-400+180,400],Y=e.useState(F),U=Y[0],K=Y[1],G=e.useState(0),X=G[0],Q=G[1],ee=e.useState({}),te=ee[0],ne=ee[1],re=function(){K(q)},oe=function(){Q(0),K(F)};return x.default.createElement(lkt,{className:0===U[1]?"hidden-split":"",split:"horizontal",sizes:U,onChange:K,allowResize:U[1]>0,sashRender:function(){return x.default.createElement(x.default.Fragment,null)}},x.default.createElement(ZEt,{minSize:250,maxSize:"100%",style:{marginBottom:10}},x.default.createElement($Et,{showColumnChoose:S,isSelectMulti:s,dataSourceFilter:h,totalCount:O,dataSource:N,columns:A,rowSelection:_,format:M,stateId:b,height:0===U[1]?U[0]:U[0]-160,viewIdTable:y,currentPageDefault:o,rowsPerPageDefault:i,queryOrderDefault:a,queryKeyDataView:l,handleContextMenuClick:u,rowSelected:function(e){d(e),function(e){Q(0);var t=e.rowData;t&&!e.rightClick&&H&&(null==H?void 0:H.length)>0&&(ne(e.rowData),re()),(!t&&!e.rightClick||e.rightClick)&&(ne({}),oe())}(e)},allowPaging:D,allowResizing:P,listContextHide:p,querySelectDefault:f,contextMenuOpen:g,canContextMenuItems:c,typeCheckbox:C,t:v,api:m,toolbarTemplate:n,paramToolbar:r,hasIndex:E,breakText:I,dataSelected:k,handleDoubleContextMenuClick:T,loading:z,checkInit:$,checkInit1:B,checkInit2:R,hasWorkflow:Z,apiWorkflow:V,rowClassName:j})),x.default.createElement(ZEt,{minSize:1,maxSize:"90%",style:{maxHeight:U[1]}},x.default.createElement("div",{className:"bg-white p-25",style:{border:"1px solid #e0e0e0"}},x.default.createElement("div",{style:{marginTop:"2px",marginBottom:"0px"},className:"d-flex justify-content-between align-items-center bb-1"},x.default.createElement("h5",{className:"m-0"},L),x.default.createElement("span",null,x.default.createElement($n,{style:{marginRight:5},fontSize:20,onClick:oe,className:"cursor-pointer"}))),x.default.createElement(UCt,{overflowMode:"Popup",heightAdjustMode:"Auto",className:"m-0",animation:{next:{effect:"None"},previous:{effect:"None"}},selected:function(e){Q(e.selectedIndex)}},x.default.createElement(qCt,null,null==H?void 0:H.map((function(e,t){return"AttachFile"!==e.stateId?x.default.createElement(FCt,{key:t,headerText:v(e.stateName)}):x.default.createElement(FCt,{key:t,headerText:v("File attached")})})))),x.default.createElement("div",{className:"box form-box__border d-flex flex-column p-0"},x.default.createElement(On,{activeTab:X},null==H?void 0:H.map((function(e,t){var n,r,a,l;return"AttachFile"!==e.stateId?x.default.createElement(Hn,{key:t,tabId:t},x.default.createElement($Et,{showColumnChoose:!0,showToolbar:!1,format:M,maxHeight:U[1]-130,height:U[1]-130,stateId:null!==(n=e.stateId)&&void 0!==n?n:"",viewIdTable:null!==(r=e.stateId)&&void 0!==r?r:"",dataSource:null!==(a=null==e?void 0:e.dataSource)&&void 0!==a?a:(null==te?void 0:te.id)?void 0:[],columns:null!==(l=null==e?void 0:e.columns)&&void 0!==l?l:void 0,totalCount:null==e?void 0:e.totalCount,summary:!0,currentPageDefault:o,rowsPerPageDefault:i,rowSelected:d,querySelectDefault:e.querySelectDefault,queryKeyDataView:[null==te?void 0:te.id],allowPaging:e.allowPaging,allowResizing:e.allowResizing,t:v,api:m,hasIndex:!0,breakText:I,loading:z,rowClassName:j})):x.default.createElement(Hn,{tabId:t,key:t},x.default.createElement(KCt,{height:U[1]-240,listFile:J(null==te?void 0:te.file)?"[]":null==te?void 0:te.file}))})))))))},exports.HeaderExternalInterface=function(e){var t=e.buttons,n=e.breadCrumb,r=e.CanPer,o=e.t;return x.default.createElement("div",{className:"table-toolbar"},x.default.createElement(nn,{className:"table-bar bar__action"},x.default.createElement(sn,null,x.default.createElement("div",{className:"d-flex justify-content-between align-items-center w-100"},x.default.createElement("div",{className:"bar__action-left"},x.default.createElement(GCt,{breadCrumbTitle:n.breadCrumbTitle,breadCrumbActive:o(n.breadCrumbActive),breadCrumbParent:n.breadCrumbParent})),x.default.createElement("div",{className:"bar__action-right d-flex"},t&&t.length>0&&t.map((function(e,t){var n,a,i,l=Zn[null!==(n=e.icon)&&void 0!==n?n:"Plus"];return x.default.createElement(r,{I:e.userAction,a:e.userSubject,key:t},x.default.createElement(jt,{color:e.color||"primary",onClick:e.actionClick,disabled:e.disabled,className:"me-1 d-flex"},x.default.createElement(l,{fontSize:null!==(a=e.fontSize)&&void 0!==a?a:14,className:"me-50"}),String(o(null!==(i=e.title)&&void 0!==i?i:""))))})))))))},exports.ToolbarTemplate=function(e){var t=window.localStorage.getItem("i18nextLng"),n=t||"vi";return aXe.load({vi:{daterangepicker:{placeholder:"Chọn ngày",startLabel:"Ngày bắt đầu",endLabel:"Ngày kết thúc",applyText:"Chọn",cancelText:"Hủy",selectedDays:"Chọn ngày",days:"Ngày",customRange:"Tùy chỉnh"}}}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var o=r[n];$Ue(yKe,o,{},!0)}}(require("@src/assets/cldr-data/main/".concat(n,"/ca-gregorian.json")),require("@src/assets/cldr-data/main/".concat(n,"/numbers.json")),require("@src/assets/cldr-data/main/".concat(n,"/timeZoneNames.json")),require("@src/assets/supplemental/numberingSystems.json")),wKe=n,bKe.notify("notifyExternalChange",{locale:wKe}),e.map((function(e,t){var r,o,a,i,l,s,c,u,d,h,p,f,m,v,g,b,y,w,E=null!==(r=e.option)&&void 0!==r?r:[],k=function(e,t){for(var n,r=0;r<e.length;r++){var o=e[r];if(o[o.fieldValue?o.fieldValue:"value"]===t)return z({},o);if((null===(n=o.children)||void 0===n?void 0:n.length)>0){var a=k(o.children,t);if(a)return a}}};return{template:x.default.createElement("div",{key:t,className:"me-50",style:{width:null!==(o=e.width)&&void 0!==o?o:200},title:ro(null!==(a=e.placeholder)&&void 0!==a?a:"")},"daterange"===e.type&&x.default.createElement(f_t,{id:"daterangepicker",placeholder:e.t(null!==(i=e.placeholder)&&void 0!==i?i:""),startDate:!Q(e.data)&&(null===(l=e.data)||void 0===l?void 0:l.length)>0?e.data[0]:void 0,endDate:!Q(e.data)&&(null===(s=e.data)||void 0===s?void 0:s.length)>0?e.data[1]:void 0,format:U.dateFormat,onChange:function(t){var n,r;Q(null===(n=t.target)||void 0===n?void 0:n.value)?e.setData([]):e.setData(null===(r=t.target)||void 0===r?void 0:r.value)},openOnFocus:!0,locale:n}),"listDate"===e.type&&x.default.createElement(JIe,{onChange:function(t){e.setData(null==t?void 0:t.value)},isClearable:!0,options:g_t(),value:g_t().find((function(t){var n;return t.value.toString()===(null!==(n=e.data)&&void 0!==n?n:"").toString()})),placeholder:ro(null!==(c=e.placeholder)&&void 0!==c?c:"")}),"select"===e.type&&x.default.createElement(JIe,{value:(e.isMulti?Array.isArray(e.data)&&e.data.length>0:null!==e.data&&void 0!==e.data)?e.isMulti?E.filter((function(t){return Array.isArray(e.data)&&e.data.some((function(n){var r;return t[null!==(r=e.fieldValue)&&void 0!==r?r:"value"]===n}))})):null!==(u=E.find((function(t){var n;return t[null!==(n=e.fieldValue)&&void 0!==n?n:"value"]===e.data})))&&void 0!==u?u:"":e.isMulti?[]:void 0,onChange:function(t){var n,r;(e.isMulti||(e.fieldValue&&t?t[e.fieldValue]:null==t?void 0:t.value)!==e.data)&&(e.isMulti?e.setData((null!==(n=null==t?void 0:t.length)&&void 0!==n?n:0)>0?t.map((function(e){var t;return e[null!==(t=e.fieldValue)&&void 0!==t?t:"value"]})):[]):e.setData(Q(t)?void 0:t[null!==(r=e.fieldValue)&&void 0!==r?r:"value"]))},fieldValue:null!==(d=e.fieldValue)&&void 0!==d?d:"value",fieldLabel:null!==(h=e.fieldLabel)&&void 0!==h?h:"label",placeholder:e.t(null!==(p=e.placeholder)&&void 0!==p?p:""),isMulti:null!==(f=e.isMulti)&&void 0!==f&&f,options:E,isClearable:null===(m=e.isClearable)||void 0===m||m,columns:e.columns}),"selecttree"===e.type&&x.default.createElement(Y$e,{value:(e.isMulti?(null===(v=e.data)||void 0===v?void 0:v.length)>0:!Q(e.data))?e.isMulti?e.data:k(E,e.data):e.isMulti?[]:void 0,onChange:function(t){var n;(e.isMulti||(e.fieldValue&&t?t[e.fieldValue]:null==t?void 0:t.value)!==e.data)&&(e.isMulti?e.setData(Q(t)?[]:t):e.setData(Q(t)?void 0:t[null!==(n=e.fieldValue)&&void 0!==n?n:"value"]))},columns:null!==(g=e.columns)&&void 0!==g?g:ve,placeholder:e.t(null!==(b=e.placeholder)&&void 0!==b?b:""),options:null!=E?E:[],isMulti:null!==(y=e.isMulti)&&void 0!==y&&y,isClearable:!0})),position:null!==(w=e.position)&&void 0!==w?w:"left"}}))},exports.listFilterDate=g_t,exports.renderColumnTable=function(e,t,n){var r,o,a,i,l,s,c,u=JSON.parse(null!==(o=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.dataJson)&&void 0!==o?o:"[]"),d=JSON.parse(null===(a=null==u?void 0:u[0])||void 0===a?void 0:a.Data),h={Data:null==d?void 0:d.filter((function(e){return!0===(null==e?void 0:e.IsActive)}))},p=[];n&&p.push({width:60,type:"number",freeze:"Left",field:"STT",textAlign:"center",headerText:"STT",allowFiltering:!1,allowSorting:!1});for(var f=function(e){var n=h.Data[e],r={field:n.ColVirtual,headerText:n.Title,visible:!n.IsHidden,width:n.Width,maxWidth:null!==(i=n.MaxWidth)&&void 0!==i?i:n.Width,minWidth:null!==(l=n.MinWidth)&&void 0!==l?l:n.Width,allowSorting:!0,clipMode:"EllipsisWithTooltip",freeze:n.Freeze,textAlign:n.TextAlign};switch(n.Type){case"datetime":r.typeFilter="DateRange",r.template=te,r.type="datetime",r.hideOperator=!0;break;case"date":r.hideOperator=!0,r.typeFilter="DateRange",r.template=te,r.type="date";break;case"checkbox":r.hideOperator=!0,r.typeFilter="Checkbox";break;case"number":r.typeFilter="Number",r.type="number",J(n.TypeDecimal)||"quantity"===n.TypeDecimal?r.template=le:"allocationRatio"===n.TypeDecimal?r.template=fe:"exchangeMoney"===n.TypeDecimal?r.template=ce:"overseaMoney"===n.TypeDecimal?r.template=se:"rate"===n.TypeDecimal?r.template=he:"ratio"===n.TypeDecimal?r.template=pe:"so_cong"===n.TypeDecimal?r.template=me:"unitPriceExchange"===n.TypeDecimal?r.template=ue:"unitPriceOversea"===n.TypeDecimal?r.template=de:r.template="";break;default:r.type="string"}!J(n.ColTemplate)&&J(n.OptionTemplate)&&(r.template=function(e){var r;return t(null==e?void 0:e[null!==(r=n.ColTemplate)&&void 0!==r?r:""])}),J(n.ColTemplate)||J(n.OptionTemplate)||(r.source=null===(c=JSON.parse(null!==(s=n.OptionTemplate)&&void 0!==s?s:"[]"))||void 0===c?void 0:c.map((function(e){var n,r;return z(z({},e),{value:null!==(n=null==e?void 0:e.value)&&void 0!==n?n:null==e?void 0:e.id,label:t(null!==(r=e.label)&&void 0!==r?r:null==e?void 0:e.name)})})),r.template=function(e){var t,o;return null===(o=null===(t=r.source)||void 0===t?void 0:t.find((function(t){var r;return(null==t?void 0:t.value)===(null==e?void 0:e[null!==(r=n.ColTemplate)&&void 0!==r?r:""])})))||void 0===o?void 0:o.label}),0===e&&"checkbox"===n.Type?p.unshift({width:40,type:"checkbox",freeze:"Left"}):("id"===n.ColVirtual&&(r.isPrimaryKey=!0),p.push(r))},m=0;m<h.Data.length;m++)f(m);return p},exports.renderColumnTableBe=function(e,t,n,r){var o,a,i,l,s=JSON.parse(null!==(a=null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.dataJson)&&void 0!==a?a:"[]"),c=JSON.parse(null!==(l=null===(i=null==s?void 0:s[0])||void 0===i?void 0:i.Data)&&void 0!==l?l:"[]"),u={Data:null==c?void 0:c.filter((function(e){return!0===(null==e?void 0:e.IsActive)}))},d={};return n.forEach((function(e){for(var n,o,a,i,l,s,c,h=u.Data.filter((function(t){return t.ViewId===e})),p=[],f=function(e){var u=h[e],d={field:null!==(n=u.ColVirtual)&&void 0!==n?n:"",headerText:u.Title,visible:!u.IsHidden,width:u.Width,maxWidth:null!==(o=u.MaxWidth)&&void 0!==o?o:u.Width,minWidth:null!==(a=u.MinWidth)&&void 0!==a?a:u.Width,allowFiltering:!0,allowSorting:!0,textAlign:null!==(i=u.TextAlign)&&void 0!==i?i:"left",fixedType:J(u.Freeze)?void 0:(null!==(l=u.Freeze)&&void 0!==l?l:"").toLowerCase()};switch(u.Type){case"datetime":d.typeFilter="DateRange",d.type="datetime";break;case"date":d.typeFilter="DateRange",d.type="date";break;case"checkbox":d.typeFilter="Checkbox",d.type="checkbox",d.hideOperator=!0;break;case"number":d.typeFilter="Number",d.type="number",J(u.TypeDecimal)||"quantity"===u.TypeDecimal?d.format={decimalScale:oe("quantity")}:d.format={decimalScale:oe(J(u.TypeDecimal)?"quantity":u.TypeDecimal)};break;default:d.type="string"}!J(u.ColTemplate)&&J(u.OptionTemplate)&&(d.template=function(e){var n;return t(null==e?void 0:e[null!==(n=u.ColTemplate)&&void 0!==n?n:""])}),J(u.ColTemplate)||J(u.OptionTemplate)||(d.source=null===(c=JSON.parse(null!==(s=u.OptionTemplate)&&void 0!==s?s:"[]"))||void 0===c?void 0:c.map((function(e){var n,r;return z(z({},e),{value:null!==(n=null==e?void 0:e.value)&&void 0!==n?n:null==e?void 0:e.id,label:t(null!==(r=e.label)&&void 0!==r?r:null==e?void 0:e.name)})})),d.template=function(e){var t,n;return null===(n=null===(t=d.source)||void 0===t?void 0:t.find((function(t){var n;return(null==t?void 0:t.value)===(null==e?void 0:e[null!==(n=u.ColTemplate)&&void 0!==n?n:""])})))||void 0===n?void 0:n.label}),0===e&&"checkbox"===u.Type?(p.push({width:40,field:"checkbox",fixedType:"left"}),p.push({field:"",headerText:"STT",textAlign:"center",headerTextAlign:"center",template:function(e){return e.indexRow+1},fixedType:"left",visible:r,width:50,minWidth:50,maxWidth:50})):(0===e&&p.push({field:"",headerText:"STT",textAlign:"center",headerTextAlign:"center",template:function(e){return e.indexRow+1},fixedType:"left",visible:r,width:50,minWidth:50,maxWidth:50}),p.push(d))},m=0;m<h.length;m++)f(m);d[e]=p})),d},exports.renderColumnTableGrid=io;